Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Aiheen aloitti: cavendano - lokakuu 18, 2008, 09:05:56 AP

Otsikko: wap url's
Kirjoitti: cavendano - lokakuu 18, 2008, 09:05:56 AP
I am having a problem modifying the wireless.template.php file. I need the wap side to output anything I put in between the [url] right now its only outputting the text but not the link.
I did perform a search before asking this and the closest it came to was outputting images on wap.
Otsikko: Re: wap url's
Kirjoitti: Rumbaar - lokakuu 28, 2008, 06:45:26 AP
I might move this to SMF coding section and/or Graphics and Templates.  But I'll ask, does wap2 meet the needs?  I'm not sure by it has different parse parameters?
Otsikko: Re: wap url's
Kirjoitti: cavendano - lokakuu 29, 2008, 10:48:47 AP
actually I got it to work somewhat....
function ubbcode($posting) {
      $posting=eregi_replace("\[img\]([^\[]+)\[/img\]","<img src=\"\\1\" border=\"0\">",$posting);
      $posting=eregi_replace("\[email\]([^\[]+)\[/email\]","<a href=\"mailto:\\1\">\\1</a>",$posting);
      $posting=eregi_replace("\[email=([^\[]+)\]([^\[]+)\[/email\]","<a href=\"mailto:\\1\">\\2</a>",$posting);
      $posting=eregi_replace("\[url=([^\[]+)\]([^\[]+)\[/url\]","<a href=\"\\1\">\\1</a>",$posting);
      $posting=eregi_replace("\[url\]([^\[]+)\[/url\]","<a href=\"\\1\">\\1</a>",$posting);
         $posting=eregi_replace("\[b\]","<strong>",$posting);
         $posting=eregi_replace("\[/b\]","</strong>",$posting);
        $posting=eregi_replace("\[u\]","<u>",$posting);
        $posting=eregi_replace("\[/u\]","</u>",$posting);
        $posting=eregi_replace("\[i\]","<em>",$posting);
        $posting=eregi_replace("\[/i\]","</em>",$posting);
        $posting=eregi_replace("\&#039;","",$posting);
        $posting=eregi_replace("\target=","",$posting);
        return $posting;
    }


I added this to the wireless.php and then changed the $wireless_message part (3 in total) to....
$wireless_message = ubbcode($message['body']);

that works but now i get an error message after the first post....
LainaaCannot redeclare ubbcode () (previously declared in myrootdir/load.php:1379) in myrootdir/forum/Sources/Load.php(1744) : evald()'d code on line 711

so like I said the first post works but every post that follows gets that message

any help would be appreciated
Otsikko: Re: wap url's
Kirjoitti: Rumbaar - lokakuu 29, 2008, 04:54:59 IP
Try taking out the second function you've added, as I'm sure you can call the previous function to perform the same action.