<?php
//$Start means the page no. user is viewing
if(isset($_GET['start'])) $Start = intval($_GET['start']);
else $Start = 1;
$From = ($Start-1)*10; //from which question ID?
$Display->ShowProfileQuestionCount();
$Total = $Display->ShowQuestionCount['answered'];
$NoOfPages = ceil($Total*0.2); // showing 20 questions on each page, so how many pages?
if($From > $Total)
{
$From = 0;
$Start = 1;
}
//Show link for each page
print " <div class='page_bar'> Browse the answers <strong>(Page $Start)</strong> <br /> Pages» ";
for($i=0; $i<$NoOfPages; $i++)
{
$k = $i+1;
print " <a href='./?page=answer&Start={$k}'>$k</a> ";
}
print ' </div> ';
//Show 20 questions on a page
$Display->ShowProfileAnswer();
if($Display->ShowAnswer == false)
print " <p> No questions are answered yet </p> ";
else
{
$i = 0;
foreach($Display->ShowAnswer as $Key => $KeyValue)
{
$From++;
if($KeyValue['status'] == 'answered')
{
$i++;
if($i<20 && $Key<$From)
{
if(empty($b)) $b = 0;
if($b%2 == 0) $BackgroundColour = '#F1F1F1';
else $BackgroundColour = '#E2E2E2';
$b++;
?>
<div style="background-color:<?php _P($BackgroundColour); ?>; padding:8px; margin:4px;">
<strong>Asked-by:</strong>
<?php
if(!empty($KeyValue['asker_url'])) print "<a href='{$KeyValue['asker_url']}'>{$KeyValue['asker_name']}</a>";
else print "{$KeyValue['asker_name']}";
?>
|| <strong>Time:</strong> <?php _P($KeyValue['question_time']); ?>
<blockquote style="padding:10px; font-family:Georgia, 'Times New Roman', Times, serif; text-indent:10px;"> <?php _P($KeyValue['question']); ?> </blockquote>
<a href='<?PHP _P($Display->PrsaarURL); ?>/askme/view-answer.php?id=<?php _P($KeyValue['id']); ?>'>View Answer ›</a>
</div>
<?php
}
}
}
}
?>