Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

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
  #22  
Old 01-05-2004, 12:40 AM
squawell's Avatar
squawell squawell is offline
 
Join Date: Oct 2001
Posts: 681
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Link14716
All you need is one phrase.

Just call it "home_sincelastvisit"
"There have been {1} threads and {2} posts since your last visit!"

Then use this in navbar:
Code:
<phrase 1="$getnewthread[threads]" 2="$getnewpost[posts]" />$vbphrase[home_sincelastvisit]</phrase>
thats a good infomation to me

Thankz Link
Reply With Quote
  #23  
Old 01-05-2004, 07:34 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay I'll be integrating all this new information into the next version of this hack, so stay tooned!
Reply With Quote
  #24  
Old 01-05-2004, 07:59 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 SmEdD
This is also possible to be done in one query instead of two.

And you should also give credit to the orignal author for the vb2 one as the query has barley changed.
How will I make it into one query, why don't you just post the one query so I can use that instead
Reply With Quote
  #25  
Old 01-05-2004, 08:08 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay the instructions have been updated slightly to be able to incorporate the phrases feature of vB 3. This update is strictly optional, so you do not have to install it, but if you want to have this hack in a different language, then you can install the hack with the updated instructions

Thanks to Bernd Glasstett for the idea of using phrases and Link14716 because I'm actually using the phrases that he suggested
Reply With Quote
  #26  
Old 01-05-2004, 08:41 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Gary W
How will I make it into one query, why don't you just post the one query so I can use that instead
It can easily be done with one query. My version in vBindex 3 which uses origional code only uses one query for new threads, posts and updated subscribed threads.
Reply With Quote
  #27  
Old 01-06-2004, 08:09 AM
DCX DCX is offline
 
Join Date: Dec 2003
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok, i'm really stupid.... i just managed to upgrade to rc2 myself with no prior experience and it worked out good. i didn't install this hack into it yet cause i was probably going to upgrade first. now i did look for the global.php file and found it in the admincp folder but i couldn't find this text:

******************************

OPEN global.php AND FIND

******************************

echo "End call of global.php: $aftertime\n";

echo "\n<hr />\n\n";

and i looked in the same directory and i looked in the templates folder and i couldn't find this text either:

<if condition="$show['pmstats']"><br /><a

href="private.php?$session[sessionurl]">$vbphrase[private_messages]</a>: $vbphrase[unread] <if

condition="$bbuserinfo['pmunread']"><strong>$bbuserinfo[pmunread]</strong><else

/>$bbuserinfo[pmunread]</if>, $vbphrase[total] $bbuserinfo[pmtotal].</if>

can someone give me step by step where everything is and how it's done. thanks a lot.
Reply With Quote
  #28  
Old 01-06-2004, 08:51 AM
corsacrazy's Avatar
corsacrazy corsacrazy is offline
 
Join Date: May 2002
Location: london
Posts: 854
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i put it here so its easier for users to understand
Reply With Quote
  #29  
Old 01-06-2004, 03:03 PM
ogden2k's Avatar
ogden2k ogden2k is offline
 
Join Date: Apr 2003
Posts: 192
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by corsacrazy
i put it here so its easier for users to understand
Good idea.

Which one do I use if I don't want the thread count to go up if someone posts into a thread?
Reply With Quote
  #30  
Old 01-06-2004, 07:06 PM
corsacrazy's Avatar
corsacrazy corsacrazy is offline
 
Join Date: May 2002
Location: london
Posts: 854
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

just use the second query
Reply With Quote
  #31  
Old 01-06-2004, 07:36 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 NTLDR
It can easily be done with one query. My version in vBindex 3 which uses origional code only uses one query for new threads, posts and updated subscribed threads.
Okay I never meant said that it's impossible, and I never had something like "if you're good enough then show me the query"

I just asked for the query, instead of just saying it's possible to do in one query

Also, I can't seem to find the COUNT() function in your code?
Reply With Quote
Reply


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 08:53 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04402 seconds
  • Memory Usage 2,330KB
  • 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
  • (2)bbcode_code
  • (2)bbcode_html
  • (3)bbcode_php
  • (5)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