Member only view list of thread but can't view thread
lenkbreak Offline
Junior Member
**
Posts: 23
Joined: Apr 2012
Post: #11
RE: Member only view list of thread but can't view thread
@leefish..
ups sorry sis..  Biggrin
06-05-2012 07:34 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*******
Posts: 1,009
Joined: Apr 2010
Post: #12
RE: Member only view list of thread but can't view thread
Biggrin

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


[Image: leelink.gif]
MYBB1.6 & XThreads
06-05-2012 09:29 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,338
Joined: Jan 2008
Post: #13
RE: Member only view list of thread but can't view thread

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)


My Blog
06-05-2012 11:19 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*******
Posts: 1,009
Joined: Apr 2010
Post: #14
RE: Member only view list of thread but can't view thread
gah yes. Sorry Zinga.


[Image: leelink.gif]
MYBB1.6 & XThreads
06-06-2012 04:51 AM
Visit this user's website Find all posts by this user Quote this message in a reply
lenkbreak Offline
Junior Member
**
Posts: 23
Joined: Apr 2012
Post: #15
RE: Member only view list of thread but can't view thread
(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
06-06-2012 03:13 PM
Find all posts by this user Quote this message in a reply
WINBOY Offline
Member
***
Posts: 63
Joined: Nov 2012
Post: #16
RE: Member only view list of thread but can't view thread
is below code is right for 1.8>=?

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?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
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,325
Joined: Mar 2010
Post: #17
RE: Member only view list of thread but can't view thread
(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).

01-28-2017 02:35 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: