Skip to content

Commit

Permalink
Smarty updated to 3.1.21
Browse files Browse the repository at this point in the history
More code cleanup
  • Loading branch information
silvercircle committed Mar 19, 2015
1 parent 3857313 commit 0578853
Show file tree
Hide file tree
Showing 24 changed files with 131 additions and 58 deletions.
6 changes: 6 additions & 0 deletions .idea/go_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Sources/Activities.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ function aStreamDispatch()
$xml = isset($_REQUEST['xml']) ? true : false;
if(!$modSettings['astream_active']) {
if(!$xml)
redirectexit();
redirectexit();
else
obExit(false);
obExit(false);
}
require_once($sourcedir . '/lib/Subs-Activities.php');
$sub_actions = array(
Expand Down
4 changes: 1 addition & 3 deletions Sources/CommonAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,6 @@ public static function &getHooks()
* - Zend cache
* - memcached (both the old and new implementationms)
* - file system caching
*
* TODO: database cache backend (unsure)?
*/

class cacheAPI {
Expand Down Expand Up @@ -639,7 +637,7 @@ public static function putCache($key, $value, $ttl = 120)
*
* This function does not work with all caching engines and should not
* be relied on! It can help clearing stale caches, but caching in
* general caching should try to be independent of this function. At
* general should try to be independent of this function. At
* this point, only xcache and the file cache support this feature.
*
* @param string $key
Expand Down
1 change: 0 additions & 1 deletion Sources/Display.php
Original file line number Diff line number Diff line change
Expand Up @@ -2002,6 +2002,5 @@ function QuickInTopicModeration()
if (allowedTo('delete_any') && (!allowedTo('delete_own') || $info[1] != $user_info['id']))
logAction('delete', array('topic' => $topic, 'subject' => $info[0], 'member' => $info[1], 'board' => $board));
}

redirectexit(!empty($topicGone) ? 'board=' . $board : 'topic=' . $topic . '.' . $_REQUEST['start']);
}
4 changes: 1 addition & 3 deletions Sources/DumpDatabase.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @name EosAlpha BBS
* @copyright 2011 Alex Vie silvercircle(AT)gmail(DOT)com
* @copyright 2015 Alex Vie silvercircle(AT)gmail(DOT)com
*
* This software is a derived product, based on:
*
Expand Down Expand Up @@ -178,5 +178,3 @@ function DumpDatabase2()

exit;
}

?>
8 changes: 3 additions & 5 deletions Sources/Errors.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@
// Handle fatal errors - like connection errors or load average problems
function db_fatal_error($loadavg = false)
{
global $sourcedir;

show_db_error($loadavg);

// Since we use "or db_fatal_error();" this is needed...
Expand All @@ -77,7 +75,7 @@ function db_fatal_error($loadavg = false)
// Log an error, if the option is on.
function log_error($error_message, $error_type = 'general', $file = null, $line = null)
{
global $txt, $modSettings, $sc, $user_info, $smcFunc, $scripturl, $last_error;
global $modSettings, $sc, $user_info, $scripturl, $last_error;

// Check if error logging is actually on.
if (empty($modSettings['enableErrorLogging']))
Expand Down Expand Up @@ -151,7 +149,7 @@ function log_error($error_message, $error_type = 'general', $file = null, $line
// An irrecoverable error.
function fatal_error($error, $log = 'general')
{
global $txt, $context, $modSettings;
global $txt, $modSettings;

// We don't have $txt yet, but that's okay...
if (empty($txt))
Expand Down Expand Up @@ -328,7 +326,7 @@ function setup_fatal_error_context($error_message)
function show_db_error($loadavg = false)
{
global $sourcedir, $mbname, $maintenance, $mtitle, $mmessage, $modSettings;
global $db_connection, $webmaster_email, $db_last_error, $db_error_send, $smcFunc;
global $db_connection, $webmaster_email, $db_last_error, $db_error_send;

// Don't cache this page!
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
Expand Down
4 changes: 1 addition & 3 deletions Sources/Load.php
Original file line number Diff line number Diff line change
Expand Up @@ -1235,9 +1235,7 @@ function loadMemberContext($user, $display_custom_fields = false)
);
}
}

HookAPI::callHook('load_membercontext', array(&$memberContext[$user], &$profile));

return true;
}

Expand Down Expand Up @@ -2717,7 +2715,7 @@ function logSpider()
}

/*
* left here for compatibility...
* left here for compatibility (some addon product may use the old caching API)
*/
function cache_put_data($key, $value, $ttl = 120)
{
Expand Down
1 change: 0 additions & 1 deletion Sources/Ratings.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,4 +278,3 @@ function LikesByUser($memID)
mysql_free_result($request);
EoS_Smarty::getConfigInstance()->registerHookTemplate('profile_content_area', 'ratings/profile_display');
}

3 changes: 1 addition & 2 deletions Sources/SimpleSEF.php
Original file line number Diff line number Diff line change
Expand Up @@ -1527,6 +1527,5 @@ private static function log() {
if (!empty($modSettings['simplesef_debug']))
foreach (func_get_args() as $string)
log_error($string, 'debug', __FILE__);
}

}
}
4 changes: 1 addition & 3 deletions Sources/backend/ManageMail.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @name EosAlpha BBS
* @copyright 2011 Alex Vie silvercircle(AT)gmail(DOT)com
* @copyright 2015 Alex Vie silvercircle(AT)gmail(DOT)com
*
* This software is a derived product, based on:
*
Expand Down Expand Up @@ -448,5 +448,3 @@ function time_since($time_diff)
else
return sprintf($time_diff == 1 ? $txt['mq_second'] : $txt['mq_seconds'], $time_diff);
}

