No announcement yet.

Template random number or time

  • Filter
  • Time
  • Show
Clear All
new posts

  • Template random number or time

    Is there a way to call a condition in the templates that shows the time of day or a random number?

    I want to show videos at differnt times of the day. BUT if such a thing does not exist I would opt for a random number. X>10 then show this or X<10 show that.

    I have it set up now for IE users see one video the rest see another. but I would like something less strict twards a browser like time of day or random number.

    I was even thinking users under 1500 get one the others get a differnt one.
    or posting or reputation number but it will stick to that for a while if a user does not participate on the site.

    Thanks for the help.

  • #2
    $limit_hour = vbdate("G");
    $limit_video = "0";
    if( $limit_hour < 18 ) { $limit_video = "1"; }
    if( $limit_hour < 12 ) { $limit_video = "0"; }
    Put that in your phpinclude_start template,
    and in your showthread template something like this:

    <if condition="$limit_video != '1'"><strong> It is not time yet to show the video! </strong>
    <else />
    Your html code to show the video goes here

    Note: The above is me thinking outloud, I think it should work, but not sure. Hope it does


    • #3
      Wow thank you! I will try it now


      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.