Author Topic: separating private photos from public photos  (Read 888 times)

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1004
  • Karma: +56/-7
separating private photos from public photos
« on: September 17, 2015, 10:40:17 PM »
When I view a member's photos and I am a friend, I can see both their public and private photos, but when I click to view their private photos, only their private photos appear. How can I make it so that viewing their public photos will only display their public photos, not both public and private?
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: 3009
  • Karma: +210/-7
    • Maverick Webworks
Re: separating private photos from public photos
« Reply #1 on: September 18, 2015, 12:29:13 AM »

Open your photo_search.php file and locate the following code:
Code: [Select]
case 'user':
$input['acclevel_code']='search_photo';
$input['uid']=sanitize_and_format_gpc($_GET,'uid',TYPE_INT,0,0);
if (!empty($_SESSION[_LICENSE_KEY_]['user']['user_id']) && $input['uid']==$_SESSION[_LICENSE_KEY_]['user']['user_id']) {
redirect2page('my_photos.php');
}
if (!empty($input['uid'])) {
$where.=" AND a.`fk_user_id`=".$input['uid'];
require_once _BASEPATH_.'/includes/network_functions.inc.php';
// if I am a friend with this gorgeous girl show me the hidden stuff also :)
if (empty($_SESSION[_LICENSE_KEY_]['user']['user_id']) || !is_network_member($input['uid'],$_SESSION[_LICENSE_KEY_]['user']['user_id'],NET_FRIENDS)) {
$where.=" AND a.`is_private`=0";
}
} else {
$error=true;
}
$tplvars['page_title']=sprintf($GLOBALS['_lang'][143],get_user_by_userid($input['uid']));
break;

And replace it with:
Code: [Select]
case 'user':
    $where.=" AND a.`is_private`=0";
$input['acclevel_code']='search_photo';
$input['uid']=sanitize_and_format_gpc($_GET,'uid',TYPE_INT,0,0);
if (!empty($_SESSION[_LICENSE_KEY_]['user']['user_id']) && $input['uid']==$_SESSION[_LICENSE_KEY_]['user']['user_id']) {
redirect2page('my_photos.php');
}
if (!empty($input['uid'])) {
$where.=" AND a.`fk_user_id`=".$input['uid'];
}
$tplvars['page_title']=sprintf($GLOBALS['_lang'][143],get_user_by_userid($input['uid']));
break;

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: separating private photos from public photos
« Reply #2 on: September 18, 2015, 10:46:59 PM »
Great! Thanks Maverick. :)
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.