FAP SUPPORT - FAP Guestion


Subject: FAP SUPPORT - FAP Guestion
Hello all!

I have just one guestion.

Artie has helped me already with the code so that only registered users can see full images.

Code: [Download] [Hide] [Select]
#
##------------------- [ OPEN ] ------------------------------------------------
#

album_showpage.php

#
##----------------- [ FIND ] ----------------------------------------------------
#

// ------------------------------------
// TEMPLATE ASSIGNEMENT
// ------------------------------------

#
##--------------- [ BEFORE ADD ] -----------------------------------------------------------
#
if ((!$userdata['session_logged_in']) && ($full_size_param == '&full=true'))
{
redirect(append_sid(album_append_uid(LOGIN_MG . "?redirect=album_showpage.$phpEx&pic_id=$pic_id&full=true")));
}
#
## --------- [ SAVE FILE ] ---------------------------------------------
#EoM


Now im using hide links mod (http://www.phpbbhacks.com/download/4543),
and i would like that only registered users with more than 10 post can see full images,
and all other`s can see thumbnails and medium images.

I already done this in my wap upload script,but i just can`t get it to work in FAP.
This is what i done in my wap script and it`s working.

Code: [Download] [Hide] [Select]
if( $userdata['session_logged_in'] & $userdata['user_posts'] >= 10 )
{
=======some php comes here======
}
elseif ( $userdata['user_posts'] >= 10 )
{
header("location:===login location===");
}
else
{
header("location:===location for users that have less than 10 posts===");
}


Like i said in my wap script is working but in FAP can`t get it to work.
Is there any solution?

Sorry for my english i`m from slovenia :wink:

Please help.

Profile PM  
Subject: Re: FAP Guestion
Try this:
Take the code ( from above) that I gave you and...


REPLACE
Code: [Download] [Hide] [Select]
if ((!$userdata['session_logged_in']) && ($full_size_param == '&full=true'))
{
redirect(append_sid(album_append_uid(LOGIN_MG . "?redirect=album_showpage.$phpEx&pic_id=$pic_id&full=true")));
}

WITH
Code: [Download] [Hide] [Select]
if (($userdata['user_posts'] < 10) && ($full_size_param == '&amp;full=true'))
{
// YOUR CODE TO REDIRECT USERS OF LESS THAN 10 POST
}

Profile PM  
Subject: Re: FAP Guestion
Not working :(

How about something like all users ( unregistered & members ) see tumbnails and medium pictures and only members of a specific group can see full pics?

This is the code i`m using in my download center and i tried to usit in FAP,but no luck!

First part.
Code: [Download] [Hide] [Select]
$userid = $userdata['user_id'];
$sql = "SELECT * FROM " . USER_GROUP_TABLE . " WHERE user_id = '$userid'";
$result = $db->sql_query($sql);
$isauth = 0;
while ($row = $db->sql_fetchrow($result))
{
if ($row['group_id'] == '//GROUP ID NUMBER//'' || $row['group_id'] == '//GROUP ID NUMBER//')
{
$isauth = 1;
}
}


Second part.
Code: [Download] [Hide] [Select]
if( $userdata['session_logged_in'] & $isauth == '1')
{
($full_size_param == '&amp;full=true')
}
elseif ( $userdata['session_logged_in'] & $isauth == '0')
{
header("//NOT IN GROUP LINK//");
}
else
{
header("//LOGIN LINK//");
}



any idea?

Profile PM  
Subject: Re: FAP Guestion
Can this even be done?

Profile PM  
Subject: Re: FAP Guestion
Artie wrote: [View Post]
Try this:
Take the code ( from above) that I gave you and...


REPLACE
Code: [Download] [Hide] [Select]
if ((!$userdata['session_logged_in']) && ($full_size_param == '&amp;full=true'))
{
redirect(append_sid(album_append_uid(LOGIN_MG . "?redirect=album_showpage.$phpEx&pic_id=$pic_id&full=true")));
}

WITH
Code: [Download] [Hide] [Select]
if (($userdata['user_posts'] < 10) && ($full_size_param == '&amp;full=true'))
{
// YOUR CODE TO REDIRECT USERS OF LESS THAN 10 POST
}

This works for me.

I do not understand what does not work for you....
Did you place the code as I originally instructed ?
What code did you put in to redirect your users ?

Profile PM  
Subject: Re: FAP Guestion
The code that i put in
Code: [Download] [Hide] [Select]
if (($userdata['user_posts'] < 10) && ($full_size_param == '&amp;full=true'))
{
message_die(GENERAL_ERROR, "You do not have permission to access this page");
}


The code works for registered users,but it doesent work for unregistered users?

Any idea?
Please help

Profile PM  
Subject: Re: FAP Guestion
That should work for all. :roll:

Maybe check that this '&amp;full=true' is not like this '&full=true'

Profile PM  
Subject: Re: FAP Guestion
No it`s correct!

Why this code doesent work right?

First part.
Code: [Download] [Hide] [Select]
$userid = $userdata['user_id'];
$sql = "SELECT * FROM " . USER_GROUP_TABLE . " WHERE user_id = '$userid'";
$result = $db->sql_query($sql);
$isauth = 0;
while ($row = $db->sql_fetchrow($result))
{
if ($row['group_id'] == '//GROUP ID NUMBER//'' || $row['group_id'] == '//GROUP ID NUMBER//')
{
$isauth = 1;
}
}


Second part.
Code: [Download] [Hide] [Select]
if( $userdata['session_logged_in'] & $isauth == '1')
{
($full_size_param == '&amp;full=true')
}
elseif ( $userdata['session_logged_in'] & $isauth == '0')
{
header("//NOT IN GROUP LINK//");
}
else
{
header("//LOGIN LINK//");
}


any idea?
please help

Profile PM  
Subject: Re: FAP Guestion
Artie wrote: [View Post]
That should work for all. :roll:

Maybe check that this '&amp;full=true' is not like this '&full=true'


No like i said this is what i put in

Code: [Download] [Hide] [Select]
if (($userdata['user_posts'] < 10) && ($full_size_param == '&amp;full=true'))
{
message_die(GENERAL_ERROR, "You do not have permission to access this page");
}

Profile PM  
Subject: Re: FAP Guestion
Well it should work as expected.
Did you place/replace it as described above ....

IN album_showpage.php

BEFORE
// ------------------------------------
// TEMPLATE ASSIGNEMENT
// ------------------------------------

Profile PM  
Subject: Re: FAP Guestion
Yes i did :wink:

Code: [Download] [Hide] [Select]
$picm = false;
$full_size_param = '&amp;full=true';
}
}
if (($userdata['user_posts'] < 10) && ($full_size_param == '&amp;full=true'))
{
message_die(GENERAL_ERROR, "You do not have permission to access this page");
}
// ------------------------------------
// TEMPLATE ASSIGNEMENT
// ------------------------------------
if ((isset($_GET['slideshow']) && (intval($_GET['slideshow']) > 0)) || (isset($_POST['slideshow']) && (intval($_POST['slideshow']) > 0)))
{
$gen_simple_header = true;
$show_template = 'album_slideshow_body.tpl';
$nuffimage_pic = ( $picm == false ) ? 'album_pic.' : 'album_picm.';
}


I don`t think that this 10 post is a good idea,this will bring spamers and usefull stuff to forum.Is there any way to do a group access?

Profile PM  
Subject: Re: FAP Guestion
Anybody? :(

Profile PM  
Subject: Re: FAP Guestion
Bump

Profile PM  
Subject: Re: FAP Guestion
It seems you didn't forget your attitude to bump your own topics even more than once.

I think I'm giving you a yellow card...

Subject: Re: FAP Guestion
Thanks for the yellow card :x

I dont like bumping posts,but if i don`t get an answer i have to bump it.

It`s sad that i can`t get a simple answer on my question.If it can`t be done just say so....don`t ignore me :x

Profile PM  

Page 1 of 2


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Generation Time: 0.1724s (PHP: 13% SQL: 87%)
SQL queries: 10 - Debug Off - GZIP Enabled