shout box messages

Started on the old forum in June 2009 · view the original in the archive · old links redirect here

14 replies · 761 views · started 17 years ago · 1 min read

6 participants
brand Senior · 391 posts #1

any chance some one can help me soi can get my shoutbox to show 3 messages not just one i looked on my script and can not find where i change it so it shows 3 instead of one i'm using script thats like site link this is not my site i use coding like this and thanks to any one that can help me out it be great help iff some one can post the code here please

HELP THEM WHO HELPS YOU

External image (may be gone)

i only work on wapdesire v_2 coding only

brand Senior · 391 posts #3

i need the code not other scripts so if any one can post the code it be a great help thanks to any one who posts the code

HELP THEM WHO HELPS YOU

External image (may be gone)

i only work on wapdesire v_2 coding only

riderz Lead · 975 posts #4

I didnt say use that script i say download it and remove the code from there


Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

brand Senior · 391 posts #5

if any one can post the code it be a great help thanks to any one who posts the code

HELP THEM WHO HELPS YOU

External image (may be gone)

i only work on wapdesire v_2 coding only

brand Senior · 391 posts #6

if any one can post the code it be a great help thanks to any one who posts the code

i can not download any script as i'm on lynux thats why i'm asking for the code

HELP THEM WHO HELPS YOU

External image (may be gone)

i only work on wapdesire v_2 coding only

riderz Lead · 975 posts #7

i have posted the code sumwhere cant remember where mabe here


Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

riderz Lead · 975 posts #8

core.php

function getshoutbox($sid){
$shbox = "<small>";
$lshout = mysql_query("SELECT shout, shouter, id  FROM ibwf_shouts ORDER BY shtime DESC LIMIT 2");
while ($shots = mysql_fetch_array($lshout))
{
$shnick = getnick_uid($shots[1]);
if(isonline($shots[1])){
    $bulb="<img src=\"images/onl.gif\" alt=\"On\"/>";
}
else{
    $bulb="<img src=\"images/ofl.gif\" alt=\"Off\"/>";
}    
$shbox .= "$bulb<i><a href=\"index.php?action=viewuser&sid=$sid&who=$shots[1]\">".$shnick."</a></i>: ";
$fshout = htmlspecialchars($shots[0]);

$fshout = getsmilies($fshout);
$fshout = getbbcode($fshout, $sid);
$shbox .= $fshout;
//if (ismod(getuid_sid($sid))){
//$shbox .= ", <a href=\"modproc.php?action=delsh&sid=$sid&shid=$shots[2]\">delete</a>";
//}
$shbox .= "<br/>";
}
if (isshoutblocked(getuid_sid($sid))){
    $shbox .= "»post shout(Blocked!!)";
}else{
$shbox .= "<a href=\"lists.php?action=shouts&sid=$sid\">»post shout</a>";
}
$shbox .= "</small>";
return $shbox;
}
function getshouts($sid){
boxstart("Shoutbox");
$uid=getuid_sid($sid);
if(!isshoutblocked($uid)){
    echo getshoutbox($sid);
}
boxend();
}

genproc.php

//////////////////////////////////////////shout
else if($action=="shout")
{
  $shtxt = $_POST["shtxt"];
      if (isshoutblocked(getuid_sid($sid))){
echo "Your shoutbox access has been blocked by a moderator!!!<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">Main Menu</a></center>";
boxend();
echo "</font></body></html>";
exit();    
    }
      if ($shtxt==""){
echo "This seems to be a blank shout!!! Please go back and try again.<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">Main Menu</a></center>";
boxend();
getfooter($sid);
echo "</font></body></html>";
exit();    
}
   addonline(getuid_sid($sid),"Shouting","");
     $shtxt = $shtxt;
    //$uid = getuid_sid($sid);
    $shtm = time();
    $res = mysql_query("INSERT INTO ibwf_shouts SET shout='".$shtxt."', shouter='".$uid."', shtime='".$shtm."'");
    if($res)
    {
    $shts = mysql_fetch_array(mysql_query("SELECT shouts,plusses from ibwf_users WHERE id='".$uid."'"));
    $jshts = $shts[0]+1;
    $shpl = $shts[1]+1;
    $sql=mysql_query("UPDATE ibwf_users SET shouts='".$jshts."', plusses='".$shpl."' WHERE id='".$uid."'");
    echo "<img src=\"images/ok.gif\" alt=\"O\"/>Shout added successfully!";
    }else{
        echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error!";
    }
echo "<br/><br/><a href=\"lists.php?action=shouts&sid=$sid\">";
echo "Shouts</a>";
}

