Author Topic: own photo and photo comments for a free user to see  (Read 1086 times)

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1004
  • Karma: +56/-7
own photo and photo comments for a free user to see
« on: September 29, 2015, 02:28:13 PM »
I set up my etano so that only premium members can see the photo_view.html page and the comments of another member. So, when a free member views this page after they click on a thumbnail in their my_photos.html page, they are blocked from viewing the photo_view page unless they upgrade. Is it possible for the free member to view their own large photo and photo comments?
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 2996
  • Karma: +210/-7
    • Maverick Webworks
Re: own photo and photo comments for a free user to see
« Reply #1 on: September 29, 2015, 11:43:52 PM »
Not that I know of.

When you choose to allow access to certain features only for paid members, it means everybody must have be a paid member to access it. It would be tad difficult to make exceptions for just certain features or pages.

You need to be careful which features you restrict access to, this feature in particular (view_photos) in the admin access levels which restricts access to view the large photo and comments, it also doesn't allow you to view the large photo in popups, the popup never loads the photo and can make your site appear broken to those you have restricted access.

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1004
  • Karma: +56/-7
Re: own photo and photo comments for a free user to see
« Reply #2 on: October 01, 2015, 12:49:00 AM »
I disabled the pop-up photos a month ago, so I haven't had the problems with this feature as you noted.
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

KHDev

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 505
  • Karma: +43/-2
  • Etano Contributor (Skins & Mods)
    • KH Web Development
Re: own photo and photo comments for a free user to see
« Reply #3 on: October 04, 2015, 08:00:35 AM »
Since you're not using pop-ups, You can make photo_view.php accessible to paid members only (And allow photo owner access) with something like:

Assuming you have assigned access level photo_view to paid memberships only:

Code: [Select]
<?php

###  REMOVE THIS - line 19 ### 
check_login_member('view_photo');

### FIND THIS - lines 24-25 ###
$o=isset($_GET['o']) ? (int)$_GET['o'] : 0;
$r=!empty($_GET['r']) ? (int)$_GET['r'] : current($accepted_results_per_page);

### ADD THIS BELOW IT ###
$query="SELECT `fk_user_id` FROM `{$dbtable_prefix}user_photos` WHERE `photo_id`=$photo_id";
if (!(
$res=@mysql_query($query))) {trigger_error(mysql_error(),E_USER_ERROR);}
while ($rsrow=mysql_fetch_assoc($res)) {
$pic_owner=sanitize_and_format($rsrow['fk_user_id'],TYPE_INT,$__field2format[FIELD_INT]);
}
if (!empty($_SESSION[_LICENSE_KEY_]['user']['user_id']) && $_SESSION[_LICENSE_KEY_]['user']['user_id']==$pic_owner) {
check_login_member('auth');
} else {
check_login_member('view_photo');
}



And that should be it.

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1004
  • Karma: +56/-7
Re: own photo and photo comments for a free user to see
« Reply #4 on: October 04, 2015, 10:22:35 AM »
Hey, Thanks KHDev! That's exactly what I was looking for.  :)
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.