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 '