Exclamation Point MOD »  Show posts from    to     

Icy Phoenix


Old Customizations - Exclamation Point MOD



Gianni PB [ Fri 14 Nov, 2008 21:44 ]
Post subject: Exclamation Point MOD
I have installed this mod www.phpbbhacks.com/download/5908 that allows you to automatically delete uneeded exclamation points and question marks in messages.

For example, "Question!!!!!" will be changed to "Question!" and "Who can help?????" will be changed to "Who can help?"

but "I love you...my baby" will be changed to "I love you.my baby" and this is not good :wink:


I want change in 3 points, if there are more than 3

Code: [Hide] [Select]
// Exclamation point in message
if (preg_match("/([!?.])+/", $message))
{
$message_array = preg_split("/n/", $message);

for ($x = 0; $x < count($message_array); $x++)
{
if (!preg_match("/[.*//", $message_array[$x])) // Ignore BBCode...
{
$message_array[$x] = preg_replace("/([.])+/", "...", $message_array[$x]);
}
$message = implode("n", $message_array);
}

for ($x = 0; $x < count($message_array); $x++)
{
if (!preg_match("/[.*//", $message_array[$x])) // Ignore BBCode...
{
$message_array[$x] = preg_replace("/([!])+/", "\1", $message_array[$x]);
$message_array[$x] = preg_replace("/([?])+/", "\1", $message_array[$x]);
}
$message = implode("n", $message_array);
}
}



P.S. Tried to post in IP Costumizations, but only mod can


Chaotic [ Fri 14 Nov, 2008 21:45 ]
Post subject: Re: Exclamation Point MOD
Moved to Icy Phoenix Customizations. :)


Gianni PB [ Wed 24 Dec, 2008 13:23 ]
Post subject: Re: Exclamation Point MOD
found a way

Code: [Hide] [Select]
// Exclamation point in message
if (preg_match("/([!?.])+/", $message))
{
$message_array = preg_split("/n/", $message);

for ($x = 0; $x < count($message_array); $x++)
{
if (!preg_match("/[.*//", $message_array[$x])) // Ignore BBCode...
{
$message_array[$x] = preg_replace("/([.]){4,}/", "...", $message_array[$x]);
}

if (!preg_match("/[.*//", $message_array[$x])) // Ignore BBCode...
{
$message_array[$x] = preg_replace("/([!])+/", "\1", $message_array[$x]);
$message_array[$x] = preg_replace("/([?])+/", "\1", $message_array[$x]);
}
$message = implode("n", $message_array);
}
}


thanks to JC! :mricy:




Powered by Icy Phoenix