Persian date Smarty

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
farhadprm
Forum Members
Forum Members
Posts: 158
Joined: Mon May 28, 2007 2:40 pm

Persian date Smarty

Post by farhadprm »

Hi,

I found a smarty plugin to visualize the Persian calendar. Does anyone know how I could integrate it into CMSMS?
The link is:
http://code.google.com/p/smartyjalalipl ... p&can=2&q=
There is also a version of CMSMS but is too old and does not work with 1.11.x.:
https://onedrive.live.com/?cid=fa49c2c8 ... C314%21163

Thanks in advance
far
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1974
Joined: Mon Jan 29, 2007 4:47 pm

Re: Persian date Smarty

Post by Jo Morg »

farhadprm wrote:Does anyone know how I could integrate it into CMSMS?
Usually, any smarty plugin can be dropped in CMSMS own plugins folder and it should work, but these have a hardcoded include, so your best option is to find the smarty own plugins folder (should be <site_root>\lib\smarty\plugins) and drop those files there.
HTH
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
farhadprm
Forum Members
Forum Members
Posts: 158
Joined: Mon May 28, 2007 2:40 pm

Re: Persian date Smarty

Post by farhadprm »

Thank you for your response.
I copied the files in (<site_root>\lib\smarty\plugins) but when i call it my site go down.
For example, when I edit:

Code: Select all

{$entry->postdate|cms_date_format}
to

Code: Select all

{$entry->postdate|jdate_format}
I recieve error.
Maybe I'm wrong code to call it?

Thank you
Jo Morg wrote:
farhadprm wrote:Does anyone know how I could integrate it into CMSMS?
Usually, any smarty plugin can be dropped in CMSMS own plugins folder and it should work, but these have a hardcoded include, so your best option is to find the smarty own plugins folder (should be <site_root>\lib\smarty\plugins) and drop those files there.
HTH
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1974
Joined: Mon Jan 29, 2007 4:47 pm

Re: Persian date Smarty

Post by Jo Morg »

farhadprm wrote:I recieve error.
What is the error message?
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
farhadprm
Forum Members
Forum Members
Posts: 158
Joined: Mon May 28, 2007 2:40 pm

Re: Persian date Smarty

Post by farhadprm »

this is the error message:

Code: Select all

ERROR: at line 17 in file /var/www/vhosts/domain.it/httpdocs/lib/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php:

Syntax error in template "module_db_tpl:News;summaryresponsive-summary-main"  on line 17 " {$entry->postdate|jdate_format}" unknown modifier "jdate_format"
Jo Morg wrote:
farhadprm wrote:I recieve error.
What is the error message?
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1974
Joined: Mon Jan 29, 2007 4:47 pm

Re: Persian date Smarty

Post by Jo Morg »

Ok. There is a difference in last release of Smarty in that the correct Smarty plugins folder is in <site_root>\lib\smarty\libs\plugins (my bad), so you'll need to move the files to this folder...
... the bad news is: I tested this, and although it recognizes the modifier it doesn't seem to work so well. You'll need to debug it as there seems to be an issue with the plugin itself.
HTH
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
farhadprm
Forum Members
Forum Members
Posts: 158
Joined: Mon May 28, 2007 2:40 pm

Re: Persian date Smarty

Post by farhadprm »

I tried this version and it worked! :)
Thank you
http://code.google.com/p/smartyjalalipl ... p&can=2&q=
Jo Morg wrote:Ok. There is a difference in last release of Smarty in that the correct Smarty plugins folder is in <site_root>\lib\smarty\libs\plugins (my bad), so you'll need to move the files to this folder...
... the bad news is: I tested this, and although it recognizes the modifier it doesn't seem to work so well. You'll need to debug it as there seems to be an issue with the plugin itself.
HTH
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1974
Joined: Mon Jan 29, 2007 4:47 pm

Re: Persian date Smarty

Post by Jo Morg »

Cool!
Maybe I just don't have the locale set on my side and it pukes :).
Glad it worked for you.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Post Reply

Return to “The Lounge”