Auto Redirect Via Command

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

    Auto Redirect Via Command

    Ok, topic name says it all, well, i'm after an example code to redirect via a command..
    take the lavalair script for example..

    Just say i'm in the chatroom and i write a message.. something like "/adminl" instead of it going public for the chatroom users to see, i want it to redirect me to the admin list..

    like the lavalair script has the "/me" command what goes public, i want a command that will redirect me... like i said above..

    i know its not impossible to code it and it sounds quite easy but i just can't get my head around it.

    So any help with be much appreciated.


    #2
    probably wont be able to redirect you but you could pm yourself a list of admins, mods. newest member yadda yadda quite easily just like in a irc chat

    Comment


      #3
      probably wont be able to redirect you but you could pm yourself a list of admins, mods. newest member yadda yadda quite easily just like in a irc chat[/b]
      Ok Amy, Thank You.

      Comment


        #4
        when posting message check if it contains /admin, if it does user header('location:page.php'); to redirect you else post message

        Comment


          #5
          and in page.php put codes to redirect the page to chat
          Code:
          <?php
          include("config.php");
          include("core.php");
          connectdb();
          $action = $_GET[&#39;action&#39;];
          $sid = $_GET["sid"];
          $page = $_GET["page"];
          $who = $_GET["who"];
          $uid = getuid_sid($sid);
          header("Content-type: text/vnd.wap.wml");
          header("Cache-Control: no-cache, must-revalidate");          
          header("Pragma: no-cache");
          print "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
          echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
          ?>
          <wml>
          <head>
             <meta http-equiv="refresh" 
                   content="10; url=http://www.google.com" />
            </head>
          <?php
          if(islogged($sid)==false)
          {
              echo "<card id=\"main\" title=\"$sitename\">";
                echo "<p align=\"center\">";
                echo "You are not logged in
          ";
                echo "Or Your session has been expired
          
          ";
                echo "<a href=\"index.php\">Login</a>";
                echo "</p>";
                echo "</card>";
                echo "</wml>";
                exit();
          }
          $uid = getuid_sid($sid);
          if(isbanned($uid))
              {
                  echo "<card id=\"main\" title=\"$sitename\">";
                echo "<p align=\"center\">";
                echo "<img src=\"images/notok.gif\" alt=\"x\"/>
          ";
                echo "You are [b]Banned[/b]
          ";
                $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE uid=&#39;".$uid."&#39; AND penalty=&#39;1&#39;"));
                $remain = $banto[0]- time();
                $rmsg = gettimemsg($remain);
                echo "Time to finish your penalty: $rmsg
          
          ";
                //echo "<a href=\"index.php\">Login</a>";
                echo "</p>";
                echo "</card>";
                echo "</wml>";
                exit();
              }
          if($action=="stfol")
          {
          
            addonline(getuid_sid($sid),"Wheres The Staff","");
              echo "<card id=\"main\" title=\"Staff Online\">";
          
          
            //////ALL LISTS SCRIPT <<
          
              if($page=="" || $page<=0)$page=1;
              $timeout = 180;
            $timeon = time()-$timeout;
            $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE perm>&#39;0&#39; AND lastact>&#39;".$timeon."&#39;"));
              $num_items = $noi[0]; //changable
              $items_per_page= 10;
              $num_pages = ceil($num_items/$items_per_page);
              if($page>$num_pages)$page= $num_pages;
              $limit_start = ($page-1)*$items_per_page;
              if($limit_start<0)$limit_start=0;
              //changable sql
              $sql = "
              SELECT name, perm, id FROM ibwf_users WHERE perm>&#39;0&#39; AND lastact>&#39;".$timeon."&#39;
                      LIMIT $limit_start, $items_per_page
              ";
              echo "
          
          [size="1"]";
              $items = mysql_query($sql);
              echo mysql_error();
              while ($item = mysql_fetch_array($items))
              {
                $lnk = "<a href=\"index.php?action=viewuser&amp;who=$item[2]&amp;sid=$sid\">$item[0]</a>";
                if($item[1]==1)
                {
                  $item[1] = "Mod";
                }else if($item[1]==2)
                {
                  $item[1] = "Admin";
                }
                echo "$lnk - $item[1] 
          ";
              }
              echo "[/size]</p>";
              echo "<p align=\"center\">";
              if($page>1)
              {
                $ppage = $page-1;
                echo "<a href=\"page.php?action=$action&amp;page=$ppage&amp;sid=$sid\">«PREV</a> ";
              }
              if($page<$num_pages)
              {
                $npage = $page+1;
                echo "<a href=\"page.php?action=$action&amp;page=$npage&amp;sid=$sid\">Next»</a>";
              }
              echo "
          $page/$num_pages
          ";
              if($num_pages>2)
              {
                echo getjumper($action, $sid,"index");
              }
              echo "</p>";
            ////// UNTILL HERE >>
          
            echo "<p align=\"center\">";
            echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
          echo "Home</a>";
            echo "</p>";
            echo "</card>";
          }
          else
          {
            addonline(getuid_sid($sid),"Lost in staff list lol","");
            echo "<card id=\"main\" title=\"Games(error)\">";
            echo "<p align=\"center\">";
            echo "I don&#39;t know how did you get into here, but there&#39;s nothing to show
          
          ";
            echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
            echo "</p></card>";
          }
          ?>
          </wml>
          just change www.google.com to chat.php with sid,rid

          Comment


            #6
            Thank you, got it sorted now :-)

            Comment

            Working...
            X