I have http://www.fa2000-98a.dk/
I would like to add time and date to the theme. It should be in the same bar as the "Home", "Search" and "Account Panel" but to the far right.
Is that possible?
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- internetking created topic »password problem« 25. May
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- ehdwma created topic »Hide "Register new account" and change template to 3 col« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
- mdee created topic »How to implement returnpage ?« 25. May
- nestormateo responded to »Fillters in Clip« 24. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
add time and date to theme
-
- Rank: Team Member
- Registered: Sep 06, 2006
- Last visit: May 09, 2010
- Posts: 2446
Absolutely you can
I did that last night
you can use the datetime Theme plugin:
Code
* Smarty function to display the current date and time
*
* Example
* <!--[datetime]-->
*
* <!--[datetime format='_DATEBRIEF']-->
*
* <!--[datetime format='%b %d, %Y - %I:%M %p']-->
*
* Format:
* _DATEBRIEF '%b %d, %Y'
* _DATELONG '%A, %B %d, %Y'
* _DATESTRING '%A, %B %d @ %H:%M:%S'
* _DATETIMEBRIEF '%b %d, %Y - %I:%M %p'
* _DATETIMELONG '%A, %B %d, %Y - %I:%M %p'
Call the plugin into the navigation menu of your andreas08 theme.
Check the /templates/master.htm and /templates/modules/home.htm files.
Around line 21 you'll see the menu code:
Code
<div id="theme_navigation_bar">
<ul>
<li><a href="<!--[pngetbaseurl]-->"><!--[pnml name="_ANDREAS08_HOME"]--></a></li>
<li<!--[if $module eq 'Search']--> class="selected"<!--[/if]-->><a href="<!--[pnmodurl modname=Search]-->"><!--[pnml name="_SEARCH"]--></a></li>
<li<!--[if $module eq 'Profile']--> class="selected"<!--[/if]-->><a href="<!--[pnmodurl modname=Profile]-->"><!--[pnml name="_YOURACCOUNT"]--></a></li>
</ul>
</div>
Insert the new "option" for the date with the plugin call:
Code
<div id="theme_navigation_bar">
<ul>
<li><a href="<!--[pngetbaseurl]-->"><!--[pnml name="_ANDREAS08_HOME"]--></a></li>
<li<!--[if $module eq 'Search']--> class="selected"<!--[/if]-->><a href="<!--[pnmodurl modname=Search]-->"><!--[pnml name="_SEARCH"]--></a></li>
<li<!--[if $module eq 'Profile']--> class="selected"<!--[/if]-->><a href="<!--[pnmodurl modname=Profile]-->"><!--[pnml name="_YOURACCOUNT"]--></a></li>
<li><!--[datetime format='%b.%d.%Y - %I:%M %p']--></li>
</ul>
</div>
You may wish add some inline styling to the date "option":
(change "s t y l e" to "style")Code
...
<li s t y l e="float:right; border:none; padding: 0 10px"><!--[datetime format='%b.%d.%Y - %I:%M %p']--></li>
</ul>
</div>
Hope it helps!
and enjoy the Zikula Theme engine
edited by: nestormateo, Sep 23, 2008 - 06:43 AM
--
- Mateo T. -
Mis principios... son mis fines -
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Oct 08, 2008
- Posts: 49
THANKS....i almost got it rigth
The date is now visibel and in the right form. BUT the HOUR is 1 hour to slow. Cant that be corrected?
Also, i would like to move the date/time to the far right. Is that what you described in the part below this? Cause im not sure where to do this.
Quote
You may wish add some inline styling to the date "option":
Code
...
(change "s t y l e" to "style")
-
- Rank: Team Member
- Registered: Sep 06, 2006
- Last visit: May 09, 2010
- Posts: 2446
-
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Oct 08, 2008
- Posts: 49
nestormateo
Have you fixed it? i see the hour there.
Just read this and build the format string with the specifiers that you need
Yes and no.
I got what i want and where i want it. So thats great.
But i still miss an hour. Right now, the time is right, but its because i changed the timezone in zilula, so im right now living in london instead of copenhagen.
BTW Mateo, I really appriciate all the help you are providing. I would never be able to do al this without you help..... You have all my respect!!!
edited by: gotskov, Sep 23, 2008 - 08:23 PM -
- Rank: Team Member
- Registered: Sep 06, 2006
- Last visit: May 09, 2010
- Posts: 2446
Mmmmm
if unregistered, Zikula uses the site's timezone (Admin > Settings > Locale settings tab),
if logged in, uses the User's timezone.
So, you need to modify the site's config?
edited by: nestormateo, Oct 07, 2008 - 03:51 PM
--
- Mateo T. -
Mis principios... son mis fines -
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Oct 08, 2008
- Posts: 49
nestormateo
Mmmmm
if unregistered, Zikula uses the site's timezone (Admin > Settings > Locale settings tab),
if loggued int, uses the User's timezone.
So, you need to modify the site's config?
Seems that I never ended this one....sorry!!!
But you were almost rigth. The server time was fine. It was my own account, which had the wrong timezone
- Moderated by:
- Support
