$sLimit = ' LIMIT 0,' . $iDivis;
 } else {
     if ($_REQUEST['commPage2'] <= 0) {
         $_REQUEST['commPage2'] = 1;
     }
     $iCurr = (int) $_REQUEST['commPage2'];
     $sLimit = ' LIMIT ' . ($iCurr - 1) * $iDivis . ',' . $iDivis;
 }
 $sQuery = "select s.*,c.Title as ctitle from Store s inner join StoreCategories c on c.ID=s.categoryID where s.type=0 and  s.status=1 and s.userID={$profileID}  order by {$order} ";
 $rElems = mysql_query($sQuery);
 $iNums = mysql_num_rows($rElems);
 $count = (int) ($iNums / $iDivis);
 if ($iNums / $iDivis > (int) ($iNums / $iDivis)) {
     $count++;
 }
 $aPaging = $iNums > $iDivis ? MakePaging($iNums, $iCurr, $iDivis, 4, 'commPage2', '#del') : '';
 $rElems = mysql_query($sQuery . $sLimit);
 while ($book = mysql_fetch_assoc($rElems)) {
     $oVotingView->_fRate = $book['rating'];
     $vote1 = $oVotingView->getSmallVoting(0, '');
     if ($color == 'f5f5f5') {
         $color = 'ffffff';
     } else {
         $color = 'f5f5f5';
     }
     $temp = array();
     $temp['Color'] = $color;
     $temp['ID'] = $book['ID'];
     $temp['url'] = '/product.php?ID=' . $book['ID'];
     $temp['Title'] = htmlspecialchars($book['Title']);
     $temp['Date'] = date("F jS, Y", $book['date']);
    $sLimit = ' LIMIT 0,' . $iDivis;
} else {
    if ($_GET['commPage'] <= 0) {
        $_GET['commPage'] = 1;
    }
    $iCurr = (int) $_GET['commPage'];
    $sLimit = ' LIMIT ' . ($iCurr - 1) * $iDivis . ',' . $iDivis;
}
$sQuery = "select r.*,p.fname,p.lname,p.ID as pid from ProfilesRating r inner join Profiles p on p.ID=r.userID where r.voteID={$profileID} order by p.ID desc";
$rElems = mysql_query($sQuery);
$iNums = mysql_num_rows($rElems);
$count = (int) ($iNums / $iDivis);
if ($iNums / $iDivis > (int) ($iNums / $iDivis)) {
    $count++;
}
$aPaging = $iNums > $iDivis ? MakePaging($iNums, $iCurr, $iDivis, 4, 'commPage', '#reviews') : '';
$rElems = mysql_query($sQuery . $sLimit);
$rews = array();
while ($arr = mysql_fetch_assoc($rElems)) {
    $oVotingView->_fRate = $arr['rating'];
    $vote1 = $oVotingView->getSmallVoting(0, '');
    $temp['Title'] = htmlspecialchars($arr['Title']);
    $temp['Text'] = htmlspecialchars($arr['Text']);
    $temp['Author_url'] = '/profile.php?ID=' . $arr['pid'];
    $temp['Author'] = $arr['fname'] . ' ' . $arr['lname'];
    $temp['Date'] = date("d/m/Y", $arr['date']);
    $temp['Vote'] = $vote1;
    $rews[] = $temp;
}
$smarty->assign("aRews", $rews);
$smarty->assign("aPaging", $aPaging);