vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Since Your Last Visit! (https://vborg.vbsupport.ru/showthread.php?t=31957)

MrLister 10-31-2001 10:00 PM

Somebody here request it so I made it quickly.... Basically this hack here tells your users how many new posts and threads there have been since hteir last visit on the main page.

An example is https://vborg.vbsupport.ru and right under your username.

INSTRUCTIONS:
Inside index.php (not admin) find:
PHP Code:

// if user is know, then welcome 

right under it add:
PHP Code:

$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE lastpost > '$bbuserinfo[lastvisit]'");
$getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE dateline > '$bbuserinfo[lastvisit]'"); 


In the template forumhome_welcometext find:
PHP Code:

Welcome back, <b>$bbuserinfo[username]</b

right under it add:
PHP Code:

<br>There have been <b>$getnewthread[threads]</bthreads and <b>$getnewpost[posts]</bposts since your last visit


That's it! If you installed the hack please click the install button!

atrl 11-01-2001 12:52 AM

Thanks Very Much!

Neo 11-01-2001 01:00 AM

thank you for another great hack

|DarkManX| 11-01-2001 03:12 AM

getting this error with 2.2

Database error in vBulletin 2.2.0:

Invalid SQL: SELECT COUNT(*) AS threads FROM thread WHERE lastpost > '1004590373
mysql error: You have an error in your SQL syntax near ''1004590373' at line 1

mysql error number: 1064

Date: Thursday 01st of November 2001 12:10:23 AM
Script: http://www.partylounge.net/tof/tof/index.php?
Referer:



don't get what i did wrong....

MrLister 11-01-2001 03:49 AM

yikes sorry.... add a ' after $bbuserinfo[lastvisit] or look above. i fixed it.

FWC 11-01-2001 04:00 AM

Add a ' right before the last " in each query. You also need to add posts to the forumhome_welcometext.

MrLister 11-01-2001 04:13 AM

yup.. it's fully fixed now.. thx
Quote:

Originally posted by FWC
Add a ' right before the last " in each query. You also need to add posts to the forumhome_welcometext.

FWC 11-01-2001 04:29 AM

Hey, I'm the first guy to click "Installed". Thanks! :)

JJR512 11-01-2001 07:15 AM

2nd! :)

Admin 11-01-2001 10:22 AM

Clicked it as well since I'm already using this here. :) Nice job.

eva2000 11-01-2001 12:10 PM

cool gonna install it :D

MrLister 11-01-2001 01:41 PM

:) hehe..... idea successfully ripped
Quote:

Originally posted by FireFly
Clicked it as well since I'm already using this here. :) Nice job.

MrLister 11-01-2001 01:42 PM

tell me how it goes on a popular board.... that's 2 extra queries on the main page.. but the queries aren't big so shouldn't be a problem
Quote:

Originally posted by eva2000
cool gonna install it :D

eva2000 11-01-2001 01:44 PM

Quote:

Originally posted by MrLister
tell me how it goes on a popular board.... that's 2 extra queries on the main page.. but the queries aren't big so shouldn't be a problem

LOL i already added 16+ extra queries on teh front page from various hacks anyway before this :D

FWC 11-01-2001 04:51 PM

Quote:

Originally posted by eva2000
LOL i already added 16+ extra queries on teh front page from various hacks anyway before this :D
Yeah, I have you page view counter, total thread views and a Firefly posts today query going in addition to this one. :)

JJR512 11-03-2001 07:15 AM

This hack as it is used on this board has a grammatical error. On the front page of vbulletin.org, it says "There has been xx threads..." It should be have, as described in the instructions above. :)

Admin 11-03-2001 07:21 AM

LOL, thanks Justin. :)

|DarkManX| 11-04-2001 02:09 PM

thanks for this hack....:)

eva2000 11-04-2001 03:39 PM

Quote:

Originally posted by JJR512
This hack as it is used on this board has a grammatical error. On the front page of vbulletin.org, it says "There has been xx threads..." It should be have, as described in the instructions above. :)
:rolleyes:

JJR512 11-04-2001 03:48 PM

Are you rolling your eyes at the fact that this mistake was made, or that I pointed it out? ;)

