Code: Select all
Parse error: parse error, unexpected ';', expecting ')' in C:\AppServ\www\forum\index.php on line 112
The reason why you don't see the number in any page except the index page is because the counting only happens in index.php. If you want this across the board, you will need to put the code from index.php into includes/functions.php within the function page_header.*Capmaster* wrote:It's working for me now. I must have missed a cache purge somewhere. It works good in Prosilver and Odyssey, since in those styles the code change is made to index_body.html.
However ....in Subsilver2 and eTech Green (SS2-based style) I had to place it in overall_header.html since that's where the search links are.
And it shows the number OK on the index page, but for some strange reason it won't show the number when you move into forumview or topicview, or any other page besides the index. It just shows the parentheses with no number between them. Not a huge issue, but I know some members will want to know what gives.
Here's a screen grab in forumview in subsilver2:
Code: Select all
// The following assigns all _common_ variables that may be used at any point in a template.
Code: Select all
$sql = 'SELECT COUNT(post_id) as count
FROM ' . POSTS_TABLE . '
WHERE post_time > ' . $user->data['user_lastvisit'] . '
AND poster_id != ' . $user->data['user_id'];
$result = $db->sql_query($sql);
$post_count = $db->sql_fetchfield('count', false, $result);
$db->sql_freeresult($result);
Code: Select all
'SITENAME' => $config['sitename'],
Code: Select all
'NEW_POST_COUNT' => $post_count ,
lefty74 wrote:you could try
open includes/functions.php
FINDBEFORE, ADDCode: Select all
// The following assigns all _common_ variables that may be used at any point in a template.
FINDCode: Select all
$sql = 'SELECT COUNT(post_id) as count FROM ' . POSTS_TABLE . ' WHERE post_time > ' . $user->data['user_lastvisit'] . ' AND poster_id != ' . $user->data['user_id']; $result = $db->sql_query($sql); $post_count = $db->sql_fetchfield('count', false, $result); $db->sql_freeresult($result);
BEFORE, ADDCode: Select all
'SITENAME' => $config['sitename'],
and then delete the parts referred to in the mod in the index.php pageCode: Select all
'NEW_POST_COUNT' => $post_count ,