Exclamation Point MOD


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: [Download] [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("/([!])+/", "> $message_array[$x] = preg_replace("/([!])+/", "\1", $message_array[$x]); <", $message_array[$x]);
$message_array[$x] = preg_replace("/([?])+/", "> $message_array[$x] = preg_replace("/([?])+/", "\1", $message_array[$x]); <", $message_array[$x]);
}
$message = implode("n", $message_array);
}
}



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

Subject: Re: Exclamation Point MOD
Moved to Icy Phoenix Customizations. :)

Subject: Re: Exclamation Point MOD
found a way

Code: [Download] [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("/([!])+/", "> $message_array[$x] = preg_replace("/([!])+/", "\1", $message_array[$x]); <", $message_array[$x]);
$message_array[$x] = preg_replace("/([?])+/", "> $message_array[$x] = preg_replace("/([?])+/", "\1", $message_array[$x]); <", $message_array[$x]);
}
$message = implode("n", $message_array);
}
}


thanks to JC! :mricy:


Page 1 of 1


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Generation Time: 0.1132s (PHP: 15% SQL: 85%)
SQL queries: 10 - Debug Off - GZIP Enabled