• June 27, 2017, 07:22:01 AM
• Welcome, Guest. Please login or register.
News: Posting problems?
If for some reasons you can not create your own topics, please see the problem thread in the "Site news & updates" board.

Recent Posts

Pages: [1] 2 3 ... 10
What I want to figure out:
As it is, there's nothing really stopping users from racking up the "like" count, especially if you allow ratings only, which I'm sure we all have members that would abuse that feature. I want to limit the "likes" somehow, either one per member per story, or one per member per chapter. I need to set up a query to check the database to see if the user has liked the story/chapter already, and either not record the "like" or throw them an error saying they already liked it.

Here's the code from the 2.0 mod I referenced earlier:

Code: [Select]
//prevents users from artificially inflating recommendations count
$count = mysql_query("SELECT count(rating) as ratingcount FROM ".$tableprefix."fanfiction_reviews WHERE rating = '1' AND psid = '$psid' and sid = '$sid' and member='$member'");
$ratingcheck = mysql_fetch_array($count);
if($ratingcheck[ratingcount] != 0){
$rating = "0";
//end prevention section

Of course this won't work in the current install. I tried in my limited knowledge to make it someone that I can paste into 3.5.5 code:
Code: [Select]
$count = dbquery("SELECT count(rating) as ratingcount FROM ".TABLEPREFIX."fanfiction_reviews WHERE rating = '1' AND chapid = '$chapid' and sid = '$item' and userid='$uid'");
$ratingcheck = fetch_array($count);
if($ratingcheck[ratingcount] != 0){
$rating = "-1";

I pasted this in reviews.php before this line, around ln 144
Code: [Select]
dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_reviews (item, type, reviewer, review, rating, date, uid, chapid) VALUES ('$item', 'ST', '$reviewer', '$review', '$rating', now(), '".(USERUID && isNumber(USERUID) ? USERUID : 0)."', '$chapid')");

But I just get this error when trying to leave a rating or a review:
A fatal MySQL error was encountered.
Query: SELECT count(rating) as ratingcount FROM prefixfanfiction_reviews WHERE rating = '1' AND chapid = '14339' and sid = '5422' and userid='406'
Error: ()

ETA: I then tried this:
Code: [Select]
$ratecount = dbquery("select count(rating) as count FROM ".TABLEPREFIX."fanfiction_reviews WHERE item = '$item' AND chapid = '$chapid' AND uid = '$uid' AND rating != '-1'");
if($ratecount != 0) $output .= write_error(_MULTIPLERATINGS);

And the good news is it doesn't give me a MYSQL error but bad news is it logs the rating anyways.

Anyone have thoughts on preventing multiple ratings from one user?
I'm not very satisfied with the Stars or the Like/Dislike ratings system on eFic (I detail a bit on why here) so I've been working on making it a little more like the Kudos system on Archive of our own (which... is basically a "Like" button :-D). I used this 2.0 mod as a jumping off point.

I'm still testing this out and hoping to get a some questions answered and figure out a couple more things before I actually add this mod to my live archive, so at this point I suggest to others interested in this mod to not put this in their live archives yet, but add it to your test site and report back with any problems or tweaks.

How Likes/Dislikes currently work: In the Like/Dislike system, when you "like" a story, you give it a rating of 1, if you dislike it you give a rating of 0. eFic averages this out and if the average is above half (0.5) it will display a thumbs up. If it's below 0.5, thumbs down. My issue with this: There's no displayed tally of how many "Likes" a story got, if it got 1 or 50 it will display the same thumbs up. Also, the thumbs down part of it I don't feel fosters the welcoming, encouraging environment I want our archive to have.

What this mod does: Rather than average the likes, it tallies up the number of "like" reviews a story has and displays them, like a social media "like" count. The "dislike" is taken out as an option, you either like the story or you select "None". If you are converting from the star ratings to "likes", this still works fine (provided your archive is like mine and very few people give low star reviews.). Warning: you will definitely not want to go back to the star rating system after initiating this mod, since giving a story a "like" = a value of 1, but in the star ratings that's a half star.

Before Modifying Any Code:
In your Efiction Admin Menu, select "Settings" then "Review Settings" then make sure it's set to "Rating System: Like/Dislike". (if you are converting from star ratings, it will basically convert every starred rating from 1-10 as a "like". If your users mostly give each other high ratings, then this shouldn't be a problem, Otherwise, you may want to do a few search/replaces" in the "Reviews" Table of your database.)

Up to you if you want to allow ratings only, that makes it a bit more like a "like" button system. If you don't, only when someone reviews can they leave a "like".

Next step, at least for me, it stops counting the number of "likes" at 127. There is probably a better, slicker way to do this but I just went into the phpadmin for my database and on the "stories", "chapters" and "series" tables, I select "Structure" and changed the Ratings settings from "tinyint(4)" to "int(11)"

So now that the rating system is set to "like/dislike" and the database has been modified to display larger numbers, here are the code modifications:

1. Change every instance of "SELECT AVG" to "SELECT COUNT"
You can find "SELECT AVG" in the following files:

admin/maintenance.php around lines 34 and 43
includes/corefunctions.php around line 173
includes/seriesreviews.php around lines 37 and 61
reviews.php around lines 74, 77, 145 and 149
update.php around 179 and 188
(also in install/upgrade11.php on lines 399 and 408 but you shouldn't have this folder unless you are upgrading)

Change them all to SELECT COUNT

2. In includes/corefunctions.php find (around line 467):
Code: [Select]
if($ratings == "2") {
if($rating >= 0.5)
$ratingpics = ($like ? $like : "<img src=\""._BASEDIR."images/like.gif\" alt=\""._LIKED."\">");
else if(($rating < 0.5) && ($rating > 0))
$ratingpics = ($dislike ? $dislike :"<img src=\""._BASEDIR."images/dislike.gif\" alt=\""._DISLIKED."\">");
else $ratingpics = "";

and replace with:
Code: [Select]
if($ratings == "2") {
if($rating >= 1)
$ratingpics = "<span title=\"number of likes\"><img src=\""._BASEDIR."images/like.gif\"><b>".$rating."</b></span>";
else $ratingpics = "";
Once the story gets some "likes", it will display the thumbs up and the number of "likes" next to it.

If you are adding this mod to an archive where people have left star ratings, you can go to the Admin menu in eFiction, select "Archive Maintenance" and then "Recalculate Reviews". Now it will convert any star ratings to a "like" and tally it up.

3. Remove the "dislike" option from the review form

in includes/reviewform.php find:
Code: [Select]
if($ratings == "2"){
$form .= "<div><label for=\"rating\">"._OPINION."</label> <select id=\"rating\" name=\"rating\" class=\"textbox\">
<option value=\"1\"".($review['rating'] == 1 ? " selected" : "").">"._LIKED."</option><option value=\"0\"".($review['reviewid'] && !$review['rating'] ? " selected" : "").">"._DISLIKED."</option><option value=\"-1\"".($review['rating'] == -1 || $action == "add" ? " selected" : "").">"._NONE."</option></select></div>";

replace with:
Code: [Select]
if($ratings == "2"){
$form .= "<div><label for=\"rating\">"._OPINION."</label> <select id=\"rating\" name=\"rating\" class=\"textbox\">
<option value=\"1\"".($review['rating'] == 1 ? " selected" : "").">"._LIKED."</option><option value=\"-1\"".($review['rating'] == -1 || $action == "add" ? " selected" : "").">"._NONE."</option></select></div>";
Now on the review form, it will only give the options of "Liked" and "None"

4. Modify the wording of the following lines in languages/en.php

Code: [Select]
define ("_REVIEWNOTE", "<span style=\"text-decoration: underline; font-weight: bold;\">Note:</span> You may submit either a rating or a review or both.");

define ("_LIKED", "Liked");

define ("_OPINION", "Opinion");

define ("_MISSINGINFO", "You must supply either a review or a rating.");

Here are some suggestions but change them to whatever fits your archive!

Code: [Select]
define ("_REVIEWNOTE", "<span style=\"text-decoration: underline; font-weight: bold;\">Note:</span> You may submit either a thumbs up or a review or both.");

define ("_LIKED", "Yes, add a thumbs up");

define ("_OPINION", "Add a thumbs up?");

define ("_MISSINGINFO", "You must supply either a thumbs up or a rating.");

Now you your have a "Like" system on your archive!

See next post for what I want to figure out, and maybe someone with some PHP knowledge can help me?
Soooo, probably good no one replied to this because eFic already offers this feature, just gotta go to the admin menu, click "Admins", select the user you want notifications to go to and select the "Contact" box.

This does however only apply to new submissions that are sent to the submission queue (i.e. from unvalidated authors). I still wouldn't mind some kind of alert when a validated author posts something new...
Dev blog / Re: Status report
« Last post by Sheepcontrol on June 20, 2017, 02:36:17 PM »
Sadly the last two moths were pretty demanding on the daytime-job and left me rather exhausted.

But there'll be some off-time the next two weeks and I just picked up work again.
Currently working on the installer to allow fresh installs, currently only upgrades are implemented.
Dev blog / Re: Status report
« Last post by Ladama on June 15, 2017, 02:44:29 AM »
Any recent update?
Yes, I am also curious about the status, I think we're all eagerly awaiting, do let us know what we can do to help (testing, donations, etc) and thank you so much for your hard working and keeping the script going!
Dev blog / Re: Status report
« Last post by Tsukasa on June 14, 2017, 12:55:35 PM »
Any recent update?
Version 3.x General Support / Increasing TinyMCE textbox size?
« Last post by Ladama on June 14, 2017, 03:15:49 AM »
The biggest complaint I'm getting on my archive is the text in the TinyMCE boxes is too small, I believe the default is 10px. I found this very old thread regarding this issue with eFic 2.0 but didn't really see a specific solution. Can I simply add some CSS to a skin? If I have to change the CSS inside the tinymce folder, which one and where?
URL to your eFiction:  www.elsannafiction.com
Version of eFiction: 3.55
Have you bridged eFiction, if so with what?: no?  Not sure what this means - new install, no mods added.
Version of PHP: 5.6.29
Version of MySQL: 4.6.5
Have you searched for your problem: (yes/no) YES
If so, what terms did you try: Menu, current, browse, $type
State the nature of your problem: The menu does not accurately reflect the current page for "Most Recent", "Categories", "Series" or "Titles".  Instead, following those links causes the "Browse" menu entry to highlight.  I did some poking around.  It looks like each of those links calls browse.php, which in turn sets "$current" to "browse", instead of the correct value.  I think that is represented by $Type, and that I should be able to set $current to equal $Type, but I am not certain where in the code to do that.  I am extremely new to PHP... hell, I don't even know if it needs to be compiled after being updated.
Do you have a test account for us?  The problem is obvious on the main page without even logging in.  Just try any of the four links.  If you still need a test account, I can get you one.

Thanks in advance for any assistance you can give me with this.

eFiction Sites / Capeside Diaries (International)
« Last post by artphilia on June 11, 2017, 12:02:16 PM »
I am trying to bring back one of the largest (and my favorite!) archive for Dawson's Creek fanfics - http://capesidediaries.com
Unfortunately I never saved much of the fanfics, so I have to depend on the wayback machine. There is no perfect backup of the site and the former webmistress died in 2005, which makes me really sad although I never knew her. I loved her archive though and I will do my best to bring it back online.

But I'm not bringing it back only for fanfics written in English. This time it will be international.

Hope you enjoy! :winkiss:

Out of no where I am getting the following error upon attempting to login to my efiction site:


You don't have permission to access /user.php on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

I've changed nothing at all in probably more than a year. Any idea on what might be causing it or how I can fix it? I've read that this is often a permissions issue, but nothing there has changed either. Pretty sure I'm running 3.5.5, but can't actually log in to verify that.

Thank you.
Pages: [1] 2 3 ... 10