News:

Join the Facebook Fan Page.

Main Menu

Recent posts

#41
Modifications and Packages / Re: Relative Dates
Last post by Senkusha - Yesterday at 10:14:19 AM
Quote from: Kindred on January 27, 2021, 03:24:47 PMYou want *ALL* dates to be relative?



Instead of doing the Subs.php and modifications.english.php edits that this mod originally suggested...
comment out or delete these lines.

Code ("find this in Subs.php") Select
// Today and Yesterday?
if ($modSettings['todayMod'] >= 1 && $show_today === true)
{
// Get the current time.
$nowtime = forum_time();

$then = @getdate($time);
$now = @getdate($nowtime);

// Try to make something of a time format string...
$s = strpos($user_info['time_format'], '%S') === false ? '' : ':%S';
if (strpos($user_info['time_format'], '%H') === false && strpos($user_info['time_format'], '%T') === false)
{
$h = strpos($user_info['time_format'], '%l') === false ? '%I' : '%l';
$today_fmt = $h . ':%M' . $s . ' %p';
}
else
$today_fmt = '%H:%M' . $s;

// Same day of the year, same year.... Today!
if ($then['yday'] == $now['yday'] && $then['year'] == $now['year'])
return $txt['today'] . timeformat($log_time, $today_fmt, $offset_type);

// Day-of-year is one less and same year, or it's the first of the year and that's the last of the year...
if ($modSettings['todayMod'] == '2' && (($then['yday'] == $now['yday'] - 1 && $then['year'] == $now['year']) || ($now['yday'] == 0 && $then['year'] == $now['year'] - 1) && $then['mon'] == 12 && $then['mday'] == 31))
return $txt['yesterday'] . timeformat($log_time, $today_fmt, $offset_type);
}

Code ("replace the above code with this") Select
$nowtime = forum_time(); 
$retVal = time_ago($nowtime, $time);

return $retVal;

Code ("add the follow to the end of Subs.php") Select
function time_ago($now, $then)
    {
    global $txt;
 
        if(!is_numeric($then))
            $then = strtotime($then);

        $periods_sing = array($txt['rel_second'], $txt['rel_minute'], $txt['rel_hour'], $txt['rel_day'], $txt['rel_week'], $txt['rel_month'], $txt['rel_year'], $txt['rel_age']);
        $periods_plur = array($txt['rel_seconds'], $txt['rel_minutes'], $txt['rel_hours'], $txt['rel_days'], $txt['rel_weeks'], $txt['rel_months'], $txt['rel_years'], $txt['rel_ages']);
        $lengths = array("60","60","24","7","4.35","12","100");

        $difference = $now - $then;
        if ($difference <= 10 && $difference >= 0)
            return $tense = $txt['just_now'];
        elseif($difference > 0)
            $tense = $txt['ago'];
        elseif($difference < 0)
            $tense = $txt['later'];

        for($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) {
            $difference /= $lengths[$j];
        }

        $difference = round($difference);

        if ($difference > 1)
          $period = $periods_plur[$j];
        else
          $period = $periods_sing[$j];

        return "{$difference} {$period} {$tense} ";
    }

Code ("add the following to Modifications.English.php") Select

$txt['just_now'] = 'just now';
$txt['ago'] = 'ago';
$txt['later'] = 'later';
$txt['rel_second'] = 'second';
$txt['rel_minute'] = 'minute';
$txt['rel_hour'] = 'hour';
$txt['rel_day'] = 'day';
$txt['rel_week'] = 'week';
$txt['rel_month'] = 'month';
$txt['rel_year'] = 'year';
$txt['rel_age'] = 'age';
$txt['rel_seconds'] = 'seconds';
$txt['rel_minutes'] = 'minutes';
$txt['rel_hours'] = 'hours';
$txt['rel_days'] = 'days';
$txt['rel_weeks'] = 'weeks';
$txt['rel_months'] = 'months';
$txt['rel_years'] = 'years';
$txt['rel_ages'] = 'ages';
$txt['relative_today'] = 'All times are Relative';



(Edit -- do note that my code changes above will install the relative dates/times REGARDLESS of the setting in the admin. The code I put together was a hack to REPLACE, not add an option, to the current code)

