<?php
    //  if activated, prepare the XML result file
    if ($out == 'xml' && $xml_name) {
         media_xml($media_results, count($media_results), $query, round(getmicrotime() - $start_all, 3));
    }
?>

<!--    Links to more-results   -->
        <div id="other_pages" class="tblhead">
        <?php echo "    ".$sph_messages["Result page"]."" ?>:
<?php

        if ($start >1){     // if we do have more than 1 result page
?>
            <a href="<?php echo $search_string ;?>?query=<?php echo "".(addmarks($query))."" ?>&amp;start=<?php echo "".$prev."" ?>&amp;search=1&amp;category=<?php echo "".$category."" ?>&amp;catid=<?php echo "".$catid."" ?>&amp;mark=<?php echo "".$mark."" ?>&amp;media_only=<?php echo "".$media_only."" ?>&amp;results=<?php echo "".$results_per_page.$type_qry.$adv_qry."" ?>&amp;db=<?php echo "".$db."" ?>&amp;prefix=<?php echo "".$prefix."" ?>&amp;domain=<?php echo "".$domain."" ?>"><?php echo "".$sph_messages['Previous']."" ?></a>
<?php   }
        foreach ($other_pages as $page_num) {
            if ($page_num !=$start){
?>
            <a href="<?php echo $search_string ;?>?query=<?php echo "".(addmarks($query))."" ?>&amp;start=<?php echo "".$page_num."" ?>&amp;search=1&amp;category=<?php echo "".$category."" ?>&amp;catid=<?php echo "".$catid."" ?>&amp;mark=<?php echo "".$mark."" ?>&amp;media_only=<?php echo "".$media_only."" ?>&amp;results=<?php echo "".$results_per_page.$type_qry.$adv_qry."" ?>&amp;db=<?php echo "".$db."" ?>&amp;prefix=<?php echo "".$prefix."" ?>&amp;domain=<?php echo "".$domain."" ?>"><?php echo "".$page_num."" ?></a>
<?php       } else { ?>
            <strong><?php echo "".$page_num."" ?></strong>
<?php
            }
        }
        if ($next <= $pages){
?>
            <a href="<?php echo $search_string ;?>?query=<?php echo "".(addmarks($query))."" ?>&amp;start=<?php echo "".$next."" ?>&amp;search=1&amp;category=<?php echo "".$category."" ?>&amp;catid=<?php echo "".$catid."" ?>&amp;mark=<?php echo "".$mark."" ?>&amp;media_only=<?php echo "".$media_only."" ?>&amp;results=<?php echo "".$results_per_page.$type_qry.$adv_qry."" ?>&amp;db=<?php echo "".$db."" ?>&amp;prefix=<?php echo "".$prefix."" ?>&amp;domain=<?php echo "".$domain."" ?>"><?php echo "".$sph_messages['Next']."" ?></a>
 <?php  }  ?>
        </div>
<?php // ?>