Ejemplo n.º 1
0
 function view($id, $params)
 {
     global $my, $mainframe, $database, $option, $priTask, $subTask;
     global $WBG_CONFIG, $wbGalleryDB_cat;
     if (!$id) {
         $id = $params->get('id', 0);
     }
     // Load Image
     $row = new wbGalleryDB_img($database);
     $row->load($id);
     if (!$row->id) {
         echo "<script> alert('Image Not Found'); window.history.go(-1); </script>\n";
         exit;
     }
     // Track Hit
     $row->hit();
     // Load Category
     if ($row->cat_id != '0') {
         $cat = new wbGalleryDB_cat($database);
         $cat->load($row->cat_id);
         if (!$cat->id) {
             echo "<script> alert('Category Not Found'); window.history.go(-1); </script>\n";
             exit;
         }
         if ($cat->access > $my->gid) {
             mosNotAuth();
             exit;
         }
     }
     // Load Prev / Next
     $neighbors = $row->getNeighbors();
     // Load Related Images
     $database->setQuery("\r\r\n      SELECT i.*\r\r\n      FROM #__wbgallery_img AS i\r\r\n      WHERE i.cat_id = " . (int) $row->cat_id . "\r\r\n        AND i.id != " . (int) $row->id . "\r\r\n        AND i.published = 1\r\r\n      ORDER BY i.hits DESC\r\r\n        , i.ordering ASC\r\r\n      LIMIT 0, " . $params->get('related_list_limit', $mainframe->getCfg('list_limit', 15)) . "\r\r\n      ");
     $related = $database->loadObjectList();
     echo $database->getErrorMsg();
     wbGallery_img_html::view($row, $cat, $neighbors, $related, $params);
 }
Ejemplo n.º 2
0
    function manage($rows, $pageNav, $lists)
    {
        global $my, $mainframe, $database, $option, $priTask, $subTask;
        global $WBG_CONFIG, $wbGalleryDB_cat;
        ?>

    <link rel="stylesheet" href="<?php 
        echo $mainframe->getCfg('live_site');
        ?>
/administrator/components/<?php 
        echo $option;
        ?>
/css/image.manage.css" type="text/css" />
    <form action="index2.php" method="post" name="adminForm" id="adminForm">
      <table class="adminheading" cellpadding="0" cellspacing="0" width="100%">
        <tr>
          <th class="mediamanager" valign="top">
            <font size="+1">wbGallery</font><br/>
            Manage Collection Images<br/>
            <span id="ajax_result">
              <font color="red"><?php 
        echo is_object($lists['active_cat']) ? ($lists['active_cat']->name ? $lists['active_cat']->name : 'No') . ' Category Images' : 'Viewing All Images...';
        ?>
</font><br/>
            </span>
          </th>
          <td valign="top" style="width:160px;">
            Select All: <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php 
        echo count($rows);
        ?>
);" /><br/>
            <?php 
        echo $lists['moveid'];
        ?>
 <input type="submit" value=" Move Selected Items " onClick="document.adminForm.task.value='image.move';document.adminForm.submit();" /><br/>
          </td>
          <td valign="top" style="width:240px;">
            <table cellpadding="0" cellspacing="2">
              <tr>
                <td nowrap align="right">View Mode: </td>
                <td><?php 
        echo $lists['view_mode'];
        ?>
</td>
              </tr>
              <tr>
                <td nowrap align="right">Filter Category: </td>
                <td><?php 
        echo $lists['cat_id'];
        ?>
</td>
              </tr>
              <tr>
                <td nowrap align="right">Filter Term: </td>
                <td nowrap><input type="text" name="searchkw" value="<?php 
        echo $lists['searchkw'];
        ?>
" onchange="document.adminForm.submit();" />
                  <input type="submit" value=" GO " onClick="document.adminForm.submit();" /></td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
      <table class="adminlist"><tr><th colspan="3"><?php 
        echo $pageNav->getPagesLinks();
        ?>
</th></tr></table>
      <?php 
        if (!count($rows)) {
            echo '<h1 class="error_msg">There are No Images to View...</h1>';
        } elseif ($lists['view_mode_opt'] == 'list') {
            wbGallery_img_html::manage_list($rows, $pageNav);
        } else {
            wbGallery_img_html::manage_sort($rows, $pageNav);
        }
        ?>

      <input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
      <input type="hidden" name="task" value="image" />
      <input type="hidden" name="boxchecked" value="0" />
      <input type="hidden" name="hidemainmenu" value="0" />
      <?php 
        echo $pageNav->getListFooter();
        ?>

    </form>
    <?php 
    }