diff --git a/article_image.php b/article_image.php index b722eed53c4b800793af9f7a953ce33c9068acfa..2c745adbfea94e30ff28c4b9d5313e39d91d3b1b 100644 --- a/article_image.php +++ b/article_image.php @@ -37,16 +37,16 @@ if (!isset($_REQUEST["image_type"])) { switch ($_REQUEST["image_type"]) { case "article": $image_cache_prefix="article"; - break; + break; case "submission": $image_cache_prefix="article_submission"; - break; + break; case "topic": $image_cache_prefix="article_topic"; - break; + break; case "preview": $image_cache_prefix="article_preview"; - break; + break; default: die; } @@ -62,17 +62,17 @@ if ( isset($_REQUEST["reload"]) || !$useCache || !is_file($cachefile) ) { switch ($_REQUEST["image_type"]) { case "article": $storedData = $artlib->get_article_image($_REQUEST["id"]); - break; + break; case "submission": $storedData = $artlib->get_submission($_REQUEST["id"]); - break; + break; case "topic": $storedData = $artlib->get_topic_image($_REQUEST["id"]); - break; + break; case "preview": // We can't get the data from the database. No fallback solution. // No image displayed - break; + break; default: // Invalid value die; @@ -93,8 +93,8 @@ if ( isset($_REQUEST["reload"]) || !$useCache || !is_file($cachefile) ) { if (empty($data)) die; } if ($useCache && $data) { - $fp = fopen($cachefile,"wb"); - fputs($fp,$data); + $fp = fopen($cachefile, "wb"); + fputs($fp, $data); fclose($fp); } echo $data; diff --git a/banner_image.php b/banner_image.php index a074c49ad90a4a297c7bcfbc53e56f9e988231db..643aa0da79490ca1b0584e3a6058f1e9e549419a 100644 --- a/banner_image.php +++ b/banner_image.php @@ -51,8 +51,8 @@ if (is_file($bannercachefile) and (!isset($_REQUEST["reload"]))) { $type = $data["imageType"]; $data = $data["imageData"]; if ($data) { - $fp = fopen($bannercachefile,"wb"); - fputs($fp,$data); + $fp = fopen($bannercachefile, "wb"); + fputs($fp, $data); fclose($fp); } } diff --git a/categorize.php b/categorize.php index c3c1a0016182b63436efa5bf5439eb827635d91e..b4693d94a0e20f44d45f3ea217ee5851b99981d9 100644 --- a/categorize.php +++ b/categorize.php @@ -7,18 +7,18 @@ require_once('tiki-setup.php'); $access = TikiLib::lib('access'); -$access->check_script($_SERVER["SCRIPT_NAME"],basename(__FILE__)); +$access->check_script($_SERVER["SCRIPT_NAME"], basename(__FILE__)); $smarty = TikiLib::lib('smarty'); global $prefs; -$catobjperms = Perms::get( array( 'type' => $cat_type, 'object' => $cat_objid ) ); +$catobjperms = Perms::get(array( 'type' => $cat_type, 'object' => $cat_objid )); if ($prefs['feature_categories'] == 'y' && $catobjperms->modify_object_categories ) { $categlib = TikiLib::lib('categ'); if (isset($_REQUEST['import']) and isset($_REQUEST['categories'])) { - $_REQUEST["cat_categories"] = explode(',',$_REQUEST['categories']); + $_REQUEST["cat_categories"] = explode(',', $_REQUEST['categories']); $_REQUEST["cat_categorize"] = 'on'; } diff --git a/categorize_list.php b/categorize_list.php index 88c33e6399c356229aaef37b1e2803e93c1508ce..5cc21ed2793ad76df451a7bfb091b8a137365a76 100644 --- a/categorize_list.php +++ b/categorize_list.php @@ -7,14 +7,14 @@ require_once('tiki-setup.php'); $access = TikiLib::lib('access'); -$access->check_script($_SERVER["SCRIPT_NAME"],basename(__FILE__)); +$access->check_script($_SERVER["SCRIPT_NAME"], basename(__FILE__)); $userlib = TikiLib::lib('user'); $smarty = TikiLib::lib('smarty'); global $prefs; -$catobjperms = Perms::get( array( 'type' => $cat_type, 'object' => $cat_objid ) ); +$catobjperms = Perms::get(array( 'type' => $cat_type, 'object' => $cat_objid )); $smarty->assign('mandatory_category', '-1'); if ($prefs['feature_categories'] == 'y' && isset($cat_type) && isset($cat_objid)) { @@ -46,7 +46,7 @@ if ($prefs['feature_categories'] == 'y' && isset($cat_type) && isset($cat_objid) $can = $catobjperms->modify_object_categories; foreach ($categories as &$category) { - $catperms = Perms::get( array( 'type' => 'category', 'object' => $category['categId'] ) ); + $catperms = Perms::get(array( 'type' => 'category', 'object' => $category['categId'] )); if (in_array($category["categId"], $cats)) { $category["incat"] = 'y'; diff --git a/display_banner.php b/display_banner.php index e3af61c02f823fa27818101ffff584599de8fb15..e05e809a291211124eba7164cb49285be80366ac 100644 --- a/display_banner.php +++ b/display_banner.php @@ -27,11 +27,11 @@ $id = $data["bannerId"]; switch ($data["which"]) { case 'useHTML': $raw = $data["HTMLData"]; - break; + break; case 'useImage': $raw = ""; - break; + break; case 'useFixedURL': $fp = fopen($data["fixedURLData"], "r"); @@ -43,10 +43,10 @@ switch ($data["which"]) { } fclose($fp); - break; + break; case 'useText': $raw = $data["textData"]; - break; + break; } print ($raw); diff --git a/freetag_list.php b/freetag_list.php index 4caed655fff5b44183c4e90d1ec03a87910ffaee..bf0fdc22e694e6258dd37111f4f8ff5bf4abb75c 100644 --- a/freetag_list.php +++ b/freetag_list.php @@ -8,7 +8,7 @@ //this script may only be included - so its better to err & die if called directly. //smarty is not there - we need setup require_once('tiki-setup.php'); -$access->check_script($_SERVER["SCRIPT_NAME"],basename(__FILE__)); +$access->check_script($_SERVER["SCRIPT_NAME"], basename(__FILE__)); global $prefs; global $tiki_p_view_freetags; @@ -32,7 +32,7 @@ if ($prefs['feature_freetags'] == 'y' and $tiki_p_view_freetags == 'y') { } } - $smarty->assign('taglist',$taglist); + $smarty->assign('taglist', $taglist); } else { $taglist = ''; } @@ -40,7 +40,7 @@ if ($prefs['feature_freetags'] == 'y' and $tiki_p_view_freetags == 'y') { if ( !isset($cat_lang)) $cat_lang = null; - $suggestion = $freetaglib->get_tag_suggestion($taglist,$prefs['freetags_browse_amount_tags_suggestion'],$cat_lang); + $suggestion = $freetaglib->get_tag_suggestion($taglist, $prefs['freetags_browse_amount_tags_suggestion'], $cat_lang); - $smarty->assign('tag_suggestion',$suggestion); + $smarty->assign('tag_suggestion', $suggestion); } diff --git a/group_tracker_ajax.php b/group_tracker_ajax.php index 65d460f43b306b5b47dd59cc0d170112d2d33b3d..d93b4e33f3abadc2e24aba2a1782f7cf7886ac4c 100644 --- a/group_tracker_ajax.php +++ b/group_tracker_ajax.php @@ -18,6 +18,6 @@ if (!empty($re['usersTrackerId']) && !empty($re['registrationUsersFieldIds'])) { $json_data['debug'] = $re; } -header( 'Content-Type: application/json' ); +header('Content-Type: application/json'); $access->output_serialized($json_data); diff --git a/messu-compose.php b/messu-compose.php index 0b327ff9b6291e08399be2b7f3a3af9e4e9cb7b5..d8c2d1eb3278ff3c0f083a1966528fddf0f59d31 100644 --- a/messu-compose.php +++ b/messu-compose.php @@ -41,7 +41,7 @@ foreach (array( 'bcc' ) as $dest) { if (is_array($_REQUEST[$dest])) { - $sep = strstr(implode('',$_REQUEST[$dest]), ',') === false?', ': '; '; + $sep = strstr(implode('', $_REQUEST[$dest]), ',') === false?', ': '; '; $_REQUEST[$dest] = implode($sep, $_REQUEST[$dest]); } } @@ -87,13 +87,13 @@ if (isset($_REQUEST['send'])) { if (($messulib->count_messages($a_user) < $prefs['messu_mailbox_size']) || ($prefs['messu_mailbox_size'] == 0)) { $users[] = $a_user; } else { - $message.= sprintf(tra("User %s can not receive messages, mailbox is full") ,htmlspecialchars($a_user)) . "
"; + $message.= sprintf(tra("User %s can not receive messages, mailbox is full"), htmlspecialchars($a_user)) . "
"; } } else { - $message.= sprintf(tra("User %s can not receive messages") , htmlspecialchars($a_user)) . "
"; + $message.= sprintf(tra("User %s can not receive messages"), htmlspecialchars($a_user)) . "
"; } } else { - $message.= sprintf(tra("Invalid user: %s") , htmlspecialchars($a_user)) . "
"; + $message.= sprintf(tra("Invalid user: %s"), htmlspecialchars($a_user)) . "
"; } } } @@ -107,13 +107,13 @@ if (isset($_REQUEST['send'])) { if (($messulib->count_messages($a_user) < $prefs['messu_mailbox_size']) || ($prefs['messu_mailbox_size'] == 0)) { $users[] = $a_user; } else { - $message.= sprintf(tra("User %s can not receive messages, mailbox is full") , htmlspecialchars($a_user)) . "
"; + $message.= sprintf(tra("User %s can not receive messages, mailbox is full"), htmlspecialchars($a_user)) . "
"; } } else { - $message.= sprintf(tra("User %s can not receive messages") , htmlspecialchars($a_user)) . "
"; + $message.= sprintf(tra("User %s can not receive messages"), htmlspecialchars($a_user)) . "
"; } } else { - $message.= sprintf(tra("Invalid user: %s") , htmlspecialchars($a_user)) . "
"; + $message.= sprintf(tra("Invalid user: %s"), htmlspecialchars($a_user)) . "
"; } } } @@ -127,13 +127,13 @@ if (isset($_REQUEST['send'])) { if (($messulib->count_messages($a_user) < $prefs['messu_mailbox_size']) || ($prefs['messu_mailbox_size'] == 0)) { $users[] = $a_user; } else { - $message.= sprintf(tra("User %s can not receive messages, mailbox is full") , htmlspecialchars($a_user)) . "
"; + $message.= sprintf(tra("User %s can not receive messages, mailbox is full"), htmlspecialchars($a_user)) . "
"; } } else { - $message.= sprintf(tra("User %s can not receive messages") , htmlspecialchars($a_user)) . "
"; + $message.= sprintf(tra("User %s can not receive messages"), htmlspecialchars($a_user)) . "
"; } } else { - $message.= sprintf(tra("Invalid user: %s") , htmlspecialchars($a_user)) . "
"; + $message.= sprintf(tra("Invalid user: %s"), htmlspecialchars($a_user)) . "
"; } } } @@ -152,8 +152,17 @@ if (isset($_REQUEST['send'])) { } // Insert the message in the inboxes of each user foreach ($users as $a_user) { - $result = $messulib->post_message($a_user, $user, $_REQUEST['to'], $_REQUEST['cc'], $_REQUEST['subject'], $_REQUEST['body'], $_REQUEST['priority'], $_REQUEST['replyto_hash'], - isset($_REQUEST['replytome']) ? 'y' : '', isset($_REQUEST['bccme']) ? 'y' : ''); + $result = $messulib->post_message( + $a_user, + $user, + $_REQUEST['to'], + $_REQUEST['cc'], + $_REQUEST['subject'], + $_REQUEST['body'], + $_REQUEST['priority'], + $_REQUEST['replyto_hash'], + isset($_REQUEST['replytome']) ? 'y' : '', isset($_REQUEST['bccme']) ? 'y' : '' + ); if ($result) { if ($prefs['feature_score'] == 'y') { $tikilib->score_event($user, 'message_send'); diff --git a/metrics-tab.php b/metrics-tab.php index aafa149fd72797c8effca2213d0754bcec940d20..9cc98e3b8c1f8f7048d2a4dc621d91cabbe42238 100644 --- a/metrics-tab.php +++ b/metrics-tab.php @@ -55,19 +55,18 @@ $date_field = $_REQUEST['date_field']; require_once 'lib/cache/pagecache.php'; $pageCache = Tiki_PageCache::create() - ->requiresPreference( 'metrics_cache_output' ) - ->addKeys( $_REQUEST, array( 'tab_id', 'range', 'date_from', 'date_to', 'date_field' ) ) + ->requiresPreference('metrics_cache_output') + ->addKeys($_REQUEST, array( 'tab_id', 'range', 'date_from', 'date_to', 'date_field' )) ->applyCache(); $metrics_notify = ''; if (empty($date_field)) { $date_field = 'date_field'; -} -else { +} else { /** * strip ` and limit column length */ - $date_field = preg_replace('/[`\/\\\<>"\']/','', $date_field); + $date_field = preg_replace('/[`\/\\\<>"\']/', '', $date_field); $date_field = substr($date_field, 0, COLUMN_MAXLEN); } if (!is_numeric($tab_id)) { @@ -82,7 +81,7 @@ if (!empty($converted_range['msg'])) { } $tab_info = $metricslib->getTabById($tab_id); -$ret = $metricslib->getMetricsData( $tab_info, $range, $converted_range, $date_field ); +$ret = $metricslib->getMetricsData($tab_info, $range, $converted_range, $date_field); $tab_content = $tab_info['tab_content']; $m = $ret['data']; $m_id = $ret['ids']; diff --git a/modsadm.php b/modsadm.php index 3b8d239f29ab75cbc1b53dc70ccfc06cd9e1e57f..d32695fdc3b0c9a15060d31c658fd67b7fdfeca3 100644 --- a/modsadm.php +++ b/modsadm.php @@ -41,33 +41,36 @@ $commands=array('help' => array(), // 'republish' => array(), ); -function tikimods_feedback_listener($num, $err) { +function tikimods_feedback_listener($num, $err) +{ switch($num) { case -1: echo $err."\n"; - break; + break; case 0: echo "! ".$err."\n"; - break; + break; case 1: echo "*** ".$err."\n"; - break; + break; } } $modslib->add_feedback_listener('tikimods_feedback_listener'); - -function ask($str) { +function ask($str) +{ echo $str; $res=fgets(STDIN, 1024); return trim($res); } -function command_help($goption, $coption, $cparams) { +function command_help($goption, $coption, $cparams) +{ usage(0); } -function command_install($goption, $coption, $cparams) { +function command_install($goption, $coption, $cparams) +{ global $modslib; global $prefs; global $mods_server; @@ -122,7 +125,8 @@ function command_install($goption, $coption, $cparams) { $modslib->install_with_deps($prefs['mods_dir'], $mods_server, $deps); } -function command_remove($goption, $coption, $cparams) { +function command_remove($goption, $coption, $cparams) +{ global $modslib; global $prefs; global $mods_server; @@ -153,7 +157,8 @@ function command_remove($goption, $coption, $cparams) { $modslib->remove_with_deps($prefs['mods_dir'], $mods_server, $deps); } -function command_list($goption, $coption, $cparams) { +function command_list($goption, $coption, $cparams) +{ global $repos; global $modslib; $merged=array(); @@ -190,7 +195,8 @@ function command_list($goption, $coption, $cparams) { } } -function command_show($goption, $coption, $cparams) { +function command_show($goption, $coption, $cparams) +{ global $repos; global $modslib; @@ -340,12 +346,14 @@ function command_show($goption, $coption, $cparams) { } -function failure($errstr) { +function failure($errstr) +{ fprintf(STDERR, "%s\n", $errstr); exit(1); } -function usage($err) { +function usage($err) +{ global $goptions; global $commands; @@ -368,7 +376,8 @@ function usage($err) { exit($err); } -function readargs($argv) { +function readargs($argv) +{ global $goptions; global $commands; diff --git a/plugins_help.php b/plugins_help.php index 3bb06d3baf04ea829f37529b0ab13c40b68e9940..8cb130a512369fd997b59b40b63e225fcdeab685 100644 --- a/plugins_help.php +++ b/plugins_help.php @@ -8,9 +8,9 @@ //this script may only be included - so its better to err & die if called directly. //smarty is not there - we need setup require_once('tiki-setup.php'); -$access->check_script($_SERVER["SCRIPT_NAME"],basename(__FILE__)); +$access->check_script($_SERVER["SCRIPT_NAME"], basename(__FILE__)); global $wikilib; include_once('lib/wiki/wikilib.php'); -$plugins = $wikilib->list_plugins( true ); +$plugins = $wikilib->list_plugins(true); $smarty->assign_by_ref('plugins', $plugins); diff --git a/poll_categorize.php b/poll_categorize.php index 971dfde7bfada6663e7b4ca4badd04586fe2ef65..05a77c11e4dd299c62e3cf3a51f024b3c55cea2d 100644 --- a/poll_categorize.php +++ b/poll_categorize.php @@ -8,7 +8,7 @@ //this script may only be included - so its better to err & die if called directly. //smarty is not there - we need setup require_once('tiki-setup.php'); -$access->check_script($_SERVER["SCRIPT_NAME"],basename(__FILE__)); +$access->check_script($_SERVER["SCRIPT_NAME"], basename(__FILE__)); global $prefs; if ($prefs['feature_polls'] == 'y') { @@ -16,7 +16,9 @@ if ($prefs['feature_polls'] == 'y') { #echo '
hier
'; if (!is_object($categlib)) include_once('lib/categories/categlib.php'); if (!is_object($polllib)) include_once('lib/polls/polllib.php'); - if (!isset($_REQUEST['poll_title'])) { $_REQUEST['poll_title'] = 'rate it!'; } + if (!isset($_REQUEST['poll_title'])) { + $_REQUEST['poll_title'] = 'rate it!'; + } if (isset($_REQUEST["poll_template"]) and $_REQUEST["poll_template"]) { $catObjectId = $categlib->is_categorized($cat_type, $cat_objid); @@ -34,6 +36,6 @@ if ($prefs['feature_polls'] == 'y') { $catObjectId = $categlib->add_categorized_object($cat_type, $cat_objid, $cat_desc, $cat_name, $cat_href); } $olpoll = $polllib->get_poll($_REQUEST["olpoll"]); - $polllib->poll_categorize($catObjectId,$_REQUEST["olpoll"], $olpoll['title']); + $polllib->poll_categorize($catObjectId, $_REQUEST["olpoll"], $olpoll['title']); } } diff --git a/reindex_file.php b/reindex_file.php index 61e1689fdcaab23407dd525fda8fe5445d261f2a..d68a749a094c6b4dd5dbeb54172be649515cbabc 100644 --- a/reindex_file.php +++ b/reindex_file.php @@ -50,10 +50,10 @@ header('Cache-Control: no-cache'); header('Content-type: image/gif'); header('Content-length: 85'); print base64_decode( - 'R0lGODlhAQABALMAAAAAAIAAAACAA'. - 'ICAAAAAgIAAgACAgMDAwICAgP8AAA'. - 'D/AP//AAAA//8A/wD//wBiZCH5BAE'. - 'AAA8ALAAAAAABAAEAAAQC8EUAOw==' + 'R0lGODlhAQABALMAAAAAAIAAAACAA'. + 'ICAAAAAgIAAgACAgMDAwICAgP8AAA'. + 'D/AP//AAAA//8A/wD//wBiZCH5BAE'. + 'AAA8ALAAAAAABAAEAAAQC8EUAOw==' ); flush(); exit; diff --git a/show_image.php b/show_image.php index f731d5ffc8cbcc9260cddea156447bd7caa638fe..62094d1624db8d45b2ad0997b336b8d7dd221ab2 100644 --- a/show_image.php +++ b/show_image.php @@ -6,7 +6,7 @@ // $Id$ if (!isset($_REQUEST["nocache"])) - session_cache_limiter ('private_no_expire'); + session_cache_limiter('private_no_expire'); //include_once ("tiki-setup_base.php"); include_once ("tiki-setup.php"); @@ -32,7 +32,7 @@ if (isset($_REQUEST["name"])) { } elseif (isset($_REQUEST["id"])) { $id=$_REQUEST["id"]; } elseif (isset($_REQUEST["galleryId"])) { - $id=$imagegallib->get_gallery_image($_REQUEST["galleryId"],'default'); + $id=$imagegallib->get_gallery_image($_REQUEST["galleryId"], 'default'); } if (!$id) { @@ -41,7 +41,7 @@ if (!$id) { } $galleryId = $imagegallib->get_gallery_from_image($id); -$galperms = Perms::get( array( 'type' => 'image gallery', 'object' => $galleryId ) ); +$galperms = Perms::get(array( 'type' => 'image gallery', 'object' => $galleryId )); if ( ! $galperms->view_image_gallery ) { header("HTTP/1.0 404 Not Found"); @@ -66,7 +66,7 @@ if (isset($_REQUEST["thumb"])) { } else { $itype = 's'; $scalesize = $galdef; - } + } } if ($imagegallib->get_etag($id, $itype, $scalesize)!==false) { @@ -75,7 +75,7 @@ if ($imagegallib->get_etag($id, $itype, $scalesize)!==false) { # Etag value is based on the md5 hash of the image. It should change everytime the image changes. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.19 #if the client sends the HTTP_IF_NONE_MATCH header(because it received the etag for this image the first time he saw it) we check that the received etag is the same as the actual etag (this is, the image haven't changed) and if it's equal, we send the "Not modified" header(304) - if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] == $imagegallib->etag){ + if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] == $imagegallib->etag) { header("HTTP/1.0 304 Not Modified"); exit(); } diff --git a/tiki-wiki_rankings.php b/tiki-wiki_rankings.php index ad5daca6287d1ae0d1b0a232418ec868926dc936..987a8b0c7af0fdcf5a5ff705aa607f4d1d76dbee 100644 --- a/tiki-wiki_rankings.php +++ b/tiki-wiki_rankings.php @@ -11,7 +11,7 @@ require_once ('tiki-setup.php'); include_once ('lib/rankings/ranklib.php'); -$access->check_feature( array('feature_wiki', 'feature_wiki_rankings') ); +$access->check_feature(array('feature_wiki', 'feature_wiki_rankings')); $access->check_permission('tiki_p_view'); if (!isset($_REQUEST["limit"])) { @@ -22,11 +22,11 @@ if (!isset($_REQUEST["limit"])) { if (isset($_REQUEST["categId"]) && $_REQUEST["categId"] > 0) { $smarty->assign('categIdstr', $_REQUEST["categId"]); - $categs = explode(",",$_REQUEST["categId"]); + $categs = explode(",", $_REQUEST["categId"]); } else { $categs = array(); } -$smarty->assign('categId',$categs); +$smarty->assign('categId', $categs); $allrankings = array( array( diff --git a/validate-ajax.php b/validate-ajax.php index 573f97c02e7ebab72f7e8343d81122aa08e83dd8..0ae29ee7abef00d66a343bccbe3b8df55892e5ff 100644 --- a/validate-ajax.php +++ b/validate-ajax.php @@ -36,6 +36,6 @@ if (!in_array($_REQUEST['validator'], $validatorslib->available)) { $validatorslib->setInput($_REQUEST["input"]); $result = $validatorslib->validateInput($_REQUEST["validator"], $_REQUEST["parameter"], $_REQUEST["message"]); -header( 'Content-Type: application/json' ); -echo json_encode( $result ); +header('Content-Type: application/json'); +echo json_encode($result);