Changeset 374 for minimanager/forum.php


Ignore:
Timestamp:
Sep 11, 2008, 9:10:27 AM (16 years ago)
Author:
george
Message:
  • Aktualizováno: Minimanager 0.12 rev. 99. Opraveno zobrazování honoru, přidána captcha p?i registraci nového účtu a mini fórum.
  • Přidáno: Český překlad pro Minimanager 0.12.
  • Smazáno: Staré fotky fyzického serveru přesunuty do fotogalerie.
  • Přidáno: Nějaké návody na eventy od bbtrashe.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • minimanager/forum.php

    r307 r374  
    9393require_once("scripts/forum.conf.php");
    9494require_once("scripts/extra_lib.php");
    95 valid_login(0);
     95valid_login($action_permission['read']);
    9696
    9797if (isset($_COOKIE["lang"])){
    9898        $forumlang = $_COOKIE["lang"];
    99         if (!file_exists("lang/Forum_$forumlang.php")) $forumlang = $language;
     99        if (!file_exists("lang/forum_$forumlang.php")) $forumlang = $language;
    100100        } else $forumlang = $language;
    101 require_once("lang/Forum_$forumlang.php");
     101require_once("lang/forum_$forumlang.php");
    102102
    103103foreach($forum_skeleton as $cid => $category){
     
    118118// #######################################################################################################
    119119function forum_index(){
    120         global $enablesidecheck, $forum_skeleton, $forum_lang, $user_lvl, $output, $realm_db;
     120        global $enablesidecheck, $forum_skeleton, $forum_lang, $user_lvl, $output, $realm_db, $mmfpm_db;
    121121        if($enablesidecheck)
    122122        $side = get_side();
    123123    $mysql = new SQL;
    124     $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    125     $result = $mysql->query("SELECT `authorname`,`id`,`name`,`time`,`forum` FROM `posts` WHERE `id` IN (SELECT MAX(`id`) FROM `posts` GROUP BY `forum`) ORDER BY `forum`;");
     124    $mysql->connect($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass'], $mmfpm_db['name']);
     125    $result = $mysql->query("SELECT `authorname`,`id`,`name`,`time`,`forum` FROM `forum_posts` WHERE `id` IN (SELECT MAX(`id`) FROM `forum_posts` GROUP BY `forum`) ORDER BY `forum`;");
    126126    $lasts = array();
    127127    if($mysql->num_rows($result) > 0){
     
    154154                }
    155155            }
    156             $totaltopics = $mysql->query("SELECT id FROM posts WHERE forum = '$id' AND id = `topic`;");
     156            $totaltopics = $mysql->query("SELECT id FROM forum_posts WHERE forum = '$id' AND id = `topic`;");
    157157            $numtopics = $mysql->num_rows($totaltopics);
    158             $totalreplies = $mysql->query("SELECT id FROM posts WHERE forum = '$id';");
     158            $totalreplies = $mysql->query("SELECT id FROM forum_posts WHERE forum = '$id';");
    159159            $numreplies = $mysql->num_rows($totalreplies);
    160160            $output .= "<tr><td align=\"left\"><a href=\"forum.php?action=view_forum&amp;id=$id\">{$forum["name"]}</a><br />{$forum["desc"]}</td>
     
    179179// #######################################################################################################
    180180function forum_view_forum(){
    181         global $enablesidecheck, $forum_skeleton, $forum_lang, $maxqueries, $user_lvl, $output, $realm_db;
     181        global $enablesidecheck, $forum_skeleton, $forum_lang, $maxqueries, $user_lvl, $output, $mmfpm_db;
    182182        if($enablesidecheck) $side = get_side();
    183183        $mysql = new SQL;
    184         $link = $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     184        $link = $mysql->connect($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass'], $mmfpm_db['name']);
    185185        if(!isset($_GET["id"])) error($forum_lang["no_such_forum"]);
    186186        else $id = $mysql->quote_smart($_GET["id"]);
     
    216216        $output .= "<div class=\"top\"><h1>{$forum_lang["forums"]}</h1>{$forum_lang["you_are_here"]} : <a href=\"forum.php\">{$forum_lang["forum_index"]}</a> -> <a href=\"forum.php?action=view_forum&amp;id={$id}\">{$forum["name"]}</a></div>
    217217                                <center><table class=\"lined\">";
    218         $topics = $mysql->query("SELECT id, authorid, authorname, name, annouced, sticked, closed FROM posts WHERE (forum = '$id' AND id = `topic`) OR annouced = 1 AND id = `topic` ORDER BY annouced DESC, sticked DESC, lastpost DESC LIMIT $start, $maxqueries;");
    219         $result = $mysql->query("SELECT `topic` as curtopic,(SELECT count(`id`)-1 FROM posts WHERE `topic` = `curtopic`) AS replies,lastpost as curlastpost,(SELECT authorname FROM posts WHERE id = curlastpost) as authorname,(SELECT time FROM posts WHERE id = curlastpost) as time FROM `posts` WHERE (`forum` = $id AND `topic` = `id` ) OR annouced = 1;");
     218        $topics = $mysql->query("SELECT id, authorid, authorname, name, annouced, sticked, closed FROM forum_posts WHERE (forum = '$id' AND id = `topic`) OR annouced = 1 AND id = `topic` ORDER BY annouced DESC, sticked DESC, lastpost DESC LIMIT $start, $maxqueries;");
     219        $result = $mysql->query("SELECT `topic` as curtopic,(SELECT count(`id`)-1 FROM forum_posts WHERE `topic` = `curtopic`) AS replies,lastpost as curlastpost,(SELECT authorname FROM forum_posts WHERE id = curlastpost) as authorname,(SELECT time FROM forum_posts WHERE id = curlastpost) as time FROM `forum_posts` WHERE (`forum` = $id AND `topic` = `id` ) OR annouced = 1;");
    220220        $lasts = array();
    221221        if($mysql->num_rows($result) > 0){
     
    251251                                                </tr>";
    252252                }
    253                 $totaltopics = $mysql->query("SELECT id FROM posts WHERE forum = '$id' AND id = `topic`;"); //My page system is so roxing, i can' t break this query xD
     253                $totaltopics = $mysql->query("SELECT id FROM forum_posts WHERE forum = '$id' AND id = `topic`;"); //My page system is so roxing, i can' t break this query xD
    254254                $pages = ceil($mysql->num_rows($totaltopics)/$maxqueries);
    255255                $output .= "<tr><td align=\"right\" colspan=\"4\">{$forum_lang["pages"]} : ";
     
    271271function forum_view_topic(){
    272272
    273         global $enablesidecheck, $forum_skeleton, $forum_lang, $maxqueries, $user_lvl, $user_id, $output, $realm_db, $characters_db, $realm_id;
     273        global $enablesidecheck, $forum_skeleton, $forum_lang, $maxqueries, $user_lvl, $user_id, $output, $realm_db, $characters_db, $realm_id, $mmfpm_db;
    274274
    275275        if($enablesidecheck) $side = get_side(); // Better to use it here instead of call it many time in the loop :)
    276276
    277277        $mysql = new SQL;
    278         $link = $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     278        $link = $mysql->connect($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass'], $mmfpm_db['name']);
    279279
    280280        if(isset($_GET["id"])){
     
    297297
    298298        if(!$post){
    299                 $posts = $mysql->query("SELECT id,authorid,authorname,forum,name,text,time,annouced,sticked,closed FROM posts WHERE topic = '$id' ORDER BY id ASC LIMIT $start, $maxqueries;");
     299                $posts = $mysql->query("SELECT id,authorid,authorname,forum,name,text,time,annouced,sticked,closed FROM forum_posts WHERE topic = '$id' ORDER BY id ASC LIMIT $start, $maxqueries;");
    300300
    301301// Thx qsa for the query structure
     302
     303                $link = $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     304
    302305$query = "SELECT account,name,SUBSTRING_INDEX(SUBSTRING_INDEX(data,' ', 37),' ',-1) AS gen,race,class,
    303306SUBSTRING_INDEX(SUBSTRING_INDEX(data,' ',35),' ',-1) AS level,(SELECT gmlevel FROM `{$realm_db['name']}`.account WHERE `{$realm_db['name']}`.account.id = `{$characters_db[$realm_id]['name']}`.characters.account) as gmlevel
     
    454457                }
    455458
    456                 $link = $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    457 
    458                 $totalposts = $mysql->query("SELECT id FROM posts WHERE topic = '$id';");
     459                $link = $mysql->connect($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass'], $mmfpm_db['name']);
     460
     461                $totalposts = $mysql->query("SELECT id FROM forum_posts WHERE topic = '$id';");
    459462                $totalposts = $mysql->num_rows($totalposts);
    460463
     
    520523                $output .= "<div class=\"top\"><h1>Stand by...</h1></div>";
    521524
    522                 $post = $mysql->query("SELECT topic, id FROM posts WHERE id = '$id'"); // Get our post id
     525                $post = $mysql->query("SELECT topic, id FROM forum_posts WHERE id = '$id'"); // Get our post id
    523526                if($mysql->num_rows($post)==0)
    524527                        error($forum_lang["no_such_topic"]);
     
    527530                        redirect("forum.php?action=view_topic&id=$id");
    528531                $topic = $post[0];
    529                 $posts = $mysql->query("SELECT id FROM posts WHERE topic = '$topic';"); // Get posts in our topic
     532                $posts = $mysql->query("SELECT id FROM forum_posts WHERE topic = '$topic';"); // Get posts in our topic
    530533                $replies = $mysql->num_rows($posts);
    531534                if($replies==0)
     
    547550}
    548551function forum_do_edit_close(){
    549         global $forum_lang, $user_lvl, $realm_db;
    550         $mysql = new SQL;
    551         $link = $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     552        global $forum_lang, $user_lvl, $mmfpm_db;
     553        $mysql = new SQL;
     554        $link = $mysql->connect($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass'], $mmfpm_db['name']);
    552555
    553556        if($user_lvl == 0)
     
    560563        else $state = $mysql->quote_smart($_GET["state"]);
    561564
    562         $mysql->query("UPDATE posts SET closed = '$state' WHERE id = '$id'");
     565        $mysql->query("UPDATE forum_posts SET closed = '$state' WHERE id = '$id'");
    563566        $mysql->close();
    564567        redirect("forum.php?action=view_topic&id=$id");
     
    566569}
    567570function forum_do_edit_announce(){
    568         global $forum_lang, $user_lvl, $realm_db;
    569         $mysql = new SQL;
    570         $link = $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     571        global $forum_lang, $user_lvl, $mmfpm_db;
     572        $mysql = new SQL;
     573        $link = $mysql->connect($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass'], $mmfpm_db['name']);
    571574
    572575        if($user_lvl == 0)
     
    579582        else $state = $mysql->quote_smart($_GET["state"]);
    580583
    581         $mysql->query("UPDATE posts SET annouced = '$state' WHERE id = '$id'");
     584        $mysql->query("UPDATE forum_posts SET annouced = '$state' WHERE id = '$id'");
    582585        $mysql->close();
    583586        redirect("forum.php?action=view_topic&id=$id");
     
    585588}
    586589function forum_do_edit_stick(){
    587         global $forum_lang, $user_lvl, $realm_db;
    588         $mysql = new SQL;
    589         $link = $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     590        global $forum_lang, $user_lvl, $mmfpm_db;
     591        $mysql = new SQL;
     592        $link = $mysql->connect($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass'], $mmfpm_db['name']);
    590593
    591594        if($user_lvl == 0)
     
    598601        else $state = $mysql->quote_smart($_GET["state"]);
    599602
    600         $mysql->query("UPDATE posts SET sticked = '$state' WHERE id = '$id'");
     603        $mysql->query("UPDATE forum_posts SET sticked = '$state' WHERE id = '$id'");
    601604        $mysql->close();
    602605        redirect("forum.php?action=view_topic&id=$id");
     
    604607}
    605608function forum_delete_post(){
    606         global $enablesidecheck, $forum_skeleton, $forum_lang, $maxqueries, $user_lvl, $user_id, $output, $realm_db;
    607         $mysql = new SQL;
    608 
    609         $link = $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     609        global $enablesidecheck, $forum_skeleton, $forum_lang, $maxqueries, $user_lvl, $user_id, $output, $mmfpm_db;
     610        $mysql = new SQL;
     611
     612        $link = $mysql->connect($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass'], $mmfpm_db['name']);
    610613        if(!isset($_GET["id"])) error($forum_lang["no_such_post"]);
    611614        else $id = $mysql->quote_smart($_GET["id"]);
    612615
    613         $topic = $mysql->query("SELECT id,topic,authorid,forum FROM posts WHERE id = '$id';");
     616        $topic = $mysql->query("SELECT id,topic,authorid,forum FROM forum_posts WHERE id = '$id';");
    614617        if($mysql->num_rows($topic)==0) error($forum_lang["no_such_post"]);
    615618        $topic = $mysql->fetch_row($topic);
     
    617620        $fid = $topic[3];
    618621
    619         $topic2 = $mysql->query("SELECT name FROM posts WHERE id = '{$topic[1]}';");
     622        $topic2 = $mysql->query("SELECT name FROM forum_posts WHERE id = '{$topic[1]}';");
    620623        $name = $mysql->fetch_row($topic2);
    621624
     
    642645}
    643646function forum_do_delete_post(){
    644         global $forum_lang, $forum_skeleton, $maxqueries, $user_lvl, $user_id, $output, $realm_db;
    645 
    646         $mysql = new SQL;
    647         $link = $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     647        global $forum_lang, $forum_skeleton, $maxqueries, $user_lvl, $user_id, $output, $mmfpm_db;
     648
     649        $mysql = new SQL;
     650        $link = $mysql->connect($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass'], $mmfpm_db['name']);
    648651
    649652        if(!isset($_GET["id"])) error($forum_lang["no_such_post"]);
    650653        else $id = $mysql->quote_smart($_GET["id"]);
    651654
    652         $topic = $mysql->query("SELECT id,topic,name,authorid,forum FROM posts WHERE id = '$id';");
     655        $topic = $mysql->query("SELECT id,topic,name,authorid,forum FROM forum_posts WHERE id = '$id';");
    653656        if($mysql->num_rows($topic)==0) error($forum_lang["no_such_post"]);
    654657        $topic = $mysql->fetch_row($topic);
     
    657660
    658661        if($id==$topic[1]){
    659                 $mysql->query("DELETE FROM posts WHERE topic = '$id'");
     662                $mysql->query("DELETE FROM forum_posts WHERE topic = '$id'");
    660663                redirect("forum.php?action=view_forum&id=$fid");
    661664        }
    662665        else
    663666        {
    664                 $mysql->query("DELETE FROM posts WHERE id = '$id'");
    665                 $result = $mysql->query("SELECT id FROM posts WHERE topic = '{$topic[1]}' ORDER BY id DESC LIMIT 1;"); // get last post id
     667                $mysql->query("DELETE FROM forum_posts WHERE id = '$id'");
     668                $result = $mysql->query("SELECT id FROM forum_posts WHERE topic = '{$topic[1]}' ORDER BY id DESC LIMIT 1;"); // get last post id
    666669                $lastpostid = $mysql->fetch_row($result);
    667670                $lastpostid = $lastpostid[0];
    668                 $mysql->query("UPDATE posts SET lastpost = '$lastpostid' WHERE id = '{$topic[1]}'"); // update topic' s last post id
     671                $mysql->query("UPDATE forum_posts SET lastpost = '$lastpostid' WHERE id = '{$topic[1]}'"); // update topic' s last post id
    669672                redirect("forum.php?action=view_topic&id={$topic[1]}");
    670673        }
     
    673676
    674677function forum_add_topic(){
    675         global $enablesidecheck, $forum_lang, $forum_skeleton, $maxqueries, $minfloodtime, $user_lvl, $user_id, $output, $realm_db;
     678        global $enablesidecheck, $forum_lang, $forum_skeleton, $maxqueries, $minfloodtime, $user_lvl, $user_id, $output, $mmfpm_db;
    676679
    677680        if($enablesidecheck) $side = get_side(); // Better to use it here instead of call it many time in the loop :)
    678681        $mysql = new SQL;
    679         $link = $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     682        $link = $mysql->connect($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass'], $mmfpm_db['name']);
    680683
    681684        if($minfloodtime > 0)
    682685        {
    683                 $userposts = $mysql->query("SELECT time FROM posts WHERE authorid = '$user_id' ORDER BY id DESC LIMIT 1;");
     686                $userposts = $mysql->query("SELECT time FROM forum_posts WHERE authorid = '$user_id' ORDER BY id DESC LIMIT 1;");
    684687                if($mysql->num_rows($userposts) != 0)
    685688                {
     
    766769}
    767770function forum_do_add_topic(){
    768         global $enablesidecheck, $forum_skeleton, $forum_lang, $user_lvl, $user_name, $user_id, $realm_db, $minfloodtime;
     771        global $enablesidecheck, $forum_skeleton, $forum_lang, $user_lvl, $user_name, $user_id, $mmfpm_db, $minfloodtime;
    769772
    770773        if($enablesidecheck) $side = get_side(); // Better to use it here instead of call it many time in the loop :)
    771774
    772775        $mysql = new SQL;
    773         $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     776        $mysql->connect($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass'], $mmfpm_db['name']);
    774777
    775778
    776779        {
    777                 $userposts = $mysql->query("SELECT time FROM posts WHERE authorid = '$user_id' ORDER BY id DESC LIMIT 1;");
     780                $userposts = $mysql->query("SELECT time FROM forum_posts WHERE authorid = '$user_id' ORDER BY id DESC LIMIT 1;");
    778781                if($mysql->num_rows($userposts) != 0)
    779782                {
     
    839842        $time = date("m/d/y H:i:s");
    840843
    841         $mysql->query("INSERT INTO posts (authorid, authorname, forum, name, text, time) VALUES ('$user_id', '$user_name', '$forum', '$name', '$msg', '$time');");
     844        $mysql->query("INSERT INTO forum_posts (authorid, authorname, forum, name, text, time) VALUES ('$user_id', '$user_name', '$forum', '$name', '$msg', '$time');");
    842845        $id = $mysql->insert_id();
    843         $mysql->query("UPDATE posts SET topic = '$id', lastpost = '$id' WHERE id = '$id';");
     846        $mysql->query("UPDATE forum_posts SET topic = '$id', lastpost = '$id' WHERE id = '$id';");
    844847
    845848        $mysql->close();
     
    849852}
    850853function forum_do_add_post(){
    851         global $enablesidecheck, $forum_skeleton, $forum_lang, $minfloodtime, $user_lvl, $user_name, $user_id, $realm_db;
     854        global $enablesidecheck, $forum_skeleton, $forum_lang, $minfloodtime, $user_lvl, $user_name, $user_id, $mmfpm_db;
    852855
    853856        if($enablesidecheck) $side = get_side(); // Better to use it here instead of call it many time in the loop :)
    854857
    855858        $mysql = new SQL;
    856         $link = $link = $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     859        $link = $link = $mysql->connect($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass'], $mmfpm_db['name']);
    857860
    858861        if($minfloodtime > 0)
    859862        {
    860                 $userposts = $mysql->query("SELECT time FROM posts WHERE authorid = '$user_id' ORDER BY id DESC LIMIT 1;");
     863                $userposts = $mysql->query("SELECT time FROM forum_posts WHERE authorid = '$user_id' ORDER BY id DESC LIMIT 1;");
    861864                if($mysql->num_rows($userposts) != 0)
    862865                {
     
    912915        }
    913916
    914         $name = $mysql->query("SELECT name FROM posts WHERE id = '$topic';");
     917        $name = $mysql->query("SELECT name FROM forum_posts WHERE id = '$topic';");
    915918        $name = $mysql->fetch_row($name);
    916919        $name = $mysql->quote_smart($name[0]);
     
    918921        $time = date("m/d/y H:i:s");
    919922
    920         $mysql->query("INSERT INTO posts (authorid, authorname, forum, topic, name, text, time) VALUES ('$user_id', '$user_name', '$forum', $topic, '$name', '$msg', '$time');");
     923        $mysql->query("INSERT INTO forum_posts (authorid, authorname, forum, topic, name, text, time) VALUES ('$user_id', '$user_name', '$forum', $topic, '$name', '$msg', '$time');");
    921924        $id = @mysql_insert_id($link);
    922         $mysql->query("UPDATE posts SET lastpost = $id WHERE id = $topic;");
     925        $mysql->query("UPDATE forum_posts SET lastpost = $id WHERE id = $topic;");
    923926
    924927        $mysql->close();
     
    929932
    930933function forum_edit_post(){
    931         global $forum_skeleton, $forum_lang, $maxqueries, $minfloodtime, $user_lvl, $user_id, $output, $realm_db;
    932 
    933         $mysql = new SQL;
    934         $link = $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     934        global $forum_skeleton, $forum_lang, $maxqueries, $minfloodtime, $user_lvl, $user_id, $output, $mmfpm_db;
     935
     936        $mysql = new SQL;
     937        $link = $mysql->connect($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass'], $mmfpm_db['name']);
    935938
    936939        if(!isset($_GET["id"])) error($forum_lang["no_such_post"]);
    937940        else $id = $mysql->quote_smart($_GET["id"]);
    938941
    939         $post = $mysql->query("SELECT id,topic,authorid,forum,name,text FROM posts WHERE id = '$id';");
     942        $post = $mysql->query("SELECT id,topic,authorid,forum,name,text FROM forum_posts WHERE id = '$id';");
    940943        if($mysql->num_rows($post)==0) error($forum_lang["no_such_post"]);
    941944        $post = $mysql->fetch_row($post);
     
    10081011}
    10091012function forum_do_edit_post(){
    1010         global $forum_lang, $user_lvl, $user_name, $user_id, $realm_db;
    1011 
    1012         $mysql = new SQL;
    1013         $link = $link = $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     1013        global $forum_lang, $user_lvl, $user_name, $user_id, $mmfpm_db;
     1014
     1015        $mysql = new SQL;
     1016        $link = $link = $mysql->connect($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass'], $mmfpm_db['name']);
    10141017
    10151018        if(!isset($_POST['forum'])) error($forum_lang["no_such_forum"]);
     
    10451048//      $msg = str_replace('\r', '<br />', $msg);
    10461049
    1047         $result = $mysql->query("SELECT topic FROM posts WHERE id = $post;");
     1050        $result = $mysql->query("SELECT topic FROM forum_posts WHERE id = $post;");
    10481051        $topicid = $mysql->fetch_row($result);
    10491052
    1050         $mysql->query("UPDATE posts SET text = '$msg' WHERE id = $post;");
     1053        $mysql->query("UPDATE forum_posts SET text = '$msg' WHERE id = $post;");
    10511054
    10521055        if($topic == 1){
    1053                 $mysql->query("UPDATE posts SET name = '$name' WHERE topic = {$topicid[0]};");
    1054         }
    1055 
    1056         $result = $mysql->query("SELECT topic FROM posts WHERE id = $post;");
     1056                $mysql->query("UPDATE forum_posts SET name = '$name' WHERE topic = {$topicid[0]};");
     1057        }
     1058
     1059        $result = $mysql->query("SELECT topic FROM forum_posts WHERE id = $post;");
    10571060        $topicid = $mysql->fetch_row($result);
    10581061
     
    10631066
    10641067function forum_move_topic(){
    1065         global $forum_skeleton, $forum_lang, $maxqueries, $user_lvl, $user_id, $output, $realm_db;
    1066         $mysql = new SQL;
    1067 
    1068         $link = $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     1068        global $forum_skeleton, $forum_lang, $maxqueries, $user_lvl, $user_id, $output, $mmfpm_db;
     1069        $mysql = new SQL;
     1070
     1071        $link = $mysql->connect($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass'], $mmfpm_db['name']);
    10691072        if(!isset($_GET["id"])) error($forum_lang["no_such_topic"]);
    10701073        else $id = $mysql->quote_smart($_GET["id"]);
    10711074
    1072         $topic = $mysql->query("SELECT id,topic,authorid,forum, name FROM posts WHERE id = '$id';");
     1075        $topic = $mysql->query("SELECT id,topic,authorid,forum, name FROM forum_posts WHERE id = '$id';");
    10731076        //                                                              0       1               2               3         4
    10741077        if($mysql->num_rows($topic)==0) error($forum_lang["no_such_topic"]);
     
    11081111}
    11091112function forum_do_move_topic(){
    1110         global $forum_lang, $forum_skeleton, $maxqueries, $user_lvl, $user_id, $output, $realm_db;
    1111 
    1112         $mysql = new SQL;
    1113         $link = $mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     1113        global $forum_lang, $forum_skeleton, $maxqueries, $user_lvl, $user_id, $output, $mmfpm_db;
     1114
     1115        $mysql = new SQL;
     1116        $link = $mysql->connect($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass'], $mmfpm_db['name']);
    11141117
    11151118        if(!isset($_POST['forum'])) error($forum_lang["no_such_forum"]);
     
    11181121        else $id = $mysql->quote_smart($_POST['id']);
    11191122
    1120         $mysql->query("UPDATE posts SET forum = '$forum' WHERE topic = '$id'"); // update topic' s last post id
     1123        $mysql->query("UPDATE forum_posts SET forum = '$forum' WHERE topic = '$id'"); // update topic' s last post id
    11211124        redirect("forum.php?action=view_topic&id=$id");
    11221125        // Queries : 1
Note: See TracChangeset for help on using the changeset viewer.