Notifications
Clear all

"Stories by" counting number of stories co-authored instead of total stories

27 Posts
11 Users
0 Reactions
8,970 Views
(@marauder-by-midnight)
Posts: 56
Trusted Member
Topic starter
 

A user recently brought this to my attention. With the 3.4.2 system, the "Stories by" is reflecting the number of stories co-authored (I'm assuming) rather than the number of stories written total. The reason I'm assuming this is because no one has yet to co-author more than one story, yet all the users with co-authored stories are showing up as having written only 1 story, though some have written more than 10.

I did everything on the Archive Maintenance at least twice, but nothing's changed. When I went into phpmyadmin and fixed the story count manually then clicked "Recalculate stories", the story count goes back down to 1.

Here's what I have for viewuser.php around lines81 - 99

$codequery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_codeblocks WHERE code_type = 'userTabs'");
while($code = dbassoc($codequery)) {
eval($code['code_text']);
}

while($panel = dbassoc($panelquery)) {
$panellink = "";
if(substr($panel['panel_name'], -2, 2) == "by") {
$itemcount = 0;
if($panel['panel_name'] == "storiesby") {
$count = dbquery("SELECT stories FROM ".TABLEPREFIX."fanfiction_authorprefs WHERE uid = '$uid'");
}
else {
if(substr($panel['panel_name'], 0, 3) == "val") {
$table = substr($panel['panel_name'], 3);
$table = substr($table, 0, strlen($table) - 2);
$valid = 1;
}
else {
$table = $panel['panel_name'];
if(substr($panel['panel_name'], 0, strlen($panel['panel_name']) - 2) == "stories") $valid = 1;
else $valid = 0;
}
$count = dbquery("SELECT COUNT(uid) FROM ".TABLEPREFIX."fanfiction_".substr($table, 0, strlen($panel['panel_name']) - 2)." WHERE (uid = '$uid'".($panel['panel_name'] == "storiesby" ? " OR FIND_IN_SET($uid, coauthors) > 0" : "").")".($valid ? " AND validated > 0" : "").($panel['panel_name'] == "reviewsby" ? " AND review != 'No Review'" : ""));
}
list($itemcount) = dbrow($count);
}

Any help would be greatly appreciated 🙂


 
Posted : 27/04/2008 8:53 pm
(@rhapsody)
Posts: 31
Eminent Member
 

Site details:
URL to your eFiction: http://www.silmarillionwritersguild.org/archive/home/
Version of eFiction: 3.4.2 (upgrade from 3.3.1
Have you bridged eFiction, if so with what?: No and no mods installed.
Version of PHP: 5.2.5
Version of MySQL: 5.0.45-community-log
Have you searched for your problem: Yes
If so, what terms did you try: Stories co-author table, statistics, numbers of stories co-authored instead of total stories
State the nature of your problem: When an author is listed as a co-author in the co-author tables, the total stories statistics get pulled from that table alone or completely ignores the data in the fanfiction_authorprefs table. And a RR pops up three times over in the stories list of the author who started the RR after I added co-authors.

I have exactly the same problem Maruader is describing. When I either add an author as co-author or I recalculate the stories statistics, the nr of stories is set back to the nr of the co-author table (also when I do the archive maintenance again). Before this happened, I ran into the problems as described in this thread: https://efiction.org/forums/index.php?topic=6179.0 . I fixed that and could get access to the site again. Then I started to check if everything was working.

At first nothing was displayed when I wanted to browse the author's (yet the table still existed), so in admin I performed all the archive maintenance tasks. That worked. Hoewever, once I start to add co-author's (and they are listed in the co-author table), I run into the same problems Marauder is encountering.

Secondly, with a Round Robin where I had to add the co-author's manually, suddenly the round robin pops up three times over in the story listing of the person who initiated the Round Robin: http://www.silmarillionwritersguild.org/archive/home/viewuser.php?uid=1 (browse a bit down for the Round Robin).

Any help is appreciated! Thanks so much!


 
Posted : 28/04/2008 7:01 am
(@guest2276)
Posts: 0
 

I've looked through some of the posts seeming to deal with this issue, but cannot find much help or even the identical problem.

Brand new installation of 3.4.2 on an in-house test server: WinXP SP2 running Apache 2.2.6, PHP 5.2.5, mySQL 5.0.

I've created some members to be authors, added some test stories (setting Validated to Story at the same time), yet the story count for the author remains at 0. If I re-calculate some stuff, the story count is updated. Why would I have to re-calc every time?

However, even after re-calculating, the Authors in the main info panel remains at 0.

A clean install of 3.3.1 on the same server (different folder and DB) does not have these problems. Adding and validating a story immediately updates the story count and the number of authors as needed.


 
Posted : 04/05/2008 10:41 pm
(@jaded)
Posts: 63
Trusted Member
 

The advice offered on this topic...

https://efiction.org/forums/index.php?topic=6271.0

... worked like a charm. I don't know for sure that it will solve your problem, but the story count issue I was having seemed identical to yours. After I replaced those lines of code with what Tracer provided, I clicked Re-calculate Site Statistics and the story count was properly updated.

Hope that helps you too!


 
Posted : 06/05/2008 1:29 pm
(@tammy)
Posts: 2577
Member Moderator
 

I cannot replicate this error at all.  No matter how many times I recalculate the stories the information remains correct for me.


 
Posted : 07/05/2008 1:28 am
(@marauder-by-midnight)
Posts: 56
Trusted Member
Topic starter
 

Well, here's an example:

This is a link to the primary author's bio page. The story's listed 5 times, but she has the correct number of stories.
This is a link to a second author. The story is listed once, but only one story is attributed to her.

I didn't change anything in the viewuser.php :/


 
Posted : 07/05/2008 11:07 am
(@julieann)
Posts: 60
Trusted Member
 

URL to your eFiction: http://www.gatchfanfic.com/
Version of eFiction: 3.4.2
Have you bridged eFiction, if so with what?: SMF
Any mods installed?: Challenges, cpg-art
Version of PHP: 5.2.5
Version of MySQL: 4.1.22-standard
Do you have a test account for us? Yes. User name: testreg  Password: test1234

I have this problem as well, but it's not consistent. I have a coauthor on a story and both she and I have the correct statistic. At first I wondered if this could be because I'm admin, but then I discovered this:

http://www.gatchfanfic.com/viewuser.php?action=storiesby&uid=104

This author is one of our most prolific, yet the site is only counting the coauthored stories. With one of the coauthors ( http://www.gatchfanfic.com/viewuser.php?uid=96), the counts are also wrong, but with the other coauthor ( http://www.gatchfanfic.com/viewuser.php?uid=29) they are correct.

The more I look, the more authors I'm finding affected, yet it is not consistent site-wide. Yes, I've reloaded files, fixed databases, performed archive maintenance (after applying https://efiction.org/forums/index.php?topic=6271.0). Nothing has fixed this. A very strange bug.

Edit: On one author that was wrong, I changed the count to the correct number in 'authorprefs' in phpMyAdmin. It showed up as it should when the authors page was reloaded. Went to Admin and recalculated stories, and it once again went to the wrong count of counting on the co-authored stories.


Julieann

Running 3.4.3 bridged with SMF and Coppermine
Mods: Challenges, cpg-art (not working), Limit Summary Length, Bio to Prefs, Top 20 instead of 10
Wants: Move Betareader to Prefs, Twitter
Gatchaman Fanfic Archive

 
Posted : 23/05/2008 2:11 am
(@julieann)
Posts: 60
Trusted Member
 

I have discovered something interesting. On my site the only authors affected by this are authors that I created the account as an Admin and put up the first stories. One of the accounts was then turned over to the Author and they put up the rest of the stories, however she is still be affected. I went to the _authors database table and all of the affected accounts have a "1" in the "admincreated" field. However, changing this to a "0" and then recalculating didn't fix the problem. Is there some other field that could be affecting this? Perhaps attached to the stories themselves? Could all the Admin-created accounts having the same email address be causing this?


Julieann

Running 3.4.3 bridged with SMF and Coppermine
Mods: Challenges, cpg-art (not working), Limit Summary Length, Bio to Prefs, Top 20 instead of 10
Wants: Move Betareader to Prefs, Twitter
Gatchaman Fanfic Archive

 
Posted : 23/05/2008 11:20 am
(@rhapsody)
Posts: 31
Eminent Member
 

Well at our site it doesn't make a difference. The thing is however that those people added as a co-author have their story nr count set back to 1 and cannot reply to reviews. I have been giving this a lot of thought and I think we somehow got stuck with a half upgrade because we've been getting errors across the archive. So I am going to see if I can a better result with 3.4.3.


 
Posted : 30/05/2008 2:18 pm
(@tammy)
Posts: 2577
Member Moderator
 

If you got stuck with a half upgrade as you believe, then I would suggest you restore your site to pre-3.4 and then run the upgrade again.  Running the 3.4.2 to 3.4.3 upgrade will not fix things that are already wrong.


 
Posted : 30/05/2008 6:40 pm
(@rhapsody)
Posts: 31
Eminent Member
 

Tammy, would it be sufficient to delete the co-author table, change the e-fiction version manually in the database and copy all the 3.3.1 files over the 3.4.2 files?  After that, checking if the site still runs and copy the 3.4.3 over it for installation? We do have an old 3.3.1 back-up, but then we'd loose all the data of about at least a month, if not more.


 
Posted : 01/06/2008 11:07 am
(@tammy)
Posts: 2577
Member Moderator
 

You'd lose all your co-author information, but it kind of sounds like it's messed up in some way already.


 
Posted : 01/06/2008 6:40 pm
(@dreamhowler)
Posts: 147
Estimable Member
 

My story counts aren't updating, I looked at the topic listed, but I have 3.4.3 and the lines listed above are fixed.

This is a brand new install, but every time I add a group of stories in the Add New Story Menu in the Admin Panel, I have to go and recalculate the stories so the story counts for the author updates. 

Also, the stats recalculation isn't showing Action Completed or whatever it's supposed to say, it's just a blank page. I applied the fix at the bottom of the above link, and that fixed it. Still having a story count problem though in the stats/user profile.

Any ideas?

http://thehwe.com/index.php


Current Version: 3.4.2
PHP 4
Mods: Challenges, Recommendations, Storyend, Display Word, Beta Reader, Bad Reviewer

 
Posted : 10/06/2008 4:37 am
(@rhapsody)
Posts: 31
Eminent Member
 

It worked, we are back at 3.3.1 now. However when I went back to this version, the main admin who (author id 1) was added to those stories who previously had co-author's. At one occassion she was added to *every* story, including her own material, but I fixed that by running an sql query and in another case she was added to just two stories.

Steps taken (for further reference for others):
1. Empty co-author table in phpadmin and then delete it
2. in fanfiction_settings change version to 3.3
3. Copy all the files from the 3.3.1 install over it
4. Run the update when prompted if you go to the admin panel on your site.
5. Add all the co-authors at places where they should be
6 . Run Re-calculate Site Statistics in the admin panel

If the person with author id 1 gets attached to every story as a co-author and this is not correct, run the following query on fanfiction_stories:

UPDATE fanfiction_stories SET coauthors = '0' WHERE coauthors = '1'

 
Posted : 11/06/2008 6:15 am
(@babaca)
Posts: 722
Member Moderator
 

When you say "went back to this version" do you mean 3.4.2 or the latest 3.4.3?


******************************************
Mucking around in eFiction since circa 2001 (ver. 1.0)
Now running v.3

 
Posted : 11/06/2008 7:00 pm
Page 1 / 2
Share: