Web Analytics Made Easy -
StatCounter Can Anyone Help Me With This Query? - CodingForum

Announcement

Collapse
No announcement yet.

Can Anyone Help Me With This Query?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can Anyone Help Me With This Query?

    My friend gave me this mod for my board. It didnt come with a Query to run so i can use it. Everytime i try it get this message.
    [code]Table 'ibf_rpgban' does not exist. Would anyone possibly look over the file i attached and see if they can figure out the query? I would greatly appreciate it.
    Attached Files

  • #2
    Well do you have that table created in mysql?

    Comment


    • #3
      Nope lol. I know what table to create. Just dont know what query to run. To Help ya out im gonna post everything in the text doc.
      Code:
      INSTALL DOC!!!!!!!!!
      #########################################################################
      admin.php
      sources/Admin/admin_pages.php
      sources/RPG.php
      lang/en/lang_error.php
      Number of new files: 1
      New files:
      sources/Admin/ad_rpgban.php
      Info
      You can ban member's from the RPG, and add a reason why!
      Tips
      If you don't know:
      Under means place underneath, and Replace mean's replace with following 
      ------------------------------------------------------------------
      Step 1
      Open admin.php
      --------------------------------------------
      Find:
      -----------------------
      'additem'     => 'item', 
      -------------------------------------
      Under:
      -----------------------------------------
      'rpgban'     => 'rpgban', 
      =====================================================
      Step 2
      Open admin_pages.php
      Find:
      -----------------------------------------
      6 =>array( 'RPG Logs' , 'act=rpglog' ), 
      -----------------------------------
      Under:
      ========================
      7 =>array( 'RPG Ban Settings' , 'act=rpgban' ), 
      ----------------------------------
      Step 3
      Open RPG.php
      Find:
      -----------------------------------
      global $ibforums, $std, $print; 
      ----------------------------------
      Replace:
      ========================
      global $ibforums, $std, $print,$DB; 
      ----------------------------------
      Find:
      -------------------------  
      f(empty($this->member['id'])){
      $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_guests' ) );
      } 
      -----------------------------
      Under:
      -----------------------------------------
      $DB->query("SELECT * from ibf_rpgban where mem_id='".$this->member['id']."'");
      if($DB->get_num_rows() != 0){
      $std->Error( array( 'LEVEL' => 1, 'MSG' => 'rpg_banned' ) );
      } 
      --------------------------------------
      Find:
      ----------------------------------- 
      $DB->query("SELECT * FROM ibf_members where name='{$to}'");
      if(!$gto=$DB->fetch_row()){
      $std->Error( array( 'LEVEL' => 1, 'MSG' => 'member_notfound' ) );
      } 
      =========================
      Under:
      ============================
      
      $DB->query("SELECT * from ibf_rpgban where mem_id='{$member['id']}'");
      if($DB->get_num_rows() != 0){
      $std->Error( array( 'LEVEL' => 1, 'MSG' => 'rpgban' ) );
      } 
      ------------------------------------------------
      Find:
      ------------------------------------------------------
      if($tmem['claninv']==""){}else{
      $std->Error( array( 'LEVEL' => 1, 'MSG' => 'invall' ) );
      } 
      ------------------------------------------------
      Under:
      -----------------------------------------
      $DB->query("SELECT * from ibf_rpgban where mem_id='{$tmem['id']}'");
      if($DB->get_num_rows() != 0){
      $std->Error( array( 'LEVEL' => 1, 'MSG' => 'rpgban' ) );
      } 
      -------------------------------------------------
      Step 4
      
      Open lang_error.php
      
      Find:
      ---------------------------------------------
      <?php
      
      $lang = array ( 
      -------------------------------------
      Under: 
      ----------------------------------
      'rpg_banned' => "You cannot access the RPG, you have been suspended or banned!",
      'rpgban' => "This member is currently banned from the RPG", 
      -----------------------------------
      Completed
      ---------------------------------------------
      #########################################################################
      Ad-rpgban.php
      #########################################################################
      <?php
      
      // Ban member from Killer RPG v1.5
      
      
      $idx = new ad_rpgban();
      
      class ad_rpgban {
      function ad_rpgban(){
      global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
      $ADMIN->page_title = "Killer RPG Ban Settings";
      $ADMIN->page_detail = "Setup the ban features to stop certain members from using Killer RPG.";
      
      	switch($IN['code']){
      		default:
      			$this->ban_idx();
      		break;
      		case 'doban':
      			$this->ban_form($IN['re']);
      		break;
      		case 'bannow':
      			$this->ban();
      		break;
      		case 'editnow':
      			$this->edit();
      		break;
      		case 'rpgdelete':
      			$this->delete();
      		break;
      	}
      
      }
      
      function ban_idx(){
      		global $ADMIN, $SKIN, $DB, $IN;
      	$ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code'  , 'doban'  ),
      											  2 => array( 'act'   , 'rpgban'       ),
      											  3 => array( 're'     , 'add'            ),
      									     )      );
      
      	$SKIN->td_header[] = array( "&nbsp;"  , "40%" );
      	
      	$SKIN->td_header[] = array( "&nbsp;"  , "60%" );
      
      	$ADMIN->html .= $SKIN->start_table( "Ban Control" );
      	
      	$drop[0] = array( '0', 'Choose member' );
      
      	$DB->query("SELECT * from ibf_members order by name asc");
      	
      	while($cervio=$DB->fetch_row()){
      	$drop[] = array( $cervio['id'] , $cervio['name'] );
      	}
      	$ADMIN->html .= $SKIN->add_td_row( array( "<b>Member to ban</b>" ,  $SKIN->form_dropdown( "mem",
      																		$drop,
      												  						0
      												  					  ) ) );
      												 
      	$ADMIN->html .= $SKIN->end_form("Ban form");
      									 
      	$ADMIN->html .= $SKIN->end_table();
      
      	$SKIN->td_header[] = array( "Id" , "10%" );
      	$SKIN->td_header[] = array( "Member Id" , "20%" );
      	$SKIN->td_header[] = array( "Reason" , "50%" );
      	$SKIN->td_header[] = array( "Edit" , "10%" );
      	$SKIN->td_header[] = array( "Delete" , "10%" );
      
      	$ADMIN->html .= $SKIN->start_table("Banned members");
      	
      	$DB->query("SELECT * from ibf_rpgban ORDER by id desc");
      	while($banned=$DB->fetch_row()){
      	$ban_link="<a href='{$SKIN->base_url}&act=rpgban&code=doban&re=edit&id=".$banned['id']."'>Edit</a>";
      	$ban_dlink="<a href='{$SKIN->base_url}&act=rpgban&code=rpgdelete&id=".$banned['id']."'>Delete</a>";
      	$ADMIN->html .= $SKIN->add_td_row( array ( $banned['id'], $banned['mem_id'], $banned['reason'], $ban_link, $ban_dlink ) );
      	}
      
      	$ADMIN->html .= $SKIN->end_table();
      
      	$ADMIN->output();
      
      }
      
      function ban_form($type){
      	global $IN, $ADMIN, $SKIN, $DB;
      
      	if($type=="add"){
      	$ADMIN->page_title = "Banning member";
      	$ADMIN->page_detail = "Ban a member here.";
      	$ti = "Banning";
      	$reason="Abuse of RPG System";
      	$DB->query("SELECT * from ibf_members where id='".$IN['mem']."'");
      	$Mem=$DB->fetch_row();
      	$ADMIN->html .= $SKIN->start_form( array (
      								1 => array ( "code" , "bannow" ),
      								2 => array ( "act" , "rpgban" ),
      								3 => array ( "mem" , $IN['mem'] ),
      	) );
      	$button="Ban member";
      	}else if($type == "edit"){
      	$ADMIN->page_title = "Edit banned member";
      	$ADMIN->page_detail = "Edit the banned member";
      	$ti="Editing";
      	$DB->query("SELECT * from ibf_rpgban where id='".$IN['id']."'");
      	$xxxx=$DB->fetch_row(); // Lol, i could only think of xxxx ^_^
      	$reason = $xxxx['reason'];
      	$DB->query("SELECT * from ibf_members where id='".$xxxx['mem_id']."'");
      	$Mem=$DB->fetch_row();
      	$button="Edit banned member";
      	$ADMIN->html .= $SKIN->start_form( array (
      								1 => array ( "code" , "editnow" ),
      								2 => array ( "act" , "rpgban" ),
      								3 => array ( "id" , $IN['id'] ),
      	) );
      	}
      
      	$ADMIN->html .= $SKIN->start_table($ti);
      	
      	$ADMIN->html .= $SKIN->add_td_row( array( "Member" , $Mem['name'] ) );
      
      	$ADMIN->html .= $SKIN->add_td_row( array( "Reason" , $SKIN->form_textarea( "reason" , $reason ) ) );
      
      	$ADMIN->html .= $SKIN->end_form($button);
      
      	$ADMIN->html .= $SKIN->end_table();
      	
      	$ADMIN->output();
      
      }
      
      function ban(){
      	global $IN, $ADMIN, $SKIN, $DB;
      	
      	$DB->query("INSERT into ibf_rpgban (id,mem_id,reason) VALUES ('','".$IN['mem']."','".$IN['reason']."')");
      	$message="[Auto message, do not reply] - You have been banned from the RPG Area, unless the administrator decides you are ok for using the RPG again, you will are banned.";
      	$message.="
      
      	The reason you are banned is:
      
      	{$IN['reason']}";
      	$this->Send_PM("Banned", $message, $IN['mem']);
      	$ADMIN->done_screen("Member banned", "RPG Ban Control", "act=rpgban" );
      }
      
      function edit(){
      	global $DB, $IN, $ADMIN, $SKIN;
      
      	$DB->query("UPDATE ibf_rpgban SET reason='".$IN['reason']."'");
      
      	$ADMIN->done_screen("Edited ban" , "RPG Ban Control", "act=rpgban" );
      }
      
      function delete(){
      	global $DB, $IN, $ADMIN;
      
      	$DB->query("DELETE from ibf_rpgban WHERE id='".$IN['id']."'");
      
      	$ADMIN->done_screen("Delete ban" , "RPG Ban Control", "act=rpgban" );
      }
      
      function Send_PM($Title,$Message,$To){
      global $DB, $ibforums, $std, $print;
      // Member
      $DB->query("SELECT * FROM ibf_members where id='{$To}'");
      $member=$DB->fetch_row();
      $DB->query("SELECT MAX(msg_id) as message_id FROM ibf_messages");
      $auto_pm = $DB->fetch_row();
      $auto_pm_messageid = $auto_pm['message_id'] + 1;
      $current_time = time();
      $pm_message = str_replace("*username*",$in_username,$Message);
      $pm_subject = str_replace("*username*",$in_username,$Title);
      require "./sources/lib/post_parser.php";
      			   
      $this->parser = new post_parser();  
      $pm_message = $this->parser->convert( array( 'TEXT'    => $pm_message,
      'SMILIES' => 1,
      'CODE'    => $ibforums->vars['msg_allow_code'],
      'HTML'    => $ibforums->vars['msg_allow_html']
      )       );
      $pm_message = addslashes($pm_message);			
      $DB->query("INSERT INTO ibf_messages (msg_id,msg_date,read_state,title,message,from_id,vid,member_id,recipient_id,attach_type,attach_file,cc_users,tracking,read_date) VALUES  ('','{$current_time}','0','{$pm_subject}','{$pm_message}','1','in','{$To}','{$To}', 'NULL', 'NULL', 'NULL', '0', 'NULL')");
      $member['msg_msg_id'] = $auto_pm_messageid;
      $member['msg_total'] += 1;
      $member['show_popup'] = $ibforums->vars['show_pm_popup'];
      $DB->query("update ibf_members set msg_from_id='1',msg_msg_id='{$member['msg_msg_id']}',new_msg='1',msg_total=msg_total+'1',show_popup='1' where id='{$To}'");
      }
      
      }
      ?>

      Comment


      • #4
        whitefox from forumX right?

        they are instructions, follow them.
        php & asp tutorials - the birthplace - biorust - photoshop and web technologies

        Comment


        • #5
          Nope i think you have the wrong guy. But i did follow those instructions. And when i go to try to ban someone. It says Cannot Find Table 'ib_rpgban" so i put in the sql query
          Create table ibf_rpgban and it said somethign was wrong with my sqp syntax. So i was confused so i thought i would post it here hopefully thinkin someone would help me.

          Comment


          • #6
            Create table ibf_rpgban and it said somethign was wrong with my sqp syntax. So i was confused so i thought i would post it here hopefully thinkin someone would help me.
            If you would ask smart questions, then you probably would have been helped by now.

            The fact that "and it said somethign was wrong with my sqp syntax" isn't realy much to work on for us.

            Maybe post the executed sql-statement + the complete error that you got.

            (for a more elaborated manual on asking smart questions, check my sig)
            Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

            Comment


            • #7
              haha smartass that is what it said.Exactly what i posted. Man people are here are so rude it aint even funny. Man here is a new rule for all you jerks out there. IF YA AINT GOT SOMETHING NICE/IMPORTANT TO SAY ABOUT THE TOPIC. DONT SAY IT. You didnt help me what so ever. So dont post. dam i hate stupid people. oh and if i can quote myself i SAID
              Table 'ibf_rpgban' does not exist
              SO READ ABOVE.
              Last edited by XIWhiteFoxIX; Feb 24, 2004, 08:31 AM.

              Comment


              • #8
                Well there goes the help I was gonna give you out the window. Your childishness isn't worth the hassle

                Comment


                • #9
                  good. Im tired of people pointing me to that dam guidelines thing. I have read it over and over. I did what it says. and then not even readin my post. It has been there a week. I have asked for help on 2 questions. You guys are supposed to be geniuses. One i figured out on my own. Another one i guess i will have to do the same. Man if you are here to help people HELP THEM. dont point them to the stupid guidlines on smart posting. I SAID WHAT WAS WRONG 4 TIMES. are people that stupid to reconize the problem and suggest a solution? Or is it that hard to say well i dont get what you are talkin about. Instead os saying look at those stupid *** posting guidlines that dont do **** for the question i am asking. Man this board blows. All you guys do is sit here ask stupid questions and get post counts. TRY GETTING A LIFE!!!

                  Comment


                  • #10
                    I reread the complete thread and nowhere do i see a createstatement.

                    Maybe you just misunderstood but i was suggesting you post the executed create-statement + the error it returns, so that we can see what you're doing wrong.

                    I don't understand why you get that excited about my post. You obviously have lotts to learn about coding, accepted behaviour on forums and real life interpersonal relationships.

                    So i'll humour you and wount bother you anymore with my stupidity.
                    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

                    Comment

                    Working...
                    X