Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
How many threads and posts since your last visit! Details »»
How many threads and posts since your last visit!
Version: 1.00, by Gary King Gary King is offline
Developer Last Online: Jun 2020 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 01-02-2004 Last Update: Never Installs: 172
 
No support by the author.

PLEASE CLICK ON THE INSTALL BUTTON IF YOU INSTALLED THIS! THANKS!

What does this hack do?

This hack basically shows the number of new threads and posts since your last visit, in the navbar (under your nick.) Check out the attached screenshot for more information

Installation
This is a pretty simple hack to install.
Instructions are as follows:

FILE MODIFICATIONS
global.php

TEMPLATE MODIFICATIONS
navbar

PHRASES
navbar_sincelastvisit

OPEN global.php AND FIND
PHP Code:
    echo "End call of global.php:  $aftertime\n"
    echo 
"\n<hr />\n\n"

(NOTE: If you want old threads with new posts to count as a new thread, then skip this next step)
UNDER IT, ADD
PHP Code:
# SINCE YOUR LAST VISIT 
$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM ".TABLE_PREFIX."thread WHERE lastpost > '".$bbuserinfo['lastvisit']."'"); 
$getnewpost=$DB_site->query_first("SELECT COUNT(*) AS posts FROM ".TABLE_PREFIX."post WHERE dateline > '".$bbuserinfo['lastvisit']."'"); 
(NOTE: If you did the step above, then skip this next step)

UNDER IT, ADD
PHP Code:
# SINCE YOUR LAST VISIT 
$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM ".TABLE_PREFIX."thread WHERE dateline > '".$bbuserinfo['lastvisit']."'"); 
$getnewpost=$DB_site->query_first("SELECT COUNT(*) AS posts FROM ".TABLE_PREFIX."post WHERE dateline > '".$bbuserinfo['lastvisit']."'"); 
OPEN UP THE navbar TEMPLATE AND FIND
HTML Code:
<if condition="$show['pmstats']"><br /><phrase 1="$vbphrase[unread_x_nav_compiled]" 2="$vbphrase[total_x_nav_compiled]" 3="$session[sessionurl]">$vbphrase[private_messages_nav]</phrase></if>
UNDER IT, ADD
HTML Code:
<br /><phrase 1="$getnewthread[threads]" 2="$getnewpost[posts]" />$vbphrase[navbar_sincelastvisit]</phrase>
CREATE NEW PHRASE CALLED navbar_sincelastvisit
WITH THE FOLLOWING CONTENT:
Code:
There have been {1} threads and {2} posts since your last visit!
THE HACK IS NOW INSTALLED, ENJOY!

Screenshots

Attached

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #62  
Old 01-11-2004, 06:24 PM
Reverend Reverend is offline
 
Join Date: Mar 2002
Location: England
Posts: 206
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For anyone that has installed the instructions_newthreads.txt version you might want to make a grammatical change to the phrase content

From this:

Code:
There have been {1} threads and {2} posts since your last visit!
To this:

Code:
There have been {2} posts in {1} threads since your last visit!
Reply With Quote
  #63  
Old 01-11-2004, 06:36 PM
Linear Helix's Avatar
Linear Helix Linear Helix is offline
 
Join Date: Nov 2002
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is what I have put in my globals.php, replacing what the original hack prescribed.

PHP Code:
// #############################################################################
// activity since last visit hack

