user smilies function help please

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

8 replies · 454 views · started 17 years ago · 1 min read

3 participants
wackywizards Junior · 44 posts #1

i tryed 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;
}

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

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

wackywizards Junior · 44 posts #3

Dj-marc wrote: 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

wackywizards Junior · 44 posts #5

Dj-marc wrote: 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

riderz Lead · 975 posts #6

well there u can do this

/*
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

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;
}

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

wackywizards Junior · 44 posts #7

riderz wrote: well there u can do this

/*
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

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

riderz Lead · 975 posts #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

wackywizards Junior · 44 posts #9

riderz wrote: 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

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