Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 11-02-2000 Last Update: Never Installs: 0
 
No support by the author.

I am trying to display a custom message to guests on the forum I help run...so when they come in, instead of saying "Welcome back..." it will say a customisable message that could be defined from the templates.
I was planning to put some php in the templates to do this but now I remember that you can only parse php code in the header/footer.
Has this ever been done before, or perhaps someone could point me in the right direction?

Thanks in advance!

Show Your Support

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

Comments
  #2  
Old 11-02-2000, 05:42 PM
Guest
 
Posts: n/a
Default

Are you talking about the "welcometext" template?
Reply With Quote
  #3  
Old 11-02-2000, 06:36 PM
Guest
 
Posts: n/a
Default

Sorry I didn't explain this quite well enough
I would like a different message to be displayed to unregistered users to that showed to normal registered users.
So eg a normal user would get "Welcome back $username. You last visited...." but a guest would get "Welcome to eDevBoards forums. Please register at this link. "
I presume cookies would be needed for this.

Thanks!
Reply With Quote
  #4  
Old 11-02-2000, 08:14 PM
Guest
 
Posts: n/a
Default

Basically you will have to replace the template "welcometext" with PHP code within index.php.

Your code will then have to check if they are a valid user by checking the $bbuserid variable against the database. If they are a valid user then use the default welcometext string. If not use the string you wish for the quests.

I.E.
Code:
if ($bbuserid) {

 ...*Check Database Here *...

 $welcometext = "Welcome Back " . $username;
}
else {
 $welcometext = "Your a guest go register please!.!.!"
}
Reply With Quote
  #5  
Old 11-03-2000, 04:45 AM
Guest
 
Posts: n/a
Default

Thanks a lot!
Wayne, recognise me? I'm James from SitePoint
Reply With Quote
  #6  
Old 11-03-2000, 04:57 AM
Guest
 
Posts: n/a
Default

I've adapted it slightly to use templates, so if anyone actually wants the hack let me know and I will release it
But its hardly a hack, only a few lines of code
Reply With Quote
  #7  
Old 11-03-2000, 02:26 PM
Guest
 
Posts: n/a
Default

Quote:
I've adapted it slightly to use templates, so if anyone actually wants the hack let me know and I will release it
I'd love to see it!
Reply With Quote
  #8  
Old 11-04-2000, 08:04 PM
Guest
 
Posts: n/a
Default

OK here it is:
Tested on 1.1.3 and 1.1.4
Demo location: http://www.eDevBoards.com (only if you haven't registered -- otherwise it wont show up )


Setup Instructions:
  • Open up the forum control panel and add a template called "guestmsg". In it type the message you want displayed to unregistered users, along with any formatting. I have used the <smallfont> tags to make it fit better on the page.
  • Open global.php into your favorite text editor and find the following line:
    eval("\$fivelinks = \"".gettemplate("fivelinks")."\";");
  • Above it, insert the following code:
    Code:
    if ($bbuserid == "0") {
    	eval("\$guestmsg = \"".gettemplate("guestmsg")."\";");
    }
  • Go into your forum control panel again, and find the place you want the guest message to show up. I have mine at the bottom of the fivelinks template. Type "$guestmsg" in the right place.

Not much of a hack, but anyway
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 11:20 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.07105 seconds
  • Memory Usage 2,249KB
  • Queries Executed 21 (?)
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
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (8)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
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete