Exemple #1
0
 /**
  * The name says it all
  */
 public function setVarsFromRequest()
 {
     //Required fields
     if (isset($_REQUEST['categoryid'])) {
         $this->setVar('categoryid', PublisherRequest::getInt('categoryid'));
     }
     if (isset($_REQUEST['title'])) {
         $this->setVar('title', PublisherRequest::getString('title'));
     }
     if (isset($_REQUEST['body'])) {
         $this->setVar('body', PublisherRequest::getText('body'));
     }
     //Not required fields
     if (isset($_REQUEST['summary'])) {
         $this->setVar('summary', PublisherRequest::getText('summary'));
     }
     if (isset($_REQUEST['subtitle'])) {
         $this->setVar('subtitle', PublisherRequest::getString('subtitle'));
     }
     if (isset($_REQUEST['item_tag'])) {
         $this->setVar('item_tag', PublisherRequest::getString('item_tag'));
     }
     if (isset($_REQUEST['image_featured'])) {
         $image_item = PublisherRequest::getArray('image_item');
         $image_featured = PublisherRequest::getString('image_featured');
         //Todo: get a better image class for xoops!
         //Image hack
         $image_item_ids = array();
         global $xoopsDB;
         $sql = 'SELECT image_id, image_name FROM ' . $xoopsDB->prefix('image');
         $result = $xoopsDB->query($sql, 0, 0);
         while ($myrow = $xoopsDB->fetchArray($result)) {
             $image_name = $myrow['image_name'];
             $id = $myrow['image_id'];
             if ($image_name == $image_featured) {
                 $this->setVar('image', $id);
             }
             if (in_array($image_name, $image_item)) {
                 $image_item_ids[] = $id;
             }
         }
         $this->setVar('images', implode('|', $image_item_ids));
     }
     if (isset($_REQUEST['uid'])) {
         $this->setVar('uid', PublisherRequest::getInt('uid'));
     } elseif ($this->isnew()) {
         $this->setVar('uid', is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->uid() : 0);
     }
     if (isset($_REQUEST['author_alias'])) {
         $this->setVar('author_alias', PublisherRequest::getString('author_alias'));
         if ($this->getVar('autor_alias') != '') {
             $this->setVar('uid', 0);
         }
     }
     if (isset($_REQUEST['datesub'])) {
         $this->setVar('datesub', strtotime($_REQUEST['datesub']['date']) + $_REQUEST['datesub']['time']);
     } elseif ($this->isnew()) {
         $this->setVar('datesub', time());
     }
     if (isset($_REQUEST['item_short_url'])) {
         $this->setVar('short_url', PublisherRequest::getString('item_short_url'));
     }
     if (isset($_REQUEST['item_meta_keywords'])) {
         $this->setVar('meta_keywords', PublisherRequest::getString('item_meta_keywords'));
     }
     if (isset($_REQUEST['item_meta_description'])) {
         $this->setVar('meta_description', PublisherRequest::getString('item_meta_description'));
     }
     if (isset($_REQUEST['weight'])) {
         $this->setVar('weight', PublisherRequest::getInt('weight'));
     }
     if (isset($_REQUEST['allowcomments'])) {
         $this->setVar('cancomment', PublisherRequest::getInt('allowcomments'));
     } elseif ($this->isnew()) {
         $this->setVar('cancoment', $this->publisher->getConfig('submit_allowcomments'));
     }
     if (isset($_REQUEST['status'])) {
         $this->setVar('status', PublisherRequest::getInt('status'));
     } elseif ($this->isnew()) {
         $this->setVar('status', $this->publisher->getConfig('submit_status'));
     }
     if (isset($_REQUEST['dohtml'])) {
         $this->setVar('dohtml', PublisherRequest::getInt('dohtml'));
     } elseif ($this->isnew()) {
         $this->setVar('dohtml', $this->publisher->getConfig('submit_dohtml'));
     }
     if (isset($_REQUEST['dosmiley'])) {
         $this->setVar('dosmiley', PublisherRequest::getInt('dosmiley'));
     } elseif ($this->isnew()) {
         $this->setVar('dosmiley', $this->publisher->getConfig('submit_dosmiley'));
     }
     if (isset($_REQUEST['doxcode'])) {
         $this->setVar('doxcode', PublisherRequest::getInt('doxcode'));
     } elseif ($this->isnew()) {
         $this->setVar('doxcode', $this->publisher->getConfig('submit_doxcode'));
     }
     if (isset($_REQUEST['doimage'])) {
         $this->setVar('doimage', PublisherRequest::getInt('doimage'));
     } elseif ($this->isnew()) {
         $this->setVar('doimage', $this->publisher->getConfig('submit_doimage'));
     }
     if (isset($_REQUEST['dolinebreak'])) {
         $this->setVar('dobr', PublisherRequest::getInt('dolinebreak'));
     } elseif ($this->isnew()) {
         $this->setVar('dobr', $this->publisher->getConfig('submit_dobr'));
     }
     if (isset($_REQUEST['notify'])) {
         $this->setVar('notifypub', PublisherRequest::getInt('notify'));
     }
 }
