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)
-   -   [Concept Demo RC3] Conditionals in templates (https://vborg.vbsupport.ru/showthread.php?t=16743)

Mas*Mind 05-16-2001 07:20 AM

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 :)

chrispadfield 05-16-2001 09:15 AM

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.

cliffe2 05-21-2001 07:36 PM

a combi of a php variable & javascript can do something nice too ...

Vinnie 05-25-2001 07:42 PM

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.

Mas*Mind 05-25-2001 09:21 PM

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.

fastforward 05-25-2001 09:59 PM

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.

Mas*Mind 05-25-2001 10:27 PM

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)

fastforward 05-26-2001 02:02 AM

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).

Mike Sullivan 05-26-2001 04:18 AM

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()...

ConqSoft 11-20-2005 09:26 PM

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.


All times are GMT. The time now is 07:56 AM.

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.00978 seconds
  • Memory Usage 1,739KB
  • 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
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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