vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   CMS Article - How to split date format. (https://vborg.vbsupport.ru/showthread.php?t=274255)

killer_t 11-18-2011 10:36 PM

CMS Article - How to split date format.
 
1 Attachment(s)
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 [DATE]1321718186[/DATE] at [TIME]1321718186[/TIME] ---------------

Ok, get it!

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


at line 786 after

PHP Code:

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

add

PHP Code:

                $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:

HTML Code:

{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


Demo : AppleMod - Home

Like this : https://vborg.vbsupport.ru/attachmen...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.


All times are GMT. The time now is 03:53 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,728KB
  • 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_html_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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