https://www.icyphoenix.com/viewtopic.php?f=26&t=1582
-----------------------------------
Siljo
Mon 09 Apr, 2007 17:27

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 linenumbers=false]#
##------------------- [ OPEN ] ------------------------------------------------
#
 
album_showpage.php

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

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

#
##--------------- [ BEFORE ADD ] -----------------------------------------------------------
#
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")));
	} 
#
## --------- [ SAVE FILE ] ---------------------------------------------
#EoM[/code]

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 linenumbers=false]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===");
       }
[/code]

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.


-----------------------------------
Artie
Mon 09 Apr, 2007 20:56

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


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


-----------------------------------
Siljo
Tue 10 Apr, 2007 18:43

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 linenumbers=false]$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;
}
}[/code]

Second part.
[code linenumbers=false]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//");
   }

[/code]

any idea?


-----------------------------------
Siljo
Thu 12 Apr, 2007 20:36

Re: FAP Guestion
-----------------------------------
Can this even be done?


-----------------------------------
Artie
Thu 12 Apr, 2007 20:46

Re: FAP Guestion
-----------------------------------
[quote user="Artie" post="11707"]Try this: 
Take the code ( from above) that I gave you and...


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

Re: FAP Guestion
-----------------------------------
The code that i put in
[code linenumbers=false]if (($userdata['user_posts'] < 10) && ($full_size_param == '&amp;full=true'))
   {
         message_die(GENERAL_ERROR, "You do not have permission to access this page");  
   }[/code]

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

Any idea?
Please help


-----------------------------------
Artie
Fri 13 Apr, 2007 17:41

Re: FAP Guestion
-----------------------------------
That should work for all. :roll: 

Maybe check that this [highlight=#FFFFAA]'&amp;full=true'[/highlight] is not like this [highlight=#FFFFAA]'&full=true'[/highlight]


-----------------------------------
Siljo
Fri 13 Apr, 2007 18:51

Re: FAP Guestion
-----------------------------------
No it`s correct!

Why this code doesent work right?

First part.
[code linenumbers=false]$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;
}
}
[/code]

Second part.
[code linenumbers=false]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//");
   }[/code]

any idea?
please help


-----------------------------------
Siljo
Tue 17 Apr, 2007 09:08

Re: FAP Guestion
-----------------------------------
[quote user="Artie" post="12101"]That should work for all. :roll: 

Maybe check that this [highlight=#FFFFAA]'&amp;full=true'[/highlight] is not like this [highlight=#FFFFAA]'&full=true'[/highlight][/quote]

No like i said this is what i put in

[code linenumbers=false]if (($userdata['user_posts'] < 10) && ($full_size_param == '&amp;full=true'))
   {
         message_die(GENERAL_ERROR, "You do not have permission to access this page");  
   }[/code]


-----------------------------------
Artie
Tue 17 Apr, 2007 18:28

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

IN [b]album_showpage.php[/b]

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


-----------------------------------
Siljo
Fri 20 Apr, 2007 00:00

Re: FAP Guestion
-----------------------------------
Yes i did :wink: 

[code linenumbers=false]		$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.';
}[/code]

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

Re: FAP Guestion
-----------------------------------
Anybody? :(


-----------------------------------
Siljo
Fri 18 May, 2007 22:29

Re: FAP Guestion
-----------------------------------
Bump


-----------------------------------
Mighty Gorgon
Sun 20 May, 2007 15:27

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

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


-----------------------------------
Mighty Gorgon
Sun 20 May, 2007 19:44

Re: FAP Guestion
-----------------------------------
[quote user="Siljo" post="14413"]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[/quote]
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

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  :oops:


-----------------------------------
Mighty Gorgon
Fri 25 May, 2007 03:04

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

Re: FAP Guestion
-----------------------------------
Yes i can  :mryellow:


