vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How do I add the current date to a vB3.5 forum footer? (https://vborg.vbsupport.ru/showthread.php?t=97332)

dilbert 10-02-2005 12:41 AM

How do I add the current date to a vB3.5 forum footer?
 
I added some text to the footer of my forum.
It says Copyright © MySite.com 2004 - 2005.

Most of the site is in ColdFusion and the 2005 part is really this:
<CFOUTPUT>#DatePart("yyyy",now())#</CFOUTPUT>.

Is it possible to do the same in php?
I know it's only one simple date to update and it only happens once per year, but I'd still like it automatically updated.

Thanks, Cliff

Marco van Herwaarden 10-02-2005 06:53 AM

dilbert,

You are currently showing up as unlicensed. To be able to download hacks and/or receive support here at vBulletin.org, we ask you to please click here (vB-germany users click here) and enter your email address, to show us that you are licensed.

You will need to use your customer number and password (which will be in the email you got when you paid for your license) to access that page. Please note that your email is case sensitive. The update of your account may take up to one hour.

Thank you.

dilbert 10-02-2005 12:01 PM

Sorry, I changed my e-mail address here and didn't realize this would happen, I have changed it back.

So, any tips on the date question? :rolleyes:

Thanks, Cliff

Marco van Herwaarden 10-02-2005 01:23 PM

Check the vbdate() function. It will format a date to the user preference.

Or for only the year with just PHP: date('Y')

dilbert 10-03-2005 05:37 PM

Doesn't seem that easy. When I add date('Y') it displays that literally.

I am trying to add this to the footer of a 3.5 forum.

I have this table that I want to edit the 2005 to (Current Year):
<table width="100%" height="45" class="bottomstripforumjelsoft">
<tr>
<td>
<div class="smallfont" align="center">
<!-- Do not remove this copyright notice -->
$vbphrase[powered_by_vbulletin]
<!-- Do not remove this copyright notice -->
</div>

<div class="smallfont" align="center">
<!-- Do not remove $cronimage or your scheduled tasks will cease to function -->
$cronimage
<!-- Do not remove $cronimage or your scheduled tasks will cease to function -->

$vboptions[copyrighttext]
</div>
</div>
<div class="smallfont" align="center">
Copyright © BloodBankTalk.com 2004 - 2005
</div>
</div></td>
</tr>
</table>

Andrew 10-03-2005 05:48 PM

What version of vB are you using ? You will most likely have to add the following code to either your phpinclude_start template (3.0.X) or add it as a plugin (3.5.X):

PHP Code:

// Generate current year
$homedate date('Y'); 

Then put the variable $homedate into your template wherever you want the date to be shown.

dilbert 10-03-2005 05:54 PM

Thanks Andrew, I am using 3.5.
How do I do this as a plug-in, I'm fairly php illiterate. :)
What do I use as the hook location, and what name should I give it?
Also, do I add all of the code you listed above in the Plugin PHP Code box?

Thanks for the help.
Cliff


Edit
Nevermind, I guess I should have played first, I got it to work.
Thanks you very much!

Andrew 10-03-2005 06:09 PM

You're very welcome !!

ResaleBroker 11-18-2005 01:29 AM

Thanks Andrew. That's just what I was looking for. ;)


All times are GMT. The time now is 04:44 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.01025 seconds
  • Memory Usage 1,727KB
  • 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_php_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