Jump to content

almightyegg

Members
  • Posts

    791
  • Joined

  • Last visited

Everything posted by almightyegg

  1. all i know is that it won't recognise the function...and it says: Parse error: syntax error, unexpected '[', expecting ')' in /home/lordofth/public_html/forum/viewthread.php on line 76 line 76 is:    function emoticon($r['post']) {
  2. i know there is something iffy with the function :( [code]<?     function emoticon($r['post']) {   $emoticonarray = array(     ':)'  => 'smile.gif',     ':('  => 'sad.gif',     ';)'  => 'wink.gif',     ':P'  => 'tongue.gif'   );   foreach($emoticonarray as $emoticon => $img) {     $search[] = $emoticon;     $replace[] = '<img src="images/emotions/' . $img . '" alt="' . $emoticon . '" />';   }   $r['post'] = str_replace($search, $replace, $r['post']);   return $r['post']; }     echo stripslashes($r['username']); ?></td>     <td style="width:80%;background-color:#101010;">     <?     echo nl2br(stripslashes($r['post'])); ?></td>[/code]
  3. sorry to post again but nobody replied :(
  4. when pulling data out of a table using a while loop, how do you make it separate the data into different pages?? like the first 10 rows is one page then it goes to a second page for 11-20 then third etc...
  5. anyone? if you don't want to rewrite then can you then explain in simple terms what wildteen88 said???
  6. didn't really understand that :( could you rewrite this? then in future i will understand :) [code]  function emoticon($r['post']) {   // defines the emoticons   $emoticonarray = array(     ':)'  => 'smile.gif',     ':('  => 'sad.gif',     ';)'  => 'wink.gif',     ':P'  => 'tongue.gif',     ':'('  => 'cry.gif'   );   foreach($emoticonarray as $emoticon => $img) {     $search[] = $emoticon;     $replace[] = '<img src="images/emotions/' . $img . '" alt="' . $emoticon . '" />';   }   $r['post'] = str_replace($search, $replace, $r['post']);   return $r['post']; }     echo stripslashes($r['username']); ?>[/code]
  7. i get an error...but i dont understand :( Parse error: syntax error, unexpected '[', expecting ')' in /home/lordofth/public_html/forum/viewthread.php on line 78 [code]<?     function emoticon($r['post']) {   // the line below this is line 78   $emoticonarray = array(     ':)'  => 'smile.gif',     ':('  => 'sad.gif',     ';)'  => 'wink.gif',     ':P'  => 'tongue.gif'   );     foreach($emoticonarray as $emoticon => $img) {     $search[] = $emoticon;     $replace[] = '<img src="/emoticons/' . $img . '" alt="' . $emoticon . '" />';   }   $r['post'] = str_replace($search, $replace, $r['post']);   return $r['post']; }     echo stripslashes($r['username']); ?></td>     <td style="width:80%;background-color:#101010;">     <?     echo nl2br(stripslashes($r['post'])); ?></td>   </tr> </table>[/code]
  8. i have made my own message board, but i want to add smilies. just ones which when you put a colon and a bracket that it recognises it as an image....how would i do this???
  9. yay the str replace worked :D my code before with preg :) $tags = array('{MEM_ID}', '{MEM_USERNAME}', '{MEM_CLUTCH}'); $vals = array($mem['id'], $mem['username'], $mem[clutch]); $qlink['quicklinks'] = preg_replace($tags, $vals, $qlink['quicklinks']); thanks for the help :D
  10. Before: {MEM_USERNAME}'s House Iridia Central My Clutch Mine Shaft Portal Battle Arena Message Board My Account Logout After: {Lord of the Abyss}'s House Iridia Central My Clutch Mine Shaft Portal Battle Arena Message Board My Account Logout
  11. right now it shows all info plus {} around those bits we changed
  12. what if i have 2 different php bits $mem[id] and $mem[username] would you change it to: $qlink['quicklinks'] = preg_replace('|\{MEM_ID\}|', $mem['id'],  '|\{MEM_USERNAME}\|', $mem['username'], $qlink['quicklinks']);
  13. it pulls out code for the quicklinks eg. <a href="blah.html">link</a><----that comes out fine <a href="link.php?<? echo "$mem[id]"; ?>">link2</a> <----that doesnt... so basically i add : <? echo "qlink[quicklinks]"; ?> to every page and then i only have to edit the database when i change things... i think that answers both questions???
  14. never done the eval() func before ??? something like: <? eval('$qlink[quicklinks]'); echo "$qlink[quicklinks]"; ?> ??
  15. i want to be able to update links quickly and easily so id only have to change 1 page, (well 1 row of a database) so i added code to all pages saying to fetch this row of a database and it won't read any php inside it :( it will read html links but not the '<? echo "$mem[id]"; ?>' etc... any ideas? it will make my life so much simpler :D
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.