MyBB Hacks

Full Version: Member only view list of thread but can't view thread
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
@leefish..
ups sorry sis..  Biggrin
Biggrin

no probs Bro (you are a bro?????)

PHP Code:
if($mybb->user['gid'] == '5' && in_array($thread['fid'], array(1,2,5))


(the IN operator is SQL, not PHP; it's fun to have different syntaxes for different languages)

gah yes. Sorry Zinga.
(06-05-2012 09:29 PM)leefish Wrote: [ -> ]Biggrin

no probs Bro (you are a bro?????)
Yes. I am
glad to know you sis Smile

(06-05-2012 11:19 PM)ZiNgA BuRgA Wrote: [ -> ]

PHP Code:
if($mybb->user['gid'] == '5' && in_array($thread['fid'], array(1,2,5))


(the IN operator is SQL, not PHP; it's fun to have different syntaxes for different languages)

wohoooo..
it works! thanks a lot zinga burga

OOT:
how can I give reputation?
I cannot find reputation button or I missed that
is below code is right for 1.8>=?

Code:
<?php
$plugins->add_hook('showthread_start', 'gcvt_thread');
$plugins->run_hooks("showthread_start");
$plugins->add_hook('archive_thread_start', 'gcvt_thread');
$plugins->run_hooks("archive_thread_start");


function gcvt_info()
{
    return array(
        'name'            => 'Guests Can\'t View Threads',
        'description'    => 'Guests cannot view threads.',
        'website'        => 'http://mybbplug.in/',
        'author'        => 'Jammerx2',
        'authorsite'    => 'http://mybbplug.in/',
        'version'        => '1.1',
	"compatibility" => "14*,16*,18*"
        'guid'        => '8ac34edb831b6a420c48602ed5384b59'
    );
}

function gcvt_activate()
{
}

function gcvt_deactivate()
{
}
function gcvt_thread()
{
    global $db, $mybb,$lang, $thread;

                    if($mybb->user['gid'] == '1,2,5' && in_array($thread['fid'], array(168))
                    {
                        error_no_permission();
                    }
                    
    $lang->send_thread = "";
}
?>


It give me Parse error: syntax error, unexpected '{' in C:xxx/xxx/xxx\inc\plugins\gcvt.php on line 33

(01-26-2017 10:01 PM)WINBOY Wrote: [ -> ]

Code:
if($mybb->user['gid'] == '1,2,5' && in_array($thread['fid'], array(168))


You should use in_array for the gid as well.
IIRC, 1.8 already have a function to check the user's usergroup(s).
Pages: 1 2
Reference URL's