PDA

View Full Version : CMS Article - How to split date format.


killer_t
11-18-2011, 10:36 PM
Hello!

I need to split the date format in cms article, for article publish date.

I especially need the day and the month divided, how can i put this?

To explain myself well, i have to put the day in <div></div> ad month in and another <div></div>

Thank you!

--------------- Added 1321718186 at 1321718186 ---------------

Ok, get it!

Go to root of your site --> packages --> vbcms --> content --> article.php


at line 786 after

$view->publishdatelocal = vbdate(vB::$vbulletin->options['dateformat'], $this->content->getPublishDate());

add

$view->publishdatelocalday = vbdate(j, $this->content->getPublishDate());
$view->publishdatelocalmonth = vbdate(F, $this->content->getPublishDate());
$view->publishdatelocalyear = vbdate(Y, $this->content->getPublishDate());

Now in your template you can add with some style in additional.css:

{vb:raw publishdatelocalday} or/and {vb:raw publishdatelocalmonth} or/and {vb:raw publishdatelocalyear}

You can edit the format of day - month - year changing the code j F Y with this rules (http://php.net/manual/en/function.date.php)


Demo : AppleMod - Home (http://www.applemod.com/)

Like this : https://vborg.vbsupport.ru/attachment.php?attachmentid=134527&stc=1&d=1321718625

ENjoy!:up:

Lynne
11-19-2011, 03:18 PM
That looks very nice! Thanks for sharing how to do this.

FYI, your code from adv.arubamediamarketing.it is taking forever to load and therefore making the rest of your page not load. I'd suggest trying to put that javascript at the end of the page so the rest of the page can load first. I still cannot see your page - that javascript is still loading and I am not that fast of a typist!
I finally had to reload it a couple of times to see it.

killer_t
11-19-2011, 04:16 PM
If you want i can post css template and image...

Thank's Lynne, i modify it as soon as possible! (edit : it's not possibile! however i've to change it in php source)

I have a big question (i think is vbulletin issue) : How do you change the language for the month in the date?

I turned around:

Phrases
vbulletin_date_picker.js
datepicker.php
vbulletin-language.xml (master)

but i can't change the language of month

Lynne
11-19-2011, 05:12 PM
Changing the language would be done in admincp > language manager > edit your language > you will see the formatting settings there.