Color and smileys shoutbox 2

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

13 replies · 925 views · started 15 years ago · 1 min read

TL;DR · summary of 13 replies
  • -put the function code in your core.php file.
  • -Add the echo line for stylesheet inside the bbcode function in core.php.
  • -The color should now be visible.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

4 participants
Leviathan73 Senior · 260 posts #1

Hello, on the Shout do not see the color and even the smileys, I tried but I could not, thanks for the reply

//////////////////////////////////chat shouts 2
else if($action=="shouts2")
{
    addonline(getuid_sid($sid),"è nel chat shout","");
    echo "<head>";
    echo "<title>Chat ShoutBox</title>";
    echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"themes/$theme[0]\">";
    echo "</head>";
    echo "<body>";
    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_shouts2"));
    }else{
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts2 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_shouts2 ORDER BY shtime DESC LIMIT $limit_start, $items_per_page";
}else{
    $sql = "SELECT id, shout, shouter, shtime  FROM ibwf_shouts2  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]);
        $sht = htmlspecialchars($item[1]);
        $shdt = date("d m y-H:i", $item[3]);
      $lnk = "<a href=\"index.php?action=viewuser&who=$item[2]&sid=$sid\">$shnick</a>: $sht<br/>$shdt";
      if(ismod(getuid_sid($sid)))
      {
      $dlsh = "<a href=\"modproc.php?action=delsh2&sid=$sid&shid=$item[0]\">[x]</a>";
      }else{
        $dlsh = "";
      }
      echo "$lnk $dlsh<br/>";
 
    }
    }
arnage Lead · 811 posts #2

Find function names for smilies and bb codes in the script and add on this line something like:

$sht = htmlspecialchars($item[1]);
$sht = functionSmilies($item[1]);
$sht = functionBBcodes($item[1]);
<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***
Leviathan73 Senior · 260 posts #3

all pages have smileys and bbcode, but when you go to read all the messages, the address is in lists.php, I put them there but not working. Fatal error: Call to undefined function: functionbbcodes () etc. etc.

ozziemale31 Lead · 861 posts #4

make the function in your core and name it that

function bbcodes($text){

    $status = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='icons'"));

    if($status[0]==1){

$sql = "SELECT * FROM ibwf_smilies";

$smilies = mysql_query($sql);

while($smilie=mysql_fetch_array($smilies)){

$scode = $smilie[1];

$spath = $smilie[2];

$text = str_replace($scode,"<img src=\"$spath\" alt=\"$scode\"/>",$text);

}

    }

return $text;

}

Added after 8 minutes:

u must define the function in your core its way 2 easy

External image (may be gone) External image (may be gone)

External image (may be gone)

*****

**Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer.. Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free ***

Leviathan73 Senior · 260 posts #8

😊somethingelse thanks,. you see the smile and bbcode, 🙂 missing only the color... the color please

ozziemale31 Lead · 861 posts #9

re

try adding it like this on your page

 //////////////////////////////////chat shouts 2
else if($action=="shouts2")
{
    addonline(getuid_sid($sid),"è nel chat shout","");
    echo "<head>";
    echo "<title>Chat ShoutBox</title>";
    echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"themes/$theme[0]\">";
    echo "</head>";
    echo "<body>";
    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_shouts2"));
    }else{
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts2 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_shouts2 ORDER BY shtime DESC LIMIT $limit_start, $items_per_page";
}else{
    $sql = "SELECT id, shout, shouter, shtime  FROM ibwf_shouts2  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]);
        $sht = parsepm($item[1], $sid);
        $sht = htmlspecialchars($item[1]);
        $sht = functionSmilies($item[1]);
        $sht = functionBBcodes($item[1]);
        $shdt = date("d m y-H:i", $item[3]);
      $lnk = "<a href=\"index.php?action=viewuser&who=$item[2]&sid=$sid\">$shnick</a>: $sht<br/>$shdt";
      if(ismod(getuid_sid($sid)))
      {
      $dlsh = "<a href=\"modproc.php?action=delsh2&sid=$sid&shid=$item[0]\">[x]</a>";
      }else{
        $dlsh = "";
      }
      echo "$lnk $dlsh<br/>";
 
    }
    } 

Added after 8 minutes:

another way to give u an idea for color nicks like u u need a new table in ibwf_users called kaler varchar(100) NOT NULL,

then a code like the following so it selects the color they want their username to appear

function getshoutbox($sid)
{

  $shbox .= "<b>Shoutbox</b><div align=\"left\">";
  $lshout = mysql_fetch_array(mysql_query("SELECT shout, shouter, id  FROM ibwf_shouts ORDER BY shtime DESC LIMIT 1"));
  $shnick = getnick_uid($lshout[1]);
  $icon = getnickicon($lshout[1]);
  if($icon=="")
  {
  $onl = "";
  }else{
  $onl = "<img src=\"$icon\" alt=\"*\"/>";
  }
  $kaler = mysql_fetch_array(mysql_query("SELECT kaler FROM ibwf_users WHERE name='$shnick'"));
  $shbox .= "<i><a href=\"index.php?action=viewuser&sid=$sid&who=$lshout[1]\">$onl<font color=\"$kaler[0]\">".$shnick."</font></a></i><br/>";
  $text = parsepm($lshout[0], $sid);
  $shbox .= $text;
  if (ismod(getuid_sid($sid)))
  {
  $shbox .= " <a href=\"modproc.php?action=delsh&sid=$sid&shid=$lshout[2]\">[x]</a>";
  }

  if(gettoken(getuid_sid($sid))<1)
  {
  $shbox .= "<br/><a href=\"index.php?action=addshout&sid=$sid\">[Shout]</a> <a href=\"main.php?action=shout&sid=$sid\">[More]</a>";
  }else{
  $shbox .= "<br/><a href=\"index.php?action=addshout&sid=$sid\">[Shout]</a> <a href=\"main.php?action=shout&sid=$sid\">[More]</a>";
  $shbox .= "</div>";

  }
  return $shbox;
}

External image (may be gone) External image (may be gone)

External image (may be gone)

*****

**Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer.. Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free ***

something else Fellow · 2,296 posts #10

Leviathan73 wrote: 😊somethingelse thanks,. you see the smile and bbcode, 🙂 missing only the color... the color please

i dont know your color function ... and its not standard lava .... so without seeing it in core.php it would be a complete guess

Leviathan73 Senior · 260 posts #12

I have this , core.php

/////////////////////////////////////////////Function shoutbox 2
function getshoutbox2($sid)
{
  $lshout = mysql_fetch_array(mysql_query("SELECT shout, shouter, id  FROM ibwf_shouts2 ORDER BY shtime DESC LIMIT 1"));
  $shnick = getnick_uid($lshout[1]);
  $shbox .= "<i><a href=\"index.php?action=viewuser&sid=$sid&who=$lshout[1]\">".$shnick."</a></i>: ";
  $shbox .= parsepm($lshout[0], $sid);
  $shbox .=  parsepm($item[1],$sid);
  $shbox .= "<br/>";

and there is no background color

Leviathan73 Senior · 260 posts #14

I solved it! where to put this echo "<link rel="stylesheet" type="text/css" href="themes/$theme[0]">"; to this, echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; thanks guys,the color you see 🙂

Write your reply now; next you create a free account (or sign in) and it is posted right away. 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