vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   How to link to current date for the calendar (https://vborg.vbsupport.ru/showthread.php?t=276649)

SgtSling 01-08-2012 05:25 PM

How to link to current date for the calendar
 
I want to create a static image displayed on my cms that is linked to the current date for the vbcalendar. Is there a current date command so that I don't have to change the link on the picture everyday?

Is this possible?

Lynne 01-08-2012 05:37 PM

You can probably use the calendar_getday_start hook and do something like:

if (!$vbulletin->GPC['day']), then set $vbulletin->GPC['day'] to todays date

SgtSling 01-08-2012 06:25 PM

Quote:

Originally Posted by Lynne (Post 2285306)
You can probably use the calendar_getday_start hook and do something like:

if (!$vbulletin->GPC['day']), then set $vbulletin->GPC['day'] to todays date

Can you be more specific?
What do I use as the href on the image?
Thanks!

Lynne 01-08-2012 07:13 PM

calendar.php?do=getinfo&c=xx

xx would be the calendar id. That link is not going to work right now because the date isn't specified which is why I'm saying to specify today's date in the plugin and then it will work.

SgtSling 01-08-2012 08:14 PM

1 Attachment(s)
I disabled it because it was giving errors.
Here is the link I used.
http://www.rotharmy.com/forums/calen...do=getinfo&c=1
The calendar is 1 (the public calendar)

Here is the error,

Parse error: syntax error, unexpected ',' in /home/content/r/o/t/rotharmy/html/forums/calendar.php(1160) : eval()'d code on line 1

here is how I entered it into the hook manager.

SgtSling 01-08-2012 08:15 PM

thanks for helping with this Lynne!

kh99 01-08-2012 08:26 PM

Lynne wasn't posting the exact code, just a description of what needed to be done. But try this:

Code:

if (!$vbulletin->GPC['day'])
    $vbulletin->GPC['day'] = vbdate('Y-m-d');


SgtSling 01-08-2012 08:41 PM

That works! So it should point to tormorrows date after midnight (server time)?

Thanks!

kh99 01-08-2012 08:48 PM

That should go by each user's local time. If you want to always go by the server time, change vbdate to just 'date' (without the quotes).


All times are GMT. The time now is 09:12 PM.

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.01009 seconds
  • Memory Usage 1,726KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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