(If the latter...hey, I'm just trying to help make this site the best it can be, and poor grammar contributes greatly to an unprofessional image. :D)

Ifrani 11-04-2001 06:25 PM

Is it possible, that it only count posts ? The number of posts an threads is always the same... ?!?

Lesane 11-04-2001 06:32 PM

Thanks for the hack

Ifrani 11-05-2001 08:50 AM

I doublecheck all changes for this hack, but it still displays only posts and it is not counting the new threads (display the same number as posts)...
Is that only my problem ???

Ifrani 11-05-2001 05:31 PM

Ok, I find the error:

The code to insert is:
PHP Code:

$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE dateline > '$bbuserinfo[lastvisit]'");
$getnewpost=$DB_site->query_first("SELECT COUNT(*) AS posts FROM post WHERE dateline > '$bbuserinfo[lastvisit]'"); 

Don't use the "lastpost" in the query, "dateline" works better for me :)...

Alien 11-06-2001 01:51 PM

Installed and working, thanks a bunch! :D

Mr. X 11-09-2001 01:57 AM

Just installed it. Thanks :)

over 11-09-2001 08:03 PM

thnx will be adding to my board :) very useful hack

snyx 11-10-2001 05:01 PM

whoa, works great man
JUST what the doctor ordered :D

philliplewisuk 11-11-2001 07:29 PM

I had to remove it.

I have 300 members on my forum at most times and adding it just made it error and error!

LuBi 11-16-2001 05:57 PM

FireFly what do I edit just to make it like yours.

>>Welcome back, user
Avatar Time Now
last vist
There have been XX posts
Click Here to view posts

Which do I edit? forumhome template itself?

Admin 11-16-2001 06:07 PM

Basically yeah.

LuBi 11-16-2001 07:02 PM

What does you code look like :( sorry I'm juts not having luck with this picking the right templates :confused: or anything plus I can't find the avatar code. Really I just want that on top of the forum below the normal stuff added to the table of the forum much like you have it.

LuBi 11-17-2001 05:55 AM

After playing with it a bit I now know I have no clue what I am doing, if you get a chance go to my page and look at what I've done :( anyhow. I need to know the code for the users avatar, I'll need to find that guest avatar hack and I need to connect the fourmhome with the actual table... problem is I have no clue. If oyu could maybe walk me through it.. or post yours or something, I dunno... any help would be great as usual firefly (this begger aint choosey) ;)

Admin 11-17-2001 03:02 PM

What is it you're trying to do, exactly?
I don't understand a word from your post LuBi.

LuBi 11-17-2001 03:05 PM

I want to mkae a box like yours. Where the admin is, I need to understand what goes into it and the code behind it. If all that's not to much trouble.

In short, I need the code, and the templates to edit.

Lesane 11-17-2001 03:08 PM

Firefly, is it possible that you can give a link to the new threads.

like it says:
There here have been 10 threads....

and then a link on "10" and that link shows the new 10 threads.

Cool if thats possible.

Admin 11-17-2001 03:15 PM

Lesane, there's no link on my numbers. :confused:

LuBi, it invloves a lot of new code and templates, I can just "post it all".

Lesane 11-17-2001 03:31 PM

hehe, i know that there is no link on your numbers :)

but i wonder if there is an way to give a link to that new threads.

It says: There here have been 10 threads....

now is it possible to add a lil hack that gives the number 10 a link and that link shows the 10 new threads.

over 11-17-2001 05:06 PM

Quote:

Originally posted by Lesane
hehe, i know that there is no link on your numbers :)

but i wonder if there is an way to give a link to that new threads.

It says: There here have been 10 threads....

now is it possible to add a lil hack that gives the number 10 a link and that link shows the 10 new threads.

vbb's own view new posts code you could edit slightly to do the job u want :)

LuBi 11-17-2001 07:26 PM

Ok then I have an idea, tell me which things you edit and why, tell me which things you create and why. Also I just need the code for the avatar, The code for the users current avatar. Much like the one in edit options.

Thanks


All times are GMT. The time now is 04:46 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.01942 seconds
  • Memory Usage 1,799KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete