IT NEWS PC REVUE PC FORUM FreeBSDInternet time: @716
Obsah fóra
Pravidlá  •  Kontakt  •  Prihlásenie  •  Registrácia

Súťaž o LEGO® duplo®

Vyhrajte prekvapenie pre svoje detičky! LEGO duplo 2 krát deňne do konca mesiaca www.duplo.lego.com

Aj ty si hokejový odborník?

Neseď iba pred televízorom a dokáž s vlastným tímom, že na to máš. www.hrajhokej.sk

Spoločnosti Online s.r.o.

Ponúkame čisté spoločnosti. Obchodný register vybavíme za vás! www.spolecnostionline.cz

Lacné ubytovanie pri Balatone

Ubytuj sa teraz až s 50% zľavou Akciové zľavy na viac ako 1000 ubytovaní szallasguru.sk

Auto žiarovky - dobré ceny

Vyššia svietivosť, dlhšia životnosť. Lepšie osvetlenie pre vyššiu bezpečnosť. www.autok.sk

Frinendly date

Zaslať odpoveď
AutorSpráva
JanoF
Správca fóra
Správca fóra

Založený: 01.05.2005
Príspevky: 8736
Bydlisko: Bratislava
Vek: 27

PríspevokZaslal: Pi 13.10.06 9:09Odpovedať s citátomNávrat hore

kód:
##############################################################
## MOD Title: frinendly date
## MOD Author: vegatron <webmaster@vega.4t.com>  - <www.jam3a.tk - www.alhandasa.net> (arabic sites)
## MOD Description:
##  This mod will replace the date with the word 'Today' or 'Yesterday' for the posts that are posted on today or yesterday,
##  which will make the date look more friendly.
##
## MOD Version: 1.0
##
## PHPBB Version: 2.0.0+
## Installation Level: easy
## Installation Time: ~ 1 Minutes
## Files To Edit:  1
##      includes/functions.php
##
## Included Files: N/A
##
##############################################################
## Author's Notes:
##
## The form of the displayed date is 'Today/yesterday - h:i a" ,so in case you wanted to change the date format
##  all you have to do is to edit the variable '$time_format'
##
## This MOD is released under the GPL License.
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

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

#
#-----[ FIND ]------------------------------------------
#
   return ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $tz)), $translate) : @gmdate($format, $gmepoch + (3600 * $tz));

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

// friendly date mod\\*******************

   $thetime = ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $tz)), $translate) : @gmdate($format, $gmepoch + (3600 * $tz));
   
   $L_Today = 'Today';
   $L_Yesterday = 'Yesterday';
   $time_format = " - h:i a";// - hour:minute am/pm
   
   $date = getdate();
   $today = $date['mday'];
   $month = $date['mon'];
   $year = $date['year'];

   $forum_date_today = @gmdate ("d", $gmepoch);
   $forum_date_month = @gmdate ("m", $gmepoch);
   $forum_date_year = @gmdate ("Y", $gmepoch);
   
   if ($forum_date_today == $today && $forum_date_month == $month && $forum_date_year == $year)
      $thetime = $L_Today . @gmdate ($time_format, $gmepoch);//today
   
   else
   if ($today != 1 && $forum_date_today == ($today-1) && $forum_date_month == $month && $forum_date_year == $year)
      $thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch);//yesterday
      
   else
   //if today is 1 and the month is not 1, then we have to check how many days in the previews month
   //and then set $yesterday to the last day in the previews month
   if ($today == 1 && $month != 1)
   {
   $yesterday = date ("t", mktime(0,0,0,($month-1),1,$year));//returns how many days in the previews month
   if ($forum_date_today == $yesterday && $forum_date_month == ($month-1) && $forum_date_year == $year)
      $thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch);//yesterday
   }
   else
   //if we are in the first day in the year
   if ($today == 1 && $month == 1)
   {
   $yesterday = date ("t", mktime(0,0,0,12,1,($year -1)));
   if ($forum_date_today == $yesterday && $forum_date_month == 12 && $forum_date_year == ($year-1))
      $thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch);//yesterday
   }

      return ($thetime);
//end friendly date \\*******************************

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




