From 80f2ba640ec528bd43db243122a69e765703b7c0 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 24 May 2016 20:49:23 -0700 Subject: code cleanup --- include/text.php | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'include/text.php') diff --git a/include/text.php b/include/text.php index caaef664f..a7cc4c9bd 100644 --- a/include/text.php +++ b/include/text.php @@ -20,7 +20,6 @@ define('RANDOM_STRING_TEXT', 0x01 ); * @return string substituted string */ function replace_macros($s, $r) { - $a = get_app(); $arr = array('template' => $s, 'params' => $r); call_hooks('replace_macros', $arr); @@ -96,7 +95,6 @@ function z_input_filter($channel_id,$s,$type = 'text/bbcode') { if($type == 'application/x-pdl') return escape_tags($s); - $a = get_app(); if(App::$is_sys) { return $s; } @@ -653,11 +651,10 @@ function log_priority_str($priority) { * @param int $level A log level. */ function dlogger($msg, $level = 0) { + // turn off logger in install mode - global $a; - global $db; - if((App::$module == 'install') || (! (DBA::$dba && DBA::$dba->connected))) + if(App::$module == 'setup') return; $debugging = get_config('system','debugging'); @@ -815,7 +812,6 @@ function get_mentions($item,$tags) { function contact_block() { $o = ''; - $a = get_app(); if(! App::$profile['uid']) return; @@ -928,7 +924,7 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) { function search($s,$id='search-box',$url='/search',$save = false) { - $a = get_app(); + return replace_macros(get_markup_template('searchbox.tpl'),array( '$s' => $s, '$id' => $id, @@ -1073,7 +1069,7 @@ function get_mood_verbs() { // Function to list all smilies, both internal and from addons // Returns array with keys 'texts' and 'icons' function list_smilies() { - $a = get_app(); + $texts = array( '<3', '</3', @@ -1106,10 +1102,8 @@ function list_smilies() { ':coffee', ':facepalm', ':like', - ':dislike', - 'red#matrix', - 'red#', - 'r#' + ':dislike' + ); $icons = array( @@ -1145,9 +1139,6 @@ function list_smilies() { ':facepalm', ':like', ':dislike', - 'redmatrix', - 'redmatrix', - 'redmatrix' ); @@ -1218,7 +1209,7 @@ function smile_unshield($m) { * @param array $x */ function preg_heart($x) { - $a = get_app(); + if (strlen($x[1]) == 1) return $x[0]; @@ -1491,7 +1482,6 @@ function format_event($jobject) { } function prepare_body(&$item,$attach = false) { - require_once('include/channel.php'); call_hooks('prepare_body_init', $item); @@ -1721,7 +1711,6 @@ function feed_hublinks() { /* return atom link elements for salmon endpoints */ function feed_salmonlinks($nick) { - $a = get_app(); $salmon = '' . "\n" ; @@ -1789,7 +1778,7 @@ function mimetype_select($channel_id, $current = 'text/bbcode') { 'application/x-pdl' ); - $a = get_app(); + if(App::$is_sys) { $x[] = 'application/x-php'; } @@ -1822,7 +1811,6 @@ function mimetype_select($channel_id, $current = 'text/bbcode') { function lang_selector() { - global $a; $langs = glob('view/*/hstrings.php'); -- cgit v1.2.3