function Joom_User_PanelShow_HTML(&$showcats, &$showpicupload, &$olist, &$slist, &$rows, &$pageNav)
    {
        $config = Joom_getConfig();
        $database =& JFactory::getDBO();
        $user =& JFactory::getUser();
        if ($config->jg_showminithumbs) {
            ?>
  <script  type="text/javascript" src="<?php 
            echo _JOOM_LIVE_SITE;
            ?>
includes/js/overlib_mini.js"></script>
<?php 
        }
        ?>
  <div class="jg_userpanelview">
    <div class="jg_up_head">
<?php 
        if ($showpicupload) {
            ?>
      <input type="button" name="Button" value="<?php 
            echo JText::_('JGS_NEW_PICTURE');
            ?>
"
      onclick = "javascript:location.href='<?php 
            echo JRoute::_('index.php?option=com_joomgallery&func=showupload' . _JOOM_ITEMID, false);
            ?>
';"
      class="button" />

<?php 
        }
        if ($showcats) {
            ?>
      <input type="button" name="Button" value="<?php 
            echo JText::_('JGS_CATEGORIES');
            ?>
"
      onclick = "javascript:location.href='<?php 
            echo JRoute::_('index.php?option=com_joomgallery&func=showusercats&uid=' . $user->get('id') . _JOOM_ITEMID, false);
            ?>
';"
      class="button" />
<?php 
        }
        ?>
      <form action="<?php 
        echo JRoute::_('index.php?option=com_joomgallery&func=userpanel' . _JOOM_ITEMID);
        ?>
" method="post" name="form">
        <p>
<?php 
        //navigation, only if pictures exist
        if (!is_null($pageNav)) {
            ?>
          <?php 
            echo $pageNav->getListFooter();
            ?>
 
<?php 
        }
        ?>
          <?php 
        echo $slist;
        ?>
 
          <?php 
        echo $olist;
        ?>
 
        </p>
      </form>
    </div>
    <div class="sectiontableheader">
      <div class="jg_up_entry">
        <div class="jg_up_ename">
          <?php 
        echo JText::_('JGS_PICTURE_NAME');
        ?>
 
        </div>
        <div class="jg_up_ehits">
          <?php 
        echo JText::_('JGS_HITS');
        ?>
 
        </div>
        <div class="jg_up_ecat">
          <?php 
        echo JText::_('JGS_CATEGORY');
        ?>
 
        </div>
        <div class="jg_up_eact">
          <?php 
        echo JText::_('JGS_ACTION');
        ?>
 
        </div>
<?php 
        if ($config->jg_approve) {
            ?>
        <div class="jg_up_eappr">
          <?php 
            echo JText::_('JGS_APPROVED');
            ?>
 
        </div>
<?php 
        }
        ?>
      </div>
    </div>
<?php 
        $k = 0;
        if (count($rows)) {
            foreach ($rows as $row) {
                $k = 1 - $k;
                $p = $k + 1;
                $catpath = Joom_GetCatPath($row->catid);
                ?>
    <div class="<?php 
                echo "sectiontableentry" . $p;
                ?>
">
      <div class="jg_up_entry">
<?php 
                if ($row->approved) {
                    $link = Joom_OpenImage($config->jg_detailpic_open, $row->id, $catpath, $row->catid, $row->imgfilename, $row->imgtitle, $row->imgtext);
                }
                ?>
        <div class="jg_up_ename">
<?php 
                if ($config->jg_showminithumbs) {
                    if ($row->imgthumbname != '' && is_file(JPath::clean(JPATH_ROOT . DS . $config->jg_paththumbs . $catpath . $row->imgthumbname))) {
                        $tnfile = JPath::clean(JPATH_ROOT . DS . $config->jg_paththumbs . $catpath . $row->imgthumbname);
                        $imginfo = getimagesize($tnfile);
                        $srcWidth = $imginfo[0];
                        $srcHeight = $imginfo[1];
                        if ($row->approved) {
                            ?>
            <a href="<?php 
                            echo $link;
                            ?>
" onmouseover="return overlib('<img src=\'<?php 
                            echo _JOOM_LIVE_SITE . $config->jg_paththumbs . $catpath . $row->imgthumbname;
                            ?>
\' />',WIDTH,<?php 
                            echo $srcWidth;
                            ?>
, HEIGHT,<?php 
                            echo $srcHeight;
                            ?>
)" onmouseout="return nd()" >
<?php 
                        } else {
                            ?>
            <a href="#" onmouseover="return overlib('<img src=\'<?php 
                            echo _JOOM_LIVE_SITE . $config->jg_paththumbs . $catpath . $row->imgthumbname;
                            ?>
\' />',WIDTH,<?php 
                            echo $srcWidth;
                            ?>
, HEIGHT,<?php 
                            echo $srcHeight;
                            ?>
)" onmouseout="return nd()" >
<?php 
                        }
                        ?>
              <img src="<?php 
                        echo _JOOM_LIVE_SITE . $config->jg_paththumbs . $catpath . $row->imgthumbname;
                        ?>
" border="0" height="30" alt="" />
            </a>
<?php 
                    } else {
                        ?>
            &nbsp;
<?php 
                    }
                } else {
                    ?>
          <div class="jg_floatleft">
            <img src="<?php 
                    echo _JOOM_LIVE_SITE . 'components/com_joomgallery/assets/images/arrow.png';
                    ?>
" class="pngfile jg_icon" alt="arrow" />
          </div>
<?php 
                }
                if ($row->approved) {
                    ?>
          <a href="<?php 
                    echo $link;
                    ?>
"> 
<?php 
                }
                ?>
          <?php 
                echo $row->imgtitle;
                ?>
 
<?php 
                if ($row->approved) {
                    ?>
          </a>
<?php 
                }
                ?>
        </div>
        <div class="jg_up_ehits">
        <?php 
                echo $row->imgcounter;
                ?>
 
        </div>
        <div class="jg_up_ecat">
        <?php 
                echo Joom_ShowCategoryPath($row->catid);
                ?>
 
        </div>
        <div class="jg_up_esub1">
          <a href="<?php 
                echo JRoute::_('index.php?option=com_joomgallery&func=editpic&uid=' . $user->get('id') . '&id=' . $row->id . _JOOM_ITEMID);
                ?>
" title="<?php 
                echo JText::_('JGS_EDIT');
                ?>
">
            <img src= "<?php 
                echo _JOOM_LIVE_SITE;
                ?>
components/com_joomgallery/assets/images/edit.png" class="pngfile jg_icon" border="0" width="16" height="16" alt="<?php 
                echo JText::_('JGS_EDIT');
                ?>
" class="pngfile" />
          </a>
        </div>
        <div class="jg_up_esub2">
          <a href="javascript:if (confirm('<?php 
                echo JText::_('JGS_ALERT_SURE_DELETE_SELECTED_ITEM', true);
                ?>
')){ location.href='<?php 
                echo JRoute::_('index.php?option=com_joomgallery&func=deletepic&uid=' . $user->get('id') . '&id=' . $row->id . _JOOM_ITEMID, false);
                ?>
';}" title="<?php 
                echo JText::_('JGS_DELETE');
                ?>
">
            <img src="<?php 
                echo _JOOM_LIVE_SITE;
                ?>
components/com_joomgallery/assets/images/edit_trash.png" class="pngfile jg_icon" border="0" width="16" height="16" alt="<?php 
                echo JText::_('JGS_DELETE');
                ?>
" class="pngfile" />
          </a>
        </div>
<?php 
                if ($config->jg_approve) {
                    if ($row->approved) {
                        $a_pic = 'tick.png';
                    } else {
                        $a_pic = 'cross.png';
                    }
                    ?>
        <div class="jg_up_eappr">
          <img src="<?php 
                    echo _JOOM_LIVE_SITE;
                    ?>
components/com_joomgallery/assets/images/<?php 
                    echo $a_pic;
                    ?>
" height="16" width="16" border="0" alt="pngfile" class="pngfile jg_icon" />
        </div>
<?php 
                }
                ?>
      </div>
    </div>
<?php 
            }
        } else {
            $p = $k + 1;
            ?>
    <div class="jg_txtrow">
      <div class="<?php 
            echo "sectiontableentry" . $p;
            ?>
">
        <img src="<?php 
            echo _JOOM_LIVE_SITE . 'components/com_joomgallery/assets/images/arrow.png';
            ?>
" class="pngfile jg_icon" alt="arrow" />
      <?php 
            echo JText::_('JGS_YOU_DO_NOT_HAVE_PICTURE');
            ?>
      </div>
    </div>
<?php 
        }
        ?>
  </div>
