Table 'lideocom_primary.articles' doesn't existTable 'lideocom_primary.articles' doesn't existExecute('(SELECT * FROM articles WHERE postid = '.$DB->qstr($id).' LIMIT 1) UNION (SELECT * FROM articles WHERE postcat = '.$DB->qstr($u).' LIMIT 50)'); if(!$rc) print $DB->ErrorMsg(); else while(!$rc->EOF) { if($rc->fields['postid'] == $id) { $postcat = $rc->fields['postcat']; $postuserid = $rc->fields['postuserid']; $mainads[] = $rc->fields; } else { $subads[] = $rc->fields; } $rc->MoveNext(); } $rd = $DB->execute('SELECT parent.id, parent.title, parent.seotitle, parent.parent, parent.level FROM category AS node, category AS parent WHERE node.lft BETWEEN parent.lft AND parent.rgt AND (node.id = '.$DB->qstr($postcat).') GROUP BY parent.lft ORDER BY parent.lft;'); while(!$rd->EOF) { $category[] = $rd->fields; $rd->MoveNext(); } $re = $DB->Execute('SELECT * FROM members WHERE userid = '.$DB->qstr($postuserid).' LIMIT 1'); if(!$re) print $DB->ErrorMsg(); else while(!$re->EOF) { $profileid = $re->fields['userid']; $members[] = $re->fields; $re->MoveNext(); } $shouter = @$_SESSION['userid']; $rf = $DB->Execute('SELECT * FROM followers WHERE fotoid = '.$DB->qstr($profileid).' or fofromid = '.$DB->qstr($profileid).''); if(!$rf) print $DB->ErrorMsg(); else while(!$rf->EOF) { $fotoid = $rf->fields['fotoid']; $fofromid = $rf->fields['fofromid']; if($shouter == $fofromid) { $smarty->assign('fofromid','4'); } if($fofromid == $profileid) { $followers[] = $rf->fields; } $rf->MoveNext(); } $rg = $DB->Execute('SELECT * FROM comments WHERE idcomm = '.$DB->qstr($id).' ORDER BY commentid DESC'); if(!$rg) print $DB->ErrorMsg(); else while(!$rg->EOF) { if($rg->fields['commid'] == 0) { $comments[] = $rg->fields; } else { $comment[] = $rg->fields; } $rg->MoveNext(); } if(@$_SESSION['hits'] <> $id.$_SERVER['SERVER_NAME']) { $rh = $DB->Prepare('UPDATE articles SET hits = hits + '.$DB->qstr('1').' WHERE postid = '.$DB->qstr($id).''); if($DB->Execute($rh) === false) { print $DB->ErrorMsg(); } } $_SESSION['hits'] = $id.$_SERVER['SERVER_NAME']; $smarty->caching = $caching; $smarty->assign('mainads',@$mainads); $smarty->assign('category',@$category); $smarty->assign('subads',@$subads); $smarty->assign('members',@$members); $smarty->assign('followers',@$followers); $smarty->assign('profileid',@$profileid); $smarty->assign('comments',@$comments); $smarty->assign('comment',@$comment); include ('includes/menu.php'); $smarty->display('article.php',$id); $smarty->display('footer.php'); $DB->Close(); ?>