Welcome to Geeklog, Anonymous Saturday, December 21 2024 @ 09:20 am EST

Geeklog Forums

Submissions Counter Not working??


Status: offline

zilch

Forum User
Newbie
Registered: 12/01/02
Posts: 7
A user pointed out an oddity to me today tha I can't seem to track a fix to.

The submissions counter doesn't seem to go up when new stories are posted for approval. Oddly enough, new links and Events do increment the counter in the admin menu.

Does anyone have any ideas why the Admin menu Submissions counter would work for some submissions but not for Stories?

Thanks for any help you can provide.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by zilchBig Grinoes anyone have any ideas why the Admin menu Submissions counter would work for some submissions but not for Stories?

Does it happen for the site Admin or for a Story Admin? The submission counter honors the permission system. So if a story is submitted for a topic that the Story Admin doesn't have access to, it won't be counted (for that Story Admin).

bye, Dirk
 Quote

Status: offline

zilch

Forum User
Newbie
Registered: 12/01/02
Posts: 7
Dirk, I am the site admin and I posted a few stories as a "Test user" with no admin rights. When I logged back in as Site Admin, I got a big 0 next to Submissions. Confused
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by zilch: When I logged back in as Site Admin, I got a big 0 next to Submissions.

But the submissions were there?

bye, Dirk
 Quote

zilch

Anonymous
Yes, the submissions where awaiting approval like normal. There is just no alert that the new stories exist.
 Quote

Maximus

Anonymous
I am also having this problem, none of the admins or editors are seeing the counter next to the submissions entry as anything other than (0), but submissions are present on the submissions page. It has been tested with all combo's of permissions posting (took the entire staff of 3 a few hours).

We have a large number of plugins, including the menu plugin, which required a replacement search.php file. I do not think we modified any other stock GL files.

also, we are getting emailed notice of anything submitted.

If you could tell me where the function for this counter lives, and what other functions it relies upon to get the counter number, I'd be very happy to go bug hunting myself.

--maximus co-admin darja.net.
 Quote

maximus

Anonymous
Solved it. When using the most recent version of the menu plugin, you will never have the submissions counter say anything other than (0), except with a membership submission.

Why? Glad you asked.

For some reason, they have reproduced the admin block function in lib-common in thier functions.inc file in the GL/plugins/menu folder. It has an error.

Starting in the neighborhood of line 509, and I have maintained the code I snipped in the comments on these lines to show the difference. As the code appears here, the counter seems to behave properly.

$num = 0;

if( SEC_hasrights( 'story.edit' ))
{
$num += DB_count( $_TABLES['storysubmission'] ); //, 'uid', 0 );
}

if( SEC_hasrights( 'event.edit' ))
{
$num += DB_count ($_TABLES['eventsubmission'] ); //, 'eid', 0);
}

if( SEC_hasrights( 'link.edit' ))
{
$num += DB_count( $_TABLES['linksubmission']); //, 'lid', 0 );
}

if( SEC_hasrights( 'user.edit' ) && SEC_hasrights( 'user.delete' ))
{
$emptypwd = md5( '' );
$num += DB_count( $_TABLES['users'], 'passwd', $emptypwd );
}

The db calls were not correct. Could someone call them and let them know to replace these functions with calls to lib-common, or update them?

Thanks
--maximus co-admin of darja.net
 Quote

All times are EST. The time is now 09:20 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content