Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


smiley bbcode problem[PHP]

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
deleted user 111213
Grandmaster Cheater
Reputation: 0

Joined: 09 Nov 2007
Posts: 714

PostPosted: Sat Jan 17, 2009 4:16 am    Post subject: smiley bbcode problem[PHP] Reply with quote

this is my fuction

Code:
<?php

function topic($input)
{

    $pattern[0] = "/\&/i";
    $pattern[1] = "/\</i";
    $pattern[2] = "/\>/i";
    $pattern[3] = "/\[b\](.*?)\[\/b\]/i";
    $pattern[4] = "/\[u\](.*?)\[\/u\]/i";
    $pattern[5] = "/\[i\](.*?)\[\/i\]/i";
    $pattern[6] = "/\[code\](.*?)\[\/code\]/i";
    $pattern[7] = "/\[url\](.*?)\[\/url\]/i";
    $pattern[8] = "/\[img\](.*?)\[\/img\]/i";
    $pattern[9] = "/\[url\=(.*)\](.*)\[\/url\]/i";
    $pattern[10] = "/\:smile:/i";
    $pattern[11] = "/\[youtube\](.*?)\[\/youtube\]/i";

    $replace[0] = "&amp;";
    $replace[1] = "&lt;";
    $replace[2] = "&gt;";
    $replace[3] = "<b>$1</b>";
    $replace[4] = "<u>$1</u>";
    $replace[5] = "<i>$1</i>";
    $replace[6] = "<br>Code:<br><div id=\"code\"><tt>$1</tt></div>\n";
    $replace[7] = "<a href=$1>$1</a>";
    $replace[8] = "<img src = $1 />";
    $replace[9] = "<a href=$1>$2</a>";
    $replace[10] = "<img src='images/smiley1.gif'/>";
    $replace[11] = "<object width=\"425\" height=\"344\"><param name=\"movie\" value=\"http://www.youtube.com/v/$1=en&fs=1\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/$1=en&fs=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"425\" height=\"344\"></embed></object>";

    $bbcoded = preg_replace($pattern, $replace, $input);

    return nl2br($bbcoded);

    return nl2br(strip_tags(stripslashes(htmlspecialchars($input))));

}

?>


the only problem is with $pattern[10] is that i want to replace it with
Code:
:)
but it wouldn't work for me.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites