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)
-   -   Advanced Templates: Dynamic Templates Changing according to different conditions (https://vborg.vbsupport.ru/showthread.php?t=43325)

AndrewD 09-17-2002 05:35 PM

Sorry to tell you this...

There is an obscure bug when this hack is installed, a user forgets his password and he requests a new one. One ends up with a PHP parse error.

The bug is as follows:

VBulletin uses $a as a global variable in the reset password code (around line 174 of member.php). This messes up use of $a as the command argument in advanced_templates.

Solution: use a variable in advanced_templates which does not have global scope. (e.g. replace $a by $basictemplate)

Logician 09-17-2002 06:13 PM

Quote:

Originally posted by AndrewD
There is an obscure bug when this hack is installed, a user forgets his password and he requests a new one. One ends up with a PHP parse error.

Andrew, I have already noticed that bug, released an update and sent it to hack users via email (for ones who clicked "install" in the hack thread) in September 9th. I put the bug notice and fix into thread's first message and the hack instruction has also been corrected..

Since you wisely noticed the bug and its cause, I'm sure you already fixed it in your board but if you didnt, you can get the updated file and correct the problem.. :)

Thx for the feedback though..

AndrewD 09-17-2002 06:18 PM

You're too quick for me, Logician - or rather I'm too slow and bleary eyed by this time of day

Have now clicked on install, so that you can duly tell me the next wonderful things you achieve

trainer 09-21-2002 03:30 PM

i am seeing

[[(6==6)]]

Advanced Templates Hack has been successfully installed! By the way this remark is visible to Site Admins only.. ;) Enjoy..
Logician \\=^))

[[/(6==6)]]


in the index.php page. how do i get rid of the [[(6==6)]] and [[/(6==6)]]

so i will only see the message?

just checked and seeing

[[(2==6)]]

Advanced Templates Hack has been successfully installed! By the way this remark is visible to Site Admins only.. ;) Enjoy..
Logician \\=^))

[[/(2==6)]]


in the index.php page. how do i get rid of the [[(6==6)]] and [[/(6==6)]]


anyone else having this problem?

Freddie Bingham 09-21-2002 03:43 PM

Quote:

Originally posted by fastforward

Great hack Logician, but Ed was inspired way before March 2002 :) :
https://vborg.vbsupport.ru/showthrea...t=conditionals

Like I said though, great hack and thanks... I'll be using it.

Yes conditionals were one of the first things to go into vb3 and that was before March 2002.

As for technical details:

1. You can do if/else constructs
2. The conditionals are parsed at the time you edit your templates since we now store two copies of every template. One with the conditionals asis, and one with any conditionals converted to accompanying php code so that there is no overhead when the templates are called by the forum.

Logician 09-21-2002 08:49 PM

Quote:

Originally posted by trainer
how do i get rid of the [[(6==6)]] and [[/(6==6)]] so i will only see the message?

Trainer please login to your Admin CP, choose vb settings and disable "Add template name in comments".. This should fix your problem.. If this fixes the problem and you are determined to keep this option enabled, AndrewD posted the code to apply in this thread a few post above, please apply this one.. But IMO there is no need have this settings on all the time..

Logician 09-21-2002 09:02 PM

Quote:

Originally posted by freddie
Yes conditionals were one of the first things to go into vb3 and that was before March 2002.

Great.. Although this is usually for power users, I believe conditionals add a lot of functionality to the board, so it's a very valuable addition to the script.. I'm using the concept since my webtemplates hack and didnt know you intented to add it to vb 3 and I'm very glad you did..

Quote:

2. The conditionals are parsed at the time you edit your templates since we now store two copies of every template. One with the conditionals asis, and one with any conditionals converted to accompanying php code so that there is no overhead when the templates are called by the forum.
I dont exactly understand what kind of algorithm you are following but if I'm not wrong, it will be much different than my approach. I parse them on the fly and I accept that this can add a small (IMO bearable) overhead to running time, but I believe it's the only way to code it, if functionality is the primary concern. This helps to have more than 1 conditionals in every template and also allow any variable to be used as a conditional.

Of course I'm sure you have a nice algorithm either.. :)

Xenon 09-22-2002 10:16 AM

perhaps you've read that already, but if not:
http://www.vbulletin.com/forum/showt...3&pagenumber=2

Logician 09-22-2002 03:01 PM

Quote:

Originally posted by Xenon
perhaps you've read that already, but if not:
http://www.vbulletin.com/forum/showt...3&pagenumber=2

thx for the link Pal, but that explanation is still unclear to me.. The only educated guess I can make from that statement is that vb3 will save the conditionals seperate from the template itself so that they could be eval'ed without need to parse through the template but it's still not clear to me how this would increase the template parsing time.. If a condition is met, there will be still a replacement (= parsing) in template. The only gain would be while searching through the template if it has a conditional or not but well considering the templates sizes are not so big, IMO its overhead increase should be very trivial..

It's just a "substr_count" that's saved (which I intend to add to my hack too) but IMO it does not effect running time so significiantly..

Or I still didnt get how it will work? lol

trainer 09-22-2002 10:51 PM

what is this like on server load? it seems to be pretty hard on my site. any ideas?


All times are GMT. The time now is 01:05 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.01386 seconds
  • Memory Usage 1,746KB
  • 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
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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