mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
Switch table naming vars to constants
git-svn-id: file:///svn/phpbb/trunk@21 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
acfee8f3f1
commit
8f193b2a39
5 changed files with 34 additions and 34 deletions
|
@ -65,31 +65,31 @@ $session_cookie_time = 3600;
|
|||
// DB connection config
|
||||
$dbms = "mysql";
|
||||
$dbhost = "localhost";
|
||||
$dbname = "mydbname";
|
||||
$dbuser = "imanidiot";
|
||||
$dbpasswd = "imanidiotspassword";
|
||||
$dbname = "phpbb";
|
||||
$dbuser = "iamstillanidiot";
|
||||
$dbpasswd = "iamstillanidiotspassword";
|
||||
|
||||
// Date format (needs to go into DB)
|
||||
$date_format = "M d, Y h:i:s a";
|
||||
|
||||
// DB table config
|
||||
$banlist_table = "phpbb_banlist";
|
||||
$categories_table = "phpbb_categories";
|
||||
$config_table = "phpbb_config";
|
||||
$disallow_table = "phpbb_disallow";
|
||||
$forum_access_table = "phpbb_forum_access";
|
||||
$forum_mods_table = "phpbb_forum_mods";
|
||||
$forums_table = "phpbb_forums";
|
||||
$headermetafooter_table = "phpbb_headermetafooter";
|
||||
$posts_table = "phpbb_posts";
|
||||
$posts_text_table = "phpbb_posts_text";
|
||||
$priv_msgs_table = "phpbb_priv_msgs";
|
||||
$ranks_table = "phpbb_ranks";
|
||||
$sessions_table = "phpbb_sessions";
|
||||
$themes_table = "phpbb_themes";
|
||||
$topics_table = "phpbb_topics";
|
||||
$users_table = "phpbb_users";
|
||||
$whosonline_table = "phpbb_whosonline";
|
||||
$words_table = "phpbb_words";
|
||||
define("BANLIST_TABLE", "phpbb_banlist");
|
||||
define("CATEGORIES_TABLE", "phpbb_categories");
|
||||
define("CONFIG_TABLE", "phpbb_config");
|
||||
define("DISALLOW_TABLE", "phpbb_disallow");
|
||||
define("FORUM_ACCESS_TABLE", "phpbb_forum_access");
|
||||
define("FORUM_MODS_TABLE", "phpbb_forum_mods");
|
||||
define("FORUMS_TABLE", "phpbb_forums");
|
||||
define("HEADERMETAFOOTER_TABLE", "phpbb_headermetafooter");
|
||||
define("POSTS_TABLE", "phpbb_posts");
|
||||
define("POSTS_TEXT_TABLE", "phpbb_posts_text");
|
||||
define("PRIV_MSGS_TABLE", "phpbb_priv_msgs");
|
||||
define("RANKS_TABLE", "phpbb_ranks");
|
||||
define("SESSIONS_TABLE", "phpbb_sessions");
|
||||
define("THEMES_TABLE", "phpbb_themes");
|
||||
define("TOPICS_TABLE", "phpbb_topics");
|
||||
define("USERS_TABLE", "phpbb_users");
|
||||
define("WHOSONLINE_TABLE", "phpbb_whosonline");
|
||||
define("WORDS_TABLE", "phpbb_words");
|
||||
|
||||
?>
|
||||
|
|
|
@ -56,7 +56,7 @@ $logged_in = 0;
|
|||
$userdata = Array();
|
||||
|
||||
// Setup forum wide options.
|
||||
$sql = "SELECT * FROM $config_table WHERE selected = 1";
|
||||
$sql = "SELECT * FROM ".CONFIG_TABLE." WHERE selected = 1";
|
||||
if(!$result = $db->sql_query($sql))
|
||||
{
|
||||
error_die($db, QUERY_ERROR);
|
||||
|
|
|
@ -46,11 +46,11 @@ function auth($type,
|
|||
switch($type)
|
||||
{
|
||||
case 'ip ban':
|
||||
$sql = "DELETE FROM $banlist_table
|
||||
$sql = "DELETE FROM ".BANLIST_TABLE."
|
||||
WHERE (ban_end < ". mktime(date("H"), date("i"), date("s"), date("m"), date("d"), date("Y")).")
|
||||
AND (ban_end > 0)";
|
||||
$db->sql_query($sql);
|
||||
$sql = "SELECT ban_ip FROM $banlist_table";
|
||||
$sql = "SELECT ban_ip FROM ".BANLIST_TABLE;
|
||||
if($result = $db->sql_query($sql))
|
||||
{
|
||||
if($totalrows = $db->sql_numrows())
|
||||
|
@ -92,11 +92,11 @@ function auth($type,
|
|||
return(TRUE);
|
||||
break;
|
||||
case 'username ban':
|
||||
$sql = "DELETE FROM $banlist_table
|
||||
$sql = "DELETE FROM ".BANLIST_TABLE."
|
||||
WHERE (ban_end < ". mktime(date("H"), date("i"), date("s"), date("m"), date("d"), date("Y")).")
|
||||
AND (ban_end > 0)";
|
||||
$db->sql_query($sql);
|
||||
$sql = "SELECT ban_userid FROM $banlist_table WHERE ban_userid = '$user_id'";
|
||||
$sql = "SELECT ban_userid FROM ".BANLIST_TABLE." WHERE ban_userid = '$user_id'";
|
||||
if($result = $db->sql_query($sql))
|
||||
{
|
||||
if($db->sql_numrows())
|
||||
|
@ -124,7 +124,7 @@ function auth($type,
|
|||
function get_userdata_from_id($userid, $db)
|
||||
{
|
||||
|
||||
$sql = "SELECT * FROM $users_table WHERE user_id = $userid";
|
||||
$sql = "SELECT * FROM ".USERS_TABLE." WHERE user_id = $userid";
|
||||
if(!$result = $db->sql_query($sql))
|
||||
{
|
||||
$userdata = array("error" => "1");
|
||||
|
|
|
@ -38,7 +38,7 @@ function new_session($userid, $remote_ip, $lifespan, $db)
|
|||
$currtime = (string) (time());
|
||||
$expirytime = (string) (time() - $lifespan);
|
||||
|
||||
$deleteSQL = "DELETE FROM $sessions_tables WHERE (start_time < $expirytime)";
|
||||
$deleteSQL = "DELETE FROM ".SESSIONS_TABLE." WHERE (start_time < $expirytime)";
|
||||
$delresult = $db->sql_query($deleteSQL);
|
||||
|
||||
if (!$delresult)
|
||||
|
@ -46,7 +46,7 @@ function new_session($userid, $remote_ip, $lifespan, $db)
|
|||
error_die($db, SESSION_CREATE);
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO $sessions_table (sess_id, user_id, start_time, remote_ip) VALUES ($sessid, $userid, $currtime, '$remote_ip')";
|
||||
$sql = "INSERT INTO ".SESSIONS_TABLE." (sess_id, user_id, start_time, remote_ip) VALUES ($sessid, $userid, $currtime, '$remote_ip')";
|
||||
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
|
@ -86,7 +86,7 @@ function get_userid_from_session($sessid, $cookietime, $remote_ip, $db)
|
|||
{
|
||||
$mintime = time() - $cookietime;
|
||||
$sql = "SELECT user_id
|
||||
FROM $sessions_table
|
||||
FROM ".SESSIONS_TABLE."
|
||||
WHERE (sess_id = $sessid)
|
||||
AND (start_time > $mintime)
|
||||
AND (remote_ip = '$remote_ip')";
|
||||
|
@ -113,7 +113,7 @@ function update_session_time($sessid, $db)
|
|||
{
|
||||
|
||||
$newtime = (string) time();
|
||||
$sql = "UPDATE $sessions_table SET start_time=$newtime WHERE (sess_id = $sessid)";
|
||||
$sql = "UPDATE ".SESSIONS_TABLE." SET start_time=$newtime WHERE (sess_id = $sessid)";
|
||||
$result = $db->sql_query($sql);
|
||||
if (!$result)
|
||||
{
|
||||
|
@ -126,7 +126,7 @@ function update_session_time($sessid, $db)
|
|||
|
||||
function end_user_session($userid, $db)
|
||||
{
|
||||
$sql = "DELETE FROM $sessions_table WHERE (user_id = $userid)";
|
||||
$sql = "DELETE FROM ".SESSIONS_TABLE." WHERE (user_id = $userid)";
|
||||
$result = $db->sql_query($sql, $db);
|
||||
if (!$result)
|
||||
{
|
||||
|
|
|
@ -41,7 +41,7 @@ include('page_header.'.$phpEx);
|
|||
$template->set_block("body", "catrow", "cats");
|
||||
$template->set_block("catrow", "forumrow", "forums");
|
||||
|
||||
$sql = "SELECT * FROM $categories_table ORDER BY cat_order";
|
||||
$sql = "SELECT * FROM ".CATEGORIES_TABLE." ORDER BY cat_order";
|
||||
if(!$result = $db->sql_query($sql))
|
||||
{
|
||||
error_die($db, QUERY_ERROR);
|
||||
|
@ -57,7 +57,7 @@ if($total_rows)
|
|||
"PHP_SELF" => $PHP_SELF,
|
||||
"CAT_DESC" => stripslashes($rows[$x]["cat_title"])));
|
||||
|
||||
$sub_sql = "SELECT f.* FROM $forums_table f WHERE f.cat_id = '".$rows[$x]["cat_id"]."' ORDER BY forum_id";
|
||||
$sub_sql = "SELECT f.* FROM ".FORUMS_TABLE." f WHERE f.cat_id = '".$rows[$x]["cat_id"]."' ORDER BY forum_id";
|
||||
if(!$sub_result = $db->sql_query($sub_sql))
|
||||
{
|
||||
error_die($db, QUERY_ERROR);
|
||||
|
|
Loading…
Add table
Reference in a new issue