View Full Version : How do I add the current date to a vB3.5 forum footer?
dilbert
10-02-2005, 12:41 AM
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 (http://members.vbulletin.com/membersupport_priority.php) (vB-germany users click here (http://members.vbulletin-germany.com/membersupport_priority.php)) 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):
// 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. ;)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.