Welcome, Guest. Please Login or Register.
April 30, 2025, 08:57:54 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  yesterday mod w/ 1.3 « previous next »
Pages: [1] Reply Ignore Print
Author Topic: yesterday mod w/ 1.3  (Read 490 times)
ac
Noobie
*
Posts: 12


Walk the llama, llama!

yesterday mod w/ 1.3
« on: April 05, 2002, 07:24:07 PM »
Reply with quote

Can I use the yesterday/today/tommarow mod on v1.3? I tried it and got an invalid line error from subs.pl.
Logged
seth4chaos
Noobie
*
Posts: 22


YaBB SE Rulez!!!

Re:yesterday mod w/ 1.3
« Reply #1 on: April 05, 2002, 09:43:22 PM »
Reply with quote

Yep, you can

I'm running it right now  ;)

here is my code (don't have the mod, sorry) for the timeformat() function
function timeformat ($logTime){
   global $timeformatstring,$username,$settings,$timeoffset,$txt,$db_prefix,$locale;
   if (!isset($GLOBALS['todayMod']))
   {
      // pre-load variable so we don't query too much
      $req = mysql_query("SELECT value FROM {$db_prefix}settings WHERE variable='todayMod'");
      list($GLOBALS['todayMod'])=mysql_fetch_row($req);
   }
   $time = isset($settings[18])?$settings[18]:0;
   $time = ($timeoffset+$time)*3600;
   $nowtime = $time+time();
   $time += $logTime;
   if ($GLOBALS['todayMod']=='1')
   {
      $t1 = getdate($time);
      $t2 = getdate($nowtime);
      $strtfmt = (($username == 'Guest' || $settings[17]=='')?$timeformatstring:$settings[17]);
      if ($t1['yday']==$t2['yday'] && $t1['year']==$t2['year'])
         return $txt['yse10'].date(substr_count($strtfmt, "%H") == 0?" h:i:sa":" H:i:s", $time);   //Bugfix by Omar Bazavilvazo
      if ($t1['yday']==($t2['yday']-1) && $t1['year']==$t2['year'])
         return $txt['yse10b'].date(substr_count($strtfmt, "%H") == 0?" h:i:sa":" H:i:s", $time);   //Bugfix by Omar Bazavilvazo
   }
   return lang_strftime ($time);
}
Logged
ac
Noobie
*
Posts: 12


Walk the llama, llama!

Re:yesterday mod w/ 1.3
« Reply #2 on: April 06, 2002, 01:26:33 PM »
Reply with quote

That did the trick. Thanks.  :)

I should add that anyone who wants to add this code should remember to edit english.ing:

Look for:
$txt['yse10'] = "<b>Today</b> at ";
Add this after:
$txt['yse10b'] = "<b>Yesterday</b> at ";
« Last Edit: April 06, 2002, 01:27:43 PM by ac » Logged
joker
Jr. Member
**
Posts: 85


Fanatiker sind zu allem fähig, sonst aber zu nix!

Re:yesterday mod w/ 1.3
« Reply #3 on: April 10, 2002, 02:52:38 PM »
Reply with quote

i installed the yesterday mod code together with the SearchNew Mod of Forge
and it seems as if the yesterday code causes a little display effect:

For all dates before today the time is like '%16:%05:%50'
Does anyone know how to fix this?
Logged

MfG joker ;)
ac
Noobie
*
Posts: 12


Walk the llama, llama!

Re:yesterday mod w/ 1.3
« Reply #4 on: April 10, 2002, 07:09:15 PM »
Reply with quote

Sure in your forum setting replace your Default time format with this.


%B %e, %Y, %I:%M:%S %p
Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  yesterday mod w/ 1.3 « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.027 seconds with 16 queries.