$erg = db_query($abf); $class = ''; while ($row = db_fetch_object($erg)) { if ($row->stat == 1) { $coo = 'schließen'; $up = 0; } else { $coo = 'öffnen'; $up = 1; } if ($class == 'Cmite') { $class = 'Cnorm'; } else { $class = 'Cmite'; } echo '<tr class="' . $class . '">'; echo '<td><a href="javascript:delcheck(' . $row->poll_id . ')">löschen</a></td>'; echo '<td><a href="admin.php?vote=0&vid=' . $row->poll_id . '">ändern</a></td>'; echo '<td><a href="admin.php?vote-5=0&ak=' . $up . '&id=' . $row->poll_id . '">' . $coo . '</a></td>'; echo '<td><a href="admin.php?vote=0&showVote=' . $row->poll_id . '">zeigen</a></td>'; echo '<td>' . $row->frage . '</td>'; echo '</tr>'; if (isset($_GET['showVote']) and $_GET['showVote'] == $row->poll_id) { echo '<tr class="' . $class . '"><td colspan="5">'; echo '<table width="90%" cellpadding="0" border="0" cellspacing="0" align="right">'; showVote($row->poll_id); echo '</table></td></tr>'; } } echo '</table>'; $design->footer();
echo '<td width="' . $cw . '" class="dg_body_background_td" align="center" valign="top">'; $ld = "<a href='" . JRoute::_("index.php?option=com_datsogallery&task=image&catid=" . $row->catid . "&id=" . $row->id . $itemid) . "' title='" . $row->imgtitle . "'>"; echo $ld; echo "<img src=\"" . resize($row->imgoriginalname, $ad_thumbwidth, $ad_thumbheight, $ad_crop, $ad_cropratio, 0, $row->catid) . "\" " . get_width_height($row->imgoriginalname, $ad_thumbwidth, $ad_thumbheight, $row->catid, $ad_cropratio) . " class=\"dgimg\" title=\"" . $row->imgtitle . "\" alt=\"" . $row->imgtitle . "\" /></a>"; if ($ad_showdetail) { echo "<div style=\"width:" . $ad_thumbwidth . "px;margin:10px auto 0 auto;text-align:left;text-transform: uppercase;\">"; echo $ad_showimgtitle ? $ld . '<span>' . $row->imgtitle . '</span></a><br />' : ''; ?> <span> <?php echo $ad_showfimgdate ? '<strong>' . JText::_('COM_DATSOGALLERY_DATE_ADD') . '</strong>: ' . strftime($ad_datef, $row->imgdate) . '<br />' : ''; echo $task == 'purchases' ? '<strong>' . JText::_('COM_DATSOGALLERY_DATE_PURCHASED') . '</strong>: ' . strftime($ad_datef, strtotime($row->date)) . '<br />' : ''; echo $task == 'purchases' ? '<strong>' . JText::_('COM_DATSOGALLERY_PRICE') . '</strong>: ' . currencySymbol($ad_pp_currency) . $row->imgprice . '<br />' : ''; echo $ad_showimgcounter ? '<strong>' . JText::_('COM_DATSOGALLERY_HITS') . '</strong>: ' . $row->imgcounter . '<br />' : ''; echo $ad_showdownloads ? '<strong>' . JText::_('COM_DATSOGALLERY_DOWNLOADS') . '</strong>: ' . $row->imgdownloaded . '<br />' : ''; echo $ad_showrating ? showVote($row->id, $row->imgvotes, $row->imgvotesum) : ''; if ($ad_showcomments) { $db->setQuery('SELECT COUNT(cmtid) FROM #__datsogallery_comments WHERE cmtpic = ' . $row->id . ' AND published = 1'); $comments = $db->loadResult(); $comments = $comments ? $comments : JText::_('COM_DATSOGALLERY_NO'); echo "<strong>" . JText::_('COM_DATSOGALLERY_COMMENTS') . "</strong>: {$comments}"; } ?> </span> <?php echo '</div>'; } echo '</td>'; $rowcounter++; } if ($rowcounter % $ad_cp != 0) {
$link = '<a rel="nofollow" class="dgtip" href="http://' . remove_http($obj->imgauthorurl) . '" target="_blank" class="dgtip" id="' . JText::_('COM_DATSOGALLERY_GOTO_AUTHOR_URL') . '">' . $obj->imgauthor . '</a>'; } if (!$obj->imgauthorurl) { $link = $obj->imgauthor; } if (!$obj->imgauthor) { $link = JText::_('COM_DATSOGALLERY_UNKNOWN_AUTHOR'); } echo '<strong>' . JText::_('COM_DATSOGALLERY_AUTHOR') . '</strong>: ' . $link . '<br />'; } echo $ad_showfimgdate ? '<strong>' . JText::_('COM_DATSOGALLERY_DATE_ADD') . '</strong>: ' . strftime($ad_datef, $obj->imgdate) . '<br />' : ''; echo $ad_showimgcounter ? '<strong>' . JText::_('COM_DATSOGALLERY_HITS') . '</strong>: ' . $obj->imgcounter . '<br />' : ''; echo $ad_showdownloads ? '<strong>' . JText::_('COM_DATSOGALLERY_DOWNLOADS') . '</strong>: ' . $obj->imgdownloaded . '<br />' : ''; echo $ad_showres ? '<strong>' . JText::_('COM_DATSOGALLERY_SIZE') . '</strong>: ' . $res . ' / ' . $type . '<br />' : ''; echo $ad_showfimgsize ? '<strong>' . JText::_('COM_DATSOGALLERY_FILESIZE') . '</strong>: ' . $dgfilesize . '<br />' : ''; echo $ad_showrating ? showVote($obj->id, $obj->imgvotes, $obj->imgvotesum, true) : ''; echo exifData($obj->imgoriginalname); ?> </td> <?php } ?> <?php if ($ad_bookmarker) { ?> <td class="bookmarker"><?php echo DatsoBookmarker((int) $obj->id, $obj->imgtitle, $obj->imgtext); ?> </td> <?php }
function viewCategory() { $app = JFactory::getApplication('site'); $db = JFactory::getDBO(); $user = JFactory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); $document = JFactory::getDocument(); $filter_order = $app->getUserStateFromRequest('com_datsogallery.filter_order', 'filter_order', 'a.ordering', 'cmd'); $filter_order_Dir = $app->getUserStateFromRequest('com_datsogallery.filter_order_Dir', 'filter_order_Dir', '', 'word'); $catid = JRequest::getVar('catid', 0, '', 'int'); $menu = JSite::getMenu(); $ids = $menu->getItems('link', 'index.php?option=com_datsogallery&view=datsogallery'); $itemid = isset($ids[0]) ? '&Itemid=' . $ids[0]->id : ''; $is_editor = strtolower($user->usertype) == 'editor' || strtolower($user->usertype) == 'administrator' || strtolower($user->usertype) == 'super administrator'; GalleryHeader(); $db->setQuery("select count(*) from #__datsogallery_catg where cid = " . $catid . " AND access IN (" . $groups . ")"); $is_allowed = $db->loadResult(); if (!$is_allowed) { $app->redirect(JRoute::_('index.php?option=com_datsogallery' . $itemid, false), JText::_('COM_DATSOGALLERY_NOT_ACCESS_THIS_CATEGORY'), 'notice'); } //echo dgCategories($catid); require JPATH_COMPONENT_ADMINISTRATOR . DS . 'config.datsogallery.php'; if ($ad_sbcat) { $ssa = !$ad_slideshow_auto ? ',onOpen:function(currentImage){Shadowbox.play();Shadowbox.pause();}' : ''; $document->addStyleSheet(JURI::base(true) . '/components/com_datsogallery/libraries/shadowbox/shadowbox.css'); $document->addScript(JURI::base(true) . '/components/com_datsogallery/libraries/shadowbox/shadowbox.js'); $sbinit = 'Shadowbox.init({slideshowDelay:' . $ad_slideshow_delay . $ssa . '});'; $document->addScriptDeclaration($sbinit); } $db->setQuery("SELECT COUNT(*)" . " FROM #__datsogallery AS a" . " LEFT JOIN #__datsogallery_catg AS c" . " ON c.cid = a.catid" . " WHERE a.published = 1" . " AND a.catid = " . $catid . " AND a.approved = 1" . " AND c.access IN (" . $groups . ")"); $count = $db->loadResult(); if (!in_array($filter_order, array('a.imgcounter', 'a.imgdownloaded', 'a.imgtitle', 'a.imgdate', 'a.ordering'))) { $filter_order = 'a.ordering'; } if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC'))) { $filter_order_Dir = $ad_sortby; } $orderby = ' ORDER BY ' . $filter_order . ' ' . $filter_order_Dir; if ($ad_picincat && $count > 0) { echo JText::sprintf('COM_DATSOGALLERY_CATEGORY_IMAGES', $count); } ?> <form method="post" id="adminForm"> <?php $query = "SELECT count(*) AS count" . " FROM #__datsogallery" . " WHERE catid = " . $catid . " AND published = 1" . " AND approved = 1"; $db->setQuery($query); $row = $db->LoadObject(); $total = $row->count; jimport('joomla.html.pagination'); $limit = JRequest::getVar('limit', $ad_perpage, '', 'int'); $limitstart = JRequest::getVar('limitstart', 0, '', 'int'); $pagination = new JPagination($total, $limitstart, $limit); if ($count > $ad_perpage) { $page_nav_links = $pagination->getPagesLinks(); ?> <div class="datso_pgn"><?php echo $page_nav_links; ?> </div> <div style="clear:both"></div> <?php } $db->setQuery("SELECT * FROM #__datsogallery_catg WHERE cid = " . $catid); $rows = $db->loadObjectList(); $catname = $rows[0]->name; if ($show_grid) { echo '<div class="dg_head_background">' . str_replace('Joomla.tableOrdering', 'tableOrdering', JHTML::_('grid.sort', $catname . ' ', 'a.imgtitle', $filter_order_Dir, $filter_order)); echo '<span class="grid_txt"><div class="grid_border">' . str_replace('Joomla.tableOrdering', 'tableOrdering', JHTML::_('grid.sort', JText::_('COM_DATSOGALLERY_ORDER') . ' ', 'a.ordering', $filter_order_Dir, $filter_order)) . '</div>'; echo '<div class="grid_border">' . str_replace('Joomla.tableOrdering', 'tableOrdering', JHTML::_('grid.sort', JText::_('COM_DATSOGALLERY_DATE_ADD') . ' ', 'a.imgdate', $filter_order_Dir, $filter_order)) . '</div>'; echo '<div class="grid_border">' . str_replace('Joomla.tableOrdering', 'tableOrdering', JHTML::_('grid.sort', JText::_('COM_DATSOGALLERY_HITS') . ' ', 'a.imgcounter', $filter_order_Dir, $filter_order)) . '</div>'; echo '<div class="grid_border">' . str_replace('Joomla.tableOrdering', 'tableOrdering', JHTML::_('grid.sort', JText::_('COM_DATSOGALLERY_DOWNLOADS') . ' ', 'a.imgdownloaded', $filter_order_Dir, $filter_order)) . '</div>'; echo '</span></div>'; } else { echo '<div class="dg_head_background">' . $catname . '</div>'; } echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"dg_body_background\">\n"; if ($count > $ad_perpage) { $addspace = ' - '; } else { $addspace = ''; } $pages = $pagination->getPagesCounter(); $document->setTitle($catname . $addspace . $pages); if ($ad_metagen) { if ($rows[0]->description) { $document->setTitle($catname . $addspace . $pages); $document->setDescription(limit_words($rows[0]->description, 25)); $document->setMetadata('keywords', metaGen($rows[0]->description)); } } $query = 'SELECT a.*' . ' FROM #__datsogallery AS a' . ' LEFT JOIN #__datsogallery_catg AS c' . ' ON c.cid = a.catid' . ' WHERE a.published = 1' . ' AND a.catid = ' . $catid . ' AND a.approved = 1' . ' AND c.access IN (' . $groups . ')' . $orderby; $db->setQuery($query, $pagination->limitstart, $pagination->limit); $rows = $db->loadObjectList(); $rowcounter = 0; if (count($rows) > 0) { foreach ($rows as $row1) { if ($ad_ncsc) { $cw = 100 / $ad_cp . "%"; } if ($rowcounter % $ad_cp == 0) { echo " <tr>\n"; } echo " <td width=\"" . $cw . "\" class=\"dg_body_background_td\" align=\"center\" valign=\"top\">\n"; $tle = jsspecialchars($row1->imgtitle); if ($ad_showdetail) { $picdate = strftime($ad_datef, $row1->imgdate); } $na = $ad_na ? '#dgtop' : ''; $ld = "<a href='" . JRoute::_("index.php?option=com_datsogallery&task=image&catid=" . $catid . "&id=" . $row1->id . $itemid) . $na . "' title='" . $tle . "'>"; if ($ad_sbcat) { echo " <a rel='shadowbox[screenshots];player=img' href='" . JURI::root() . "index.php?option=com_datsogallery&task=sbox&catid=" . $catid . "&id=" . $row1->id . "&format=raw' title='" . $tle . "'>"; } else { echo $ld; } echo " <img src=\"" . resize($row1->imgoriginalname, $ad_thumbwidth, $ad_thumbheight, $ad_crop, $ad_cropratio, 0, $row1->catid) . "\" " . get_width_height($row1->imgoriginalname, $ad_thumbwidth, $ad_thumbheight, $catid, $ad_cropratio) . " class=\"dgimg\" title=\"" . $tle . "\" alt=\"" . $tle . "\" /></a>"; if ($ad_showdetail) { echo " <div style=\"width:" . $ad_thumbwidth . "px;margin:10px auto 0 auto;text-align:left;text-transform: uppercase;\">"; echo $ad_showimgtitle ? $ld . '<span>' . $row1->imgtitle . '</span></a><br />' : ''; echo " <span>"; echo $ad_showfimgdate ? '<strong>' . JText::_('COM_DATSOGALLERY_DATE_ADD') . '</strong>: ' . $picdate . '<br />' : ''; echo $ad_showimgcounter ? '<strong>' . JText::_('COM_DATSOGALLERY_HITS') . '</strong>: ' . $row1->imgcounter . '<br />' : ''; echo $ad_showdownloads ? '<strong>' . JText::_('COM_DATSOGALLERY_DOWNLOADS') . '</strong>: ' . $row1->imgdownloaded . '<br />' : ''; echo $ad_showrating ? showVote($row1->id, $row1->imgvotes, $row1->imgvotesum) : ''; if ($ad_showcomments) { $and = $is_editor ? '' : ' AND published = 1'; $db->setQuery('SELECT COUNT(cmtid) FROM #__datsogallery_comments WHERE cmtpic = ' . $row1->id . $and); $comments = $db->loadResult(); echo "<strong>" . JText::_('COM_DATSOGALLERY_COMMENTS') . "</strong>: {$comments}"; } echo " </span>"; echo " </div>"; } echo " </td>\n"; $rowcounter++; } } else { echo " <td width=\"" . @$cw . "\" class=\"dg_body_background_td\">" . JText::_('COM_DATSOGALLERY_NO_RESULTS') . "</td>\n"; } if ($rowcounter % $ad_cp != 0) { for ($i = 1; $i <= $ad_cp - $rowcounter % $ad_cp; $i++) { echo " <td width=\"" . @$cw . "\" class=\"dg_body_background_td\"> </td>\n"; } } echo " </tr>\n"; echo "</table>\n"; if ($count > $ad_perpage) { $page_nav_links = $pagination->getPagesLinks(); ?> <div class="datso_pgn"><?php echo $page_nav_links; ?> </div> <?php } ?> <input type="hidden" name="filter_order" value="<?php echo $filter_order; ?> " /> <input type="hidden" name="filter_order_Dir" value="<?php echo $filter_order_Dir; ?> " /> <?php echo JHTML::_('form.token'); ?> </form> <?php echo dgCategories($catid); GalleryFooter(); }