$forumids array_keys($forumcache);
foreach(
$forumids AS $key => $value) {
    
$fperms = &$bbuserinfo['forumpermissions']["$forumid"];
    
$forum = &$forumcache["$forumid"];
    if (!(
$fperms CANVIEW) OR !($fperms CANSEARCH) OR !verify_forum_password($forumid$forum['password'], false)) {
        unset(
$forumids["$key"]);
    }


$getnewthread=$DB_site->query_first("
    SELECT COUNT(*) AS threads
    FROM " 
TABLE_PREFIX "thread
    WHERE lastpost IN(" 
implode(', '$forumids) . ") > '" $bbuserinfo['lastvisit'] . "'
    "
); 

$getnewpost=$DB_site->query_first("
    SELECT COUNT(*) AS posts
    FROM " 
TABLE_PREFIX "post
    WHERE dateline IN(" 
implode(', '$forumids) . ") > '" $bbuserinfo['lastvisit'] . "'
    "
); 
But I got a database error, so... I guess I can't figure it out. I'm used to php, but this is the first experience I've had with vB's scripts. What am I missing?
Reply With Quote
  #64  
Old 01-11-2004, 06:39 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Reverend
For anyone that has installed the instructions_newthreads.txt version you might want to make a grammatical change to the phrase content

From this:

Code:
There have been {1} threads and {2} posts since your last visit!
To this:

Code:
There have been {2} posts in {1} threads since your last visit!
What's the difference?
Reply With Quote
  #65  
Old 01-11-2004, 06:40 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Linear Helix
This is what I have put in my globals.php, replacing what the original hack prescribed.

PHP Code:
// #############################################################################
// activity since last visit hack

$forumids array_keys($forumcache);
foreach(
$forumids AS $key => $value) {
    
$fperms = &$bbuserinfo['forumpermissions']["$forumid"];
    
$forum = &$forumcache["$forumid"];
    if (!(
$fperms CANVIEW) OR !($fperms CANSEARCH) OR !verify_forum_password($forumid$forum['password'], false)) {
        unset(
$forumids["$key"]);
    }


$getnewthread=$DB_site->query_first("
    SELECT COUNT(*) AS threads
    FROM " 
TABLE_PREFIX "thread
    WHERE lastpost IN(" 
implode(', '$forumids) . ") > '" $bbuserinfo['lastvisit'] . "'
    "
); 

$getnewpost=$DB_site->query_first("
    SELECT COUNT(*) AS posts
    FROM " 
TABLE_PREFIX "post
    WHERE dateline IN(" 
implode(', '$forumids) . ") > '" $bbuserinfo['lastvisit'] . "'
    "
); 
But I got a database error, so... I guess I can't figure it out. I'm used to php, but this is the first experience I've had with vB's scripts. What am I missing?
What was the database error? If you can't see it, then go to View Source - it's in there
Reply With Quote
  #66  
Old 01-11-2004, 06:52 PM
Linear Helix's Avatar
Linear Helix Linear Helix is offline
 
Join Date: Nov 2002
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah, I had not known that the HTML for the database error page would contain the error comment.

***

Database error in vBulletin 3.0.0 Release Candidate 2:

Invalid SQL:
SELECT COUNT(*) AS threads
FROM thread
WHERE lastpost IN() &gt; '1068258593'

mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') &gt; '1068258593'' at line 3

mysql error number: 1064

***

Character entity. I'll see if I can fix that &gt; crappage.
Reply With Quote
  #67  
Old 01-11-2004, 07:00 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Linear Helix
Ah, I had not known that the HTML for the database error page would contain the error comment.

***

Database error in vBulletin 3.0.0 Release Candidate 2:

Invalid SQL:
SELECT COUNT(*) AS threads
FROM thread
WHERE lastpost IN() &gt; '1068258593'

mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') &gt; '1068258593'' at line 3

mysql error number: 1064

***

Character entity. I'll see if I can fix that &gt; crappage.
Nah it's just like that in HTML, it's supposed to be >.

Anyways, I think you're missing the code from this post: https://vborg.vbsupport.ru/showpost....8&postcount=48
Reply With Quote
  #68  
Old 01-11-2004, 07:02 PM
Linear Helix's Avatar
Linear Helix Linear Helix is offline
 
Join Date: Nov 2002
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Check the database error I posted. You're right, it probably isn't the gt that is messing up, but it's thereabouts.

I am not missing that code: it's right there at the beginning of the code block I posted.
Reply With Quote
  #69  
Old 01-11-2004, 07:03 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Reverend
For anyone that has installed the instructions_newthreads.txt version you might want to make a grammatical change to the phrase content

From this:

Code:
There have been {1} threads and {2} posts since your last visit!
To this:

Code:
There have been {2} posts in {1} threads since your last visit!
That won't work. What if they make 2 posts in a thread that isn't new?
Reply With Quote
  #70  
Old 01-11-2004, 09:42 PM
Reverend Reverend is offline
 
Join Date: Mar 2002
Location: England
Posts: 206
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo
That won't work. What if they make 2 posts in a thread that isn't new?
If they make 2 posts in thread which isn't new it will say
"There have been 2 posts in 1 threads since your last visit!"

If they make 3 posts in 2 threads that aren't new it will say
"There have been 3 posts in 2 threads since your last visit!"

So would you like to explain why you reckon that doesn't work. ????

Don't forget i'm using the first version of the hack which isn't specifically for "new" threads
Reply With Quote
  #71  
Old 01-11-2004, 09:48 PM
Reverend Reverend is offline
 
Join Date: Mar 2002
Location: England
Posts: 206
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Gary W
What's the difference?
I was merely pointing out that some people might want to change the grammar.

Geez,sorry for mentioning it. :devious:
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:16 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06084 seconds
  • Memory Usage 2,354KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (7)bbcode_code
  • (2)bbcode_html
  • (5)bbcode_php
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete