Mythotical
12-12-2009, 04:29 PM
Well found another coding error and can't seem to figure out what is going on. Need someone to look over this for me and tell me if there is another way to work the if condition or work around for it.
$query = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "download WHERE catid = '" . $cid . ");
while ($dl = $db->fetch_array($query))
{
$fid = $dl['file_id'];
$moderated = $dl['moderated'];
$version = $dl['version'];
$name = $dl['name'];
$title = $dl['title'];
$size = $dl['size'];
$description = $dl['description'];
$username = $dl['username'];
$userid = $dl['userid'];
$ugpid = $dl['usergroupid'];
$bytes = vbmksize($size);
$fileview = $ugpid;
if (!empty($ugpid))
{
$ugpids = explode(',', $ugpid);
}
else
{
$ugpids = array('0');
}
$myids = '';
if ($vbulletin->userinfo['membergroupids'] == '')
{
$myids = array($vbulletin->userinfo['usergroupid']);
}
else
{
$myids = explode(',',$vbulletin->userinfo['membergroupids']);
}
$showfile = 0;
if (!empty($ugpid))
{
for ($i=0; $i<=20; $i++)
{
if (in_array($ugpids[$i], $myids))
{
$showfile = 1;
}
}
}
}
Thanks in advance for the help
Steve
$query = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "download WHERE catid = '" . $cid . ");
while ($dl = $db->fetch_array($query))
{
$fid = $dl['file_id'];
$moderated = $dl['moderated'];
$version = $dl['version'];
$name = $dl['name'];
$title = $dl['title'];
$size = $dl['size'];
$description = $dl['description'];
$username = $dl['username'];
$userid = $dl['userid'];
$ugpid = $dl['usergroupid'];
$bytes = vbmksize($size);
$fileview = $ugpid;
if (!empty($ugpid))
{
$ugpids = explode(',', $ugpid);
}
else
{
$ugpids = array('0');
}
$myids = '';
if ($vbulletin->userinfo['membergroupids'] == '')
{
$myids = array($vbulletin->userinfo['usergroupid']);
}
else
{
$myids = explode(',',$vbulletin->userinfo['membergroupids']);
}
$showfile = 0;
if (!empty($ugpid))
{
for ($i=0; $i<=20; $i++)
{
if (in_array($ugpids[$i], $myids))
{
$showfile = 1;
}
}
}
}
Thanks in advance for the help
Steve