<?php defined('_JEXEC') or die('Restricted access'); define('REAL_NAME', 0); define('USERNAME', 1); $Itemid=AwdwallHelperUser::getComItemId(); $userids=$this->userids; $privacy=$this->privacy; $useridstr=$this->useridstr; $app = JFactory::getApplication('site'); $config = & $app->getParams('com_awdwall'); $listingperpage = $config->get('listingperpage', 5); $imagelimit = $config->get('imagelimit',4); $wallversion=checkversionwall(); $db =& JFactory :: getDBO(); $user =& JFactory::getUser(); $pendingFriends = JsLib::getPendingFriends($user->id); $groupsUrl=JRoute::_('index.php?option=com_awdwall&task=groups&Itemid=' . $Itemid, false); if($wallversion=='cb') { $friendJsUrl = JRoute::_('index.php?option=com_awdwall&task=friends&Itemid=' . $Itemid, false); $accountUrl=JRoute::_('index.php?option=com_comprofiler&task=userProfile&user='******'&Itemid=' . $Itemid, false); } elseif($wallversion=='js') { $friendJsUrl = JRoute::_('index.php?option=com_community&view=friends&userid=' . $user->id . '&Itemid=' . $Itemid,false); $accountUrl=JRoute::_('index.php?option=com_community&view=profile&userid=' . $user->id . '&Itemid=' . $Itemid, false); } else { $friendJsUrl = JRoute::_('index.php?option=com_awdwall&task=friends&Itemid=' . $Itemid, false);
function isalbumviewable($id) { $db =& JFactory :: getDBO(); $user=&JFactory::getUser(); $query = 'SELECT * FROM #__awd_jomalbum where id='.$id; $db->setQuery($query); $albums=$db->loadObjectList(); $wallversion=checkversionwall(); $friendstr=getfriendlistAlbum($albums[0]->userid); $friendofFriendstr=getfriendOfFriendlistAlbum($albums[0]->userid); if($albums[0]->privacy==0) // all { return true; } else if($albums[0]->privacy==1) //friendonly { if($albums[0]->userid==$user->id) // if owner of album { return true; } else { if($friendstr==1) { return true; } else { return false; } } } else if($albums[0]->privacy==3) // me only { if($albums[0]->userid==$user->id) { return true; } else { return false; } } else if($albums[0]->privacy==2) // friend of friends { if($albums[0]->userid==$user->id)// if owner of album { return true; } else if($friendstr==1)// if friend { return true; } else { if($friendofFriendstr==1)// if friend of friends { return true; } else { return false; } } } else { return false; } }