2009-06-20, 05:16 PM
2009-06-20, 05:18 PM
Forgive my ignorance, but what is a slap message and where do you want to display it?
2009-06-20, 05:19 PM
Slap message is when you do
Like this:
* duyen slaps babjusi around a bit with a large trout.
I want to randomize "around a bit with a large trout." and "slaps"
/slap
Like this:
* duyen slaps babjusi around a bit with a large trout.
I want to randomize "around a bit with a large trout." and "slaps"
2009-06-20, 05:21 PM
Ah, I see. And where do you want to display them? At the board index of your forum for ex?
2009-06-20, 05:29 PM
I found a solution, I'll post it in a sec.
EDIT:
$slaps = array();
$slaps[1] = "slaps";
$slaps[2] = "slap chops";
$slaps[3] = "pwns";
$slaps[4] = "rap chops";
$slapobject = array();
$slapobject[1] = "around a bit with a large trout.";
$slapobject[2] = "with Vince.";
$slapobject[3] = "with his mad DotA skills.";
$slapobject[4] = "with his nuts.";
$tempint=rand(1,2);
// Replace "me" code and slaps if we have a username
if($options['me_username'])
{
global $lang;
$message = preg_replace('#(>|^|\r|\n)/me ([^\r\n<]*)#i', "\\1<span style=\"color: red;\">* {$options['me_username']} \\2</span>", $message);
$message = preg_replace('#(>|^|\r|\n)/slap ([^\r\n<]*)#i', "\\1<span style=\"color: red;\">* {$options['me_username']} $slaps[$tempint] \\2 $slapobject[$tempint]</span>", $message);
}
EDIT:
$slaps = array();
$slaps[1] = "slaps";
$slaps[2] = "slap chops";
$slaps[3] = "pwns";
$slaps[4] = "rap chops";
$slapobject = array();
$slapobject[1] = "around a bit with a large trout.";
$slapobject[2] = "with Vince.";
$slapobject[3] = "with his mad DotA skills.";
$slapobject[4] = "with his nuts.";
$tempint=rand(1,2);
// Replace "me" code and slaps if we have a username
if($options['me_username'])
{
global $lang;
$message = preg_replace('#(>|^|\r|\n)/me ([^\r\n<]*)#i', "\\1<span style=\"color: red;\">* {$options['me_username']} \\2</span>", $message);
$message = preg_replace('#(>|^|\r|\n)/slap ([^\r\n<]*)#i', "\\1<span style=\"color: red;\">* {$options['me_username']} $slaps[$tempint] \\2 $slapobject[$tempint]</span>", $message);
}
2009-06-21, 02:46 PM
can show us the result in screenshot it would nice to understand what output of this code has
thank you
thank you
2009-06-21, 06:51 PM
What do you do with that? =/
2009-06-22, 03:32 AM
(2009-06-21, 06:51 PM)Elegant Totality Wrote: [ -> ]What do you do with that? =/
To slap the person above your post..!
2009-06-22, 05:07 AM
* Elegant Totality slaps Ghazal around a bit with a large trout.
I knew that
I was asking where I put that code... I want to use it xD
I knew that
I was asking where I put that code... I want to use it xD