?>
4 changes: 1 addition & 3 deletions Sources/backend/ManagePermissions.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @name EosAlpha BBS
* @copyright 2011 Alex Vie silvercircle(AT)gmail(DOT)com
* @copyright 2015 Alex Vie silvercircle(AT)gmail(DOT)com
*
* This software is a derived product, based on:
*
Expand Down Expand Up @@ -2382,5 +2382,3 @@ function ModifyPostModeration()
}
mysql_free_result($request);
}

?>
4 changes: 1 addition & 3 deletions Sources/backend/Packages.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @name EosAlpha BBS
* @copyright 2011 Alex Vie silvercircle(AT)gmail(DOT)com
* @copyright 2015 Alex Vie silvercircle(AT)gmail(DOT)com
*
* This software is a derived product, based on:
*
Expand Down Expand Up @@ -2256,5 +2256,3 @@ function PackageFTPTest()
),
);
}

?>
3 changes: 1 addition & 2 deletions Sources/backend/Plugins.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @name EosAlpha BBS
* @copyright 2011 Alex Vie silvercircle(AT)gmail(DOT)com
* @copyright 2015 Alex Vie silvercircle(AT)gmail(DOT)com
*
* This software is a derived product, based on:
*
Expand Down Expand Up @@ -167,4 +167,3 @@ function PluginsMain()
{
EoS_Plugin_Loader::main();
}
?>
4 changes: 1 addition & 3 deletions Sources/backend/RepairBoards.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @name EosAlpha BBS
* @copyright 2011 Alex Vie silvercircle(AT)gmail(DOT)com
* @copyright 2015 Alex Vie silvercircle(AT)gmail(DOT)com
*
* This software is a derived product, based on:
*
Expand Down Expand Up @@ -1637,5 +1637,3 @@ function createSalvageArea()
// Restore the user's language.
loadLanguage('Admin');
}

?>
4 changes: 1 addition & 3 deletions Sources/backend/Themes.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @name EosAlpha BBS
* @copyright 2011 Alex Vie silvercircle(AT)gmail(DOT)com
* @copyright 2015 Alex Vie silvercircle(AT)gmail(DOT)com
*
* This software is a derived product, based on:
*
Expand Down Expand Up @@ -2146,5 +2146,3 @@ function CopyTemplate()

$context['sub_template'] = 'copy_template';
}

?>
2 changes: 2 additions & 0 deletions Sources/lib/Subs-BoardIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ function getBoardIndex($boardIndexOptions)
* move hidden boards into a separate pseudo category to hide them from normal
* board list display.
*
* user can customize ignored boards in profile -> Ignore board options
*
* @param $boardlist array of boards (either a $category['boards'] or normal list
* when categories are unwanted.
* @return int number of boards that are hidden in this list of boards
Expand Down
36 changes: 34 additions & 2 deletions Sources/lib/Subs.php
Original file line number Diff line number Diff line change
Expand Up @@ -736,15 +736,14 @@ function comma_format($number, $override_decimal_count = false)
$decimal_separator = $matches[2];
$decimal_count = strlen($matches[3]);
}

// Format the string with our friend, number_format.
return number_format($number, is_float($number) ? ($override_decimal_count === false ? $decimal_count : $override_decimal_count) : 0, $decimal_separator, $thousands_separator);
}

// Format a time to make it look purdy.
function timeformat($log_time, $show_today = false, $offset_type = false)
{
global $context, $user_info, $txt, $modSettings;
global $user_info, $txt, $modSettings;
static $non_twelve_hour = null;

// Offset the time.
Expand Down Expand Up @@ -3512,6 +3511,39 @@ function getLegacyAttachmentFilename($filename, $attachment_id, $dir = null, $ne
return $filename;
}

function smf_ipv6_expand($addr, $strict_check = true)
{
/* Check if there are segments missing, insert if necessary */
if (strpos($addr, '::') !== false)
{
$part = explode('::', $addr);
$part[0] = explode(':', $part[0]);
$part[1] = explode(':', $part[1]);
$missing = array();
for ($i = 0; $i < (8 - (count($part[0]) + count($part[1]))); $i++)
array_push($missing, '0000');
$missing = array_merge($part[0], $missing);
$part = array_merge($missing, $part[1]);
}
else
$part = explode(":", $addr);

/* Pad each segment until it has 4 digits */
foreach ($part as &$p)
while (strlen($p) < 4)
$p = '0' . $p;

unset($p);

/* Join segments */
$result = implode(':', $part);

/* Quick check to make sure the length is as expected */
if (!$strict_check || strlen($result) == 39)
return $result;
else
return false;
}
// Convert a single IP to a ranged IP.
function ip2range($fullip)
{
Expand Down
5 changes: 5 additions & 0 deletions Themes/default/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,11 @@ li.medium_avatar img, span.medium_avatar img {
width: 48px;
margin: 2px 5px;
}

div.poster img.avatar {
max-width: 60px !important;
}

span.small_avatar {
display: block;
position: relative;
Expand Down
Loading

0 comments on commit 0578853

Please sign in to comment.