"Advanced" phpBB integration? (going into evil/twi "Advanced" phpBB integration? (going into evil/twi
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

"Advanced" phpBB integration? (going into evil/twi

Started by DefenceTalk.com, January 20, 2004, 05:56:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DefenceTalk.com

Hi, got another twisted idea to further the board integration already in place.

Here is what I want to get out of this.

Current situation:

Only registered people can see the full sized images... a person can register, login and go to the gallery and look at any pic he wants. Fair enough.

Proposed "advanced" feature request:

How great would it be to regulate who has the right to see full size picture depending on # of posts they have made to the integrated board?

Since board groups are also integrated into the gallery, I can make a group called "50-posts" and take away ALL of its permissions in CM group management - then they wont be able to post comments, rate pics, etc...  When the user has more than 50 posts, they automatically(through a phpbb mod) are put into "regular member" group and have regular member permissions. This can also be done by having the member apply to "regular member" group and then the admin approving.

What u think?  :twisted: evil idea? confused? :(
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.defencetalk.com%2Fpictures%2Fsignature_cpg.php&hash=c0098ed5314d39beb9e8799c7c8787a9a0353b45)

Nibbler

How about this:

You make a rank in phpbb with minimum post requirement of 50.

You change displayimage.php like this:

find:


    if (isset($image_size['reduced'])) {
        $winsizeX = $CURRENT_PIC_DATA['pwidth'] + 16;
        $winsizeY = $CURRENT_PIC_DATA['pheight'] + 16;
        $pic_html = "<a href=\"javascript:;\" onClick=\"MM_openBrWindow('displayimage.php?pid=$pid&fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=yes,status=yes,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
        $pic_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title; //added by gaugau
        $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
        $pic_html .= "</a>\n";
    } else {


alter it to:


if (isset($image_size['reduced'])) {
        $winsizeX = $CURRENT_PIC_DATA['pwidth'] + 16;
        $winsizeY = $CURRENT_PIC_DATA['pheight'] + 16;
        $rankcheck = mysql_fetch_array(db_query("SELECT user_rank FROM phpbb_users WHERE user_id=" .USER_ID));
        if ($rankcheck[user_rank] == 2) {
            $fpu = "displayimage.php?pid=$pid&fullsize=1";
        } else {
            $fpu = "bleh.html";
        }
        $pic_html = "<a href=\"javascript:;\" onClick=\"MM_openBrWindow('".$fpu."','" . uniqid(rand()) . "','scrollbars=yes,toolbar=yes,status=yes,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
        $pic_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title; //added by gaugau
        $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
        $pic_html .= "</a>\n";
    } else {


(instead of 2 use the id of the rank you created.)

use bleh.html to display a message about insufficient posts.

 :)

DefenceTalk.com

that was fast... :D i ll try it once i get home. I am tempted to try it now though!  :lol:

thanks
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.defencetalk.com%2Fpictures%2Fsignature_cpg.php&hash=c0098ed5314d39beb9e8799c7c8787a9a0353b45)

DefenceTalk.com

I tried and gives this error:

There was an error while processing a database query  

for some pics that require extra click for another window to open the FULL size pic but does not give that error for pics that do not require extra click....  :shock:
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.defencetalk.com%2Fpictures%2Fsignature_cpg.php&hash=c0098ed5314d39beb9e8799c7c8787a9a0353b45)

Nibbler

Turn on debug mode, try again, post the error msg this time.

Also if your phpbb users table is not called phpbb_users you will need to change that.

DefenceTalk.com

Well its not going for the phpbb database... its looking for the user in pictures/cm database!


error:

While executing query "SELECT user_rank FROM phpbb_users WHERE user_id=3" on 0

mySQL error: Table 'defence_pictures.phpbb_users' doesn't exist
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.defencetalk.com%2Fpictures%2Fsignature_cpg.php&hash=c0098ed5314d39beb9e8799c7c8787a9a0353b45)

Nibbler

So change it to defence_xmb2.phpbb_users then ( im guessing that is where your phpbb db is ;) )

DefenceTalk.com

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.defencetalk.com%2Fpictures%2Fsignature_cpg.php&hash=c0098ed5314d39beb9e8799c7c8787a9a0353b45)

DefenceTalk.com

well it works.  8) But does it take "special ranks" into consideration.... ?
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.defencetalk.com%2Fpictures%2Fsignature_cpg.php&hash=c0098ed5314d39beb9e8799c7c8787a9a0353b45)

DefenceTalk.com

well, kinda confusing the ranks now.

i have private = 1 (id=3) post and then after that its Lance Corporal = 51 (id=4) posts...i want everyone all Lance Corporals and UP see the full size pic... :D

when i put in id 3 it doesnt allow me and when i put in id 4, it still does not allow me to see the full size pic.
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.defencetalk.com%2Fpictures%2Fsignature_cpg.php&hash=c0098ed5314d39beb9e8799c7c8787a9a0353b45)

Nibbler

Well you could try this:



if ($rankcheck[user_rank] > 3)
 


to stop anyone with a rank 3 or below seeing the full size pics, you'll just have to play with it depeding on how your ranks work.