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

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
  #12  
Old 05-16-2001, 07:20 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

Quote:
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
Yes, it can dramaticly infect the speed. I'm not sure how many, but regexes are pretty resource intensive

Quote:
Using this system could eliminate a large amount of templates though...
Yeah, but still: It defeats the purpose of templates imho
Reply With Quote
  #13  
Old 05-16-2001, 09:15 AM
chrispadfield's Avatar
chrispadfield chrispadfield is offline
 
Join Date: Oct 2001
Posts: 180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i don't know, gossamer threads does this sort of thing for their links based templates and it works very very well. It saves having to have 10 million options for everything like how many links to display here, there and everywhere else because you can set it as part of the template, and in that case it is a display thing because displaying 10 links as opposed to 20 is a display issue. I am not sure the idea transfers over so well to vb but it is still interesting idea anyway.
Reply With Quote
  #14  
Old 05-21-2001, 07:36 PM
cliffe2
Guest
 
Posts: n/a
Default

a combi of a php variable & javascript can do something nice too ...
Reply With Quote
  #15  
Old 05-25-2001, 07:42 PM
Vinnie
Guest
 
Posts: n/a
Default

This is EXACTLY what I need.

However, I am concerned about the speed issues, and the necessity of reapplying the mod for every new release.

This having been said, I have an expanded "fivelinks" nav bar at the top of my forum:
http://forum.bearsharelabs.com
or
http://208.239.76.100

I want to have the "Logout" icon change to "Login" depending on the state of the user.

It would also be nice to have a "Post" icon appear in the list at the appropriate time.

And, it would be cool to NOT show the "User control panel" icon when they are actually already viewing the control panel.

While we're at it, it would be good not to show the Admin icon unless they actually had administrator privileges.

The possibilities are endless.
Reply With Quote
  #16  
Old 05-25-2001, 09:21 PM
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

Quote:
Originally posted by chrispadfield
i don't know, gossamer threads does this sort of thing for their links based templates and it works very very well. It saves having to have 10 million options for everything like how many links to display here, there and everywhere else because you can set it as part of the template, and in that case it is a display thing because displaying 10 links as opposed to 20 is a display issue. I am not sure the idea transfers over so well to vb but it is still interesting idea anyway.
I don't say it's not usefull; In most cases it actually saves alot of vbcode to accomplish certain things. But again: Templates are meant to separate code from layout (for designs sake and to make it friendly for non-coders). Bringing back the code into it just makes no sense.
Reply With Quote
  #17  
Old 05-25-2001, 09:59 PM
fastforward fastforward is offline
 
Join Date: Oct 2001
Location: NC, USA
Posts: 399
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Ed Sullivan
Then you add that fact that you regex any template that you want to use with it
How are replacement variables handled then? Isn't every template parsed for these things anyway? Can't you just have a special type of replacement variable that has it's replaced value treated as a block of code?

Oversimplified I know, but is it feasible?

This is definately something I'd like though. Even if it only handled a simple if then construct it would be great.
Reply With Quote
  #18  
Old 05-25-2001, 10:27 PM
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

Quote:
Originally posted by fastforward

How are replacement variables handled then? Isn't every template parsed for these things anyway? Can't you just have a special type of replacement variable that has it's replaced value treated as a block of code?

Oversimplified I know, but is it feasible?

This is definately something I'd like though. Even if it only handled a simple if then construct it would be great.
Regexing text is far more resource-intensitive then using str_replace (like replacement vars are parsed)
Reply With Quote
  #19  
Old 05-26-2001, 02:02 AM
fastforward fastforward is offline
 
Join Date: Oct 2001
Location: NC, USA
Posts: 399
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Mas*Mind


Regexing text is far more resource-intensitive then using str_replace (like replacement vars are parsed)
Actually there are calls to preg_replace in both the dovars() and the bbcodeparse2() functions (replacement vars and bbcode).
Reply With Quote
  #20  
Old 05-26-2001, 04:18 AM
Mike Sullivan Mike Sullivan is offline
 
Join Date: Feb 2002
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bbcodeparse2() is completely unrelated to replacement variables... it's the general post parsing routine. You can't do str_replace()'ment on anything there...

The one in dovars() is most likely for the pm popup and only processed when there's a PM popup.

Replacement variables are done with str_replace() which is faster than preg_replace which is faster than ereg_replace()...
Reply With Quote
  #21  
Old 11-20-2005, 09:26 PM
ConqSoft's Avatar
ConqSoft ConqSoft is offline
 
Join Date: Jul 2003
Location: Raleigh, NC
Posts: 686
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any plans to port this over to vB 3.5.x?

Actually, I just ran across this and thought it was interesting to see when/how template conditionals got their start.
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 01:35 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.04492 seconds
  • Memory Usage 2,306KB
  • 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
  • (6)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
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (9)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