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)

Logician 01-29-2003 08:31 AM

Quote:

Originally posted by lowtaxbaby
We just downgraded back to version 2.2.6, and it works fine now. So sorry for posting that prematurely and thanks for the help!
As stated by Logik and Boofo, hack should work in newer versions too. So I believe you might have forgotten to reapply the hack after you upgraded your board?

LanciaStratos 02-12-2003 03:30 PM

Awesome hack, Logician! Thank you so much! You should be on the vB dev team! :) I'm already making use of conditional templates by showing a special message to guests in my header, encouraging them to join. I'm also making use of it in my headinclude template, so that pop-up advertising code is only inserted for guests, but not members! :cool:

I know that you would rather not answer questions about creating conditionals, but I would just like confirmation on whether or not this is possible... Can a conditional be created so that it displays the code only once every 12 hours per visitor?

Logician 02-12-2003 07:08 PM

Quote:

Originally posted by LanciaStratos
I know that you would rather not answer questions about creating conditionals, but I would just like confirmation on whether or not this is possible... Can a conditional be created so that it displays the code only once every 12 hours per visitor?
I'm not sure if I understand correctly the condition you want to set? If you want to show the text within certain hours, this can help:
[[(date("H", time())>0 AND date("H", time())<13)]]
condition
[[/(date("H", time())>0 AND date("H", time())<13)]]
This will apply when time is between 00.00 to 12.00 (server time).

LanciaStratos 02-13-2003 09:20 PM

Quote:

Originally posted by Logician

I'm not sure if I understand correctly the condition you want to set? If you want to show the text within certain hours, this can help:
[[(date("H", time())>0 AND date("H", time())<13)]]
condition
[[/(date("H", time())>0 AND date("H", time())<13)]]
This will apply when time is between 00.00 to 12.00 (server time).

No, that's not exactly what I'm wanting to accomplish. Thanks for your help, but I just realized that I won't be able to pull off my desired effect without cookies. :ermm:

Dominick 02-13-2003 09:21 PM

does this hack work with vbhome lite?

here is my intended result. stop me at the point where I screwed up...

in the index.php for vbhome lite
I added forumid to this select statement...
Code:

$articlebits = '';
$articlemaxnumber = iif ( $articlemax!=0 , 'LIMIT ' . $articlemax , '' );
$articles = $DB_site->query("
  SELECT thread.threadid,thread.title,thread.lastpost,thread.forumid,thread.rep\lycount,thread.postusername,thread.postuserid,
  thread.lastposter,thread.dateline,thread.views,post.pagetext as pagetext

that should pull the forumid so I can use it... no?

so then in the aritcle bit of vbhome lite I put in

[[($articlebits[thread.forumid='3'])]]foo[[(/$articlebits[thread.forumid='3'])]]

I have tried numerous concatenations of articlebits articles article as such. I cant figure it out. mostly because Im newbie to all of this... any help? is this possible?

Slynderdale 02-13-2003 10:20 PM

If your looking for a similar hack like this but works in posts as a vB Code, try here:

https://vborg.vbsupport.ru/showthrea...threadid=48492

Edgemyster 02-18-2003 08:29 PM

Logician,

The hack is awesome and works (in 2.2.9) so far ... but this is the effect I'm trying to achieve and was hoping you might offer some insight:

I'd like to show certain data in a template on "X" date and show alternative data in a template if the current date is not "X".

Any hints?

Logician 02-18-2003 08:42 PM

Quote:

Originally posted by Edgemyster
Logician,

The hack is awesome and works (in 2.2.9) so far ... but this is the effect I'm trying to achieve and was hoping you might offer some insight:

I'd like to show certain data in a template on "X" date and show alternative data in a template if the current date is not "X".

Any hints?

[[(date("m.d.Y")=="02.19.2003")]]
template content to display if date is 02.19.2003 (server time!)
[[/(date("m.d.Y")=="02.19.2003")]]
[[(date("m.d.Y")!="02.19.2003")]]
template content to display if date is NOT 02.19.2003 (server time!)
[[/(date("m.d.Y")!="02.19.2003")]]

bensonfactor 02-19-2003 02:15 AM

Something is up, it isn't working it is only printing out the lines and not restricting anything.

Running 2.2.9, somewhat modified, it was working earlier.

Logician 02-19-2003 05:53 AM

try to reapply.. a recent hack might have overwrited the hack somehow..


All times are GMT. The time now is 05:37 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.01314 seconds
  • Memory Usage 1,745KB
  • 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
  • (1)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)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