<?php 
    }
function Joom_LightboxImages($start, $end, $orderclause = null, $catid, $id)
{
    global $func;
    $config = Joom_getConfig();
    $database =& JFactory::getDBO();
    $user =& JFactory::getUser();
    if (($func == 'viewcategory' && $config->jg_detailpic_open > 3 && ($config->jg_showdetailpage == 1 || $config->jg_showdetailpage == 0 && $user->get('aid') > 0) || $func == 'detail' && ($config->jg_bigpic == 1 && $user->get('aid') > 0 || $config->jg_bigpic == 2) && $config->jg_bigpic_open > 3) && $end != 0 && $start < $end && $config->jg_lightbox_slide_all == 1) {
        if ($orderclause == null) {
            if ($config->jg_secondorder != '' && $config->jg_thirdorder == '') {
                $orderclause = "a." . $config->jg_firstorder . ", a." . $config->jg_secondorder;
            } elseif ($config->jg_secondorder != '' && $config->jg_thirdorder != '') {
                $orderclause = "a." . $config->jg_firstorder . ", a." . $config->jg_secondorder . ", a." . $config->jg_thirdorder;
            } else {
                $orderclause = "a." . $config->jg_firstorder;
            }
        }
        if ($func == 'detail') {
            $type = $end == 1 ? "before" : "after";
            $database->setQuery(" SELECT \n                              COUNT(id)\n                            FROM \n                              #__joomgallery\n                            WHERE \n                                      catid = {$catid} \n                              AND approved  = '1' \n                              AND published = '1'\n                          ");
            $end = $database->loadResult();
        }
        $database->setQuery(" SELECT \n                            id, \n                            imgfilename, \n                            imgthumbname, \n                            imgtitle\n                          FROM \n                            #__joomgallery AS a\n                          LEFT JOIN \n                            #__joomgallery_catg AS c ON c.cid=a.catid\n                          WHERE \n                               a.published = '1' \n                            AND a.catid    = {$catid} \n                            AND a.approved = '1' \n                            AND c.access  <= '" . $user->get('aid') . "'\n                          ORDER BY \n                            {$orderclause}\n                          LIMIT {$start}," . ($end - $start));
        $rows = $database->loadObjectList();
        $zaehl = 0;
        $check = 0;
        if ($func == 'detail' && $type == 'after') {
            while ($rows[$zaehl]->id != $id) {
                $zaehl++;
            }
            $zaehl++;
        } elseif ($func == 'detail' && $type == 'before' && $rows[$zaehl]->id == $id) {
            $check = 1;
        }
        echo "  <div class=\"jg_displaynone\">\n";
        while ($zaehl < sizeof($rows) && $check != 1) {
            if ($func == 'detail' && $type == 'before' && $rows[$zaehl]->id == $id) {
                $check = 1;
            }
            $row = $rows[$zaehl];
            $catpath = Joom_GetCatPath($catid);
            if ($func == 'detail' && is_file(JPath::clean(JPATH_ROOT . DS . $config->jg_pathoriginalimages . $catpath . $row->imgfilename)) || $func == 'viewcategory') {
                $link = Joom_OpenImage($config->jg_bigpic_open, $row->id, $catpath, $catid, $row->imgfilename, $row->imgtitle, '');
                echo "    <a href=\"" . $link . "\">" . $row->id . "</a>\n";
            }
            $zaehl++;
        }
        echo "  </div>\n";
    }
}
    function Joom_ShowSpecials_HTML($tl_title, $rows, $sorting)
    {
        $config = Joom_getConfig();
        $database =& JFactory::getDBO();
        $user =& JFactory::getUser();
        $num_rows = ceil(count($rows) / $config->jg_toplistcols);
        $index = 0;
        $line = 1;
        ?>
  <div class="jg_topview">
    <div class="sectiontableheader">
      <?php 
        echo $tl_title;
        ?>
&nbsp;
    </div>
<?php 
        $count_rows = count($rows);
        if ($count_rows) {
            for ($row_count = 0; $row_count < $num_rows; $row_count++) {
                $line++;
                $linecolor = $line % 2 + 1;
                ?>
    <div class="jg_row <?php 
                if ($linecolor == 1) {
                    echo "sectiontableentry1";
                } else {
                    echo "sectiontableentry2";
                }
                ?>
">
<?php 
                for ($col_count = 0; $col_count < $config->jg_toplistcols && $index < $count_rows; $col_count++) {
                    $row1 = $rows[$index];
                    ?>
      <div class="jg_topelement">
<?php 
                    $catpath = Joom_GetCatPath($row1->catid);
                    if ($config->jg_showdetailpage == 0 && $user->get('aid') != 0 || $config->jg_showdetailpage == 1) {
                        $link = Joom_OpenImage($config->jg_detailpic_open, $row1->id, $catpath, $row1->catid, $row1->imgfilename, $row1->imgtitle, $row1->imgtext);
                    } else {
                        $link = "javascript:alert('" . JText::_('JGS_ALERT_NO_DETAILVIEW_FOR_GUESTS', true) . "')";
                    }
                    ?>
        <div  class="jg_topelem_photo">
          <a href="<?php 
                    echo $link;
                    ?>
">
            <img src="<?php 
                    echo _JOOM_LIVE_SITE . $config->jg_paththumbs . $catpath . $row1->imgthumbname;
                    ?>
" class="jg_photo" alt="<?php 
                    echo $row1->imgtitle;
                    ?>
" />
          </a>
        </div>
        <div class="jg_topelem_txt">
          <ul>
            <li>
              <b><?php 
                    echo $row1->imgtitle;
                    ?>
</b>
            </li>
            <li>
              <?php 
                    echo JText::_('JGS_CATEGORY') . ':';
                    ?>
              <a href="<?php 
                    echo JRoute::_('index.php?option=com_joomgallery&func=viewcategory&catid=' . $row1->catid . _JOOM_ITEMID);
                    ?>
">
                <?php 
                    echo $row1->name;
                    ?>
              </a>
            </li>
<?php 
                    if ($config->jg_showauthor) {
                        if ($row1->imgauthor) {
                            $authorowner = $row1->imgauthor;
                        } elseif ($config->jg_showowner) {
                            $authorowner = Joom_GetDisplayName($row1->owner);
                        } else {
                            $authorowner = JText::_('JGS_NO_DATA');
                        }
                        ?>
            <li>
              <?php 
                        echo JText::_('JGS_AUTHOR') . ': ' . $authorowner;
                        ?>
&nbsp;
            </li>
<?php 
                    }
                    if ($config->jg_showhits) {
                        ?>
            <li>
              <?php 
                        echo JText::_('JGS_HITS') . ': ' . $row1->imgcounter;
                        ?>
&nbsp;
            </li>
<?php 
                    }
                    if ($config->jg_showcatrate) {
                        ?>
            <li>
<?php 
                        if ($row1->imgvotes > 0) {
                            $fimgvotesum = number_format($row1->imgvotesum / $row1->imgvotes, 2, ',', '');
                            if ($row1->imgvotes == 1) {
                                $frating = $fimgvotesum . ' (' . $row1->imgvotes . ' ' . JText::_('JGS_ONE_VOTE') . ')';
                            } else {
                                $frating = $fimgvotesum . ' (' . $row1->imgvotes . ' ' . JText::_('JGS_VOTES') . ')';
                            }
                        } else {
                            $frating = '(' . JText::_('JGS_NO_RATINGS') . ')';
                        }
                        ?>
              <?php 
                        echo JText::_('JGS_RATING') . ': ' . $frating;
                        ?>
            </li>
<?php 
                    }
                    if ($config->jg_showcatcom) {
                        # Check how many comments exist
                        $database->setQuery(" SELECT \n                                    COUNT(*)\n                                  FROM \n                                    #__joomgallery_comments\n                                  WHERE \n                                           cmtpic = '{$row1->id}' \n                                    AND approved  = '1' \n                                    AND published = '1'\n                                ");
                        $comments = $database->LoadResult();
                        ?>
            <li>
<?php 
                        switch ($comments) {
                            case 0:
                                ?>
              <?php 
                                echo JText::_('JGS_NO_COMMENTS');
                                ?>
&nbsp;
<?php 
                                break;
                            case 1:
                                ?>
              <?php 
                                echo $comments . ' ' . JText::_('JGS_COMMENT');
                                ?>
&nbsp;
<?php 
                                break;
                            default:
                                ?>
              <?php 
                                echo $comments . ' ' . JText::_('JGS_COMMENTS');
                                ?>
&nbsp;
<?php 
                                break;
                        }
                        ?>
            </li>
<?php 
                        if ($sorting == 'lastcomment' && $config->jg_showthiscomment) {
                            for ($ii = 0; $ii < $comments; $ii++) {
                                $userid = $row1->userid;
                                $cmtname = $row1->cmtname;
                                if ($userid > 0) {
                                    $cmtname = $row1->username;
                                }
                                $cmttext = $row1->cmttext;
                                $cmtdate = $row1->cmtdate;
                                #$cmtdate = strftime( "%d-%m-%Y %H:%M:%S", $cmtdate );
                                $cmtdate = strftime($config->jg_dateformat, $cmtdate);
                            }
                            ?>
            <li>
<?php 
                            if ($userid > 0) {
                                ?>
			        <?php 
                                echo Joom_GetDisplayName($userid, false);
                            } else {
                                echo $cmtname;
                            }
                            echo ' ' . JText::_('JGS_WROTE') . ' (' . JText::_('JGS_AT') . ' ' . $cmtdate . '):';
                            $cmttext = Joom_ProcessText($cmttext);
                            if ($config->jg_smiliesupport) {
                                $smileys = Joom_GetSmileys();
                                foreach ($smileys as $i => $sm) {
                                    $cmttext = str_replace($i, '<img src="' . $sm . '" border="0" alt="' . $i . '" title="' . $i . '" />', $cmttext);
                                }
                            }
                            ?>
              <?php 
                            echo stripslashes($cmttext);
                            ?>
&nbsp;
            </li>
<?php 
                        }
                    }
                    ?>
          </ul>
        </div>
      </div>
<?php 
                    $index++;
                }
                ?>
      <div class="jg_clearboth"></div>
    </div>
<?php 
            }
        }
        ?>
  </div>
<?php 
    }
    function Joom_ShowCategoryBody_HTML(&$rows, &$rowcounter, &$colum, $order_by, &$order_dir)
    {
        global $id;
        $config = Joom_getConfig();
        $document =& JFactory::getDocument();
        $mainframe =& JFactory::getApplication('site');
        $database =& JFactory::getDBO();
        $user =& JFactory::getUser();
        //wenn jg_cooliris = true, dann zusaetzlich XML im head aufbauen
        if ($config->jg_cooliris && count($rows) > 0) {
            $href = _JOOM_LIVE_SITE . $this->viewcategory_url . $this->catid . '&startpage=' . $this->catstartpage . '&cooliris=1' . _JOOM_ITEMID;
            $attribs = array('id' => 'joomgallery', 'type' => 'application/rss+xml', 'title' => 'Cooliris');
            $document->addHeadLink($href, 'alternate', 'rel', $attribs);
            if ($config->jg_coolirislink) {
                $document->addScript('http://lite.piclens.com/current/piclens.js');
                echo '<a id="jg_cooliris" href="javascript:PicLensLite.start({feedUrl:\'' . _JOOM_LIVE_SITE . $this->viewcategory_url . $this->catid . '&startpage=' . $this->catstartpage . _JOOM_ITEMID . '&cooliris=1\'});">' . JText::_('JGS_COOLIRISLINK_TEXT') . '</a>';
            }
        }
        if (!$config->jg_showtitle && !$config->jg_showhits && !$config->jg_showauthor && !$config->jg_showowner && !$config->jg_showcatrate && !$config->jg_showcatcom && !$config->jg_showcatdescription) {
            $show_text = false;
        } else {
            $show_text = true;
        }
        $num_rows = ceil(count($rows) / $colum);
        $index = 0;
        $count_pics = count($rows);
        ?>
  <a name="category"></a>
<?php 
        if ($count_pics > 0) {
            for ($row_count = 0; $row_count < $num_rows; $row_count++) {
                $linecolor = ($row_count + 1) % 2 + 1;
                ?>
  <div class="jg_row <?php 
                if ($linecolor == 1) {
                    echo "sectiontableentry1";
                } else {
                    echo "sectiontableentry2";
                }
                ?>
">
<?php 
                for ($col_count = 0; $col_count < $colum && $index < $count_pics; $col_count++) {
                    $ii = 1;
                    $row1 = $rows[$index];
                    if ($config->jg_showpicasnew) {
                        $isnew = Joom_CheckNew($row1->imgdate, $config->jg_daysnew);
                    }
                    $catpath = Joom_GetCatPath($row1->cid);
                    if ($config->jg_showdetailpage == 0 && $user->get('aid') != 0 || $config->jg_showdetailpage == 1) {
                        $link = Joom_OpenImage($config->jg_detailpic_open, $row1->id, $catpath, $row1->cid, $row1->imgfilename, $row1->imgtitle, $row1->imgtext);
                    } else {
                        $link = "javascript:alert('" . JText::_('JGS_ALERT_NO_DETAILVIEW_FOR_GUESTS', true) . "')";
                    }
                    ?>
    <div class="jg_element_cat">
      <a href="<?php 
                    echo $link;
                    ?>
" class="jg_catelem_photo">
        <img src="<?php 
                    echo _JOOM_LIVE_SITE . $config->jg_paththumbs . $catpath . $row1->imgthumbname;
                    ?>
" class="jg_photo" alt="<?php 
                    echo $row1->imgtitle;
                    ?>
" />
      </a>
<?php 
                    if ($show_text) {
                        ?>
      <div class="jg_catelem_txt">
        <ul>
<?php 
                        if ($config->jg_showtitle || $config->jg_showpicasnew) {
                            ?>
          <li>
<?php 
                            if ($config->jg_showtitle) {
                                ?>
            <b><?php 
                                echo $row1->imgtitle;
                                ?>
</b>
<?php 
                            }
                            if ($config->jg_showpicasnew) {
                                ?>
            <?php 
                                echo $isnew;
                                ?>
&nbsp;
<?php 
                            }
                            ?>
          </li>
<?php 
                        }
                        if ($config->jg_showauthor) {
                            if ($row1->imgauthor) {
                                $authorowner = $row1->imgauthor;
                            } elseif ($config->jg_showowner) {
                                $authorowner = Joom_GetDisplayName($row1->owner);
                            } else {
                                $authorowner = JText::_('JGS_NO_DATA');
                            }
                            ?>
          <li>
            <?php 
                            echo JText::_('JGS_AUTHOR') . ": " . $authorowner;
                            ?>
&nbsp;
          </li>
<?php 
                        }
                        if ($config->jg_showhits) {
                            ?>
          <li>
            <?php 
                            echo JText::_('JGS_HITS') . ": " . $row1->imgcounter;
                            ?>
&nbsp;
          </li>
<?php 
                        }
                        if ($config->jg_showcatrate) {
                            if ($row1->imgvotes > 0) {
                                $fimgvotesum = number_format($row1->imgvotesum / $row1->imgvotes, 2, ',', '.');
                                if ($row1->imgvotes == 1) {
                                    $frating = $fimgvotesum . ' (' . $row1->imgvotes . ' ' . JText::_('JGS_ONE_VOTE') . ')';
                                } else {
                                    $frating = $fimgvotesum . ' (' . $row1->imgvotes . ' ' . JText::_('JGS_VOTES') . ')';
                                }
                            } else {
                                $frating = JText::_('JGS_NO_VOTES');
                            }
                            ?>
          <li>
            <?php 
                            echo JText::_('JGS_RATING') . ": " . $frating;
                            ?>
&nbsp;
          </li>
<?php 
                        }
                        if ($config->jg_showcatcom) {
                            # Check how many comments exist
                            $database->setQuery(" SELECT \n                                        COUNT(cmtid)\n                                      FROM \n                                        #__joomgallery_comments\n                                      WHERE \n                                               cmtpic = '{$row1->id}' \n                                        AND published ='1' \n                                        AND approved = '1'\n                                    ");
                            $comments = $database->LoadResult();
                            ?>
          <li>
            <?php 
                            echo JText::_('JGS_COMMENTS') . ": " . $comments;
                            ?>
 
          </li>
<?php 
                        }
                        if ($config->jg_showcatdescription == 1 && $row1->imgtext) {
                            ?>
          <li>
            <?php 
                            echo JText::_('JGS_DESCRIPTION') . ": " . $row1->imgtext;
                            ?>
&nbsp;
          </li>
<?php 
                        }
                        $mainframe->triggerEvent('onAfterDisplayJoomThumb', array($row1->id));
                        $li_tag_set = false;
                        if (is_file(JPath::clean(JPATH_ROOT . DS . $config->jg_pathoriginalimages . $catpath . $row1->imgfilename)) || $config->jg_downloadfile != 1) {
                            if ($config->jg_showcategorydownload == 1 && $user->get('aid') >= 1 || $config->jg_showcategorydownload == 2 && $user->get('aid') == 2 || $config->jg_showcategorydownload == 3) {
                                ?>
          <li>
            <a href="<?php 
                                echo JRoute::_('index.php?option=com_joomgallery&func=download&catid=' . $row1->catid . '&id=' . $row1->id . _JOOM_ITEMID);
                                ?>
"
                onMouseOver="return overlib('<?php 
                                echo JText::_('JGS_DOWNLOAD_TOOLTIP_TEXT', true);
                                ?>
', CAPTION, '<?php 
                                echo JText::_('JGS_DOWNLOAD_TOOLTIP_CAPTION', true);
                                ?>
', BELOW, RIGHT);" onmouseout="return nd();">
              <img src="<?php 
                                echo _JOOM_LIVE_SITE . 'components/com_joomgallery/assets/images/download.png';
                                ?>
" alt="<?php 
                                echo JText::_('JGS_DOWNLOAD_TOOLTIP_CAPTION');
                                ?>
" class="pngfile jg_icon" />
            </a>
<?php 
                                $li_tag_set = true;
                            } elseif ($config->jg_showcategorydownload == 1 && $user->get('aid') < 1) {
                                ?>
          <li>
            <span onMouseOver="return overlib('<?php 
                                echo JText::_('JGS_DOWNLOAD_TOOLTIP_TEXT_LOGIN', true);
                                ?>
', CAPTION, '<?php 
                                echo JText::_('JGS_DOWNLOAD_TOOLTIP_CAPTION', true);
                                ?>
', BELOW, RIGHT);" onmouseout="return nd();" >
              <img src="<?php 
                                echo _JOOM_LIVE_SITE . 'components/com_joomgallery/assets/images/download_gr.png';
                                ?>
" alt="<?php 
                                echo JText::_('JGS_DOWNLOAD_TOOLTIP_CAPTION');
                                ?>
"  class="pngfile jg_icon" />
            </span>
<?php 
                                $li_tag_set = true;
                            }
                        }
                        if ($config->jg_favourites == 1 && $config->jg_showcategoryfavourite) {
                            if ($config->jg_showdetailfavourite == 0 && $user->get('aid') >= 1 || $config->jg_showdetailfavourite == 1 && $user->get('aid') == 2 || $config->jg_usefavouritesforpubliczip == 1 && $user->get('aid') < 1) {
                                if ($config->jg_usefavouritesforzip == 1 || $config->jg_usefavouritesforpubliczip == 1 && $user->get('aid') < 1) {
                                    if (!$li_tag_set) {
                                        $li_tag_set = true;
                                        ?>
          <li>
<?php 
                                    }
                                    ?>
            <a href="<?php 
                                    echo JRoute::_('index.php?option=com_joomgallery&func=addpicture&id=' . $row1->id . '&catid=' . $row1->catid . _JOOM_ITEMID);
                                    ?>
"
                onMouseOver="return overlib('<?php 
                                    echo JText::_('JGS_ZIP_ADD_PICTURE_TOOLTIP_TEXT', true);
                                    ?>
', CAPTION, '<?php 
                                    echo JText::_('JGS_ZIP_ADD_PICTURE_TOOLTIP_CAPTION', true);
                                    ?>
', BELOW, RIGHT);" onmouseout="return nd();" >
              <img src="<?php 
                                    echo _JOOM_LIVE_SITE . 'components/com_joomgallery/assets/images/basket_put.png';
                                    ?>
" alt="<?php 
                                    echo JText::_('JGS_ZIP_ADD_PICTURE_TOOLTIP_CAPTION');
                                    ?>
"  class="pngfile jg_icon" />
            </a>
<?php 
                                } else {
                                    if (!$li_tag_set) {
                                        $li_tag_set = true;
                                        ?>
          <li>
<?php 
                                    }
                                    ?>
            <a href="<?php 
                                    echo JRoute::_('index.php?option=com_joomgallery&func=addpicture&id=' . $row1->id . '&catid=' . $row1->catid . _JOOM_ITEMID);
                                    ?>
"
                onMouseOver="return overlib('<?php 
                                    echo JText::_('JGS_FAV_ADD_PICTURE_TOOLTIP_TEXT', true);
                                    ?>
', CAPTION, '<?php 
                                    echo JText::_('JGS_FAV_ADD_PICTURE_TOOLTIP_CAPTION', true);
                                    ?>
', BELOW, RIGHT);" onmouseout="return nd();">
              <img src="<?php 
                                    echo $this->assetsimages_url . 'star.png';
                                    ?>
" alt="<?php 
                                    echo JText::_('JGS_FAV_ADD_PICTURE_TOOLTIP_CAPTION');
                                    ?>
" class="pngfile jg_icon" />
            </a>
<?php 
                                }
                            } elseif ($config->jg_favouritesshownotauth == 1) {
                                if ($config->jg_usefavouritesforzip == 1) {
                                    if (!$li_tag_set) {
                                        $li_tag_set = true;
                                        ?>
          <li>
<?php 
                                    }
                                    ?>
            <span onMouseOver="return overlib('<?php 
                                    echo JText::_('JGS_ZIP_ADD_PICTURE_NOT_ALLOWED_TOOLTIP_TEXT', true);
                                    ?>
', CAPTION, '<?php 
                                    echo JText::_('JGS_ZIP_ADD_PICTURE_TOOLTIP_CAPTION', true);
                                    ?>
', BELOW, RIGHT);" onmouseout="return nd();" >
              <img src="<?php 
                                    echo $this->assetsimages_url . 'basket_put_gr.png';
                                    ?>
" alt="<?php 
                                    echo JText::_('JGS_ZIP_ADD_PICTURE_TOOLTIP_CAPTION');
                                    ?>
"  class="pngfile jg_icon" />
            </span>
<?php 
                                } else {
                                    if (!$li_tag_set) {
                                        $li_tag_set = true;
                                        ?>
          <li>
<?php 
                                    }
                                    ?>
            <span onMouseOver="return overlib('<?php 
                                    echo JText::_('JGS_FAV_ADD_PICTURE_NOT_ALLOWED_TOOLTIP_TEXT', true);
                                    ?>
', CAPTION, '<?php 
                                    echo JText::_('JGS_FAV_ADD_PICTURE_TOOLTIP_CAPTION', true);
                                    ?>
', BELOW, RIGHT);" onmouseout="return nd();" >
              <img src="<?php 
                                    echo $this->assetsimages_url . 'star_gr.png';
                                    ?>
" alt="<?php 
                                    echo JText::_('JGS_FAV_ADD_PICTURE_TOOLTIP_CAPTION');
                                    ?>
"  class="pngfile jg_icon" />
            </span>
<?php 
                                }
                            }
                        }
                        if ($li_tag_set) {
                            ?>
          </li>
<?php 
                        }
                        ?>
        </ul>
      </div>
<?php 
                    }
                    ?>
    </div>
<?php 
                    $index++;
                }
                // for loop over cols in row
                ?>
    <div class="jg_clearboth"></div>
  </div>
<?php 
                $ii++;
            }
            // for loop over rows
            if ($config->jg_showcathead) {
                ?>
    <div class="sectiontableheader">
      &nbsp; 
    </div>
<?php 
            }
        }
        // if count($pics) > 0
    }
    /**
     * Class constructor
     *
     */
    function Joom_DetailView()
    {
        include_once JPATH_COMPONENT . DS . 'includes' . DS . 'html' . DS . 'joom.viewdetails.html.php';
        jimport('joomla.filesystem.file');
        $this->_mainframe =& JFactory::getApplication('site');
        $database =& JFactory::getDBO();
        $user =& JFactory::getUser();
        $config = Joom_getConfig();
        $this->id = JRequest::getInt('id', 0);
        $this->slideshow = trim(Joom_mosGetParam('jg_slideshow', '', 'post'));
        if ($config->jg_showdetailaccordion) {
            $this->toggler = 'class="joomgallery-toggler"';
            $this->slider = 'class="joomgallery-slider"';
        } else {
            $this->toggler = 'class="joomgallery-notoggler"';
            $this->slider = '';
        }
        $database->setQuery(" SELECT\n                            c.access AS access,\n                            c.name AS name,\n                            c.cid AS cid\n                          FROM\n                            #__joomgallery_catg AS c\n                          LEFT JOIN\n                            #__joomgallery AS a ON a.catid = c.cid\n                          WHERE\n                            a.id = {$this->id}\n                        ");
        if (!($catinfo = $database->loadObject())) {
            $this->_mainframe->redirect(JRoute::_('index.php?option=com_joomgallery&view=gallery' . _JOOM_ITEMID, false), JText::_('JGS_ALERT_NOT_ALLOWED_VIEW_PICTURE'));
        }
        $this->c_access = $catinfo->access;
        $this->cattitle = $catinfo->name;
        if ($user->get('aid') < $this->c_access) {
            $this->_mainframe->redirect(JRoute::_('index.php?option=com_joomgallery&view=gallery' . _JOOM_ITEMID, false), JText::_('JGS_ALERT_NOT_ALLOWED_VIEW_PICTURE'));
        }
        $database->setQuery(" SELECT\n                            a.id,\n                            a.catid,\n                            a.imgtitle,\n                            a.imgauthor,\n                            a.imgtext,\n                            a.imgdate,\n                            a.imgcounter,\n                            a.imgvotes,\n                            a.imgvotesum,\n                            a.published,\n                            a.imgfilename,\n                            a.imgthumbname,\n                            a.checked_out,\n                            a.owner,\n                            a.approved,\n                            a.useruploaded,\n                            a.ordering,\n                            u.username,\n                            ROUND(imgvotesum/imgvotes, 2) AS rating\n                          FROM\n                            #__joomgallery AS a\n                          LEFT JOIN\n                            #__users AS u ON u.id = a.owner\n                          WHERE\n                                a.id        = " . $this->id . "\n                            AND a.approved  = '1'\n                            AND a.published = '1'\n                        ");
        $result1 = $database->loadObject();
        $this->id = $result1->id;
        $this->catid = $result1->catid;
        $this->imgtitle = $result1->imgtitle;
        $this->imgauthor = $result1->imgauthor;
        $this->imgtext = $result1->imgtext;
        $this->imgdate = $result1->imgdate;
        $this->imgcounter = $result1->imgcounter;
        $this->imgvotes = $result1->imgvotes;
        $this->imgvotesum = $result1->imgvotesum;
        $this->published = $result1->published;
        $this->imgfilename = $result1->imgfilename;
        $this->imgthumbname = $result1->imgthumbname;
        $this->checked_out = $result1->checked_out;
        $this->imgowner = $result1->owner;
        $this->approved = $result1->approved;
        $this->useruploaded = $result1->useruploaded;
        $this->ordering = $result1->ordering;
        $this->imgownerid = $result1->username;
        $this->rating = $result1->rating;
        if ($this->published != 1 && $this->approved != 1) {
            $this->_mainframe->redirect(JRoute::_('index.php?option=com_joomgallery&view=gallery' . _JOOM_ITEMID, false), JText::_('JGS_ALERT_NOPICTURE_OR_NOTAPPROVED'));
        }
        $this->catpath = Joom_GetCatPath($this->catid);
        $this->joom_thumbnailpath = $config->jg_paththumbs . $this->catpath;
        $this->joom_picturepath = $config->jg_pathimages . $this->catpath;
        $this->joom_originalpath = $config->jg_pathoriginalimages . $this->catpath;
        $this->joom_thumbnailsource = $config->jg_paththumbs . $this->catpath . $this->imgfilename;
        $this->joom_picturesource = $config->jg_pathimages . $this->catpath . $this->imgfilename;
        $this->joom_originalsource = $config->jg_pathoriginalimages . $this->catpath . $this->imgfilename;
        $this->joom_componenturl = 'index.php?option=com_joomgallery';
        $this->joom_assetspath = 'components/com_joomgallery/assets/';
        $this->picture_src = '';
        if ($config->jg_watermark == 1) {
            $this->picture_src = _JOOM_LIVE_SITE . $this->joom_componenturl . '&amp;func=watermark&amp;catid=' . $this->catid . '&amp;id=' . $this->id . str_replace('&', '&amp;', _JOOM_ITEMID);
        } else {
            $this->picture_src = _JOOM_LIVE_SITE . $this->joom_picturesource;
        }
        if (JFile::exists(JPATH_ROOT . DS . $this->joom_originalsource)) {
            $imginfo_ori = getimagesize(JPath::clean(JPATH_ROOT . DS . $this->joom_originalsource));
            $this->originalimgsize = filesize(JPath::clean(JPATH_ROOT . DS . $this->joom_originalsource));
            $this->foriginalimgsize = number_format($this->originalimgsize / 1024, 2, ",", ".") . " KB";
        } else {
            $imginfo_ori[0] = 0;
            $imginfo_ori[1] = 0;
            $this->foriginalimgsize = JText::_('JGS_NO_ORIGINAL_FILE');
        }
        $imginfo = getimagesize(JPath::clean(JPATH_ROOT . DS . $this->joom_picturesource));
        $imgsize = filesize(JPath::clean(JPATH_ROOT . DS . $this->joom_picturesource));
        $this->fimgsize = number_format($imgsize / 1024, 2, ',', '.') . ' KB';
        $this->srcWidth_ori = $imginfo_ori[0];
        $this->srcHeight_ori = $imginfo_ori[1];
        $this->srcWidth = $imginfo[0];
        $this->srcHeight = $imginfo[1];
        $this->fimgdate = strftime($config->jg_dateformat, $this->imgdate);
        $this->frating = number_format($this->rating, 2, ',', '.');
        if ($config->jg_secondorder != '' && $config->jg_thirdorder == '') {
            $orderclause = $config->jg_firstorder . ', ' . $config->jg_secondorder;
        } elseif ($config->jg_secondorder != '' && $config->jg_thirdorder != '') {
            $orderclause = $config->jg_firstorder . ', ' . $config->jg_secondorder . ', ' . $config->jg_thirdorder;
        } else {
            $orderclause = $config->jg_firstorder;
        }
        $database->setQuery(" SELECT\n                            *\n                          FROM\n                            #__joomgallery\n                          WHERE\n                                    catid = " . $this->catid . "\n                            AND approved  = '1'\n                            AND published = '1'\n                          ORDER BY\n                            {$orderclause}\n                        ");
        $this->rows = $database->loadObjectList();
        ?>
  <a name="joomimg"></a>
<?php 
        if ($config->jg_showdetailtitle == 1) {
            HTML_Joom_Detail::Joom_ShowPictureTitle_HTML();
        }
        if (($config->jg_bigpic == 1 && $user->get('aid') > 0 || $config->jg_bigpic == 2) && !$this->slideshow && JFile::exists(JPATH_ROOT . DS . $this->joom_originalsource) && ($this->srcWidth_ori > $this->srcWidth && $this->srcHeight_ori > $this->srcHeight)) {
            $this->link = Joom_OpenImage($config->jg_bigpic_open, $this->id, $this->catpath, $this->catid, $this->imgfilename, $this->imgtitle, $this->imgtext);
        } else {
            $this->link = '';
        }
        if ($this->slideshow == false) {
            Joom_LightboxImages(0, 1, 0, $this->catid, $this->id);
        }
        $this->Joom_ShowPicture();
        if ($config->jg_slideshow) {
            $this->Joom_ShowSlideshow();
        }
        $this->Joom_PagingCategory();
        if (!$this->slideshow) {
            Joom_LightboxImages(0, 2, 0, $this->catid, $this->id);
        }
        if ($config->jg_minis) {
            $this->Joom_ShowMinis();
        }
        if ($config->jg_showdetailtitle == 2) {
            HTML_Joom_Detail::Joom_ShowPictureTitle_HTML();
        }
        $modules = Joom_getModules('detailbtm');
        if (count($modules)) {
            $document =& JFactory::getDocument();
            $renderer = $document->loadRenderer('module');
            $style = -2;
            $params = array('style' => $style);
            foreach ($modules as $module) {
                ?>
  <div class="jg_module">
<?php 
                if ($module->showtitle) {
                    ?>
    <div class="sectiontableheader">
      <h4>
        <?php 
                    echo $module->title;
                    ?>
&nbsp;
      </h4>
    </div>
<?php 
                }
                echo $renderer->render($module, $params);
                ?>
  </div>
<?php 
            }
        }
        if ($config->jg_showdetail) {
            $this->Joom_ShowPictureData();
        }
        # Update View counter
        $this->imgcounter++;
        if ($config->jg_watermark == 0) {
            $database->setQuery(" UPDATE\n                              #__joomgallery\n                            SET\n                              imgcounter = " . $this->imgcounter . "\n                            WHERE\n                              id = " . $this->id . "\n                          ");
            $database->query();
        }
        if ($config->jg_slideshow) {
            HTML_Joom_Detail::Joom_ShowSlideshow_HTML();
        }
        //******************************************************************************
        //wenn die Slideshow aktiviert ist, sind die folgenden Abfragen hinfaellig
        if ($this->slideshow) {
            return;
        }
        //******************************************************************************
        $modules = Joom_GetModules('detailpane');
        if (count($modules)) {
            HTML_Joom_Detail::Joom_ShowModules_HTML($modules);
        }
        if ($config->jg_showexifdata && extension_loaded('exif') && function_exists('exif_read_data')) {
            include_once JPATH_COMPONENT . DS . 'includes' . DS . 'exif' . DS . 'joom.exifdata.php';
        }
        if ($config->jg_showiptcdata) {
            include_once JPATH_COMPONENT . DS . 'includes' . DS . 'iptc' . DS . 'joom.iptcdata.php';
        }
        if ($config->jg_showrating) {
            HTML_Joom_Detail::Joom_ShowVotingArea_HTML();
        }
        if ($config->jg_bbcodelink) {
            $show_img = false;
            $show_url = false;
            if ($config->jg_bbcodelink == 1 || $config->jg_bbcodelink == 3) {
                $show_img = true;
            }
            if ($config->jg_bbcodelink == 2 || $config->jg_bbcodelink == 3) {
                $show_url = true;
            }
            HTML_Joom_Detail::Joom_ShowBBCodeLink_HTML($this->picture_src, $show_img, $show_url);
        }
        if ($config->jg_showcomment) {
            //darf der Besucher Kommentare eingeben
            if ($config->jg_anoncomment || !$config->jg_anoncomment && $user->get('id')) {
                $allowcomment = 1;
            } else {
                $allowcomment = 0;
            }
            HTML_Joom_Detail::Joom_ShowCommentsHead_HTML();
            if ($config->jg_showcommentsarea == 2) {
                HTML_Joom_Detail::Joom_ShowCommentsArea_HTML($allowcomment);
                HTML_Joom_Detail::Joom_BuildCommentsForm_HTML($allowcomment);
            } else {
                HTML_Joom_Detail::Joom_BuildCommentsForm_HTML($allowcomment);
                HTML_Joom_Detail::Joom_ShowCommentsArea_HTML($allowcomment);
            }
            HTML_Joom_Detail::Joom_ShowCommentsEnd_HTML();
        }
        if ($config->jg_send2friend) {
            HTML_Joom_Detail::Joom_ShowSend2FriendArea_HTML();
        }
    }
 /**
  * Simple forwarding of Joom_OpenImage:
  * Returns the link to the detail image, as set in JoomGallery
  *
  * @param integer $picid
  * @param string $catpath
  * @param integer $catid
  * @param string $imgfilename
  * @param string $imgtitle
  * @param string $imgtext
  * @return string
  */
 function getPictureLink($picid, $catpath, $catid, $imgfilename, $imgtitle, $imgtext)
 {
     return Joom_OpenImage($this->_jg_config->jg_detailpic_open, $picid, $catpath, $catid, $imgfilename, $imgtitle, $imgtext);
 }
    function Joom_ShowFavourites_HTML2($rows, $showDownloadIcon)
    {
        $config = Joom_getConfig();
        $database =& JFactory::getDBO();
        $user =& JFactory::getUser();
        ?>
  <div class="sectiontableheader">
    <?php 
        echo $this->Output('HEADING');
        ?>
 
  </div>
  <div class="jg_fav_switchlayout">
    <a href="<?php 
        echo JRoute::_('index.php?option=com_joomgallery&func=switchlayout' . _JOOM_ITEMID);
        ?>
">
      <?php 
        echo JText::_('JGS_FAV_SWITCH_LAYOUT');
        ?>
 
    </a>
  </div>
  <div class="jg_fav_clearlist">
    <a href="<?php 
        echo JRoute::_('index.php?option=com_joomgallery&func=removeall' . _JOOM_ITEMID);
        ?>
">
      <?php 
        echo JText::_('JGS_FAV_REMOVE_ALL');
        ?>
 
    </a>
  </div>
  <div class="sectiontableheader">
    <div class="jg_up_entry">
      <div class="jg_up_ename">
        <?php 
        echo JText::_('JGS_PICTURE_NAME');
        ?>
 
      </div>
      <div class="jg_up_ehits">
        <?php 
        echo JText::_('JGS_HITS');
        ?>
 
      </div>
      <div class="jg_up_ecat">
        <?php 
        echo JText::_('JGS_CATEGORY');
        ?>
 
      </div>
      <div class="jg_up_eact">
        <?php 
        echo JText::_('JGS_ACTION');
        ?>
 
      </div>
    </div>
  </div>
  <?php 
        $k = 0;
        if (count($rows)) {
            foreach ($rows as $row) {
                $k = 1 - $k;
                $p = $k + 1;
                $catpath = Joom_GetCatPath($row->catid);
                ?>
  <div class="<?php 
                echo "sectiontableentry" . $p;
                ?>
">
    <div class="jg_up_entry">
<?php 
                if ($row->approved) {
                    $link = Joom_OpenImage($config->jg_detailpic_open, $row->id, $catpath, $row->catid, $row->imgfilename, $row->imgtitle, $row->imgtext);
                }
                if ($config->jg_showminithumbs) {
                    ?>
      <div class="jg_up_ename">
<?php 
                    if ($row->imgthumbname != '') {
                        if ($row->approved) {
                            ?>
        <a href="<?php 
                            echo $link;
                            ?>
">
<?php 
                        }
                        ?>
          <img src="<?php 
                        echo _JOOM_LIVE_SITE . $config->jg_paththumbs . $catpath . $row->imgthumbname;
                        ?>
" border="0" height="30" alt="" />
<?php 
                        if ($row->approved) {
                            ?>
        </a>
<?php 
                        }
                    }
                } else {
                    ?>
        <div class="jg_floatleft">
          <img src="<?php 
                    echo _JOOM_LIVE_SITE . 'components/com_joomgallery/assets/images/arrow.png';
                    ?>
" class="pngfile jg_icon"  alt="arrow" />
        </div>
<?php 
                }
                if ($row->approved) {
                    ?>
        <a href="<?php 
                    echo $link;
                    ?>
"> 
<?php 
                }
                ?>
        <?php 
                echo $row->imgtitle;
                ?>
 
<?php 
                if ($row->approved) {
                    ?>
        </a>
<?php 
                }
                ?>
      </div>
      <div class="jg_up_ehits">
        <?php 
                echo $row->imgcounter;
                ?>
 
      </div>
      <div class="jg_up_ecat">
        <a href="<?php 
                echo JRoute::_('index.php?option=com_joomgallery&func=viewcategory&catid=' . $row->catid . _JOOM_ITEMID);
                ?>
">
          <?php 
                echo Joom_CategoryPathLink($row->catid, false);
                ?>
 
        </a>
      </div>
<?php 
                // Download Icon
                if ($showDownloadIcon == 1) {
                    ?>
      <div class="jg_up_esub1">
        <a href="<?php 
                    echo JRoute::_('index.php?option=com_joomgallery&func=download&catid=' . $row->catid . '&id=' . $row->id . _JOOM_ITEMID);
                    ?>
"
          onMouseOver="return overlib('<?php 
                    echo JText::_('JGS_DOWNLOAD_TOOLTIP_TEXT', true);
                    ?>
', CAPTION, '<?php 
                    echo JText::_('JGS_DOWNLOAD_TOOLTIP_CAPTION', true);
                    ?>
', BELOW, RIGHT);" onmouseout="return nd();">
        <img src="<?php 
                    echo _JOOM_LIVE_SITE . 'components/com_joomgallery/assets/images/download.png';
                    ?>
" border="0" width="16" height="16" alt="<?php 
                    echo JText::_('JGS_DOWNLOAD_TOOLTIP_CAPTION');
                    ?>
" class="pngfile jg_icon" /></a>
      </div>
<?php 
                } elseif ($showDownloadIcon == -1) {
                    ?>
      <div class="jg_up_esub1" onMouseOver="return overlib('<?php 
                    echo JText::_('JGS_DOWNLOAD_TOOLTIP_TEXT_LOGIN', true);
                    ?>
', CAPTION, '<?php 
                    echo JText::_('JGS_DOWNLOAD_TOOLTIP_CAPTION', true);
                    ?>
', BELOW, RIGHT);" onmouseout="return nd();" >
        <img src="<?php 
                    echo _JOOM_LIVE_SITE . 'components/com_joomgallery/assets/images/download_gr.png';
                    ?>
" alt="<?php 
                    echo JText::_('JGS_DOWNLOAD_TOOLTIP_CAPTION');
                    ?>
"  class="pngfile jg_icon" />
      </div>
<?php 
                }
                ?>
      <div class="jg_up_esub2">
        <a href="<?php 
                echo JRoute::_('index.php?option=com_joomgallery&func=removepicture&id=' . $row->id . _JOOM_ITEMID);
                ?>
"
          onMouseOver="return overlib('<?php 
                echo $this->Output('REMOVE_TOOLTIP_TEXT');
                ?>
', CAPTION, '<?php 
                echo $this->Output('REMOVE_TOOLTIP_CAPTION');
                ?>
', BELOW, RIGHT);" onmouseout="return nd();">
        <img src="<?php 
                echo _JOOM_LIVE_SITE . 'components/com_joomgallery/assets/images/basket_remove.png';
                ?>
" alt="<?php 
                echo $this->Output('REMOVE_TOOLTIP_CAPTION');
                ?>
" class="pngfile jg_icon" /></a>
      </div>
<?php 
                if ($row->imgowner && $row->imgowner == $user->get('id')) {
                    ?>
      <div class="jg_up_esub3">
        <a href="<?php 
                    echo JRoute::_('index.php?option=com_joomgallery&func=editpic&uid=' . $user->get('id') . '&id=' . $row->id . _JOOM_ITEMID);
                    ?>
" title="<?php 
                    echo JText::_('JGS_EDIT');
                    ?>
">
          <img src= "<?php 
                    echo _JOOM_LIVE_SITE;
                    ?>
components/com_joomgallery/assets/images/edit.png" border="0" width="16" height="16" alt="<?php 
                    echo JText::_('JGS_EDIT');
                    ?>
" class="pngfile jg_icon" />
        </a>
      </div>
      <div class="jg_up_esub4">
        <a href="javascript:if (confirm('<?php 
                    echo JText::_('JGS_ALERT_SURE_DELETE_SELECTED_ITEM', true);
                    ?>
')){ location.href='<?php 
                    echo JRoute::_('index.php?option=com_joomgallery&func=deletepic&uid=' . $user->get('id') . '&id=' . $row->id . _JOOM_ITEMID, false);
                    ?>
';}" title="<?php 
                    echo JText::_('JGS_DELETE');
                    ?>
">
          <img src="<?php 
                    echo _JOOM_LIVE_SITE;
                    ?>
components/com_joomgallery/assets/images/edit_trash.png" border="0" width="16" height="16" alt="<?php 
                    echo JText::_('JGS_DELETE');
                    ?>
" class="pngfile jg_icon" />
        </a>
      </div>
<?php 
                }
                ?>
    </div>
  </div>
<?php 
            }
        } else {
            $p = $k + 1;
            ?>
  <div class="jg_txtrow">
    <div class="<?php 
            echo "sectiontableentry" . $p;
            ?>
">
      <img src="<?php 
            echo _JOOM_LIVE_SITE . 'components/com_joomgallery/assets/images/arrow.png';
            ?>
" class="pngfile jg_icon" alt="arrow" />
    <?php 
            echo $this->Output('NO_PICS');
            ?>
 
    </div>
  </div>
<?php 
        }
        ?>
  <div class="sectiontableheader">
    &nbsp;
  </div>
<?php 
    }
 /**
  * create RSS-Items
  *       *
  */
 function Joom_GetRSSItems()
 {
     global $func;
     $rssItems = '';
     $rss_thumbnailpath = $this->thumbnailpath . $this->catpath;
     $rss_picturepath = $this->picturepath . $this->catpath;
     $rss_origpicturepath = $this->absolut_origpicturepath . $this->catpath;
     foreach ($this->rows as $picture) {
         $id = $picture->id;
         if (defined('_JEXEC')) {
             $title = $this->Joom_GetBareText($picture->imgtitle);
             $text = $this->Joom_GetBareText($picture->imgtext);
         } else {
             $title = utf8_encode($this->Joom_GetBareText($picture->imgtitle));
             $text = utf8_encode($this->Joom_GetBareText($picture->imgtext));
         }
         $link = JRoute::_('index.php?option=com_joomgallery&func=detail&id=' . $picture->id);
         $name = $picture->imgauthor;
         $img_id = $picture->id;
         $link_big = 1;
         //check if original picture exists, otherwise use detail picture
         if (file_exists(JPath::clean($rss_origpicturepath . $picture->imgfilename))) {
             $func = 'detail';
         }
         $contenturl = Joom_OpenImage($link_big, $picture->id, $this->catpath, $this->catid, $picture->imgfilename, $picture->imgtitle, $picture->imgtext);
         $contenturl = str_replace('" target="_blank', '', $contenturl);
         $rssItems .= "<item>\n                    <title>" . $title . "</title>\n                    <link>" . $link . "</link>\n                    <media:thumbnail url=\"" . $rss_thumbnailpath . $picture->imgthumbname . "\" />\n                    <media:content url=\"" . $contenturl . "\" />\n                    <media:description>" . $text . "</media:description>\n                    <guid isPermaLink=\"false\">" . _JOOM_LIVE_SITE . 'joomgallery-' . $picture->id . "</guid>\n                    </item>\n";
     }
     return $rssItems;
 }
 function showimage($obj, $tdclass)
 {
     $user =& JFactory::getUser();
     $output = "   <td" . $tdclass . ">\n";
     if ($obj->picid != '') {
         $thmsize = getimagesize($this->_config['thumbnailabspath'] . $obj->catpath . '/' . $obj->imgthumbname);
         $thmWidth = $thmsize[0];
         $thmHeight = $thmsize[1];
         // if photos are resized by width
         if ($this->_config['useforresizedirection'] == 1) {
             $ratio = $thmWidth / $this->_config['imgwidth'];
             $testheight = $thmHeight / $ratio;
             // if thumbheight is higher than maxheight
             if ($testheight > $this->_config['imgheight']) {
                 $ratio = $thmHeight / $this->_config['imgwidth'];
             }
             // if photos are resized by height
         } else {
             $ratio = $thmHeight / $this->_config['imgheight'];
             $testwidth = $thmWidth / $ratio;
             // if thumbwidth is larger than maxwidth
             if ($testwidth > $this->_config['imgheight']) {
                 $ratio = $thmWidth / $this->_config['imgheight'];
             }
         }
         // Checks if image has to be resized
         $ratio = max($ratio, 1.0);
         $destWidth = (int) ($thmWidth / $ratio);
         $destHeight = (int) ($thmHeight / $ratio);
         if ($this->_config['piclink'] == 1) {
             $link = $this->getCatgLink($obj->catid);
         } else {
             if ($this->_config['showdetailpage'] == 0 && $user->get('aid') != 0 || $this->_config['showdetailpage'] == 1) {
                 $link = Joom_OpenImage($this->_config['detailpic_open'], $obj->picid, $obj->catpath . '/', $obj->catid, $obj->imgfilename, $obj->imgtitle, $obj->imgtext);
                 $link = str_replace("&amp;Itemid=&amp;Itemid=", "&amp;Itemid=", $link);
             } else {
                 $link = "javascript:alert('" . JText::_('JGS_ALERT_NO_DETAILVIEW_FOR_GUESTS', true) . "')";
             }
             if ($this->_config['detailpic_open'] == 0) {
                 $link .= "#joomimg";
             }
             $link = str_replace("lightbox[joomgallery]", "lightbox[" . $this->_stag . "1]", $link);
             $link = str_replace("rel=\"joomgallery\"", "rel=\"" . $this->_stag . "1\"", $link);
         }
         $output .= "    <a href=\"" . $link . "\">\n";
         $output .= "     <img src=\"" . $this->_config['thumbnailpath'] . $obj->catpath . '/' . $obj->imgthumbname . "\" alt=\"" . $obj->imgtitle . "\" width=\"" . $destWidth . "\" height=\"" . $destHeight . "\" class=\"";
         //$output .= ($this->_config['joomstyle']==1) ? $this->_config['myborder'] : "".$this->_stag."img" ;
         $output .= $this->_stag . "img";
         $output .= "\" />\n";
         $output .= "    </a>\n";
     } else {
         $output .= "    &nbsp;\n";
     }
     $output .= "   </td>\n";
     return $output;
 }