Exemple #2
0
             exit;
         }
     }
     publisher_cpHeader();
     publisher_editItem(true, $itemid);
     break;
 case "additem":
     // Creating the item object
     if ($itemid != 0) {
         $itemObj = $publisher->getHandler('item')->get($itemid);
     } else {
         $itemObj = $publisher->getHandler('item')->create();
     }
     $itemObj->setVarsFromRequest();
     $old_status = $itemObj->status();
     $new_status = PublisherRequest::getInt('status', _PUBLISHER_STATUS_PUBLISHED);
     //_PUBLISHER_STATUS_NOTSET;
     switch ($new_status) {
         case _PUBLISHER_STATUS_SUBMITTED:
             if ($old_status == _PUBLISHER_STATUS_NOTSET) {
                 $error_msg = _AM_PUBLISHER_ITEMNOTUPDATED;
             } else {
                 $error_msg = _AM_PUBLISHER_ITEMNOTCREATED;
             }
             $redirect_msg = _AM_PUBLISHER_ITEM_RECEIVED_NEED_APPROVAL;
             break;
         case _PUBLISHER_STATUS_PUBLISHED:
             if ($old_status == _PUBLISHER_STATUS_NOTSET || $old_status == _PUBLISHER_STATUS_SUBMITTED) {
                 $redirect_msg = _AM_PUBLISHER_SUBMITTED_APPROVE_SUCCESS;
                 $notifToDo = array(_PUBLISHER_NOT_ITEM_PUBLISHED);
             } else {
Exemple #3
0
*/
/**
 * @copyright       The XUUPS Project http://sourceforge.net/projects/xuups/
 * @license         http://www.fsf.org/copyleft/gpl.html GNU public license
 * @package         Publisher
 * @subpackage      Action
 * @since           1.0
 * @author          trabis <*****@*****.**>
 * @author          The SmartFactory <www.smartfactory.ca>
 * @version         $Id$
 */
include_once dirname(__FILE__) . '/header.php';
// At which record shall we start for the Categories
$catstart = PublisherRequest::getInt('catstart');
// At which record shall we start for the ITEM
$start = PublisherRequest::getInt('start');
// Number of categories at the top level
$totalCategories = $publisher->getHandler('category')->getCategoriesCount(0);
// if there ain't no category to display, let's get out of here
if ($totalCategories == 0) {
    redirect_header(XOOPS_URL, 2, _MD_PUBLISHER_NO_TOP_PERMISSIONS);
    exit;
}
$xoopsOption['template_main'] = 'publisher_display' . '_' . $publisher->getConfig('idxcat_items_display_type') . '.html';
include_once XOOPS_ROOT_PATH . '/header.php';
include_once PUBLISHER_ROOT_PATH . '/footer.php';
$gperm_handler = xoops_gethandler('groupperm');
// Creating the top categories objects
$categoriesObj = $publisher->getHandler('category')->getCategories($publisher->getConfig('idxcat_cat_perpage'), $catstart);
// if no categories are found, exit
$totalCategoriesOnPage = count($categoriesObj);
Exemple #4
0
$categoryid = PublisherRequest::getInt('categoryid');
// Creating the category object for the selected category
$categoryObj = $publisher->getHandler('category')->get($categoryid);
// if the selected category was not found, exit
if (!is_object($categoryObj) || $categoryObj->notLoaded()) {
    redirect_header("javascript:history.go(-1)", 1, _MD_PUBLISHER_NOCATEGORYSELECTED);
    exit;
}
// Check user permissions to access this category
if (!$categoryObj->checkPermission()) {
    redirect_header("javascript:history.go(-1)", 1, _NOPERM);
    exit;
}
// At which record shall we start
$start = PublisherRequest::getInt('start');
$item_page_id = PublisherRequest::getInt('page', -1);
$totalItems = $publisher->getHandler('category')->publishedItemsCount();
// if there is no Item under this categories or the sub-categories, exit
// why?
if (!isset($totalItems[$categoryid]) || $totalItems[$categoryid] == 0) {
    //redirect_header("index.php", 1, _MD_PUBLISHER_MAINNOFAQS);
    //exit;
}
// Added by skalpa: custom template support
$xoopsOption['template_main'] = $categoryObj->template();
if (empty($xoopsOption['template_main'])) {
    $xoopsOption['template_main'] = 'publisher_display' . '_' . $publisher->getConfig('idxcat_items_display_type') . '.html';
}
include_once XOOPS_ROOT_PATH . '/header.php';
include_once PUBLISHER_ROOT_PATH . '/footer.php';
$module_id = $publisher->getModule()->getVar('mid');
Exemple #5
0
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
 * @copyright       The XUUPS Project http://sourceforge.net/projects/xuups/
 * @license         http://www.fsf.org/copyleft/gpl.html GNU public license
 * @package         Publisher
 * @subpackage      Action
 * @since           1.0
 * @author          trabis <*****@*****.**>
 * @author          The SmartFactory <www.smartfactory.ca>
 * @version         $Id$
 */
include_once dirname(__FILE__) . '/header.php';
$fileid = PublisherRequest::getInt('fileid');
// Creating the item object for the selected item
$fileObj = $publisher->getHandler('file')->get($fileid);
if ($fileObj->getVar('status' != _PUBLISHER_STATUS_FILE_ACTIVE)) {
    redirect_header("javascript:history.go(-1)", 1, _NOPERM);
}
$itemObj = $publisher->getHandler('item')->get($fileObj->getVar('itemid'));
// Check user permissions to access this file
if (!$itemObj->accessGranted()) {
    redirect_header("javascript:history.go(-1)", 1, _NOPERM);
    exit;
}
// Creating the category object that holds the selected ITEM
$categoryObj = $itemObj->category();
$fileObj->updateCounter();
if (!preg_match("/^ed2k*:\\/\\//i", $fileObj->getFileUrl())) {
Exemple #6
0
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
 * @copyright       The XUUPS Project http://sourceforge.net/projects/xuups/
 * @license         http://www.fsf.org/copyleft/gpl.html GNU public license
 * @package         Publisher
 * @subpackage      Action
 * @since           1.0
 * @author          trabis <*****@*****.**>
 * @version         $Id$
 */
include_once dirname(__FILE__) . '/header.php';
//getting the values
$rating = PublisherRequest::getInt('rating');
$itemid = PublisherRequest::getInt('itemid');
$groups = $xoopsUser ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
$gperm_handler = xoops_getmodulehandler('groupperm');
$hModConfig = xoops_gethandler('config');
$module_id = $publisher->getModule()->getVar('mid');
//Checking permissions
if (!$publisher->getConfig('perm_rating') || !$gperm_handler->checkRight('global', _PUBLISHER_RATE, $groups, $module_id)) {
    redirect_header(PUBLISHER_URL . '/item.php?itemid=' . $itemid, 2, _NOPERM);
    exit;
}
if ($rating > 5 || $rating < 1) {
    redirect_header(PUBLISHER_URL . '/item.php?itemid=' . $itemid, 2, _MD_PUBLISHER_VOTE_BAD);
    exit;
}
$criteria = new Criteria('itemid', $itemid);
$ratingObjs = $publisher->getHandler('rating')->getObjects($criteria);
Exemple #7
0
     $files_form = $fileObj->getForm();
     $files_form->display();
     break;
 case "modify":
     $fileid = isset($_POST['fileid']) ? intval($_POST['fileid']) : 0;
     // Creating the file object
     if ($fileid != 0) {
         $fileObj = $publisher->getHandler('file')->get($fileid);
     } else {
         redirect_header("index.php", 1, _NOPERM);
         exit;
     }
     // Putting the values in the file object
     $fileObj->setVar('name', PublisherRequest::getString('name'));
     $fileObj->setVar('description', PublisherRequest::getString('description'));
     $fileObj->setVar('status', PublisherRequest::getInt('file_status'));
     // attach file if any
     if (isset($_FILES['item_upload_file']) && $_FILES['item_upload_file']['name'] != "") {
         $oldfile = $fileObj->getFilePath();
         // Get available mimetypes for file uploading
         $allowed_mimetypes = $publisher->getHandler('mimetype')->getArrayByType();
         // TODO : display the available mimetypes to the user
         $errors = array();
         if ($publisher->getConfig('perm_upload') && is_uploaded_file($_FILES['item_upload_file']['tmp_name'])) {
             if ($fileObj->checkUpload('item_upload_file', $allowed_mimetypes, $errors)) {
                 if ($fileObj->storeUpload('item_upload_file', $allowed_mimetypes, $errors)) {
                     unlink($oldfile);
                 }
             }
         }
     }
Exemple #8
0
$xoopsConfig["module_cache"][$module_id] = 0;
$xoopsOption["template_main"] = 'publisher_search.html';
include XOOPS_ROOT_PATH . '/header.php';
$module_info_search = $publisher->getModule()->getInfo("search");
include_once PUBLISHER_ROOT_PATH . "/" . $module_info_search["file"];
$limit = 10;
//$publisher->getConfig('idxcat_perpage');
$uid = 0;
$queries = array();
$andor = PublisherRequest::getString('andor');
$start = PublisherRequest::getInt('start');
$category = PublisherRequest::getArray('category');
$username = PublisherRequest::getString('uname');
$searchin = PublisherRequest::getArray('searchin');
$sortby = PublisherRequest::getString('sortby');
$term = PublisherRequest::getString('term');
if (empty($category) || is_array($category) && in_array("all", $category)) {
    $category = array();
} else {
    $category = !is_array($category) ? explode(",", $category) : $category;
    $category = array_map("intval", $category);
}
$andor = in_array(strtoupper($andor), array("OR", "AND", "EXACT")) ? strtoupper($andor) : "OR";
$sortby = in_array(strtolower($sortby), array("itemid", "datesub", "title", "categoryid")) ? strtolower($sortby) : "itemid";
if (!(empty($_POST["submit"]) && empty($term))) {
    $next_search["category"] = implode(",", $category);
    $next_search["andor"] = $andor;
    $next_search["term"] = $term;
    $query = trim($term);
    if ($andor != "EXACT") {
        $ignored_queries = array();
Exemple #9
0
 /**
  * Cleans the request from script injection.
  *
  * @static
  * @return    void
  */
 static function clean()
 {
     PublisherRequest::_cleanArray($_FILES);
     PublisherRequest::_cleanArray($_ENV);
     PublisherRequest::_cleanArray($_GET);
     PublisherRequest::_cleanArray($_POST);
     PublisherRequest::_cleanArray($_COOKIE);
     PublisherRequest::_cleanArray($_SERVER);
     if (isset($_SESSION)) {
         PublisherRequest::_cleanArray($_SESSION);
     }
     $REQUEST = $_REQUEST;
     $GET = $_GET;
     $POST = $_POST;
     $COOKIE = $_COOKIE;
     $FILES = $_FILES;
     $ENV = $_ENV;
     $SERVER = $_SERVER;
     if (isset($_SESSION)) {
         $SESSION = $_SESSION;
     }
     foreach ($GLOBALS as $key => $value) {
         if ($key != 'GLOBALS') {
             unset($GLOBALS[$key]);
         }
     }
     $_REQUEST = $REQUEST;
     $_GET = $GET;
     $_POST = $POST;
     $_COOKIE = $COOKIE;
     $_FILES = $FILES;
     $_ENV = $ENV;
     $_SERVER = $SERVER;
     if (isset($SESSION)) {
         $_SESSION = $SESSION;
     }
 }
Exemple #10
0
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
 * @copyright       The XUUPS Project http://sourceforge.net/projects/xuups/
 * @license         http://www.fsf.org/copyleft/gpl.html GNU public license
 * @package         Publisher
 * @subpackage      Action
 * @since           1.0
 * @author          trabis <*****@*****.**>
 * @version         $Id$
 */
include_once dirname(__FILE__) . '/header.php';
$uid = PublisherRequest::getInt('uid');
if (empty($uid)) {
    redirect_header('index.php', 2, _CO_PUBLISHER_ERROR);
    exit;
}
$member_handler = xoops_gethandler('member');
$thisuser = $member_handler->getUser($uid);
if (!is_object($thisuser)) {
    redirect_header('index.php', 2, _CO_PUBLISHER_ERROR);
    exit;
}
if (!$publisher->getConfig('perm_author_items')) {
    redirect_header('index.php', 2, _CO_PUBLISHER_ERROR);
    exit;
}
$myts = MyTextSanitizer::getInstance();
Exemple #11
0
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
 * @copyright       The XUUPS Project http://sourceforge.net/projects/xuups/
 * @license         http://www.fsf.org/copyleft/gpl.html GNU public license
 * @package         Publisher
 * @since           1.0
 * @author          trabis <*****@*****.**>
 * @author          The SmartFactory <www.smartfactory.ca>
 * @version         $Id$
 */
include_once dirname(__FILE__) . '/admin_header.php';
$op = PublisherRequest::getString('op');
function publisher_editFile($showmenu = false, $fileid = 0, $itemid = 0)
{
    $publisher = PublisherPublisher::getInstance();
    include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
    // if there is a parameter, and the id exists, retrieve data: we're editing a file
    if ($fileid != 0) {
        // Creating the File object
        $fileObj = $publisher->getHandler('file')->get($fileid);
        if ($fileObj->notLoaded()) {
            redirect_header("javascript:history.go(-1)", 1, _AM_PUBLISHER_NOFILESELECTED);
            exit;
        }
        if ($showmenu) {
            //publisher_adminMenu(2, _AM_PUBLISHER_FILE . " > " . _AM_PUBLISHER_EDITING);
        }
Exemple #12
0
function publisher_editCat($showmenu = false, $categoryid = 0, $nb_subcats = 4, $categoryObj = null)
{
    $publisher = PublisherPublisher::getInstance();
    // if there is a parameter, and the id exists, retrieve data: we're editing a category
    if ($categoryid != 0) {
        // Creating the category object for the selected category
        $categoryObj = $publisher->getHandler('category')->get($categoryid);
        if ($categoryObj->notLoaded()) {
            redirect_header("category.php", 1, _AM_PUBLISHER_NOCOLTOEDIT);
            exit;
        }
    } else {
        if (!$categoryObj) {
            $categoryObj = $publisher->getHandler('category')->create();
        }
    }
    if ($categoryid != 0) {
        if ($showmenu) {
            //publisher_adminMenu(1, _AM_PUBLISHER_CATEGORIES . " > " . _AM_PUBLISHER_EDITING);
        }
        echo "<br />\n";
        publisher_openCollapsableBar('edittable', 'edittableicon', _AM_PUBLISHER_EDITCOL, _AM_PUBLISHER_CATEGORY_EDIT_INFO);
    } else {
        if ($showmenu) {
            //publisher_adminMenu(1, _AM_PUBLISHER_CATEGORIES . " > " . _AM_PUBLISHER_CREATINGNEW);
        }
        publisher_openCollapsableBar('createtable', 'createtableicon', _AM_PUBLISHER_CATEGORY_CREATE, _AM_PUBLISHER_CATEGORY_CREATE_INFO);
    }
    $sform = $categoryObj->getForm($nb_subcats);
    $sform->display();
    if (!$categoryid) {
        publisher_closeCollapsableBar('createtable', 'createtableicon');
    } else {
        publisher_closeCollapsableBar('edittable', 'edittableicon');
    }
    //Added by fx2024
    if ($categoryid) {
        $sel_cat = $categoryid;
        publisher_openCollapsableBar('subcatstable', 'subcatsicon', _AM_PUBLISHER_SUBCAT_CAT, _AM_PUBLISHER_SUBCAT_CAT_DSC);
        // Get the total number of sub-categories
        $categoriesObj = $publisher->getHandler('category')->get($sel_cat);
        $totalsubs = $publisher->getHandler('category')->getCategoriesCount($sel_cat);
        // creating the categories objects that are published
        $subcatsObj = $publisher->getHandler('category')->getCategories(0, 0, $categoriesObj->categoryid());
        $totalSCOnPage = count($subcatsObj);
        echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>";
        echo "<tr>";
        echo "<td width='60' class='bg3' align='left'><strong>" . _AM_PUBLISHER_CATID . "</strong></td>";
        echo "<td width='20%' class='bg3' align='left'><strong>" . _AM_PUBLISHER_CATCOLNAME . "</strong></td>";
        echo "<td class='bg3' align='left'><strong>" . _AM_PUBLISHER_SUBDESCRIPT . "</strong></td>";
        echo "<td width='60' class='bg3' align='right'><strong>" . _AM_PUBLISHER_ACTION . "</strong></td>";
        echo "</tr>";
        if ($totalsubs > 0) {
            foreach ($subcatsObj as $subcat) {
                $modify = "<a href='category.php?op=mod&amp;categoryid=" . $subcat->categoryid() . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/edit.gif' title='" . _AM_PUBLISHER_MODIFY . "' alt='" . _AM_PUBLISHER_MODIFY . "' /></a>";
                $delete = "<a href='category.php?op=del&amp;categoryid=" . $subcat->categoryid() . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/delete.png' title='" . _AM_PUBLISHER_DELETE . "' alt='" . _AM_PUBLISHER_DELETE . "' /></a>";
                echo "<tr>";
                echo "<td class='head' align='left'>" . $subcat->categoryid() . "</td>";
                echo "<td class='even' align='left'><a href='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/category.php?categoryid=" . $subcat->categoryid() . "&amp;parentid=" . $subcat->parentid() . "'>" . $subcat->name() . "</a></td>";
                echo "<td class='even' align='left'>" . $subcat->description() . "</td>";
                echo "<td class='even' align='right'> {$modify} {$delete} </td>";
                echo "</tr>";
            }
        } else {
            echo "<tr>";
            echo "<td class='head' align='center' colspan= '7'>" . _AM_PUBLISHER_NOSUBCAT . "</td>";
            echo "</tr>";
        }
        echo "</table>\n";
        echo "<br />\n";
        publisher_closeCollapsableBar('subcatstable', 'subcatsicon');
        publisher_openCollapsableBar('bottomtable', 'bottomtableicon', _AM_PUBLISHER_CAT_ITEMS, _AM_PUBLISHER_CAT_ITEMS_DSC);
        $startitem = PublisherRequest::getInt('startitem');
        // Get the total number of published ITEMS
        $totalitems = $publisher->getHandler('item')->getItemsCount($sel_cat, array(_PUBLISHER_STATUS_PUBLISHED));
        // creating the items objects that are published
        $itemsObj = $publisher->getHandler('item')->getAllPublished($publisher->getConfig('idxcat_perpage'), $startitem, $sel_cat);
        $totalitemsOnPage = count($itemsObj);
        $allcats = $publisher->getHandler('category')->getObjects(null, true);
        echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>";
        echo "<tr>";
        echo "<td width='40' class='bg3' align='center'><strong>" . _AM_PUBLISHER_ITEMID . "</strong></td>";
        echo "<td width='20%' class='bg3' align='left'><strong>" . _AM_PUBLISHER_ITEMCOLNAME . "</strong></td>";
        echo "<td class='bg3' align='left'><strong>" . _AM_PUBLISHER_ITEMDESC . "</strong></td>";
        echo "<td width='90' class='bg3' align='center'><strong>" . _AM_PUBLISHER_CREATED . "</strong></td>";
        echo "<td width='60' class='bg3' align='center'><strong>" . _AM_PUBLISHER_ACTION . "</strong></td>";
        echo "</tr>";
        if ($totalitems > 0) {
            for ($i = 0; $i < $totalitemsOnPage; $i++) {
                $categoryObj =& $allcats[$itemsObj[$i]->categoryid()];
                $modify = "<a href='item.php?op=mod&amp;itemid=" . $itemsObj[$i]->itemid() . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/edit.gif' title='" . _AM_PUBLISHER_EDITITEM . "' alt='" . _AM_PUBLISHER_EDITITEM . "' /></a>";
                $delete = "<a href='item.php?op=del&amp;itemid=" . $itemsObj[$i]->itemid() . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/delete.png' title='" . _AM_PUBLISHER_DELETEITEM . "' alt='" . _AM_PUBLISHER_DELETEITEM . "'/></a>";
                echo "<tr>";
                echo "<td class='head' align='center'>" . $itemsObj[$i]->itemid() . "</td>";
                echo "<td class='even' align='left'>" . $categoryObj->name() . "</td>";
                echo "<td class='even' align='left'>" . $itemsObj[$i]->getitemLink() . "</td>";
                echo "<td class='even' align='center'>" . $itemsObj[$i]->datesub('s') . "</td>";
                echo "<td class='even' align='center'> {$modify} {$delete} </td>";
                echo "</tr>";
            }
        } else {
            $itemid = -1;
            echo "<tr>";
            echo "<td class='head' align='center' colspan= '7'>" . _AM_PUBLISHER_NOITEMS . "</td>";
            echo "</tr>";
        }
        echo "</table>\n";
        echo "<br />\n";
        $parentid = PublisherRequest::getInt('parentid');
        $pagenav_extra_args = "op=mod&categoryid={$sel_cat}&parentid={$parentid}";
        xoops_load('XoopsPageNav');
        $pagenav = new XoopsPageNav($totalitems, $publisher->getConfig('idxcat_perpage'), $startitem, 'startitem', $pagenav_extra_args);
        echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
        echo "<input type='button' name='button' onclick=\"location='item.php?op=mod&categoryid=" . $sel_cat . "'\" value='" . _AM_PUBLISHER_CREATEITEM . "'>&nbsp;&nbsp;";
        echo "</div>";
    }
    //end of fx2024 code
}
Exemple #13
0
 */
######################################################################
# Original version:
# [11-may-2001] Kenneth Lee - http://www.nexgear.com/
######################################################################
include_once dirname(__FILE__) . '/header.php';
$xoopsOption['template_main'] = 'publisher_archive.html';
include_once XOOPS_ROOT_PATH . '/header.php';
include_once PUBLISHER_ROOT_PATH . '/footer.php';
xoops_loadLanguage('calendar');
xoops_load('XoopsLocal');
$lastyear = 0;
$lastmonth = 0;
$months_arr = array(1 => _CAL_JANUARY, 2 => _CAL_FEBRUARY, 3 => _CAL_MARCH, 4 => _CAL_APRIL, 5 => _CAL_MAY, 6 => _CAL_JUNE, 7 => _CAL_JULY, 8 => _CAL_AUGUST, 9 => _CAL_SEPTEMBER, 10 => _CAL_OCTOBER, 11 => _CAL_NOVEMBER, 12 => _CAL_DECEMBER);
$fromyear = PublisherRequest::getInt('year');
$frommonth = PublisherRequest::getInt('month');
$pgtitle = '';
if ($fromyear && $frommonth) {
    $pgtitle = sprintf(" - %d - %d", $fromyear, $frommonth);
}
$dateformat = $publisher->getConfig('format_date');
if ($dateformat == '') {
    $dateformat = 'm';
}
$myts = MyTextSanitizer::getInstance();
$xoopsTpl->assign('xoops_pagetitle', $myts->htmlSpecialChars(_MD_PUBLISHER_ARCHIVES) . $pgtitle . ' - ' . $myts->htmlSpecialChars($xoopsModule->name()));
$useroffset = '';
if (is_object($xoopsUser)) {
    $timezone = $xoopsUser->timezone();
    if (isset($timezone)) {
        $useroffset = $xoopsUser->timezone();