list.php

/////////////////////////////shouts
else if($action=="shouts")
{
  addonline(getuid_sid($sid),"Shouts","lists.php?action=$action");
boxstart("Shouts");
echo "Add shout(255 chars max):<br/><form action=\"genproc.php?action=shout&sid=$sid\" method=\"post\"><textarea id=\"inputText\" name=\"shtxt\"></textarea><br/>";
echo "<input id=\"inputButton\" type=\"submit\" value=\"Send\"/></form><br/>";
     $who = $_GET["who"];
     if($page=="" || $page<=0)$page=1;
     if($who=="")
     {
     $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts"));
     }else{
     $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts WHERE shouter='".$who."'"));
     }
     $num_items = $noi[0]; //changable
     $items_per_page= 10;
     $num_pages = ceil($num_items/$items_per_page);
     if(($page>$num_pages)&&$page!=1)$page= $num_pages;
     $limit_start = ($page-1)*$items_per_page;
      //changable sql
     if($who =="")
     {
         $sql = "SELECT id, shout, shouter, shtime  FROM ibwf_shouts ORDER BY shtime DESC LIMIT $limit_start, $items_per_page";
}else{
     $sql = "SELECT id, shout, shouter, shtime  FROM ibwf_shouts  WHERE shouter='".$who."'ORDER BY shtime DESC LIMIT $limit_start, $items_per_page";
}
      $items = mysql_query($sql);
     echo mysql_error();
     if(mysql_num_rows($items)>0)
     {
     while ($item = mysql_fetch_array($items))
     {
         $shnick = getnick_uid($item[2]);
    if(isonline($item[2])){
$iml = "<img src=\"images/onl.gif\" alt=\"+\"/>";
}else{
$iml = "<img src=\"images/ofl.gif\" alt=\"-\"/>";
}
        $sht = htmlspecialchars($item[1]);
         $shdt = date("d/m/Y h:i:s A", $item[3]+(addhours()));
        if(isadmin($item[2]))
       {$lnk = "$iml<a href=\"index.php?action=viewuser&who=$item[2]&sid=$sid\"><font color='red'>$shnick</font></a>: $shdt<br/><br/>".getbbcode(getsmilies($sht));}
       else if(ismod($item[2]))
      {$lnk = "$iml<a href=\"index.php?action=viewuser&who=$item[2]&sid=$sid\"><font color='blue'>$shnick</font></a>: $shdt<br/><br/>".getbbcode(getsmilies($sht));}
      else
      {$lnk = "$iml<a href=\"index.php?action=viewuser&who=$item[2]&sid=$sid\">$shnick</a>: $shdt<br/><br/>".getbbcode(getsmilies($sht));}
      if(ismod(getuid_sid($sid)))
       {
       $dlsh = "[<a href=\"lists.php?action=chiledit&sid=$sid&shid=$item[0]\">E</a>]|[<a href=\"adctrlpr.php?action=chilmit&sid=$sid&shid=$item[0]\">D</a>]<br/><br/>";
       }else{
         $dlsh = "<br/><br/>";
       }
       echo "$lnk $dlsh";
     }
     }
     echo "<p align=\"center\">";
     if($page>1)
     {
      $ppage = $page-1;
       echo "<a href=\"lists.php?action=shouts&page=$ppage&sid=$sid&who=$who\">«PREV</a> ";
     }
     if($page<$num_pages)
     {
       $npage = $page+1;
       echo "<a href=\"lists.php?action=shouts&page=$npage&sid=$sid&who=$who\">Next»</a>";
     }
     echo "<br/>Page $page of $num_pages<br/>";
     if($num_pages>2)
     {
       $rets = "<center>Jump to page<form action=\"lists.php\" method=\"get\"><input id=\"inputText\" name=\"page\" format=\"*N\" size=\"3\"/>";
          $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
         $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
     $rets .= "<input type=\"hidden\" name=\"who\" value=\"$who\"/>";
         $rets .= "<input id=\"inputButton\" type=\"submit\" value=\"Go\"/></form></center>";
         echo $rets;
     }
     ////// UNTILL HERE >>

    echo "<p align=\"center\">";

    echo "<a href=\"index.php?action=main&sid=$sid&clid=$clid\">";

echo "Back</a><br/>";

  echo "</p>";
  }
////////////////////////Edit Shout
else if($action=="chiledit"){
$shid = $_GET["shid"];
$getsht = mysql_fetch_array(mysql_query("SELECT shout FROM ibwf_shouts WHERE id = '".$shid."'"));
boxstart("Edit Shout");
echo "<p>";
  echo "<br/>Edit:<br/> ";
echo "<form action=\"shout.php?action=chileditfin&sid=$sid&id=$shid\" method=\"post\"><textarea id=\"inputText\" name=\"shtxt\">$getsht[0]</textarea> ";
echo "<br/><input id=\"inputButton\" type=\"submit\" value=\"Edit\"/>";
echo "</form>";
echo "</p>";
  }

add this in shout.php

///////////////////////////////////////Delete shout

else if($action=="chilmit"){
$shid = $_GET["shid"];
echo "<p align=\"center\">";
$res = mysql_query("DELETE FROM ibwf_shouts WHERE id ='".$shid."'");
if($res){
$sql = mysql_fetch_array(mysql_query("SELECT shout, shouter FROM ibwf_shouts WHERE id='".$shid."'"));
$modname = getnick_uid(getuid_sid($sid));
$shouter = getnick_uid($sql[1]);
$shout = substr("$sql[0]", 0, 30);
mysql_query("INSERT INTO ibwf_mlog SET action='shouts', details='<b>".$modname."</b> Deleted Shout Number <b>".$shid."</b>', actdt='".time()."'");
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Shout deleted";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error";
}
echo "<br/><br/>";
echo "</p>";
getfooter($sid);
}
//////////////////////////Edit Shout/////////////////////////////
else if($action=="chileditfin"){
$shid = $_GET["id"];
$shtxt = $_POST["shtxt"];
echo "<p align=\"center\">";
$res = mysql_query("UPDATE ibwf_shouts SET shout='".$shtxt."' WHERE id='".$shid."'");
if($res){
$sql = mysql_fetch_array(mysql_query("SELECT shout, shouter FROM ibwf_shouts WHERE id='".$shid."'"));
$modname = getnick_uid(getuid_sid($sid));
$shouter = getnick_uid($sql[1]);
$shout = substr("$sql[0]", 0, 30);
mysql_query("INSERT INTO ibwf_mlog SET action='shouts', details='<b>".$modname."</b> Edited <b>".$shouter."</b>\'s Shout <b><i>".$shout."...</i></b>', actdt='".time()."'");
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Shout Edited!<br/><br/><a href=\"lists.php?action=shouts&sid=$sid\">Shouts</a>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error!<br/><br/><a href=\"lists.php?action=shouts&sid=$sid\">Shouts</a>";
}
echo "<br/><br/>";
echo "</p>";
getfooter($sid);
}

sql in ibwf_users

`shoutb` int(1) default '0',

Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

metulj Super moderator Principal · 1,726 posts #10

xchellx wrote: that dont work

how you know it doesnt work? does it display any error? or...?

It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.

キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

brand Senior · 391 posts #11

metulj wrote: how you know it doesnt work? does it display any error? or...?

it dont work it shows errors in core and also in list aswell all i want is so the shout box i got now shows 3 messages not 1

this is what i got in my core.php

/////////////////////////////////////////////Function shoutboxpage

function getshoutboxpage($sid)
{
  
  echo "<p align=\"center\">";
$who = $_GET["who"];
    //////ALL LISTS SCRIPT <<

    if($page=="" || $page<=0)$page=1;
    if($who=="")
    {
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts"));
    }else{
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts WHERE shouter='".$who."'"));
    }
    $num_items = $noi[0]; //changable
    $items_per_page= 10;
    $num_pages = ceil($num_items/$items_per_page);
    if(($page>$num_pages)&&$page!=1)$page= $num_pages;
    $limit_start = ($page-1)*$items_per_page;

    //changable sql
    if($who =="")
    {
        $sql = "SELECT id, shout, shouter, shtime  FROM ibwf_shouts ORDER BY shtime DESC LIMIT $limit_start, $items_per_page";
}else{
    $sql = "SELECT id, shout, shouter, shtime  FROM ibwf_shouts  WHERE shouter='".$who."'ORDER BY shtime DESC LIMIT $limit_start, $items_per_page";
}

    $items = mysql_query($sql);
    echo mysql_error();
    if(mysql_num_rows($items)>0)
    {
    while ($item = mysql_fetch_array($items))
    {
        $shnick = getnick_uid($item[2]);
        $sht = parsepm($item[1], $sid);
        $shdt = date("d m y-H:i", $item[3]);
 

$sex = mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE who='$item[2]'"));
if($sex[0]=="M"){$usersex = "";$color=" style=\"color:#00CC33\"";}
if($sex[0]=="F"){$usersex = "";$color=" style=\"color:#FF0066\"";}
if($sex[0]==""){$usersex = "";}

$lnk = "<a href=\"index.php?action=viewuser&who=$item[2]&sid=$sid\"$color>$shnick</a>: $sht<br/>$shdt";
if(ismod(getuid_sid($sid)))
      {
      $dlsh = "<a href=\"modproc.php?action=delsh&sid=$sid&shid=$item[0]\"$color>[x]</a>";
      }else{
        $dlsh = "";
      }
      echo "$lnk $dlsh<br/>";
    }
    }
    if($page>1)
    {
      $ppage = $page-1;
      echo "<a href=\"lists.php?action=shouts&page=$ppage&sid=$sid&who=$who\">«Prev</a> ";
    }
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"lists.php?action=shouts&page=$npage&sid=$sid&who=$who\">Next»</a>";
    }
    echo "<br/>$page/$num_pages<br/>";
    if($num_pages>2)
    {
	  $rets = "<form action=\"lists.php\" method=\"get\">";
        $rets .= "<input name=\"page\" format=\"*N\" size=\"3\"/>";
        $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\">";
        $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\">";
        $rets .= "<input type=\"hidden\" name=\"who\" value=\"$who\">";
        $rets .= "<input type=\"Submit\" name=\"Submit\" Value=\"Go To Page\"></form>";

        echo $rets;
         }
//  $shbox .= "<a href=\"lists.php?action=shouts&sid=$sid\">more</a>, ";
echo "<a href=\"index.php?action=shout&sid=$sid\">shout</a>";
echo "</p>";
}

/////////////////////////////////////////////function Shoutbox 1msg
function getshoutbox($sid)
{
   $shbox .= "<form action=\"genproc.php?action=shout&sid=$sid\" method=\"post\"><center>";
 
  
  $lshout = mysql_fetch_array(mysql_query("SELECT shout, shouter, id  FROM ibwf_shouts ORDER BY shtime DESC LIMIT 3"));
  $shnick = getnick_uid($lshout[1]);
  
$sex=mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE name='$shnick'"));
if($sex[0]=="M"){$color=" style=\"color:#00CC33\"";}
if($sex[0]=="F"){$color=" style=\"color:#FF0066\"";}
if($sex[0]==""){}
 
  $shbox .= "<i><a href=\"index.php?action=viewuser&sid=$sid&who=$lshout[1]\"$color>".$shnick."</a></i> - ";
  $text = parsepm($lshout[0], $sid);
  $shbox .= $text;
  $shbox .= "<br/>";
  $shbox .= "<a href=\"lists.php?action=shouts&sid=$sid\">more</a>";
  if (ismod(getuid_sid($sid)))
  {
  $shbox .= " <a href=\"modproc.php?action=delsh&sid=$sid&shid=$lshout[2]\">delete</a>";
  }
  if(getplusses(getuid_sid($sid))<75)
  {
  $shbox .= "<br/>You need at least 75 plusses to shout!";
  }else{
  $shbox .= "<br/>ShoutBox Message:<br/><input name=\"shtxt\" maxlength=\"100\"/><br/>";
  $shbox .= "<input type=\"Submit\" name=\"shout\" Value=\"Add Shout\"></center></form>";
  }
  return $shbox;
}

this what i got on my index.php

  echo getshoutbox($sid);
  echo "</p>"; 

this what i got in list.php

//////////////////////////////////shouts

else if($action=="shouts")
{
    addonline(getuid_sid($sid),"Seeing Who Been Shouting","");
    echo "<head>";
    echo "<title>Shouts</title>";
    echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
    echo "</head>";
    echo "<body>";
    $who = mysql_real_escape_string( $_GET["who"] );
    //////ALL LISTS SCRIPT <<

    if($page=="" || $page<=0)$page=1;
    if($who=="")
    {
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts"));
    }else{
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts WHERE shouter='".$who."'"));
    }
    $num_items = $noi[0]; //changable
    $items_per_page= 10;
    $num_pages = ceil($num_items/$items_per_page);
    if(($page>$num_pages)&&$page!=1)$page= $num_pages;
    $limit_start = ($page-1)*$items_per_page;

    //changable sql
    if($who =="")
    {
        $sql = "SELECT id, shout, shouter, shtime  FROM ibwf_shouts ORDER BY shtime DESC LIMIT $limit_start, $items_per_page";
}else{
    $sql = "SELECT id, shout, shouter, shtime  FROM ibwf_shouts  WHERE shouter='".$who."'ORDER BY shtime DESC LIMIT $limit_start, $items_per_page";
}

    echo "<p><small>";
    $items = mysql_query($sql);
    echo mysql_error();
    if(mysql_num_rows($items)>0)
    {
    while ($item = mysql_fetch_array($items))
    {
        $shnick = getnick_uid($item[2]);
        $sht2 = parsepm($item[1], $sid);
        $shdt = date("d m y-H:i", $item[3]);
      $lnk = "<a href=\"index.php?action=viewuser&who=$item[2]&sid=$sid\">$shnick</a>: $sht2<br/>$shdt";
      if(ismod(getuid_sid($sid)))
      {
      $dlsh = "<a href=\"modproc.php?action=delsh&sid=$sid&shid=$item[0]\">[x]</a>";
      }else{
        $dlsh = "";
      }
      echo "$lnk $dlsh<br/>";
    }
    }
    echo "</small></p>";
    echo "<p align=\"center\">";
    if($page>1)
    {
      $ppage = $page-1;
      echo "<a href=\"lists.php?action=shouts&page=$ppage&sid=$sid&who=$who\">«PREV</a> ";
    }
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"lists.php?action=shouts&page=$npage&sid=$sid&who=$who\">Next»</a>";
    }
    echo "<br/>$page/$num_pages<br/>";
    if($num_pages>2)
    {
        $rets = "<form action=\"lists.php\" method=\"get\">";
        $rets .= "<input name=\"page\" style=\"-wap-input-format: '*N'\" size=\"2\"/>";
        $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
        $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
        $rets .= "<input type=\"hidden\" name=\"who\" value=\"$who\"/>";
        $rets .= "<input type=\"submit\" value=\"Go To Page\"/>";
        $rets .= "</form>";

        echo $rets;
    }
    echo "</p>";
  ////// UNTILL HERE >>
    echo "<p align=\"center\">";
  echo "<a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../phpThumb/phpThumb.php?src=../images/home.png\" alt=\"\"/>Home</a>";
  echo "</p>";
    echo "</body>";
exit();
}

thanks to any one that can help out

HELP THEM WHO HELPS YOU

External image (may be gone)

i only work on wapdesire v_2 coding only

riderz Lead · 975 posts #12

it work 100% just modify it to work remove the boxstart() the footer and then it should work nice on ur site when im gona add it to my site it will work 100%

OR do u guys just want to copy and paste the code and make it work if u dnt edit it u will never learn to fix ur own stuff


Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

thunderwap Developer · 169 posts #14

which script u using.

let me know so i can put here for u.

WANT GOOD CHEAP HOSTING WITH 99% UPTIME? THEN PM ME FOR DETAILS!!

capofret Developer · 225 posts #15

i think this is the only line u have to edit to show 3 shout messages

$lshout = mysql_fetch_array(mysql_query("SELECT shout, shouter, id FROM ibwf_shouts ORDER BY shtime DESC LIMIT 3"));

and how come it doesnt work for u when it works for us??

LDSWAPWORLD site closed. im busy with other things in life like facebook , send me PM so i can add you 🙂 www.pinoySG.com

don't ask for help if you're not even helping yourself! i am tired of seeing the line "best site", i want to see something NEW and UNIQUE. maybe if i find one, ill go back to my wap life again.

External image (may be gone)

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