vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Welcome Panel v1.0 (https://vborg.vbsupport.ru/showthread.php?t=63228)

JKeats 05-10-2004 08:31 PM

this was my first hack ever on VB!

i'm a phpBB vet who's recently switched to VB.

i had a welcome bar on my phpBB so it was awesome to find a similar beast for VB.

i customized this a bit... i have a screen shot but can't seem to get the .gif to attach.

i changed around the text that's displayed a bit. added a PM and mark all link and moved stuff around a little. i also removed some of the text included like the newest member and total posts and things like that.

anyway... awesome hack. thanks!

Chris|vB 05-15-2004 04:00 AM

nice job.

JKeats 05-21-2004 08:09 PM

i have a question about this one. one of my members just pointed out something interesting.

let's say that since your last visit there's 10 new posts in 3 different threads (all old threads that have been around for a while).

the welcome panel will say there's 10 new post and 3 new threads. well... the threads aren't really new... the posts are, but not the threads. there's new posts IN the threads, but the threads themselves aren't new.

did i install something wrong? is there a way to get this so that it'll only show a X number of new threads if the thread is actually NEW (i.e. created since your last visit)?

thanks for the info.

neocorteqz 05-22-2004 09:42 AM

Quote:

Originally Posted by neocorteqz
Quick question, I've been working at it, and am not sure where to put the <br> tags to make the Total Threads, Total Posts, Newest Member, Total Members, all on separate lines. Also how do I get these Numbers closer to the Words. See Attached image.

http://www.neocorteqz.com/junior/welcome.png

Thanks. :)

Bump on this question. :)

Thanks

JKeats 05-22-2004 12:46 PM

neo... that's all in the index.php edit. look for the following block and make whatever changes you want to alter the layout...

Code:

// Cell 2 - Quick Forum Stats
$welcome_new_posts=$DB_site->query_first("select count(*) as new_posts from ".TABLE_PREFIX."post where dateline > '{$bbuserinfo['lastvisit']}'");
$welcome_new_topics=$DB_site->query_first("select count(*) as new_topics from ".TABLE_PREFIX."thread where lastpost > '{$bbuserinfo['lastvisit']}'");
$total_members=$DB_site->query_first("select count(*) as all_users from ".TABLE_PREFIX."user");
$total_posts=$DB_site->query_first("select count(*) as all_posts from ".TABLE_PREFIX."post");
$total_topics=$DB_site->query_first("select count(*) as all_topics from ".TABLE_PREFIX."thread");
$welcome_members="<b>Total {$vbphrase['members']}</b>:</td><td> {$total_members['all_users']}";
$welcome_topics="<b>Total Threads</b>:</td><td> {$total_topics['all_topics']}";
$welcome_posts="<b>Total Posts</b>:</td><td> {$total_posts['all_posts']}";
if($bbuserinfo['userid']!=0){
$welcome_intro="Welcome back {$bbuserinfo['username']}, there has been {$welcome_new_posts['new_posts']} new posts and {$welcome_new_topics['new_topics']} new threads since your last visit. <a href='search.php?{$session['sessionurl']}&do=getnew'>Search For New Posts</a>";
} else {
$welcome_intro="Welcome to the forums Guest, please take a look around, if your already a member login, if not then please register. Enjoy Your Stay";
}


JKeats 05-22-2004 03:26 PM

okay... i think i've figured out the thread issue (reading up on some other hacks that count new threads). there's basically two forms of the query for the new threads.

one, the one that this hack uses, counts new threads as any thread that has a new post in it... whether or not it's actually NEW or not.

the other, will only count NEW threads (i think).

it's a matter of preference really... but here's some code to count NEW threads only

Code:

$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM ".TABLE_PREFIX."thread WHERE dateline > '".$bbuserinfo['lastvisit']."'");
i got that code from HERE

notice the very small difference... instead of "thread where lastpost >, it's "thread WHERE dateline >.

i THINK this is working on my board. i'll have to wait for some new threads and more posts to know for sure.

i simply replaced the following line in index.php...

Code:

$welcome_new_topics=$DB_site->query_first("select count(*) as new_topics from ".TABLE_PREFIX."thread where lastpost > '{$bbuserinfo['lastvisit']}'");
with

Code:

$welcome_new_topics=$DB_site->query_first("select count(*) as new_topics from ".TABLE_PREFIX."thread where dateline > '{$bbuserinfo['lastvisit']}'");
hope this helps some of you.

:)

neocorteqz 05-22-2004 04:48 PM

Quote:

Originally Posted by JKeats
neo... that's all in the index.php edit. look for the following block and make whatever changes you want to alter the layout...

Code:

// Cell 2 - Quick Forum Stats
$welcome_new_posts=$DB_site->query_first("select count(*) as new_posts from ".TABLE_PREFIX."post where dateline > '{$bbuserinfo['lastvisit']}'");
$welcome_new_topics=$DB_site->query_first("select count(*) as new_topics from ".TABLE_PREFIX."thread where lastpost > '{$bbuserinfo['lastvisit']}'");
$total_members=$DB_site->query_first("select count(*) as all_users from ".TABLE_PREFIX."user");
$total_posts=$DB_site->query_first("select count(*) as all_posts from ".TABLE_PREFIX."post");
$total_topics=$DB_site->query_first("select count(*) as all_topics from ".TABLE_PREFIX."thread");
$welcome_members="<b>Total {$vbphrase['members']}</b>:</td><td> {$total_members['all_users']}";
$welcome_topics="<b>Total Threads</b>:</td><td> {$total_topics['all_topics']}";
$welcome_posts="<b>Total Posts</b>:</td><td> {$total_posts['all_posts']}";
if($bbuserinfo['userid']!=0){
$welcome_intro="Welcome back {$bbuserinfo['username']}, there has been {$welcome_new_posts['new_posts']} new posts and {$welcome_new_topics['new_topics']} new threads since your last visit. <a href='search.php?{$session['sessionurl']}&do=getnew'>Search For New Posts</a>";
} else {
$welcome_intro="Welcome to the forums Guest, please take a look around, if your already a member login, if not then please register. Enjoy Your Stay";
}



Thanks. :)

CreedFeed 05-25-2004 02:24 PM

I have a question about this hack - how would you go about getting the Welcome Panel to display on ALL pages and not just the home page? Is there a better way to do this than have to copy/paste the code into each vBulletin page file? For example, I'd like to have the Welcome Bar shown just below the navbar.

[ breadcrumb links]
[ navbar ]

[ welcome panel ]

[ forum content ]

DarkExplosion 05-25-2004 10:10 PM

nice job, was gonna make something like this but you beat me to it :) installed without a prob.

Anub1s 05-26-2004 03:09 AM

cool

you share all the hacks in you forum

'xept inferno lol

thanks for this one =D


All times are GMT. The time now is 06:00 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.01146 seconds
  • Memory Usage 1,753KB
  • 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_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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