FAP SUPPORT - FAP Guestion »  Show posts from    to     

Icy Phoenix


Archived phpBB Topics (Styles, Mods, Support) - FAP SUPPORT - FAP Guestion



Siljo [ Mon 09 Apr, 2007 17:27 ]
Post 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: [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: [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

Please help.


Artie [ Mon 09 Apr, 2007 20:56 ]
Post subject: Re: FAP Guestion
Try this:
Take the code ( from above) that I gave you and...


REPLACE
Code: [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: [Hide] [Select]
if (($userdata['user_posts'] < 10) && ($full_size_param == '&amp;full=true'))
{
// YOUR CODE TO REDIRECT USERS OF LESS THAN 10 POST
}


Siljo [ Tue 10 Apr, 2007 18:43 ]
Post 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: [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: [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?


Siljo [ Thu 12 Apr, 2007 20:36 ]
Post subject: Re: FAP Guestion
Can this even be done?


Artie [ Thu 12 Apr, 2007 20:46 ]
Post subject: Re: FAP Guestion
Artie wrote: [View Post]
Try this:
Take the code ( from above) that I gave you and...


REPLACE
Code: [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: [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 ?


Siljo [ Fri 13 Apr, 2007 15:52 ]
Post subject: Re: FAP Guestion
The code that i put in
Code: [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


Artie [ Fri 13 Apr, 2007 17:41 ]
Post subject: Re: FAP Guestion
That should work for all.

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


Siljo [ Fri 13 Apr, 2007 18:51 ]
Post subject: Re: FAP Guestion
No it`s correct!

Why this code doesent work right?

First part.
Code: [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: [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


Siljo [ Tue 17 Apr, 2007 09:08 ]
Post subject: Re: FAP Guestion
Artie wrote: [View Post]
That should work for all.

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


No like i said this is what i put in

Code: [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");
}


Artie [ Tue 17 Apr, 2007 18:28 ]
Post 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
// ------------------------------------


Siljo [ Fri 20 Apr, 2007 00:00 ]
Post subject: Re: FAP Guestion
Yes i did

Code: [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?


Siljo [ Wed 02 May, 2007 21:38 ]
Post subject: Re: FAP Guestion
Anybody?


Siljo [ Fri 18 May, 2007 22:29 ]
Post subject: Re: FAP Guestion
Bump


Mighty Gorgon [ Sun 20 May, 2007 15:27 ]
Post 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...


Siljo [ Sun 20 May, 2007 17:26 ]
Post subject: Re: FAP Guestion
Thanks for the yellow card

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


Mighty Gorgon [ Sun 20 May, 2007 19:44 ]
Post subject: Re: FAP Guestion
Siljo wrote: [View Post]
Thanks for the yellow card

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

No, that is the wrong way.

If you don't get an answer is just because we are all doing something else. Remember that we are doing this for free.

Do you feel ignored?

We already tried to help you and after you did receive the code you did ask for another one... it's not so straightforward doing what you are requesting.

I won't code your request, because I don't have the time to customize every specific user request. And I won't accept bumping twice without having tried to write at least a row of code. Open source grow if users try to learn and to contribute, not only to request and stop...


Siljo [ Sun 20 May, 2007 20:21 ]
Post subject: Re: FAP Guestion
Sorry to hear that.I always try to code it myself before i ask for help but if common php code doesent work i dont`t know what to try.You don`t have to give me the code,give me just some pointers and i will try it myself,but without pointers and common php code doesen`t work how should i know what to do?And yes i do feel ignored,because you never have time,but thats ok,but it`s not ok to wait one month or more for reply.

I love your mod and i can live without changes,so dont`t be mad at me just because i need some help


Mighty Gorgon [ Fri 25 May, 2007 03:04 ]
Post subject: Re: FAP Guestion
I help everyone when I can.

Precedence on bugs and biggest issues... customizations you may agree that are less important, so come last.

I'll try to help you when I can... if you can accept this.


Siljo [ Sat 26 May, 2007 21:20 ]
Post subject: Re: FAP Guestion
Yes i can




Powered by Icy Phoenix