Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Hack translate: news, shoutbos and etc.
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2.08 Mods Completed

Unknown User
2013-02-09 11:27:21
This is are simple 3 lines hack, how to translate: news, shoutbox, comments and etc dates month names.  :)

First open: index.php file

Find this code:



// Show first 2 items expanded

if ($news_flag < 2) {

$disp = "block";

$pic = "minus";

} else {

$disp = "none";

$pic = "plus";

}

After this code incert this:




$gettime = utc_to_tz_time($array['added']);

$month = array('1', '2', '3', '4', '5', '6', '7','8', '9','10', '11', '12');

$showtime = date('Y',$gettime).', '.$month[date('n',$gettime)-1].' '.date('j',$gettime).' d. - '.date('H',$gettime).':'.date('i',$gettime).' hrs.';






Find this:

" . date("d-M-y", utc_to_tz_time($array['added'])) . "



Replace to this:

 ( ".$showtime." ) 





Numbers mean: months names like: 1 = January, 2 = February and etc.

You can inter your languages month name like: february: &#1092;&#1077;&#1074;&#1088;&#1072;&#1083;&#1100;, vasaris, février...



If your tracker have multilanguage system then:



This:

$month = array('1', '2', '3', '4', '5', '6', '7','8', '9','10', '11', '12');



Change to this:

$month = array(' '.T_("JANUARY").' ', ' '.T_("FEBRUARY").' ');
and etc.

And dont forget add this code to your xxx.lang file:

Example:

//english lang file

$LANG["FEBRUARY"] = "february";

//russian lang file

$LANG["FEBRUARY"] = "&#1092;&#1077;&#1074;&#1088;&#1072;&#1083;&#1100;";

//lithuanian lang file

$LANG["FEBRUARY"] = "vasaris";

//franch lang file

$LANG["FEBRUARY"] = "février";

This date translate system you can use where you want like in shoutbox or comments orcourse and forum and etc.

Dont forget say Thanks if you like it :)
Unknown User
2013-02-09 17:45:34
nice ;)
Unknown User
2013-02-10 07:58:14
How to add the names of days?

I try this:

'.date('l',$gettime).'

$days = array(''.T_("SUN").'', ''.T_("MON").'', ''.T_("TUE").'', ''.T_("WED").'', ''.T_("THU").'', ''.T_("FRI").'', ''.T_("SAT").'');
Unknown User
2013-02-10 09:11:15
try change



'.date('j',$gettime).' d.

for




'.$day[date('j',$gettime)-1].'






and add





$day = array(''.T_("SUN").'', ''.T_("MON").'', ''.T_("TUE").'', ''.T_("WED").'', ''.T_("THU").'', ''.T_("FRI").'', ''.T_("SAT").'');




not tested
Unknown User
2013-02-10 10:02:33
This metod, dont use time format like: M, m, Y, y, and etc  :)  You have use Numeric representation format its "n" = month name and "N" = week days names code:

$dayname = array(''.T_("MON").'', ''.T_("TUE").'', ''.T_("WED").'', ''.T_("THU").'', ''.T_("FRI").'', ''.T_("SAT").'', ''.T_("SUN").'');

'.$daysname[date('N',$gettime)-1].'


UPDATED first week day must be Monday
Unknown User
2013-02-10 10:08:31
Use this code:



$showtime = date('Y',$gettime).', '.$month[date('n',$gettime)-1].' '.date('j',$gettime).', '.$dayname[date('N',$gettime)-1].' - '.date('H',$gettime).':'.date('i',$gettime).' hrs.';

and your date show like this: ( 2013, february 9, monday - 13:48 hrs. ) :)
Unknown User
2013-02-10 10:39:55
Nice work! Work me! BIG thanks this code!!!!
2013-02-10 15:07:09
Woww, thanks big you!!  :D  B)

            $gettime = utc_to_tz_time($array['added']);

$dayname = array(''.T_("MON").'', ''.T_("TUE").'', ''.T_("WED").'', ''.T_("THU").'', ''.T_("FRI").'', ''.T_("SAT").'', ''.T_("SUN").'');

$showtime = date('Y',$gettime).' - '.$dayname[date('N',$gettime)-1].' '.T_("THE").' '.date('j',$gettime).' '.$month[date('n',$gettime)-1].' '.T_("HAS").' '.date('H',$gettime).':'.date('i',$gettime).' hrs.';



Langues:

French

//Jours

$LANG["MON"] = "Lundi";

$LANG["TUE"] = "Mardi";

$LANG["WED"] = "Mercredi";

$LANG["THU"] = "Jeudi";

$LANG["FRI"] = "Vendredi";

$LANG["SAT"] = "Samedi";

$LANG["SUN"] = "Dimanche";

$LANG["THE"] = "le";

$LANG["HAS"] = "à";

English

//Days

$LANG["MON"] = "Monday";

$LANG["TUE"] = "Tuesday";

$LANG["WED"] = "Wednesday";

$LANG["THU"] = "Thursday";

$LANG["FRI"] = "Friday";

$LANG["SAT"] = "Saturday";

$LANG["SUN"] = "Sunday";

$LANG["THE"] = "the";

$LANG["HAS"] = "has";
Unknown User
2013-02-11 20:03:20
You're welcome :)
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 8
  • Members: 0
  • Guests online: 8
  • Comments: 3
  • Messages: 1,728