 | |  | | | Photopost Pro How Do I...? Wondering how to do things in PhotoPost? |
October 10th, 2006, 03:49 PM
|
#1 (permalink)
| | Member Verified Customer
Join Date: Feb 2004
Posts: 117
| Comments Question
Can you please help me with a question about how PP handles some things.
I have modified my showphoto.php file so that only certain users are able to view photos in certain categories, otherwise they get sent to a signup page. I also have it where certain categories are visible to all users. Everything works fine as intended, except for when commenting. To begin with (and to better explain), here is the code I am using: Code: Content visible to verified customers only.
Basically saying, for all categories except 513, 514, and 515, unless you are a part of usergroup 5, 6, or 7 then you will be sent to the signup page. This works fine as everyone can view the photos in categories 513, 514, and 515, and only usergroups 5, 6, and 7 can view the other categories without getting the signup message.
The problem comes in when a user in a group other than 5, 6, or 7 tries to rate or comment on a photo in group 513, 514, or 515. It allows them to view the photo, and then rate or comment it, but once it has completed the rating/comment, it sends them to the signup page. I can quite figure this out, since it should send them back to the photo. Maybe I am missing something further down in the code that I didn't see which needs to be changed. The only thing I can tell is the URL does change from http://www.mysite.com/photos/showpho.../13007/cat/515 to http://www.mysite.com/photos/showphoto.php?photo=13007 so I'm not sure if that is part of the problem or not. Please help point me in the right direction. Thanks!
|
| |
October 10th, 2006, 04:59 PM
|
#2 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,695
|
the one thing I see off hand is your using within your brackets && whereas it should be ||
|
| |
October 11th, 2006, 06:45 AM
|
#3 (permalink)
| | Member Verified Customer
Join Date: Feb 2004
Posts: 117
|
It don't understand... The && means that it has to meet all of those requirements. If I replace any of the && with || then then don't meet those requirements and it starts displaying the signup page when it isn't supposed to.
If I am wrong, can you suggest how it is supposed to work then, and will that take care of my issue with it poping up the signup screen when someone leaves a comment.
|
| |
October 11th, 2006, 09:07 AM
|
#4 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,695
|
Your logic is flawed if I follow.
You want to match if a user's usergroup is not one of the ones in those parentheses AND not one of the cats then do this hense it must be like I said. Code: Content visible to verified customers only.
|
| |
October 11th, 2006, 01:01 PM
|
#5 (permalink)
| | Member Verified Customer
Join Date: Feb 2004
Posts: 117
|
I understand where you are coming from; however, if I do the code that way, then it will show the signup page for everyone, no matter what usergroup or category. Logically thinking it should be OR, since usergroup is 1 and is not a member of usergroup 5, 6, 7, OR 8, then they should see the signup page. For some reason thought it is not seeing it that way and sends all groups to the signup page. The only way I can get it to function the way it is intended is to have the code the way it is.
Anyways... I have found the problem. It appears it as I initially had said with the way the URL changes after a comment is made. When my code is looking for the particular categories that are allowed, when the URL changes, apparently it doesn't know what category it is, so it sends the person to the signup page. I fixed it by changing the following line in comments.php from Code: Content visible to verified customers only.
to Code: Content visible to verified customers only.
|
| |
October 11th, 2006, 01:28 PM
|
#6 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,695
|
You can post your mod questions in the mod corner but your code simply will never work. Your logic is not valid. The code must be as I posted as that is correct but the big question here where are you grabbing and defining the $usergroup parameter?
Nothing will work until you define the $usergroup paramter maybe above the if statement this
list( $guserid, $gusername, $gmail, $gpass, $gtemp, $usergroup ) = get_userinfo("", {$User'userid']});
|
| |
October 11th, 2006, 06:20 PM
|
#7 (permalink)
| | Member Verified Customer
Join Date: Feb 2004
Posts: 117
|
It's OK Chuck... when I changed the comments.php file it fixed what I need it to do. However flawed it may be, it is the only thing that works properly, and now all is working perfectly like I wanted it. As far as defining the usergroup, this is something you and Michael had helped me in the past with. In photopost.php I changed Code: Content visible to verified customers only.
to Code: Content visible to verified customers only.
|
| |
October 11th, 2006, 06:38 PM
|
#8 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,695
|
Right but your if statement is not using $User['usergroup'] in the statement
|
| |
October 12th, 2006, 12:43 AM
|
#9 (permalink)
| | Member Verified Customer
Join Date: Feb 2004
Posts: 117
|
Not sure why it works, but it is
This is what you sent me regarding this over a year ago: Quote:
Sure showphoto can use usergroup setting. why not just modify photopost.php to define that like so
find the offset definition and add the usergroup definition below it and then usergroup will be available throughout the program
$User['offset'] = $offset;
$User['usergroup'] = $usergroup;
| |
| |
October 12th, 2006, 08:08 AM
|
#10 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,695
|
Thats fine I am just pointing out $usergroup is never defined
|
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | | | | Display Modes | Rate This Thread | Linear Mode | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT -5. The time now is 03:58 PM. | |