Color and smileys shoutbox 2

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

    Color and smileys shoutbox 2

    Hello, on the Shout do not see the color and even the smileys, I tried but I could not, thanks for the reply
    PHP Code:
    //////////////////////////////////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&amp;who=$item[2]&amp;sid=$sid\">$shnick</a>: $sht<br/>$shdt";
          if(
    ismod(getuid_sid($sid)))
          {
          
    $dlsh = "<a href=\"modproc.php?action=delsh2&amp;sid=$sid&amp;shid=$item[0]\">[x]</a>";
          }else{
            
    $dlsh = "";
          }
          echo 
    "$lnk $dlsh<br/>";
     
        }
        } 

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

    PHP Code:
    $sht = htmlspecialchars($item[1]);
    $sht = functionSmilies($item[1]);
    $sht = functionBBcodes($item[1]); 
    <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

    Comment


      #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.

      Comment


        #4
        make the function in your core and name it that

        PHP Code:

        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
        Last edited by ozziemale31; 10.05.11, 12:03.









        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

        Comment


          #5
          does not work

          Comment


            #6
            PHP Code:
            $sht =  parsepm($item[1],$sid); 

            Comment


              #7
              its a guide to help u need to make the function inside your core page read the post its just an example

              i think hes just 2 lazy to figure it out himself or just 2 noobish to learn :p lol









              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

              Comment


                #8
                somethingelse thanks,. you see the smile and bbcode, :-) missing only the color... the color please

                Comment


                  #9
                  re

                  try adding it like this on your page

                  PHP Code:
                   //////////////////////////////////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&amp;who=$item[2]&amp;sid=$sid\">$shnick</a>: $sht<br/>$shdt";
                        if(
                  ismod(getuid_sid($sid)))
                        {
                        
                  $dlsh = "<a href=\"modproc.php?action=delsh2&amp;sid=$sid&amp;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

                  PHP Code:
                  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&amp;sid=$sid&amp;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&amp;sid=$sid&amp;shid=$lshout[2]\">[x]</a>";
                    }

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

                    }
                    return 
                  $shbox;
                  } 
                  Last edited by ozziemale31; 10.05.11, 14:32.









                  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

                  Comment


                    #10
                    Originally posted by Leviathan73 View Post
                    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

                    Comment


                      #11
                      the 2nd way i posted selects the html color that the username has in that table in ibwf users without needing it in core etc and displays the name in the particular color









                      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

                      Comment


                        #12
                        I have this , core.php
                        PHP Code:
                        /////////////////////////////////////////////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&amp;sid=$sid&amp;who=$lshout[1]\">".$shnick."</a></i>: ";
                          
                        $shbox .= parsepm($lshout[0], $sid);
                          
                        $shbox .=  parsepm($item[1],$sid);
                          
                        $shbox .= "<br/>"; 
                        and there is no background color

                        Comment


                          #13
                          and if u want to add color to the text add this in your bbcode function in core
                          PHP Code:
                          $text = preg_replace("/\[color\=(.*?)\](.*?)\[\/color\]/is","<font color=\"$1\">$2</font>",$text); 
                          Last edited by ozziemale31; 10.05.11, 14:50.









                          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

                          Comment


                            #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 :-)

                            Comment

                            Working...
                            X