Youjoomla Support Forums (http://www.youjoomla.com/joomla_support/index.php)
-   Youjoomla Date (http://www.youjoomla.com/joomla_support/forumdisplay.php?f=83)
-   -   [SOLVED] My Yootheme and language fixes (http://www.youjoomla.com/joomla_support/showthread.php?t=5123)

lanfan 12-28-2009 06:09 PM

[SOLVED] My Yootheme and language fixes
 
I really like the style of this plugin so I decided to make it work for myself. Looking around here I saw that serveral ppl have the same issues.

Language fix:
At the very end just before the ending "?>" add this function:
PHP Code:

function translateDateSE($string) {
    
$date = array("/January/""/February/""/March/""/May/""/June/""/July/""/August/""/October/""/May/""/Oct/""/Monday/""/Tuesday/""/Wednesday/""/Thursday/""/Friday/""/Saturday/""/Sunday/""/Mon/""/Tue/""/Wed/""/Thu/""/Fri/""/Sat/""/Sun/");
    
$dateSE = array( "Januari""Februari""Mars""Maj""Juni""Juli""Augusti""Oktober""Maj""Okt""Måndag""Tisdag""Onsdag""Torsdag""Fredag""Lördag""Söndag""Mån""Tis""Ons""Tor""Fre""Lör""Sön");
    return 
preg_replace($date$dateSE$string);} 

It is an ugly way to translate but it works. Please make you own language changes in the second array, $dateSE.
Then you need to call this function just before the "$final_date".
PHP Code:


$format_date    
=  translateDateSE($format_date);//NEW, added by YOU.
$final_date     explode("-",$format_date);//Original appr. line 50. 

Secondly, the break of many Yoothemes. You need to get rid of the ugly tables. Here's what I did:
PHP Code:

                $display "<div class=\"date\" style=\"float:left;\" >
                            <div class=\"date_month\">"
.$final_date[1]."</div>
                            <div class=\"date_day\">"
.$final_date[0]."</div>
                            <div class=\"date_year\">"
.$final_date[2]."</div>
                            </div>"
;
                            
//$yj_date .= '<table width="100%" border="0"><tr valign="top">';
                            //$yj_date .= '<td class="yj_date">';
                            //$yj_date .= $display.'</td><td  style="width:100%;">';
                              //echo $yj_date;
                            
echo $display;
                            
//$row->text = '</td></tr></table> </td></tr></table> <table width="100%"><tr><td>'.$row->text; 

You can remove the "//" commented code. I kept it so you can see where I am. Note the first line, I added som style to the div in order to place it where I wanted it. There are a lot more style attributes you can use. Seconly you need to add the "echo $display" to show all div's without the tables.

And yeah, the file is in \plugins\content\yj_date.php.

Hope it helps, cheers, \\LF

SomeoneHere 12-29-2009 05:39 AM

This will be usefull for others i think.
Thanks for the information.


All times are GMT -4. The time now is 07:08 AM.

Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.