Auto Redirect Via Command

Started on the old forum in May 2008 · view the original in the archive · old links redirect here

5 replies · 934 views · started 18 years ago · 1 min read

4 participants
WhiteWarrior Principal · 1,419 posts #1

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.

External image (may be gone)

amylee Principal · 1,092 posts #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

WhiteWarrior Principal · 1,419 posts #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

Ok Amy, Thank You.

wizard Senior · 493 posts #4

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

rukiya Lead · 569 posts #5

and in page.php put codes to redirect the page to chat

<?php
include("config.php");
include("core.php");
connectdb();
$action = $_GET['action'];
$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='".$uid."' AND penalty='1'"));
      $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>'0' AND lastact>'".$timeon."'"));
    $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>'0' AND lastact>'".$timeon."'
            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&who=$item[2]&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&page=$ppage&sid=$sid\">«PREV</a> ";
    }
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"page.php?action=$action&page=$npage&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&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't know how did you get into here, but there's nothing to show

";
  echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
  echo "</p></card>";
}
?>
</wml>

just change http://www.google.com to chat.php with sid,rid

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close