function showResults($result, $searchtext) { global $rsgConfig; html_rsg2_search::showSearchBox(); //Format number of hits $count = count($result); $count = "<span style=\"font-weight:bold;\">" . $count . "</span>"; ?> <table width="100%" style="border-bottom: thin solid #CCCCCC;"> <tr> <td><div align="right"><a href="index.php?option=com_rsgallery2"><?php echo JText::_('Main gallery page'); ?> </a></div></td> </tr> <tr> <td><h3><?php echo JText::_('RSGallery2 Search Results'); ?> </h3></td> </tr> <tr> <td> <span style="font-style:italic;"> <?php echo JText::_('There are ') . $count . JText::_(' results for '); ?> <span style="font-weight:bold;";><?php echo $searchtext; ?> </span> <span> </td> </tr> </table> <br /> <?php if ($result) { foreach ($result as $match) { ?> <table width="100%" border="0" style="border-bottom: thin solid #CCCCCC;"> <tr> <td width="<?php echo $rsgConfig->get('thumb_width'); ?> "> <div class="img-shadow"> <a href="index.php?option=com_rsgallery2&page=inline&id=<?php echo $match->item_id; ?> "> <img border="0" src="<?php echo JURI_SITE . $rsgConfig->get('imgPath_thumb') . "/" . imgUtils::getImgNameThumb($match->itemname); ?> " alt="image" /> </a> </div> </td> <td valign="top"> <a href="index.php?option=com_rsgallery2&page=inline&id=<?php echo $match->item_id; ?> "> <span style="font-weight:bold;"><?php echo galleryUtils::highlight_keywords($match->title, $searchtext); ?> </span> </a> <p><?php echo galleryUtils::highlight_keywords($match->descr, $searchtext); ?> </p> <p style="color: #999999;font-size:10px;"> [<?php echo JText::_('Gallery name'); ?> :<a href="<?php echo JRoute::_("index.php?option=com_rsgallery2&gid=" . $match->gallery_id); ?> "><?php echo $match->name; ?> </a>] <?php if ($match->userid > 0) { echo "[" . JText::_('Owner') . ": " . galleryUtils::genericGetUsername($match->userid) . "]"; } ?> </p> </td> </tr> </table> <br /> <?php } } }
/** * This function will show the 5 last uploaded images */ function latestImages() { global $rows; $my = JFactory::getUser(); $database = JFactory::getDBO(); $lastweek = mktime(0, 0, 0, date("m"), date("d") - 7, date("Y")); $lastweek = date("Y-m-d H:m:s", $lastweek); $database->setQuery("SELECT * FROM #__rsgallery2_files WHERE date >= '{$lastweek}' and published=1 ORDER BY id DESC LIMIT 0,5"); $rows = $database->loadObjectList(); if (count($rows) > 0) { foreach ($rows as $row) { ?> <tr> <td><?php echo $row->name; ?> </td> <td><?php echo galleryUtils::getCatnameFromId($row->gallery_id); ?> </td> <td><?php echo $row->date; ?> </td> <td><?php echo galleryUtils::genericGetUsername($row->userid); ?> </td> </tr> <?php } } else { echo "<tr><td colspan=\"4\">" . JText::_('No new entries') . "</td></tr>"; } }