Witam mam taki problem z php-fusion mianowicie gdy w newsach chce wyświetlić datę dodania newsa to wyświetla mi tak:

Cytat
Napisane przez 21 października 2010 Otto dnia


Chyba każdy się domyśli że chciałbym aby wyświetlało tak:

Cytat
Napisane przez Otto dnia 21 października 2010


Niby łatwo coś takiego naprawić ale jakoś mi to nie wychodzi...

To jest funkcja php-fusion która jest odpowiedzialna za wyświetlanie tego tekstu

  1. function newsposter($info, $sep = "", $class = "") {
  2. global $locale; $res = "";
  3. $link_class = $class ? " class='$class' " : "";
  4. $res = " <span ".$link_class.">".profile_link($info['user_id'], $info['user_name'], $info['user_status'])."</span> ";
  5. $res .= $locale['global_071'].data($info['news_date']);
  6.  
  7. return "<!--news_poster-->".$res;
  8. }


funkcja data() jest prze zemnie napisana gdyż w php-fusion nie było wyświetlania daty tak jak chciałem ( 21 października 2010 )

  1. function data($i) {
  2.  
  3. $data = strftime("%d-%m-%Y", $i);
  4. $data = explode("-", $data);
  5.  
  6. $d = $data['0'];
  7. $r = $data['2'];
  8. if ($data['1'] == "1") {
  9. $m = "stycznia";
  10. }
  11. if ($data['1'] == "2") {
  12. $m = "lutego";
  13. }
  14. if ($data['1'] == "3") {
  15. $m = "marca";
  16. }
  17. if ($data['1'] == "4") {
  18. $m = "kwietnia";
  19. }
  20. if ($data['1'] == "5") {
  21. $m = "maja";
  22. }
  23. if ($data['1'] == "6") {
  24. $m = "czerwca";
  25. }
  26. if ($data['1'] == "7") {
  27. $m = "lipca";
  28. }
  29. if ($data['1'] == "8") {
  30. $m = "sierpnia";
  31. }
  32. if ($data['1'] == "9") {
  33. $m = "września";
  34. }
  35. if ($data['1'] == "10") {
  36. $m = "października";
  37. }
  38. if ($data['1'] == "11") {
  39. $m = "listopada";
  40. }
  41. if ($data['1'] == "12") {
  42. $m = "grudnia";
  43. }
  44.  
  45. echo $d.' '.$m.' '.$r;
  46.  
  47. }


W poprzedniej funkcji showdate() nie było nic co mogło by odwrócić tą kolejność ale na wszelki wypadek podam:

  1. function showdate($format, $val) {
  2. global $settings, $userdata;
  3. if (isset($userdata['user_offset'])) {
  4. $offset = $userdata['user_offset']+$settings['serveroffset'];
  5. } else {
  6. $offset = $settings['timeoffset']+$settings['serveroffset'];
  7. }
  8. if ($format == "shortdate" || $format == "longdate" || $format == "forumdate" || $format == "newsdate") {
  9. return strftime($settings[$format], $val + ($offset * 3600));
  10. } else {
  11. return strftime($format, $val + ($offset * 3600));
  12. }
  13. }



Edit: Zrobiłem tongue.gif

  1. function newsposter($info, $sep = "", $class = "") {
  2. global $locale; $res = "";
  3. $link_class = $class ? " class='$class' " : "";
  4. echo "<span ".$link_class.">".profile_link($info['user_id'], $info['user_name'], $info['user_status'])."</span> ".$locale['global_071'];
  5. echo data($info['news_date']);
  6. echo $info['news_ext'] == "y" || $info['news_allow_comments'] ? $sep."\n" : "\n";
  7. }