AN-net
07-28-2005, 12:50 AM
ok if the user has set buddies and the user can not view the journal as of yet it will continue into this if statement but my question is:
what if the user has set buddies to view but $view is false will continue to the whocanview check or will it stop at buddies check because we have fulfilled the requirement?
if($entry['journal_private'])
{
if($bbuserinfo['userid'] != 0)
{
if(($bbuserinfo['userid'] == $entry['journalist_id']) OR ($bbuserinfo['usergroupid']==6))
{
$view_journal= true;
}
elseif($entry['journal_allowbuddies'] == 1 AND !$view)
{
if(isset($entry['jbuddylist']))
{
$buddies= explode(' ', $entry['jbuddylist']);
if(in_array($bbuserinfo['userid'], $buddies))
{
$view_journal= true;
}
else
{
$view_journal= false;
}
}
}
elseif(isset($entry['journal_whocanview']) AND !$view)
{
$wcv= explode(',', $entry['journal_whocanview']);
if(in_array($bbuserinfo['userid'], $wcv))
{
$view_journal= true;
$isbuddy= true;
}
}
else
{
$view_journal= false;
}
}
else
{
$view_journal= false;
}
}
also is there maybe another way i can check all of this stuff without these killer if statements?
what if the user has set buddies to view but $view is false will continue to the whocanview check or will it stop at buddies check because we have fulfilled the requirement?
if($entry['journal_private'])
{
if($bbuserinfo['userid'] != 0)
{
if(($bbuserinfo['userid'] == $entry['journalist_id']) OR ($bbuserinfo['usergroupid']==6))
{
$view_journal= true;
}
elseif($entry['journal_allowbuddies'] == 1 AND !$view)
{
if(isset($entry['jbuddylist']))
{
$buddies= explode(' ', $entry['jbuddylist']);
if(in_array($bbuserinfo['userid'], $buddies))
{
$view_journal= true;
}
else
{
$view_journal= false;
}
}
}
elseif(isset($entry['journal_whocanview']) AND !$view)
{
$wcv= explode(',', $entry['journal_whocanview']);
if(in_array($bbuserinfo['userid'], $wcv))
{
$view_journal= true;
$isbuddy= true;
}
}
else
{
$view_journal= false;
}
}
else
{
$view_journal= false;
}
}
also is there maybe another way i can check all of this stuff without these killer if statements?