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

Reply
 
Thread Tools
Details »»

Version: , by Mike Sullivan Mike Sullivan is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 2.0.x Rating:
Released: 05-13-2001 Last Update: Never Installs: 1
 
No support by the author.

I threw this together in about 45 minutes today. It allows you to put stuff like this in your templates:
{if ($bbuserinfo[userid]) {
<a href="usercp.php?s=$session[sessionhash]">User CP!</a>
}else{
<a href="register.php?s=$session[sessionhash]&action=signup">Signup!</a>
}endif}

Of course, it requires a code edit for each template, so it's somewhat counter intuitive, but as I said, it's not exactly a release -- it's more a concept demo.

Requires PHP4 as I use the /e modifier. Also, you'll want to have some decent PHP understanding. See attachment for more info.

Feel free to ask questions, but I may not answer/support like I did past hacks.

Show Your Support

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

Comments
  #2  
Old 05-14-2001, 03:38 AM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Mike, I needed something like this!
Reply With Quote
  #3  
Old 05-14-2001, 09:44 AM
Mark Hewitt Mark Hewitt is offline
 
Join Date: Oct 2001
Posts: 174
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I like
Reply With Quote
  #4  
Old 05-14-2001, 10:31 PM
TWTCommish's Avatar
TWTCommish TWTCommish is offline
 
Join Date: Oct 2001
Location: Pittsburgh, PA, USA
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you're looking for a quick way to swap buttons, do what I did: use the phpinclude template, a one-line ternary operator that stores the HTML for either the register button, or the user cp button -- hold it in a variable name not used elsewhere, and call on it in the template.

Example:

Code:
$the_button = (isset($bbuserid)) ? sprintf('<img src="images/top_register.gif">') : sprintf('<img src="images/top_usercp.gif">');
Reply With Quote
  #5  
Old 05-15-2001, 12:00 AM
Mike Sullivan Mike Sullivan is offline
 
Join Date: Feb 2002
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That was just an example

And if you wanna get technical, you should check $bbuserinfo[userid] instead of bbuserid for those who don't store their username/password.
Reply With Quote
  #6  
Old 05-15-2001, 12:07 AM
TWTCommish's Avatar
TWTCommish TWTCommish is offline
 
Join Date: Oct 2001
Location: Pittsburgh, PA, USA
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A competition now, eh? Well, it's just an extremely simple way to allow people to display the appropriate button.
Reply With Quote
  #7  
Old 05-15-2001, 09:25 PM
Wayne Luke's Avatar
Wayne Luke Wayne Luke is offline
Senior Member
 
Join Date: Jan 2002
Location: Southern California
Posts: 1,694
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Chris -

It isn't a competition. Look at where Mike said he put his conditional and look at where you put yours.

Mike is talking about adding conditionals to any template where they are processed by keyword. This could be used by non-programmers to make things all over the system change based on various information. They wouldn't have to learn a whole new language just a few commands.

Mike -
This is a great concept and it should probably be pursued for later versions. This would greatly improved the functionality of vBulletin.
Reply With Quote
  #8  
Old 05-15-2001, 09:32 PM
TWTCommish's Avatar
TWTCommish TWTCommish is offline
 
Join Date: Oct 2001
Location: Pittsburgh, PA, USA
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, I know -- I was making a joke.
Reply With Quote
  #9  
Old 05-16-2001, 12:41 AM
Mas*Mind's Avatar
Mas*Mind Mas*Mind is offline
 
Join Date: Oct 2001
Location: Amsterdam, The Netherlands, currently living in Cape Town, South Africa
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Personally I don't see the point to give templates this functionality. Templates are meant to separate code from layout and now you're bringing back the code into the layout

It gives templates more flexibility: true, but also makes them harder to understand to newbies.

This can be a great addon for some people, but I hope this won't be a standard in vb
Reply With Quote
  #10  
Old 05-16-2001, 02:28 AM
Mike Sullivan Mike Sullivan is offline
 
Join Date: Feb 2002
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Would this version ever see an official release? No, it's physically impossible because it requires PHP4.

Then you add that fact that you regex any template that you want to use with it

Using this system could eliminate a large amount of templates though...
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 05:58 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.04564 seconds
  • Memory Usage 2,285KB
  • Queries Executed 23 (?)
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
  • (1)bbcode_code
  • (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
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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