user smilies function help please

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

    user smilies function help please

    i tryed this code

    Code:
    function getsmilies($text)
    {
      $sql = "SELECT * FROM ibwf_usersmilies";
      $smilies = mysql_query($sql);
      while($smilie=mysql_fetch_array($smilies))
      {
        $scode = $smilie[1];
        $spath = $smilie[2];
        $text = str_replace($scode,"<img src=\"../phpThumb/phpThumb.php?src=$spath\" alt=\"$scode\"/>",$text);
      }
      return $text;
    }

    i am trying to get user smilies to show on site any chance some one can help me fix this please when i put it in my core.php i get this error
    Code:
    Fatal error: Cannot redeclare getsmilies() (previously declared in /home/*****/public_html/*******/web/core.php:2053) in /home/*******/public_html/*******/web/core.php on line 2077
    can some one help me fix this please it be a great help if some one can help

    #2
    Bor the error tells it all. you cant declare the same function bro.

    WapCHAT Forum Currenltly changing over to xhtml

    My Dowloads Site

    Comment


      #3
      Originally posted by Dj-marc View Post
      Bor the error tells it all. you cant declare the same function bro.
      thats why i'm trying to get it fixed and see if some one can help me with it i am trying to get the user smilies to show on the main page and inbox just like normal smilies

      Comment


        #4
        do you mean like in the shoutbox?

        WapCHAT Forum Currenltly changing over to xhtml

        My Dowloads Site

        Comment


          #5
          Originally posted by Dj-marc View Post
          do you mean like in the shoutbox?
          no its like the smilies page but this page is for member smilies that they want going up they have there own page

          Comment


            #6
            well there u can do this
            Code:
            /*
            function getsmilies($text)
            {
              $sql = "SELECT * FROM ibwf_usersmilies";
              $smilies = mysql_query($sql);
              while($smilie=mysql_fetch_array($smilies))
              {
                $scode = $smilie[1];
                $spath = $smilie[2];
                $text = str_replace($scode,"<img src=\"../phpThumb/phpThumb.php?src=$spath\" alt=\"$scode\"/>",$text);
              }
              return $text;
            }*/

            or rename this function and make an extra db for it also for the new function
            Code:
            function getsmilies2($text)
            {
              $sql = "SELECT * FROM ibwf_usersmilies2";
              $smilies = mysql_query($sql);
              while($smilie=mysql_fetch_array($smilies))
              {
                $scode = $smilie[1];
                $spath = $smilie[2];
                $text = str_replace($scode,"<img src=\"../phpThumb/phpThumb.php?src=$spath\" alt=\"$scode\"/>",$text);
              }
              return $text;
            }
            Last edited by riderz; 21.04.09, 21:25.
            ________________
            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

            Comment


              #7
              Originally posted by riderz View Post
              well there u can do this
              Code:
              /*
              function getsmilies($text)
              {
                $sql = "SELECT * FROM ibwf_usersmilies";
                $smilies = mysql_query($sql);
                while($smilie=mysql_fetch_array($smilies))
                {
                  $scode = $smilie[1];
                  $spath = $smilie[2];
                  $text = str_replace($scode,"<img src=\"../phpThumb/phpThumb.php?src=$spath\" alt=\"$scode\"/>",$text);
                }
                return $text;
              }*/

              or rename this function
              Code:
              function getsmilies2($text)
              {
                $sql = "SELECT * FROM ibwf_usersmilies";
                $smilies = mysql_query($sql);
                while($smilie=mysql_fetch_array($smilies))
                {
                  $scode = $smilie[1];
                  $spath = $smilie[2];
                  $text = str_replace($scode,"<img src=\"../phpThumb/phpThumb.php?src=$spath\" alt=\"$scode\"/>",$text);
                }
                return $text;
              }
              thanks mate i'll try them both i tryed the first one got shut of the error but then i test the smilies for it they dont show
              Last edited by wackywizards; 21.04.09, 21:28.

              Comment


                #8
                just look at my post ive edited the second one u need to create an second database smilies2 coz u want to make a second page for ppl own stuff like i understand u other wise add the first option ive added dnt know if it work what u wona do
                ________________
                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

                Comment


                  #9
                  Originally posted by riderz View Post
                  just look at my post ive edited the second one u need to create an second database smilies2 coz u want to make a second page for ppl own stuff like i understand u other wise add the first option ive added dnt know if it work what u wona do
                  i added the first one it got shut of the error i want to show the smilies that on the usersmilies page they show in the page but not in shoutbox or a pm i got db table for it

                  Comment

                  Working...
                  X