Forum www.forum.fora.pl Strona Główna

www.forum.fora.pl
Nieoficjalne forum pomocy serwisu fora.pl
 

Data ostatniego wpisu

 
Napisz nowy temat   Odpowiedz do tematu    Forum www.forum.fora.pl Strona Główna -> Pomoc i pytania
Zobacz poprzedni temat :: Zobacz następny temat  
Autor Wiadomość
S Jacko
Wymiatacz
Wymiatacz



Dołączył: 22 Sty 2006
Posty: 584
Przeczytał: 0 tematów

Ostrzeżeń: 0/5
Skąd: Gdynia - Oksywie
Płeć: Mężczyzna

PostWysłany: Śro 10:04, 25 Sty 2006    Temat postu: Data ostatniego wpisu

Widziałem kiedyś skrypt zmieniający datę ostatniego wpisu na stronie głównej z formatu: "Sro 0:24, 25 Sty 2006" na Dzisiaj o 0:24, Wczoraj itd.
Próbuję wpisać coś w wyszukiwarkę, ale wyskakuje pełno postów o niczym.
Czy ktoś mógłby pomóc ?


Post został pochwalony 0 razy
Powrót do góry
Zobacz profil autora
S Jacko
Wymiatacz
Wymiatacz



Dołączył: 22 Sty 2006
Posty: 584
Przeczytał: 0 tematów

Ostrzeżeń: 0/5
Skąd: Gdynia - Oksywie
Płeć: Mężczyzna

PostWysłany: Śro 13:11, 25 Sty 2006    Temat postu:

Znalazłem moda na phpBB2, ale nie wiem czy to będzie działało. A jeżeli nie, to czy jest jakiś skrypt do fora.pl ?

Kod:
##############################################################
## MOD Title: Today At/Yesterday At
## MOD Author: netclectic < [link widoczny dla zalogowanych] > (Adrian Cockburn) http://www.netclectic.com
## MOD Description: Will show Today At if the post was posted today
##                  Will show Yesterday At if the post was posted yesterday
##
## MOD Version: 1.3.1
##
## Installation Level: easy
## Installation Time: 10 Minutes
## Files To Edit: (6) page_header.php, index.php, search.php, viewforum.php, viewtopic.php, lang_main.php
## Included Files: n/a
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
##  Original Author: blulegend
##  Update by netclectic to work on 2.0.4 & 2.0.6
##
##############################################################
## MOD History:
##
##  2003-12-15 - v1.3.1
##      - no change: confirmed as 2.0.6 compatible
##  2003-06-10 - v1.3.0
##      - updated for 2.0.4
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ OPEN ]------------------------------
#
includes/page_header.php

#
#-----[ FIND ]------------------------------------------

//
// Parse and show the overall header.
//

#
#-----[ BEFORE, ADD ]-----------------------------------
#
//
// MOD - TODAY AT - BEGIN
// PARSE DATEFORMAT TO GET TIME FORMAT
//
$time_reg = '([gh][[:punct:][:space:]]{1,2}[i][[:punct:][:space:]]{0,2}[a]?[[:punct:][:space:]]{0,2}[S]?)';
eregi($time_reg, $board_config['default_dateformat'], $regs);
$board_config['default_timeformat'] = $regs[1];
unset($time_reg);
unset($regs);

//
// GET THE TIME TODAY AND YESTERDAY
//
$today_ary = explode('|', create_date('m|d|Y', time(),$board_config['board_timezone']));
$board_config['time_today'] = gmmktime(0 - $board_config['board_timezone'] - $board_config['dstime'],0,0,$today_ary[0],$today_ary[1],$today_ary[2]);
$board_config['time_yesterday'] = $board_config['time_today'] - 86400;
unset($today_ary);
// MOD - TODAY AT - END

#
#-----[ OPEN ]------------------------------
#
index.php

#
#-----[ FIND ]-----------------------------------
#
$last_post = $last_post_time . '<br />';

