vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Adding a Conditional (https://vborg.vbsupport.ru/showthread.php?t=102318)

oglsmm 12-06-2005 02:58 AM

Adding a Conditional
 
Hey,

I have moved parts of the What's going on Box to the top of my forum. Only have the Upcoming Events and Birthday's there.

I made a conditional to only have it show to specific groups and that was fine.

Now I want to add a second conditional to only show the box If there is actually an Event (Birthday/Calender Event) in the next 7 days.

Any suggestions on how to go about this?

jpennington 12-06-2005 03:10 AM

I know it can be done, but I'm sure of the exact code. You would just need to say if event time minus current time is the current time with the event time and if it is less than or equal to 241920 (one week unix) then show the table.

Dark Riku 12-06-2005 03:18 AM

This has been posted many times... but kind of hidden...
PHP Code:

    if ($vbulletin->userinfo['usergroupid'] == 9)
{
echo 
"What you want here";


Change the 9 with the usergroup you want using it.

oglsmm 12-06-2005 03:28 AM

Quote:

Originally Posted by Dark Riku
This has been posted many times... but kind of hidden...
PHP Code:

    if ($vbulletin->userinfo['usergroupid'] == 9)
{
echo 
"What you want here";


Change the 9 with the usergroup you want using it.

I have that part fine.... What I am having trouble with is the conditional to only Show the events box IF an event is upcoming within next 7 days.


All times are GMT. The time now is 01:14 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.01896 seconds
  • Memory Usage 1,720KB
  • 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
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete