@@ -249,7 +249,7 @@ function get_admin_ids()
249249function set_default_user ()
250250{
251251 global $ db , $ db_type , $ feather_config ;
252-
252+
253253 // Get Slim current session
254254 $ feather = \Slim \Slim::getInstance ();
255255
@@ -258,19 +258,19 @@ function set_default_user()
258258 // Fetch guest user
259259 $ select_set_default_user = array ('u.* ' , 'g.* ' , 'o.logged ' , 'o.last_post ' , 'o.last_search ' );
260260 $ where_set_default_user = array ('u.id ' => '1 ' );
261-
261+
262262 $ result = ORM ::for_table ($ feather ->prefix .'users ' )
263263 ->table_alias ('u ' )
264264 ->select_many ($ select_set_default_user )
265265 ->inner_join ($ feather ->prefix .'groups ' , array ('u.group_id ' , '= ' , 'g.g_id ' ), 'g ' )
266266 ->left_outer_join ($ feather ->prefix .'online ' , array ('o.ident ' , '= ' , $ remote_addr ), 'o ' , true )
267267 ->where ($ where_set_default_user )
268268 ->find_result_set ();
269-
269+
270270 if (!$ result ) {
271271 exit ('Unable to fetch guest information. Your database must contain both a guest user and a guest user group. ' );
272272 }
273-
273+
274274 foreach ($ result as $ feather ->user );
275275
276276 // Update online list
@@ -353,7 +353,7 @@ function forum_setcookie($name, $value, $expire)
353353function check_bans ()
354354{
355355 global $ db , $ feather_config , $ lang_common , $ feather_bans ;
356-
356+
357357 // Get Slim current session
358358 $ feather = \Slim \Slim::getInstance ();
359359
@@ -470,7 +470,7 @@ function check_username($username, $errors, $exclude_id = null)
470470 break ;
471471 }
472472 }
473-
473+
474474 return $ errors ;
475475}
476476
@@ -486,11 +486,11 @@ function update_users_online()
486486
487487 // Fetch all online list entries that are older than "o_timeout_online"
488488 $ select_update_users_online = array ('user_id ' , 'ident ' , 'logged ' , 'idle ' );
489-
489+
490490 $ result = \ORM ::for_table ($ db ->prefix .'online ' )->select_many ($ select_update_users_online )
491491 ->where_lt ('logged ' , $ now -$ feather_config ['o_timeout_online ' ])
492492 ->find_many ();
493-
493+
494494 foreach ($ result as $ cur_user ) {
495495 // If the entry is a guest, delete it
496496 if ($ cur_user ['user_id ' ] == '1 ' ) {
@@ -608,20 +608,20 @@ function get_tracked_topics()
608608function update_forum ($ forum_id )
609609{
610610 global $ db ;
611-
611+
612612 $ stats_query = \ORM ::for_table ($ db ->prefix .'topics ' )
613613 ->where ('forum_id ' , $ forum_id )
614614 ->select_expr ('COUNT(id) ' , 'total_topics ' )
615615 ->select_expr ('SUM(num_replies) ' , 'total_replies ' )
616616 ->find_one ();
617-
617+
618618 $ num_topics = intval ($ stats_query ['total_topics ' ]);
619619 $ num_replies = intval ($ stats_query ['total_replies ' ]);
620620
621621 $ num_posts = $ num_replies + $ num_topics ; // $num_posts is only the sum of all replies (we have to add the topic posts)
622622
623623 $ select_update_forum = array ('last_post ' , 'last_post_id ' , 'last_poster ' );
624-
624+
625625 $ result = \ORM ::for_table ($ db ->prefix .'topics ' )->select_many ($ select_update_forum )
626626 ->where ('forum_id ' , $ forum_id )
627627 ->where_null ('moved_to ' )
@@ -679,7 +679,7 @@ function delete_avatar($user_id)
679679function delete_topic ($ topic_id )
680680{
681681 global $ db ;
682-
682+
683683 // Delete the topic and any redirect topics
684684 $ where_delete_topic = array (
685685 array ('id ' => $ topic_id ),
@@ -875,7 +875,7 @@ function paginate($num_pages, $cur_page, $link, $args = null)
875875 if ($ num_pages > 1 && $ cur_page > 1 ) {
876876 $ pages [] = '<a rel="prev" ' .(empty ($ pages ) ? ' class="item1" ' : '' ).' href=" ' .get_sublink ($ link , 'page/$1 ' , ($ cur_page - 1 ), $ args ).'"> ' .$ lang_common ['Previous ' ].'</a> ' ;
877877 }
878-
878+
879879 if ($ cur_page > 3 ) {
880880 $ pages [] = '<a ' .(empty ($ pages ) ? ' class="item1" ' : '' ).' href=" ' .$ link .'">1</a> ' ;
881881
@@ -985,7 +985,7 @@ function message($message, $no_back_link = false, $http_status = null, $dontStop
985985 if (!is_null ($ http_status )) {
986986 header ('HTTP/1.1 ' . $ http_status );
987987 }
988-
988+
989989 // Get Slim current session
990990 $ feather = \Slim \Slim::getInstance ();
991991
@@ -999,7 +999,7 @@ function message($message, $no_back_link = false, $http_status = null, $dontStop
999999 require_once FEATHER_ROOT .'controller/header.php ' ;
10001000
10011001 $ feather ->config ('templates.path ' , get_path_view ());
1002-
1002+
10031003 $ header = new \controller \header ();
10041004
10051005 $ header ->setTitle ($ page_title )->display ();
@@ -1011,7 +1011,7 @@ function message($message, $no_back_link = false, $http_status = null, $dontStop
10111011 'no_back_link ' => $ no_back_link ,
10121012 )
10131013 );
1014-
1014+
10151015 require_once FEATHER_ROOT .'controller/footer.php ' ;
10161016
10171017 $ footer = new \controller \footer ();
@@ -1034,7 +1034,7 @@ function format_time($timestamp, $date_only = false, $date_format = null, $time_
10341034 if ($ timestamp == '' ) {
10351035 return $ lang_common ['Never ' ];
10361036 }
1037-
1037+
10381038 // Get Slim current session
10391039 $ feather = \Slim \Slim::getInstance ();
10401040
@@ -1178,7 +1178,7 @@ function feather_hash($str)
11781178function get_remote_address ()
11791179{
11801180 $ feather = \Slim \Slim::getInstance ();
1181-
1181+
11821182 $ remote_addr = $ feather ->request ->getIp ();
11831183
11841184 return $ remote_addr ;
@@ -1749,7 +1749,7 @@ function display_saved_queries()
17491749 <?php
17501750 ++$ i ;
17511751 }
1752-
1752+
17531753 // TODO: To be removed
17541754 foreach ($ saved_queries as $ cur_query ) {
17551755 $ query_time_total += $ cur_query [1 ];
@@ -1783,7 +1783,7 @@ function get_path_view($file = null)
17831783{
17841784 // Get Slim current session
17851785 $ feather = \Slim \Slim::getInstance ();
1786-
1786+
17871787 if ($ file && is_file ('style/ ' .$ feather ->user ->style )) {
17881788 return FEATHER_ROOT .'style/ ' .$ feather ->user ->style .'/view ' ;
17891789 }
@@ -1805,7 +1805,7 @@ function url_friendly($str)
18051805 $ str = strtr ($ str , $ url_replace );
18061806 $ str = strtolower (utf8_decode ($ str ));
18071807 $ str = feather_trim (preg_replace (array ('/[^a-z0-9\s]/ ' , '/[\s]+/ ' ), array ('' , '- ' ), $ str ), '- ' );
1808-
1808+
18091809 if (empty ($ str )) {
18101810 $ str = 'view ' ;
18111811 }
0 commit comments