#
#-----[ REPLACE WITH ]-----------------------------------
#

                        // OLD
                        // $last_post = $last_post_time . '<br />';
                        //
                                // MOD - TODAY AT - BEGIN
                        //
                        if ( $board_config['time_today'] < $forum_data[$j]['post_time'])
                        {
                           $last_post = sprintf($lang['Today_at'], create_date($board_config['default_timeformat'], $forum_data[$j]['post_time'], $board_config['board_timezone'])) . '<br />';
                        }
                        else if ( $board_config['time_yesterday'] < $forum_data[$j]['post_time'])
                        {
                           $last_post = sprintf($lang['Yesterday_at'], create_date($board_config['default_timeformat'], $forum_data[$j]['post_time'], $board_config['board_timezone'])) . '<br />';
                        }
                        else
                        {
                           $last_post = $last_post_time . '<br />';
                        }
                                // MOD - TODAY AT - END

#
#-----[ OPEN ]------------------------------
#
search.php

#
#-----[ FIND ]-----------------------------------
#
$post_date = create_date($board_config['default_dateformat'], $searchset[$i]['post_time'], $board_config['board_timezone']);

#
#-----[ AFTER, ADD ]-----------------------------------
#

         //
            // MOD - TODAY AT - BEGIN
         //
         if ( $board_config['time_today'] < $searchset[$i]['post_time'])
         {
            $post_date = sprintf($lang['Today_at'], create_date($board_config['default_timeformat'], $searchset[$i]['post_time'], $board_config['board_timezone']));
         }
         else if ( $board_config['time_yesterday'] < $searchset[$i]['post_time'])
         {
            $post_date = sprintf($lang['Yesterday_at'], create_date($board_config['default_timeformat'], $searchset[$i]['post_time'], $board_config['board_timezone']));
         }
            // MOD - TODAY AT - END

#
#-----[ FIND ]-----------------------------------
#
$last_post_time = create_date($board_config['default_dateformat'], $searchset[$i]['post_time'], $board_config['board_timezone']);

#
#-----[ AFTER, ADD ]-----------------------------------
#

            //
                // MOD - TODAY AT - BEGIN
            //
            if ( $board_config['time_today'] < $searchset[$i]['post_time'])
            {
               $last_post_time = sprintf($lang['Today_at'], create_date($board_config['default_timeformat'], $searchset[$i]['post_time'], $board_config['board_timezone']));
            }
            else if ( $board_config['time_yesterday'] < $searchset[$i]['post_time'])
            {
               $last_post_time = sprintf($lang['Yesterday_at'], create_date($board_config['default_timeformat'], $searchset[$i]['post_time'], $board_config['board_timezone']));
            }
                // MOD - TODAY AT - END

#
#-----[ OPEN ]------------------------------
#
viewforum.php

#
#-----[ FIND ]-----------------------------------
#
$last_post_time = create_date($board_config['default_dateformat'], $topic_rowset[$i]['post_time'], $board_config['board_timezone']);

#
#-----[ AFTER, ADD ]-----------------------------------
#

      //
        // MOD - TODAY AT - BEGIN
      //
      if ( $board_config['time_today'] < $topic_rowset[$i]['post_time'])
      {
         $last_post_time = sprintf($lang['Today_at'], create_date($board_config['default_timeformat'], $topic_rowset[$i]['post_time'], $board_config['board_timezone']));
      }
      else if ( $board_config['time_yesterday'] < $topic_rowset[$i]['post_time'])
      {
         $last_post_time = sprintf($lang['Yesterday_at'], create_date($board_config['default_timeformat'], $topic_rowset[$i]['post_time'], $board_config['board_timezone']));
      }
        // MOD - TODAY AT - END

#
#-----[ OPEN ]------------------------------
#
viewtopic.php

#
#-----[ FIND ]-----------------------------------
#
$post_date = create_date($board_config['default_dateformat'], $postrow[$i]['post_time'], $board_config['board_timezone']);

#
#-----[ AFTER, ADD ]-----------------------------------
#

   //
    // MOD - TODAY AT - BEGIN
   //
   if ( $board_config['time_today'] < $postrow[$i]['post_time'])
   {
      $post_date = sprintf($lang['Today_at'], create_date($board_config['default_timeformat'], $postrow[$i]['post_time'], $board_config['board_timezone']));
   }
   else if ( $board_config['time_yesterday'] < $postrow[$i]['post_time'])
   {
      $post_date = sprintf($lang['Yesterday_at'], create_date($board_config['default_timeformat'], $postrow[$i]['post_time'], $board_config['board_timezone']));
   }
    // MOD - TODAY AT - END