Is this the code that I would need to use to enable this MOD to work with 2.1.x?
#42
SMF 2.1.x Support / Re: Potential Hacking Attempts
Last post by Kindred - Yesterday at 08:56:47 AM
Those are not hacking attempts... at least not the error messages...

Those errors indicate the,  somewhere,  either in your theme or mods, you have a very badly formed/called php call that is not loading the $context variable.

What is the ACTUAL URL being called the triggers the errors?
#43
Theme Site Themes / Re: Potato
Last post by depmod - Yesterday at 08:55:41 AM
hm - in which file the script for the news is stated?
#44
SMF 2.1.x Support / Re: Potential Hacking Attempts
Last post by brianb2 - Yesterday at 08:40:56 AM
Today's round of error messages. I did go in an ensure I didn't have any unnecessary packages/mods installed.

47.91.104.88   Guest   2: Invalid argument supplied for foreach() ?sslRedirect   Today at 07:59:07 AM
47.91.104.88   Guest   8: Undefined index: template_layers ?sslRedirect   Today at 07:59:07 AM
47.91.104.88   Guest   8: Undefined index: can_register ?sslRedirect   Today at 07:59:07 AM
47.91.104.88   Guest   8: Undefined index: session_id ?sslRedirect   Today at 07:59:07 AM
47.91.104.88   Guest   8: Undefined index: session_var ?sslRedirect   Today at 07:59:07 AM
47.91.104.88   Guest   8: Undefined index: id ?sslRedirect   Today at 07:59:07 AM
47.91.104.88   Guest   8: Undefined index: id ?sslRedirect   Today at 07:59:07 AM
47.91.104.88   Guest   8: Undefined index: is_guest ?sslRedirect   Today at 07:59:07 AM
47.91.104.88   Guest   8: Undefined index: can_mod ?sslRedirect   Today at 07:59:07 AM
#45
Mod Requests / Re: media gallery for videos
Last post by Doug Heffernan - Yesterday at 06:21:14 AM
Quote from: suxatcoding on December 06, 2023, 10:13:04 PMThanks. I forgot to mention that I only want short previews accessible to the public. I need the full videos accessible to paying members only because the cost involved are too much to make them accessible to everyone.

You will need a custom mod for that.
#46
Modifications and Packages / Re: Video Embed
Last post by Steve - Yesterday at 05:49:20 AM
Try this instead (for now):

https://www.youtube.com/watch?v=LLcdqyDv2-s

Delete everything after and including the ? .
#47
There's a chance that the browser still uses the old css from cache, try forcing a refresh with ctrl+f5 or emptying your temporary files. If that doesn't work, then you might want to use the developer console to see if the css change is actually there but just not working right for some reason.
#48
Modifications and Packages / Re: Recent Forum Topics on Boa...
Last post by Pipke - Yesterday at 05:08:02 AM
Quote from: TwitchisMental on December 05, 2023, 06:15:04 PMHey just noticed that I get this error every so often.

       
/forum/Themes/default/RecentTopicsBoardIndex.template.php (Line 88)
Backtrace information
Type of error: General
Error message Select
2: foreach() argument must be of type array|object, null given

&
2: Undefined array key "categories"

I can't reproduce that error, but I made some changes and I hope this will fix your error. Download the file in the attachment and overwrite it in your theme folder. Can you please respond if it is resolved.
#49
Modifications and Packages / Undefined array key "ip", SFS ...
Last post by Ottokar - Yesterday at 04:47:53 AM
PHP 8.2.x
SMF 2.1.4
SFS 1.5.3 (only 'Check Email? (Recommended)' is active; 'Checks Required' is at 'Email & IP Address')

This Mod generates permanently errors at the registration prozess:
Undefined array key "ip"Backtrace information see attach.

Another special error:
SFS Failed as no data was sent:https://api.stopforumspam.org/api?json¬orexit&expire=90Backtrace information see attach.
I think, the session was ended while the user write the post. And as he send the post, he was redirected to login, at which loosing sfs the data.
#50
Modifications and Packages / Re: Video Embed
Last post by Thistle Sifter - Yesterday at 01:26:57 AM
I just installed this and noticed that the conditionals at line 57 and below get tripped up by youtube.be URLs that also have a query string.

For example, this:
[youtube]https://youtu.be/LLcdqyDv2-s?si=vnEVS8ETZ37g8L2y[/youtube]
Results in the following error:
You cannot view this attachment.
Advertisement: