MyBB Community Forums

Full Version: MyCode that can see only members
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Yo!

How can I create MyCode only for registred members?
I think that I can't ; /
(or I need plugin)

If somebody can and want to create... ;/

Thanks in advance,
KacperOo
So I presume you've enabled Guest posting on your boards?
No ZiNga
hm.. I wrote bad ;q
I want to create mycode that will see only members.
ex. [download]http:\\google.com\lol.rar[/download] and if someone isn't registred will see **Link only for registred members** and if someone register will have dl.gif image.
Oh okay. For your above example, something like this should work:

In /inc/class_parser.php
FIND
$message = $plugins->run_hooks("parse_message", $message);
Before, add:
$find = array('#\[download\](.*?)\[/download\]#si');
if($mybb->user['uid'])
{
 $replace = array('Download: $1');
}
else
{
 $replace = array('Link only available for registered users!');
}
$message = preg_replace($find, $replace, $message);
Thanks Zinga! I was looking for it Smile
Topic can be closed Big Grin
how to change tagg [code ] to only register and activation user can see what is inside?

and not register user saw msg: only register user can see what is in code?

can u help mme?
ZiNga BuRgA Wrote:Oh okay. For your above example, something like this should work:

In /inc/class_parser.php
FIND
$message = $plugins->run_hooks("parse_message", $message);
Before, add:
$find = array('#\[download\](.*?)\[/download\]#si');
if($mybb->user['uid'])
{
 $replace = array('Download: $1');
}
else
{
 $replace = array('Link only available for registered users!');
}
$message = preg_replace($find, $replace, $message);

Ok, but how can I create it to make a "link only for..." in frame. Something like this:
ink only for...
but only for register members?
and how to add this to [code ] tags?

is any possible for that?
br0nks Wrote:and how to add this to [code ] tags?

is any possible for that?

For code tags just change download here's the code:

$find = array('#\[code\](.*?)\[/code\]#si');
if($mybb->user['uid'])
{
 $replace = array('code: $1');
}
else
{
 $replace = array('Link only available for registered users!');
}
$message = preg_replace($find, $replace, $message); 
Kind Regards.
How do it in frame? Please, it's very important to me.
Pages: 1 2