#
#-----[ OPEN ]------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]-----------------------------------
#
?>

#
#-----[ BEFORE, ADD ]-----------------------------------
#

// MOD - TODAY AT - BEGIN
$lang['Today_at'] = "Today at %s"; // %s is the time
$lang['Yesterday_at'] = "Yesterday at %s"; // %s is the time
// MOD - TODAY AT - END

#
#-----[ OPEN ]------------------------------
#
language/lang_polish/lang_main.php

#
#-----[ FIND ]-----------------------------------
#
?>

#
#-----[ BEFORE, ADD ]-----------------------------------
#

// MOD - TODAY AT - BEGIN
$lang['Today_at'] = "Dzisaj o %s"; // %s is the time
$lang['Yesterday_at'] = "Wczoraj o %s"; // %s is the time
// MOD - TODAY AT - END

#
#-----[ SAVE/CLOSE ALL FILES ]-----------------------------------
# EoM


Post został pochwalony 0 razy
Powrót do góry
Zobacz profil autora
guldog
Nowicjusz
Nowicjusz



Dołączył: 01 Sty 2006
Posty: 30
Przeczytał: 0 tematów

Ostrzeżeń: 0/5

PostWysłany: Śro 21:50, 25 Sty 2006    Temat postu:

ja z takim skryptem sie nigdy ne spotkalem i mysle ze taki skrypty w opisie by niedzialal

Post został pochwalony 0 razy
Powrót do góry
Zobacz profil autora
S Jacko
Wymiatacz
Wymiatacz



Dołączył: 22 Sty 2006
Posty: 584
Przeczytał: 0 tematów

Ostrzeżeń: 0/5
Skąd: Gdynia - Oksywie
Płeć: Mężczyzna

PostWysłany: Czw 1:17, 26 Sty 2006    Temat postu:

Bo to jest mod z phpBB2. Już sprawdziłem i nie działa Sad .
Czy idzie to jakość przerobić na prawidłowy skrypt ? A może już taki istnieje i ktoś wie, gdzie go dostać ?

PS.
Znalazłem jeszcze jednego moda:

Kod:
##############################################################
## MOD Title: Simple Dates MOD
## MOD Author: Kinetix < [link widoczny dla zalogowanych] > (N/A) http://www.ikrontik.tk
## MOD Description: This MOD will replace certain dates with one of the following formats:
##                  'today', 'yesterday', 'x days ago', 'x weeks ago', 'x weeks, y days ago'.
## MOD Version: 0.5.2
##
## Installation Level: Easy
## Installation Time: 2 Minutes
## Files To Edit: 2: language/lang_english/lang_main.php
##                   includes/functions.php
## Included Files: 0
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes: If you're wondering about the trueness of the dates of this MOD,
##               by using mktime, this MOD gets the EXACT date that a post was made, not by using
##               the current time - given time to do it.
##               Special note, this MOD will NOT change any dates that are not in the same format as
##               the one set in your CONFIGURATION CONTROL PANEL (such as joined date).
##
##############################################################
## MOD History:  0.5.0 Initial public release.
##               0.5.2 Added $forceeasydate and $notime parameters. See the function comments for details.
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//
// START Simple Dates MOD
// By Kinetix < [link widoczny dla zalogowanych] >
$lang['Tomorrow'] = 'Tomorrow';
$lang['Tomorrow_at'] = 'Tomorrow at %s';
$lang['Yesterday'] = 'Yesterday';
$lang['Yesterday_at'] = 'Yesterday at %s';
$lang['Today'] = 'Today';
$lang['Today_at'] = 'Today at %s';
$lang['day_ago'] = '%s day ago';
$lang['day_ago_at'] = '%s day ago at %s';
$lang['days_ago'] = '%s days ago';
$lang['days_ago_at'] = '%s days ago at %s';
$lang['week'] = '%s week';
$lang['weeks'] = '%s weeks';
$lang['week_ago'] = '%s week ago';
$lang['week_ago_at'] = '%s week ago at %s';
$lang['weeks_ago'] = '%s weeks ago';
$lang['weeks_ago_at'] = '%s weeks ago at %s';
// END New date system
//

