diff options
author | James Atkinson <thefinn@users.sourceforge.net> | 2001-05-27 03:11:27 +0000 |
---|---|---|
committer | James Atkinson <thefinn@users.sourceforge.net> | 2001-05-27 03:11:27 +0000 |
commit | 9889b8ba53ca33e81b8731d52960bf5c5057be00 (patch) | |
tree | 186b3b2f5b56bf476f954434491baf33ad0f2f6c /phpBB/includes/functions.php | |
parent | 1fc155f93d658c8d390a7edd8182262c10549d51 (diff) | |
download | forums-9889b8ba53ca33e81b8731d52960bf5c5057be00.tar forums-9889b8ba53ca33e81b8731d52960bf5c5057be00.tar.gz forums-9889b8ba53ca33e81b8731d52960bf5c5057be00.tar.bz2 forums-9889b8ba53ca33e81b8731d52960bf5c5057be00.tar.xz forums-9889b8ba53ca33e81b8731d52960bf5c5057be00.zip |
More work on posting. Editing now works. Also replies can have subjects.
git-svn-id: file:///svn/phpbb/trunk@336 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 95ee824bea..4b77f1ee91 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -28,7 +28,7 @@ function get_db_stat($mode) switch($mode){ case 'postcount': - $sql = "SELECT count(*) AS total + $sql = "SELECT count(*) AS total FROM ".POSTS_TABLE; break; @@ -44,12 +44,12 @@ function get_db_stat($mode) FROM ".USERS_TABLE." WHERE user_id <> " . ANONYMOUS. " AND user_level <> ". DELETED ." - ORDER BY user_id DESC + ORDER BY user_id DESC LIMIT 1"; break; case 'usersonline': - $sql = "SELECT COUNT(*) AS online + $sql = "SELECT COUNT(*) AS online FROM ".SESSIONS_TABLE; break; } @@ -154,7 +154,7 @@ function init_userprefs($userdata) { $theme = setuptheme($userdata['user_theme']); } - else + else { $theme = setuptheme($board_config['default_theme']); } @@ -208,10 +208,10 @@ function setuptheme($theme) { global $db; - $sql = "SELECT * - FROM ".THEMES_TABLE." + $sql = "SELECT * + FROM ".THEMES_TABLE." WHERE themes_id = $theme"; - + if(!$result = $db->sql_query($sql)) { return(0); @@ -234,14 +234,14 @@ function generate_activation_key() $max_elements = count($chars) - 1; srand((double)microtime()*1000000); - + $act_key = ''; for($i = 0; $i < 8; $i++) { $act_key .= $chars[rand(0,$max_elements)]; } $act_key_md = md5($act_key); - + return($act_key_md); } @@ -276,7 +276,8 @@ function create_date($format, $gmepoch, $tz) // function get_gmt_ts() { - return(gmmktime(gmdate("H, i, s, m, d, Y"))); + $time = time(); + return($time); } // @@ -287,7 +288,7 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add { global $l_prevpage, $l_nextpage; - + $total_pages = ceil($num_items/$per_page); if($total_pages == 1) { @@ -321,7 +322,7 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add { $page_string_prepend .= "<a href=\"".append_sid($base_url."&start=".($i*$per_page))."\">" . ( ($i == 0) ? ($i+1) : $i) . " - " . ($i+9) . "</a>, "; } - + $page_string = $page_string_prepend . $page_string; } @@ -336,10 +337,10 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add $page_string_append .= ", "; } } - + $page_string .= $page_string_append; } - + if($add_prevnext_text) { if($on_page > 1) |