kód:
##############################################################
## MOD Title: frinendly date
## MOD Author: vegatron <webmaster@vega.4t.com>  - <www.jam3a.tk - www.alhandasa.net> (arabic sites)
## MOD Description:
##  This mod will replace the date with the word 'Today' or 'Yesterday' for the posts that are posted on today or yesterday,
##  which will make the date look more friendly.
##
## MOD Version: 1.0
##
## PHPBB Version: 2.0.0+
## Installation Level: easy
## Installation Time: ~ 1 Minutes
## Files To Edit:  1
##      includes/functions.php
##
## Included Files: N/A
##
##############################################################
## Author's Notes:
##
## The form of the displayed date is 'Today/yesterday - h:i a" ,so in case you wanted to change the date format
##  all you have to do is to edit the variable '$time_format'
##
## This MOD is released under the GPL License.
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

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

#
#-----[ FIND ]------------------------------------------
#
   $thetime = ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $tz)), $translate) : @gmdate($format, $gmepoch + (3600 * $tz));

#
#-----[ AFTER, ADD ]-----------------------------------
#
// friendly date mod\\*******************   
   $L_Today = 'Today';
   $L_Yesterday = 'Yesterday';
   $time_format = " - h:i a";// - hour:minute am/pm
   
   $date = getdate();
   $today = $date['mday'];
   $month = $date['mon'];
   $year = $date['year'];

   $forum_date_today = @gmdate ("d", $gmepoch);
   $forum_date_month = @gmdate ("m", $gmepoch);
   $forum_date_year = @gmdate ("Y", $gmepoch);
   
   if ($forum_date_today == $today && $forum_date_month == $month && $forum_date_year == $year)
      $thetime = $L_Today . @gmdate ($time_format, $gmepoch);//today
   
   else
   if ($today != 1 && $forum_date_today == ($today-1) && $forum_date_month == $month && $forum_date_year == $year)
      $thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch);//yesterday
      
   else
   //if today is 1 and the month is not 1, then we have to check how many days in the previews month
   //and then set $yesterday to the last day in the previews month
   if ($today == 1 && $month != 1)
   {
   $yesterday = date ("t", mktime(0,0,0,($month-1),1,$year));//returns how many days in the previews month
   if ($forum_date_today == $yesterday && $forum_date_month == ($month-1) && $forum_date_year == $year)
      $thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch);//yesterday
   }
   else
   //if we are in the first day in the year
   if ($today == 1 && $month == 1)
   {
   $yesterday = date ("t", mktime(0,0,0,12,1,($year -1)));
   if ($forum_date_today == $yesterday && $forum_date_month == 12 && $forum_date_year == ($year-1))
      $thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch);//yesterday
   }

//end friendly date mod\\*******************************

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

_________________
Skrinka: Nexus Morpho & Enermax UCTB12P | Zdroj: Enermax EMG800AWT 800W | Základná doska: Asus Rampage III Gene | Procesor: Intel Core i7 990X Extreme Edition 3.46 GHz & Scythe Susanoo SCSO-1000 | Pamäť: Kingston HyperX XMP 24 GB DDR3 1600 MHz | Grafická karta: Asus GeForce GT 440 1 GB DDR3 & Thermalright HR-03 | Pevný disk: Intel SSD 510 Series 250 GB & Hitachi Deskstar 5K4000 4000 GB | Optická mechanika: Plextor PX-820SA | Čítačka kariet: Akasa AK-ICR-11 | Klávesnica: Logitech G19 | Myš: Logitech G9x & Razer Kabuto | Monitor: 24" LCD Eizo FlexScan S2431WE | Reproduktory: Logitech Z-2300 | Operačný systém: Microsoft Windows 7 & FreeBSD 9 | Záložný zdroj: APC Back-UPS ES 700 | Spotreba: Idle - 200W / Burn - 400W | Mobil: Nokia N9 64 GB
Zobraziť informácie o autoroviOdoslať súkromnú správuOdoslať e-mailSkypeFacebookTwitterZobraziť autorove WWW stránky
Zobraziť príspevky z predchádzajúcich:    
Zaslať odpoveď
Nemôžete pridávať nové témy do tohto fóra.
Nemôžete odpovedať na témy v tomto fóre.
Nemôžete upravovať svoje príspevky v tomto fóre.
Nemôžete mazať svoje príspevky v tomto fóre.
Nemôžete hlasovať v tomto fóre.

Powered by phpBB 2.x.x © 2005 - 2012 PCforum, webhosting by WebSupport, edited by JanoF

SEO - optimalizácia pre vyhľadávače

Freebsd