#
#-----[ OPEN ]------------------------------------------
#
language/lang_polish/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//
// START Simple Dates MOD
// By Kinetix < [link widoczny dla zalogowanych] >
$lang['Tomorrow'] = 'Jutro';
$lang['Tomorrow_at'] = 'Jutro o godz. %s';
$lang['Yesterday'] = 'Wczoraj';
$lang['Yesterday_at'] = 'Wczoraj o godz. %s';
$lang['Today'] = 'Dzisiaj';
$lang['Today_at'] = 'Dzisiaj o godz. %s';
$lang['day_ago'] = '%s dzień temu';
$lang['day_ago_at'] = '%s dzień temu o godz. %s';
$lang['days_ago'] = '%s dni temu';
$lang['days_ago_at'] = '%s dni temu o godz. %s';
$lang['week'] = '%s tydzień';
$lang['weeks'] = '%s tygodni';
$lang['week_ago'] = '%s tydzień temu';
$lang['week_ago_at'] = '%s tydzień temu o godz. %s';
$lang['weeks_ago'] = '%s tygodni temu';
$lang['weeks_ago_at'] = '%s tygodni temu o godz. %s';
// END New date system
//

#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------
#
//
// Create date/time from format and timezone
//
function create_date($format, $gmepoch, $tz)
{
   global $board_config, $lang;
   static $translate;

   if ( empty($translate) && $board_config['default_lang'] != 'english' )
   {
      @reset($lang['datetime']);
      while ( list($match, $replace) = @each($lang['datetime']) )
      {
         $translate[$match] = $replace;
      }
   }

   return ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $tz)), $translate) : @gmdate($format, $gmepoch + (3600 * $tz));
}
#
#-----[ REPLACE WITH ]------------------------------------------
#
//
// Create date/time from format and timezone
//
// -------------------
// SIMPLE DATES MOD
// By Kinetix < [link widoczny dla zalogowanych] >
// -------------------
// By sending forcestring as true, it will ignore the modification and send the date as $format.
// By sending forceeasydate as TRUE, it will always return an easy date (today, yesterday).
// $notime defaults to whether or not the : character is in the $format, which indicates a time. If you send $notime
//   as true, it will NOT use the time.
//
function create_date($format, $gmepoch, $tz, $forcestring = FALSE, $forceeasydate = FALSE, $notime = FALSE)
{
   global $board_config, $lang;
   static $translate;
   
   /**
    * Important note: Using days limit over 7 will result in the date format 'X weeks, Y days ago'. This
    * string may be too long in some cases.
    * CHANGE THIS TO HOWEVER MANY DAYS BACK YOU WANT THIS MOD TO CHANGE TO: today, yesterday, days ago, week ago
    */
   $days_limit = 7;
   /* END OPTIONS */
   
   if ( empty($translate) && $board_config['default_lang'] != 'english' )
   {
      @reset($lang['datetime']);
      while ( list($match, $replace) = @each($lang['datetime']) )
      {
         $translate[$match] = $replace;
      }
   }

   $showtime = ($notime == FALSE) ? strpos($format, ":") : TRUE; // Let's search if a time format was in there
   $now = time() + (3600 * $tz);
   $tzmod = $gmepoch + (3600 * $tz);
   $timedate = @gmdate("g:i a", $tzmod);
   $gmdated = @gmdate($format, $tzmod);
   $retstring = $gmdated;
   $gmdatexp = explode(" ", @gmdate("n j Y", $tzmod));
   $nowdatexp = explode(" ", @gmdate("n j Y", $now));
   $midnight_post = mktime(0,0,0,$gmdatexp[0], $gmdatexp[1], $gmdatexp[2]); // This allows for easy division of date difference, the start of the day of the post
   $today_time = mktime(0,0,0,$nowdatexp[0], $nowdatexp[1], $nowdatexp[2]); // This determines the REAL start of the day for the user in X timezone
   $yesterday_time = $today_time - 86400; // The start of yesterday
   $diff = $today_time - $midnight_post;
   $diffrem = (double) $diff / 604800; // weeks difference
   $diff = (double) $diff / 86400; // days difference
   $diffrem = intval($diffrem);
   $diff = intval($diff);

   if(($forcestring || $board_config['default_dateformat'] != $format || $tzmod > $now || $diff > $days_limit) && !$forceeasydate) // Use given $format instead
   {
      $retstring = ( !empty($translate) ) ? strtr($gmdated, $translate) : $gmdated;
   }
   elseif($tzmod >= $today_time) // Posted today
   {
      if(!$showtime)
         $retstring = $lang['Today'];
      else
         $retstring = sprintf($lang['Today_at'], $timedate);
   }
   elseif($tzmod >= $yesterday_time) // Posted yesterday
   {
      if(!$showtime)
         $retstring = $lang['Yesterday'];
      else
         $retstring = sprintf($lang['Yesterday_at'], $timedate);
   }
   else // It's not today or yesterday, so we'll use "days ago" or the natural date
   {
      if($diff == 1)
      {
         if(!$showtime)
            $retstring = $lang['Yesterday'];
         else
            $retstring = sprintf($lang['Yesterday_at'], $timedate);
      }
      elseif(($now > $tzmod) && $diff < 7) // Generate "days ago"
      {
         if(!$showtime)
            $retstring = sprintf($lang['days_ago'], $diff);
         else
            $retstring = sprintf($lang['days_ago_at'], $diff, $timedate);
      }
      elseif(($now > $tzmod)) // Generate "week ago"
      {
         $diff = $diff % 7;
         if($diff > 0)
         {
            if(!$showtime)
            {
               $useformat = ($diffrem == 1) ? $lang['week'] : $lang['weeks'];
               $useformat2 = ($diff == 1) ? $lang['day_ago'] : $lang['days_ago'];
               $retstring = sprintf($useformat, $diffrem);
               $retstring .= ', ' . sprintf($useformat2, $diff);
            }
            else
            {
               $useformat = ($diffrem == 1) ? $lang['week'] : $lang['weeks'];
               $useformat2 = ($diff == 1) ? $lang['day_ago_at'] : $lang['days_ago_at'];
               $retstring = sprintf($useformat, $diffrem);
               $retstring .= ', ' . sprintf($useformat2, $diff, $timedate);
            }
         }
         else
         {
            if(!$showtime)
            {
               $useformat = ($diffrem == 1) ? $lang['week_ago'] : $lang['weeks_ago'];
               $retstring = sprintf($useformat, $diffrem);
            }
            else
            {
               $useformat = ($diffrem == 1) ? $lang['week_ago_at'] : $lang['weeks_ago_at'];
               $retstring = sprintf($useformat, $diffrem, $timedate);
            }
         }
      }
      else // Generate natural string date
      {
         $retstring = $gmdated;
      }
   }
   return ( !empty($translate) ) ? strtr($retstring, $translate) : $retstring;
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM


Post został pochwalony 0 razy
Powrót do góry
Zobacz profil autora
S Jacko
Wymiatacz
Wymiatacz



Dołączył: 22 Sty 2006
Posty: 584
Przeczytał: 0 tematów

Ostrzeżeń: 0/5
Skąd: Gdynia - Oksywie
Płeć: Mężczyzna

PostWysłany: Czw 20:28, 26 Sty 2006    Temat postu:


S Jacko napisał:
Czy jest jakiś skrypt do fora.pl ?

Mógłby ktoś pomóc ? Chociaż TAK lub NIE.


Post został pochwalony 0 razy
Powrót do góry
Zobacz profil autora
marxxx
Prawa ręka mafii
Prawa ręka mafii



Dołączył: 13 Sie 2005
Posty: 344
Przeczytał: 0 tematów

Ostrzeżeń: 2/5
Skąd: telchina.pl

PostWysłany: Czw 21:19, 26 Sty 2006    Temat postu:

Raczej na fora to niemożliwe aby date zmienić.

Post został pochwalony 0 razy
Powrót do góry
Zobacz profil autora
Wyświetl posty z ostatnich:   
Napisz nowy temat   Odpowiedz do tematu    Forum www.forum.fora.pl Strona Główna -> Pomoc i pytania Wszystkie czasy w strefie EET (Europa)
Strona 1 z 1

 
Skocz do:  
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach


fora.pl - załóż własne forum dyskusyjne za darmo
Powered by phpBB © 2001, 2005 phpBB Group
deoxGreen v1.2 // Theme created by Sopel stylerbb.net & programosy.pl

Regulamin