MyBB Community Forums

Full Version: MYBB allow one link per post?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How I can allow only one image link and one anchor link per post????



$parser_options = "1";
$parsed_sig = $parser->parse_message($post['message'], $parser_options);
    if(substr_count($parsed_sig, "<img") > $parser_options)

$parser_options = "1";
$parsed_sig = $parser->parse_message($post['message'], $parser_options);
   if(substr_count($parsed_sig, "<a") > $parser_options)
What exactly do you need help with? Doesn't your code works?
Yeah it works but since my php is terrible I would like to know if its OK or there is some other way to do it.
Seems like it is based on the code for the signature in UCP or something I can't recall.

Unsure why did you set $parser_options to 1, check usercp.php around lines #60.
Thanks for the advice this works like a charm Smile


$parser_options = "1"
if(substr_count($post->data['message'], "<img") > $parser_options)