/**
 * @param $options
 *
 * @return array
 */
function publisher_items_menu_show($options)
{
    $block = array();
    $publisher =& PublisherPublisher::getInstance();
    // Getting all top cats
    $blockCategoriesObj =& $publisher->getHandler('category')->getCategories(0, 0, 0);
    if (count($blockCategoriesObj) == 0) {
        return $block;
    }
    // Are we in Publisher ?
    $block['inModule'] = isset($GLOBALS['xoopsModule']) && $GLOBALS['xoopsModule']->getVar('dirname') == $publisher->getModule()->getVar('dirname');
    $catLinkClass = 'menuMain';
    $categoryid = 0;
    if ($block['inModule']) {
        // Are we in a category and if yes, in which one ?
        $categoryid = XoopsRequest::getInt('categoryid', 0, 'GET');
        if ($categoryid != 0) {
            // if we are in a category, then the $categoryObj is already defined in publisher/category.php
            global $categoryObj;
            $block['currentcat'] = $categoryObj->getCategoryLink('menuTop');
            $catLinkClass = 'menuSub';
        }
    }
    foreach ($blockCategoriesObj as $catid => $blockCategoryObj) {
        if ($catid != $categoryid) {
            $block['categories'][$catid]['categoryLink'] = $blockCategoryObj->getCategoryLink($catLinkClass);
        }
    }
    return $block;
}
Exemple #2
0
/**
 * @param bool $showmenu
 * @param int  $itemid
 * @param bool $clone
 */
function publisher_editItem($showmenu = false, $itemid = 0, $clone = false)
{
    $publisher =& PublisherPublisher::getInstance();
    global $publisherCurrentPage;
    xoops_load('XoopsFormLoader');
    $formTpl = new XoopsTpl();
    //publisher_submit.html
    // if there is a parameter, and the id exists, retrieve data: we're editing a item
    if ($itemid != 0) {
        // Creating the ITEM object
        $itemObj =& $publisher->getHandler('item')->get($itemid);
        if (!$itemObj) {
            redirect_header('item.php', 1, _AM_PUBLISHER_NOITEMSELECTED);
            //            exit();
        }
        if ($clone) {
            $itemObj->setNew();
            $itemObj->setVar('itemid', 0);
            $itemObj->setVar('status', PublisherConstants::PUBLISHER_STATUS_NOTSET);
            $itemObj->setVar('datesub', time());
        }
        switch ($itemObj->status()) {
            case PublisherConstants::PUBLISHER_STATUS_SUBMITTED:
                $breadcrumbAction1 = _CO_PUBLISHER_SUBMITTED;
                $breadcrumbAction2 = _AM_PUBLISHER_APPROVING;
                $pageTitle = _AM_PUBLISHER_SUBMITTED_TITLE;
                $pageInfo = _AM_PUBLISHER_SUBMITTED_INFO;
                $buttonCaption = _AM_PUBLISHER_APPROVE;
                $newStatus = PublisherConstants::PUBLISHER_STATUS_PUBLISHED;
                break;
            case PublisherConstants::PUBLISHER_STATUS_PUBLISHED:
                $breadcrumbAction1 = _CO_PUBLISHER_PUBLISHED;
                $breadcrumbAction2 = _AM_PUBLISHER_EDITING;
                $pageTitle = _AM_PUBLISHER_PUBLISHEDEDITING;
                $pageInfo = _AM_PUBLISHER_PUBLISHEDEDITING_INFO;
                $buttonCaption = _AM_PUBLISHER_MODIFY;
                $newStatus = PublisherConstants::PUBLISHER_STATUS_PUBLISHED;
                break;
            case PublisherConstants::PUBLISHER_STATUS_OFFLINE:
                $breadcrumbAction1 = _CO_PUBLISHER_OFFLINE;
                $breadcrumbAction2 = _AM_PUBLISHER_EDITING;
                $pageTitle = _AM_PUBLISHER_OFFLINEEDITING;
                $pageInfo = _AM_PUBLISHER_OFFLINEEDITING_INFO;
                $buttonCaption = _AM_PUBLISHER_MODIFY;
                $newStatus = PublisherConstants::PUBLISHER_STATUS_OFFLINE;
                break;
            case PublisherConstants::PUBLISHER_STATUS_REJECTED:
                $breadcrumbAction1 = _CO_PUBLISHER_REJECTED;
                $breadcrumbAction2 = _AM_PUBLISHER_REJECTED;
                $pageTitle = _AM_PUBLISHER_REJECTED_EDIT;
                $pageInfo = _AM_PUBLISHER_REJECTED_EDIT_INFO;
                $buttonCaption = _AM_PUBLISHER_MODIFY;
                $newStatus = PublisherConstants::PUBLISHER_STATUS_REJECTED;
                break;
            case PublisherConstants::PUBLISHER_STATUS_NOTSET:
                // Then it's a clone...
                $breadcrumbAction1 = _AM_PUBLISHER_ITEMS;
                $breadcrumbAction2 = _AM_PUBLISHER_CLONE_NEW;
                $buttonCaption = _AM_PUBLISHER_CREATE;
                $newStatus = PublisherConstants::PUBLISHER_STATUS_PUBLISHED;
                $pageTitle = _AM_PUBLISHER_ITEM_DUPLICATING;
                $pageInfo = _AM_PUBLISHER_ITEM_DUPLICATING_DSC;
                break;
            case 'default':
            default:
                $breadcrumbAction1 = _AM_PUBLISHER_ITEMS;
                $breadcrumbAction2 = _AM_PUBLISHER_EDITING;
                $pageTitle = _AM_PUBLISHER_PUBLISHEDEDITING;
                $pageInfo = _AM_PUBLISHER_PUBLISHEDEDITING_INFO;
                $buttonCaption = _AM_PUBLISHER_MODIFY;
                $newStatus = PublisherConstants::PUBLISHER_STATUS_PUBLISHED;
                break;
        }
        $categoryObj = $itemObj->getCategory();
        if ($showmenu) {
            //publisher_adminMenu(2, $breadcrumbAction1 . " > " . $breadcrumbAction2);
        }
        echo "<br />\n";
        publisherOpenCollapsableBar('edititemtable', 'edititemicon', $pageTitle, $pageInfo);
        if ($clone) {
            echo "<form><div style=\"margin-bottom: 10px;\">";
            echo "<input type='button' name='button' onclick=\"location='item.php?op=clone&itemid=" . $itemObj->itemid() . "'\" value='" . _AM_PUBLISHER_CLONE_ITEM . "'>&nbsp;&nbsp;";
            echo '</div></form>';
        }
    } else {
        // there's no parameter, so we're adding an item
        $itemObj =& $publisher->getHandler('item')->create();
        $itemObj->setVarsFromRequest();
        $categoryObj =& $publisher->getHandler('category')->create();
        $breadcrumbAction1 = _AM_PUBLISHER_ITEMS;
        $breadcrumbAction2 = _AM_PUBLISHER_CREATINGNEW;
        $buttonCaption = _AM_PUBLISHER_CREATE;
        $newStatus = PublisherConstants::PUBLISHER_STATUS_PUBLISHED;
        if ($showmenu) {
            //publisher_adminMenu(2, $breadcrumbAction1 . " > " . $breadcrumbAction2);
        }
        $categoryObj->setVar('categoryid', XoopsRequest::getInt('categoryid', 0, 'GET'));
        publisherOpenCollapsableBar('createitemtable', 'createitemicon', _AM_PUBLISHER_ITEM_CREATING, _AM_PUBLISHER_ITEM_CREATING_DSC);
    }
    $sform = $itemObj->getForm(_AM_PUBLISHER_ITEMS);
    $sform->assign($formTpl);
    $formTpl->display('db:publisher_submit.tpl');
    publisherCloseCollapsableBar('edititemtable', 'edititemicon');
    publisherOpenCollapsableBar('pagewraptable', 'pagewrapicon', _AM_PUBLISHER_PAGEWRAP, _AM_PUBLISHER_PAGEWRAPDSC);
    $dir = publisherGetUploadDir(true, 'content');
    if (false !== strpos(decoct(fileperms($dir)), '755')) {
        echo "<span style='color:#ff0000;'><h4>" . _AM_PUBLISHER_PERMERROR . '</h4></span>';
    }
    // Upload File
    echo "<form name='form_name2' id='form_name2' action='pw_upload_file.php' method='post' enctype='multipart/form-data'>";
    echo "<table cellspacing='1' width='100%' class='outer'>";
    echo "<tr><th colspan='2'>" . _AM_PUBLISHER_UPLOAD_FILE . '</th></tr>';
    echo "<tr valign='top' align='left'><td class='head'>" . _AM_PUBLISHER_SEARCH_PW . "</td><td class='even'><input type='file' name='fileupload' id='fileupload' size='30' /></td></tr>";
    echo "<tr valign='top' align='left'><td class='head'><input type='hidden' name='MAX_FILE_SIZE' id='op' value='500000' /></td><td class='even'><input type='submit' name='submit' value='" . _AM_PUBLISHER_UPLOAD . "' /></td></tr>";
    echo "<input type='hidden' name='backto' value='{$publisherCurrentPage}'/>";
    echo '</table>';
    echo '</form>';
    // Delete File
    $form = new XoopsThemeForm(_CO_PUBLISHER_DELETEFILE, 'form_name', 'pw_delete_file.php');
    $pWrapSelect = new XoopsFormSelect(publisherGetUploadDir(true, 'content'), 'address');
    $folder = dir($dir);
    while (($file = $folder->read()) !== false) {
        if ($file !== '.' && $file !== '..') {
            $pWrapSelect->addOption($file, $file);
        }
    }
    $folder->close();
    $form->addElement($pWrapSelect);
    $delfile = 'delfile';
    $form->addElement(new XoopsFormHidden('op', $delfile));
    $submit = new XoopsFormButton('', 'submit', _AM_PUBLISHER_BUTTON_DELETE, 'submit');
    $form->addElement($submit);
    $form->addElement(new XoopsFormHidden('backto', $publisherCurrentPage));
    $form->display();
    publisherCloseCollapsableBar('pagewraptable', 'pagewrapicon');
}
Exemple #3
0
     //$edituser->setVar('last_pass_change', time());
 }
 $edituser->setVar('url', XoopsRequest::getUrl('url', ''));
 $edituser->setVar('user_icq', XoopsRequest::getString('user_icq', ''));
 $edituser->setVar('user_from', XoopsRequest::getString('user_from', ''));
 $edituser->setVar('user_sig', xoops_substr(XoopsRequest::getString('user_sig', ''), 0, 255));
 $edituser->setVar('user_viewemail', XoopsRequest::getBool('user_viewemail', 0));
 $edituser->setVar('user_aim', XoopsRequest::getString('user_aim', ''));
 $edituser->setVar('user_yim', XoopsRequest::getString('user_yim', ''));
 $edituser->setVar('user_msnm', XoopsRequest::getString('user_msnm', ''));
 $edituser->setVar('attachsig', XoopsRequest::getBool('attachsig', 0));
 $edituser->setVar('timezone_offset', XoopsRequest::getFloat('timezone_offset', 0.0));
 $edituser->setVar('uorder', XoopsRequest::getInt('uorder', 0));
 $edituser->setVar('umode', XoopsRequest::getString('umode', 'flat'));
 $edituser->setVar('notify_method', XoopsRequest::getInt('notify_method', 1));
 $edituser->setVar('notify_mode', XoopsRequest::getInt('notify_mode', 1));
 $edituser->setVar('bio', substr(XoopsRequest::getString('bio', ''), 0, 255));
 $edituser->setVar('user_occ', XoopsRequest::getString('user_occ', ''));
 $edituser->setVar('user_intrest', XoopsRequest::getString('user_intrest', ''));
 $edituser->setVar('user_mailok', XoopsRequest::getBool('user_mailok', 0));
 if (XoopsRequest::getBool('usecookie')) {
     setcookie($xoopsConfig['usercookie'], $xoopsUser->getVar('uname'), time() + 31536000, '/', XOOPS_COOKIE_DOMAIN);
 } else {
     setcookie($xoopsConfig['usercookie']);
 }
 if (!$member_handler->insertUser($edituser)) {
     include $GLOBALS['xoops']->path('header.php');
     echo $edituser->getHtmlErrors();
     include $GLOBALS['xoops']->path('footer.php');
 } else {
     redirect_header('userinfo.php?uid=' . $uid, 1, _US_PROFUPDATED);
Exemple #4
0
<?php

/**
 * File : makefile.pdf for publisher
 * For tcpdf_for_xoops 2.01 and higher
 * Created by montuy337513 / philodenelle - http://www.chg-web.org
 **/
error_reporting(0);
include_once __DIR__ . '/header.php';
$itemid = XoopsRequest::getInt('itemid', 0, 'GET');
$item_page_id = XoopsRequest::getInt('page', -1, 'GET');
if ($itemid == 0) {
    redirect_header('javascript:history.go(-1)', 1, _MD_PUBLISHER_NOITEMSELECTED);
}
if (!is_file(XOOPS_PATH . '/vendor/tcpdf/tcpdf.php')) {
    redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['xoopsModule']->getVar('dirname') . '/viewtopic.php?topic_id=' . $itemid, 3, 'TCPF for Xoops not installed in ./xoops_lib/vendor/');
}
// Creating the item object for the selected item
$itemObj =& $publisher->getHandler('item')->get($itemid);
// if the selected item was not found, exit
if (!$itemObj) {
    redirect_header('javascript:history.go(-1)', 1, _MD_PUBLISHER_NOITEMSELECTED);
}
// Creating the category object that holds the selected item
$categoryObj =& $publisher->getHandler('category')->get($itemObj->categoryid());
// Check user permissions to access that category of the selected item
if (!$itemObj->accessGranted()) {
    redirect_header('javascript:history.go(-1)', 1, _NOPERM);
}
xoops_loadLanguage('main', PUBLISHER_DIRNAME);
$dateformat = $itemObj->getDatesub();
Exemple #5
0
                 }
             }
         }
     }
     if (!$publisher->getHandler('file')->insert($fileObj)) {
         redirect_header('item.php?itemid=' . $fileObj->itemid(), 3, _AM_PUBLISHER_FILE_EDITING_ERROR . publisherFormatErrors($fileObj->getErrors()));
         //            exit;
     }
     redirect_header('item.php?itemid=' . $fileObj->itemid(), 2, _AM_PUBLISHER_FILE_EDITING_SUCCESS);
     //        exit();
     break;
 case 'clear':
     //mb        echo 'my time is now ' . now;
     break;
 case 'del':
     $confirm = XoopsRequest::getInt('confirm', '', 'POST');
     if ($confirm) {
         if (!$publisher->getHandler('file')->delete($fileObj)) {
             redirect_header('item.php?itemid=' . $fileObj->itemid(), 2, _AM_PUBLISHER_FILE_DELETE_ERROR);
             //                exit;
         }
         redirect_header('item.php?itemid=' . $fileObj->itemid(), 2, sprintf(_AM_PUBLISHER_FILEISDELETED, $fileObj->name()));
         //            exit();
     } else {
         // no confirm: show deletion condition
         include_once $GLOBALS['xoops']->path('header.php');
         xoops_confirm(array('op' => 'del', 'fileid' => $fileObj->fileid(), 'confirm' => 1, 'name' => $fileObj->name()), 'file.php', _AM_PUBLISHER_DELETETHISFILE . ' <br />' . $fileObj->name() . ' <br /> <br />', _AM_PUBLISHER_DELETE);
         include_once $GLOBALS['xoops']->path('footer.php');
     }
     exit;
     break;
 public static function clearEditSession()
 {
     $mimeid = XoopsRequest::getInt('id', '', 'GET');
     self::clearEditSessionVars($mimeid);
     header('Location: ' . publisherMakeUri(PUBLISHER_ADMIN_URL . '/mimetypes.php', array('op' => 'edit', 'id' => $mimeid), false));
 }
        }
    }
    publisherCloseCollapsableBar('newsimport', 'newsimporticon');
    xoops_cp_footer();
}
if ($op === 'go') {
    publisherCpHeader();
    //publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT);
    publisherOpenCollapsableBar('newsimportgo', 'newsimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT);
    $moduleHandler =& xoops_getHandler('module');
    $moduleObj = $moduleHandler->getByDirname('smartsection');
    $smartsection_module_id = $moduleObj->getVar('mid');
    $gpermHandler =& xoops_getHandler('groupperm');
    $cnt_imported_cat = 0;
    $cnt_imported_articles = 0;
    $parentId = XoopsRequest::getInt('parent_category', 0, 'POST');
    $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('smartsection_categories');
    $resultCat = $GLOBALS['xoopsDB']->query($sql);
    $newCatArray = array();
    $newArticleArray = array();
    $oldToNew = array();
    while (($arrCat = $GLOBALS['xoopsDB']->fetchArray($resultCat)) !== false) {
        $newCat = array();
        $newCat['oldid'] = $arrCat['categoryid'];
        $newCat['oldpid'] = $arrCat['parentid'];
        $categoryObj =& $publisher->getHandler('category')->create();
        $categoryObj->setVars($arrCat);
        $categoryObj->setVar('categoryid', 0);
        // Copy category image
        if ($arrCat['image'] !== 'blank.gif' && $arrCat['image'] !== '') {
            copy($GLOBALS['xoops']->path('uploads/smartsection/images/category/' . $arrCat['image']), $GLOBALS['xoops']->path('uploads/publisher/images/category/' . $arrCat['image']));
/*
You may not change or alter any portion of this comment or credits
of supporting developers from this source code or any supporting source code
which is considered copyrighted (c) material of the original comment or credit authors.

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      Comments
 * @since           1.0
 * @author          trabis <*****@*****.**>
 * @version         $Id: comment_new.php 10374 2012-12-12 23:39:48Z trabis $
 */
include_once dirname(dirname(__DIR__)) . '/mainfile.php';
include_once __DIR__ . '/include/common.php';
$com_itemid = XoopsRequest::getInt('com_itemid', 0, 'GET');
if ($com_itemid > 0) {
    $itemObj =& $publisher->getHandler('item')->get($com_itemid);
    $com_replytext = _POSTEDBY . '&nbsp;<strong>' . $itemObj->getLinkedPosterName() . '</strong>&nbsp;' . _DATE . '&nbsp;<strong>' . $itemObj->dateSub() . '</strong><br /><br />' . $itemObj->summary();
    $bodytext = $itemObj->body();
    if ($bodytext != '') {
        $com_replytext .= '<br /><br />' . $bodytext . '';
    }
    $com_replytitle = $itemObj->getTitle();
    include_once $GLOBALS['xoops']->path('include/comment_new.php');
}
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: author_items.php 10374 2012-12-12 23:39:48Z trabis $
 */
include_once __DIR__ . '/header.php';
$uid = XoopsRequest::getInt('uid', 0, 'GET');
if (0 == $uid) {
    redirect_header('index.php', 2, _CO_PUBLISHER_ERROR);
    //   exit();
}
$memberHandler =& xoops_getHandler('member');
$thisuser = $memberHandler->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);
    //mb    exit();
}
$myts = MyTextSanitizer::getInstance();
Exemple #10
0
     }
 }
 include_once $GLOBALS['xoops']->path('class/template.php');
 $GLOBALS['xoopsTpl'] = new XoopsTpl();
 include_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
 $pmform = new XoopsForm('', 'pmform', 'pmlite.php', 'post', true);
 if ($reply == 1) {
     $subject = $pm->getVar('subject', 'E');
     if (!preg_match('/^' . _RE . '/i', $subject)) {
         $subject = _RE . ' ' . $subject;
     }
     $GLOBALS['xoopsTpl']->assign('to_username', $pm_uname);
     $pmform->addElement(new XoopsFormHidden('to_userid', $pm->getVar('from_userid')));
 } elseif ($sendmod == 1) {
     $GLOBALS['xoopsTpl']->assign('to_username', XoopsUser::getUnameFromId(XoopsRequest::getInt('to_userid', 0, 'POST')));
     $pmform->addElement(new XoopsFormHidden('to_userid', XoopsRequest::getInt('to_userid', 0, 'POST')));
     $subject = $myts->htmlSpecialChars(XoopsRequest::getString('subject', '', 'POST'));
     $message = $myts->htmlSpecialChars(XoopsRequest::getString('message', '', 'POST'));
 } else {
     if ($send2 == 1) {
         $GLOBALS['xoopsTpl']->assign('to_username', XoopsUser::getUnameFromId($to_userid, false));
         $pmform->addElement(new XoopsFormHidden('to_userid', $to_userid));
     } else {
         $to_username = new XoopsFormSelectUser('', 'to_userid');
         $GLOBALS['xoopsTpl']->assign('to_username', $to_username->render());
     }
     $subject = '';
     $message = '';
 }
 $pmform->addElement(new XoopsFormText('', 'subject', 30, 100, $subject), true);
 $msg_image = '';
Exemple #11
0
         include_once $GLOBALS['xoops']->path('header.php');
         xoops_confirm(array('op' => 'del', 'itemid' => $itemObj->itemid(), 'confirm' => 1, 'name' => $itemObj->getTitle()), 'submit.php', _AM_PUBLISHER_DELETETHISITEM . " <br />'" . $itemObj->getTitle() . "'. <br /> <br />", _AM_PUBLISHER_DELETE);
         include_once $GLOBALS['xoops']->path('footer.php');
     }
     exit;
     break;
 case 'preview':
     // Putting the values about the ITEM in the ITEM object
     $itemObj->setVarsFromRequest();
     $xoopsOption['template_main'] = 'publisher_submit.tpl';
     include_once $GLOBALS['xoops']->path('header.php');
     $xoTheme->addScript(XOOPS_URL . '/browse.php?Frameworks/jquery/jquery.js');
     //        $xoTheme->addScript(XOOPS_URL . '/browse.php?Frameworks/jquery/jquery-migrate-1.2.1.js');
     $xoTheme->addScript(PUBLISHER_URL . '/assets/js/publisher.js');
     include_once PUBLISHER_ROOT_PATH . '/footer.php';
     $categoryObj =& $publisher->getHandler('category')->get(XoopsRequest::getInt('categoryid', 0, 'POST'));
     $item = $itemObj->toArraySimple();
     $item['summary'] = $itemObj->body();
     $item['categoryPath'] = $categoryObj->getCategoryPath(true);
     $item['who_when'] = $itemObj->getWhoAndWhen();
     $item['comments'] = -1;
     $xoopsTpl->assign('item', $item);
     $xoopsTpl->assign('op', 'preview');
     $xoopsTpl->assign('module_home', publisherModuleHome());
     if ($itemId) {
         $xoopsTpl->assign('categoryPath', _MD_PUBLISHER_EDIT_ARTICLE);
         $xoopsTpl->assign('langIntroTitle', _MD_PUBLISHER_EDIT_ARTICLE);
         $xoopsTpl->assign('langIntroText', '');
     } else {
         $xoopsTpl->assign('categoryPath', _MD_PUBLISHER_SUB_SNEWNAME);
         $xoopsTpl->assign('langIntroTitle', sprintf(_MD_PUBLISHER_SUB_SNEWNAME, ucwords($publisher->getModule()->name())));
 ryan@masugadesign.com
 Licensed under a Creative Commons Attribution 3.0 License.
 http://creativecommons.org/licenses/by/3.0/
 See ajaxrating.txt for full credit details.
 --------------------------------------------------------- */
//  Author: Trabis
//  URL: http://www.xuups.com
//  E-Mail: lusopoemas@gmail.com
include_once dirname(__DIR__) . '/header.php';
error_reporting(0);
$xoopsLogger->activated = false;
header('Cache-Control: no-cache');
header('Pragma: nocache');
//getting the values
$rating = XoopsRequest::getInt('rating', 0, 'GET');
$itemid = XoopsRequest::getInt('itemid', 0, 'GET');
xoops_loadLanguage('main', PUBLISHER_DIRNAME);
$groups = $GLOBALS['xoopsUser'] ? $GLOBALS['xoopsUser']->getGroups() : XOOPS_GROUP_ANONYMOUS;
$gpermHandler =& $publisher->getHandler('groupperm');
$hModConfig =& xoops_getHandler('config');
$module_id = $publisher->getModule()->getVar('mid');
//Checking permissions
//if (!$publisher->getConfig('perm_rating') || !$gpermHandler->checkRight('global', _PUBLISHER_RATE, $groups, $module_id)) {
//    $output = "unit_long$itemid|" . _NOPERM . "\n";
//    echo $output;
//    exit();
//}
try {
    if (!$publisher->getConfig('perm_rating') || !$gpermHandler->checkRight('global', _PUBLISHER_RATE, $groups, $module_id)) {
        throw new Exception(_NOPERM);
    }
Exemple #13
0
 /**
  * The name says it all
  */
 public function setVarsFromRequest()
 {
     //Required fields
     //        if (!empty($categoryid = XoopsRequest::getInt('categoryid', 0, 'POST'))) {
     //            $this->setVar('categoryid', $categoryid);}
     $this->setVar('categoryid', XoopsRequest::getInt('categoryid', 0, 'POST'));
     $this->setVar('title', XoopsRequest::getString('title', '', 'POST'));
     $this->setVar('body', XoopsRequest::getText('body', '', 'POST'));
     //Not required fields
     $this->setVar('summary', XoopsRequest::getText('summary', '', 'POST'));
     $this->setVar('subtitle', XoopsRequest::getString('subtitle', '', 'POST'));
     $this->setVar('item_tag', XoopsRequest::getString('item_tag', '', 'POST'));
     if ($imageFeatured = XoopsRequest::getString('image_featured', '', 'POST')) {
         $imageItem = XoopsRequest::getArray('image_item', array(), 'POST');
         //            $imageFeatured = XoopsRequest::getString('image_featured', '', 'POST');
         //Todo: get a better image class for xoops!
         //Image hack
         $imageItemIds = array();
         $sql = 'SELECT image_id, image_name FROM ' . $GLOBALS['xoopsDB']->prefix('image');
         $result = $GLOBALS['xoopsDB']->query($sql, 0, 0);
         while (($myrow = $GLOBALS['xoopsDB']->fetchArray($result)) !== false) {
             $imageName = $myrow['image_name'];
             $id = $myrow['image_id'];
             if ($imageName == $imageFeatured) {
                 $this->setVar('image', $id);
             }
             if (in_array($imageName, $imageItem)) {
                 $imageItemIds[] = $id;
             }
         }
         $this->setVar('images', implode('|', $imageItemIds));
     }
     if ($authorAlias = XoopsRequest::getString('author_alias', '', 'POST')) {
         $this->setVar('author_alias', $authorAlias);
         if ($this->getVar('author_alias') !== '') {
             $this->setVar('uid', 0);
         }
     }
     //mb TODO check on version
     if ($datesub = XoopsRequest::getString('datesub', '', 'POST')) {
         //            if (version_compare(PHP_VERSION, '5.4.0') >= 0) {
         //                $this->setVar('datesub', strtotime(XoopsRequest::getArray('datesub', array(), 'POST')['date']) + XoopsRequest::getArray('datesub', array(), 'POST')['time']);
         //            } else {
         $resDate = XoopsRequest::getArray('datesub', array(), 'POST');
         $resTime = XoopsRequest::getArray('datesub', array(), 'POST');
         //            $this->setVar('datesub', strtotime($resDate['date']) + $resTime['time']);
         $localTimestamp = strtotime($resDate['date']) + $resTime['time'];
         // get user Timezone offset and use it to find out the Timezone, needed for PHP DataTime
         $userTimeoffset = $GLOBALS['xoopsUser']->getVar('timezone_offset');
         $tz = timezone_name_from_abbr(null, $userTimeoffset * 3600);
         if ($tz === false) {
             $tz = timezone_name_from_abbr(null, $userTimeoffset * 3600, false);
         }
         $userTimezone = new DateTimeZone($tz);
         $gmtTimezone = new DateTimeZone('GMT');
         $myDateTime = new DateTime('now', $gmtTimezone);
         $offset = $userTimezone->getOffset($myDateTime);
         $gmtTimestamp = $localTimestamp - $offset;
         $this->setVar('datesub', $gmtTimestamp);
         //            }
     } elseif ($this->isNew()) {
         $this->setVar('datesub', time());
     }
     $this->setVar('short_url', XoopsRequest::getString('item_short_url', '', 'POST'));
     $this->setVar('meta_keywords', XoopsRequest::getString('item_meta_keywords', '', 'POST'));
     $this->setVar('meta_description', XoopsRequest::getString('item_meta_description', '', 'POST'));
     $this->setVar('weight', XoopsRequest::getInt('weight', 0, 'POST'));
     if ($this->isNew()) {
         $this->setVar('uid', is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->uid() : 0);
         $this->setVar('cancoment', $this->publisher->getConfig('submit_allowcomments'));
         $this->setVar('status', $this->publisher->getConfig('submit_status'));
         $this->setVar('dohtml', $this->publisher->getConfig('submit_dohtml'));
         $this->setVar('dosmiley', $this->publisher->getConfig('submit_dosmiley'));
         $this->setVar('doxcode', $this->publisher->getConfig('submit_doxcode'));
         $this->setVar('doimage', $this->publisher->getConfig('submit_doimage'));
         $this->setVar('dobr', $this->publisher->getConfig('submit_dobr'));
     } else {
         $this->setVar('uid', XoopsRequest::getInt('uid', 0, 'POST'));
         $this->setVar('cancomment', XoopsRequest::getInt('allowcomments', 1, 'POST'));
         $this->setVar('status', XoopsRequest::getInt('status', 1, 'POST'));
         $this->setVar('dohtml', XoopsRequest::getInt('dohtml', 1, 'POST'));
         $this->setVar('dosmiley', XoopsRequest::getInt('dosmiley', 1, 'POST'));
         $this->setVar('doxcode', XoopsRequest::getInt('doxcode', 1, 'POST'));
         $this->setVar('doimage', XoopsRequest::getInt('doimage', 1, 'POST'));
         $this->setVar('dobr', XoopsRequest::getInt('dolinebreak', 1, 'POST'));
     }
     $this->setVar('notifypub', XoopsRequest::getString('notify', '', 'POST'));
 }
Exemple #14
0
        //        exit();
        break;
    case 'del':
        $fileid = XoopsRequest::getInt('fileid', 0, 'POST');
        $fileid = XoopsRequest::getInt('fileid', $fileid, 'GET');
        $fileObj =& $publisher->getHandler('file')->get($fileid);
        $confirm = XoopsRequest::getInt('confirm', 0, 'POST');
        $title = XoopsRequest::getString('title', '', 'POST');
        if ($confirm) {
            if (!$publisher->getHandler('file')->delete($fileObj)) {
                redirect_header('item.php?op=mod&itemid=' . $fileObj->itemid() . '#tab_2', 2, _AM_PUBLISHER_FILE_DELETE_ERROR);
                //                exit;
            }
            redirect_header('item.php?op=mod&itemid=' . $fileObj->itemid() . '#tab_2', 2, sprintf(_AM_PUBLISHER_FILEISDELETED, $fileObj->name()));
            //            exit();
        } else {
            // no confirm: show deletion condition
            $fileid = XoopsRequest::getInt('fileid', 0, 'GET');
            publisherCpHeader();
            xoops_confirm(array('op' => 'del', 'fileid' => $fileObj->fileid(), 'confirm' => 1, 'name' => $fileObj->name()), 'file.php', _AM_PUBLISHER_DELETETHISFILE . ' <br />' . $fileObj->name() . ' <br /> <br />', _AM_PUBLISHER_DELETE);
            xoops_cp_footer();
        }
        exit;
        break;
    case 'default':
    default:
        publisherCpHeader();
        //publisher_adminMenu(2, _AM_PUBLISHER_ITEMS);
        break;
}
include_once __DIR__ . '/admin_footer.php';
Exemple #15
0
             publisherSaveCategoryPermissions($grpmoderation, $categoryObj->categoryid(), 'category_moderation');
         }
     }
     //end of fx2024 code
     redirect_header($redirect_to, 2, $redirect_msg);
     //        exit();
     break;
     //Added by fx2024
 //Added by fx2024
 case 'addsubcats':
     $categoryid = 0;
     $nb_subcats = XoopsRequest::getInt('nb_subcats', 0, 'POST') + XoopsRequest::getInt('nb_sub_yet', 0, 'POST');
     $categoryObj =& $publisher->getHandler('category')->create();
     $categoryObj->setVar('name', XoopsRequest::getString('name', '', 'POST'));
     $categoryObj->setVar('description', XoopsRequest::getString('description', '', 'POST'));
     $categoryObj->setVar('weight', XoopsRequest::getInt('weight', 0, 'POST'));
     if (isset($parentCat)) {
         $categoryObj->setVar('parentid', $parentCat);
     }
     publisherCpHeader();
     PublisherUtilities::editCategory(true, $categoryid, $nb_subcats, $categoryObj);
     exit;
     break;
     //end of fx2024 code
 //end of fx2024 code
 case 'cancel':
     redirect_header('category.php', 1, sprintf(_AM_PUBLISHER_BACK2IDX, ''));
     //        exit();
     break;
 case 'default':
 default:
Exemple #16
0
//Checking permissions
if (!$publisher->getConfig('perm_search') || !$gpermHandler->checkRight('global', PublisherConstants::PUBLISHER_SEARCH, $groups, $module_id)) {
    redirect_header(PUBLISHER_URL, 2, _NOPERM);
    //    exit();
}
$GLOBALS['xoopsConfig']['module_cache'][$module_id] = 0;
$xoopsOption['template_main'] = 'publisher_search.tpl';
include $GLOBALS['xoops']->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 = XoopsRequest::getString('andor', '', 'POST');
$start = XoopsRequest::getInt('start', 0, 'POST');
$category = XoopsRequest::getArray('category', array(), 'POST');
$username = XoopsRequest::getString('uname', '', 'POST');
$searchin = XoopsRequest::getArray('searchin', array(), 'POST');
$sortby = XoopsRequest::getString('sortby', '', 'POST');
$term = XoopsRequest::getString('term', '', 'POST');
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 ($term && XoopsRequest::getString('submit', '', 'POST')) {
    $next_search['category'] = implode(',', $category);
error_reporting(0);
include dirname(dirname(dirname(__DIR__))) . '/mainfile.php';
include_once __DIR__ . '/common.php';
$GLOBALS['xoopsLogger']->activated = false;
xoops_loadLanguage('common', basename(dirname(__DIR__)));
if (!is_object($GLOBALS['xoopsUser'])) {
    $group = array(XOOPS_GROUP_ANONYMOUS);
} else {
    $group = $GLOBALS['xoopsUser']->getGroups();
}
$filename = basename($_FILES['publisher_upload_file']['name']);
$image_nicename = XoopsRequest::getString('image_nicename', '', 'POST');
if ($image_nicename == '' || $image_nicename == _CO_PUBLISHER_IMAGE_NICENAME) {
    $image_nicename = $filename;
}
$imgcat_id = XoopsRequest::getInt('imgcat_id', 0, 'POST');
$imgcatHandler =& xoops_getHandler('imagecategory');
$imgcat = $imgcatHandler->get($imgcat_id);
$error = false;
if (!is_object($imgcat)) {
    $error = _CO_PUBLISHER_IMAGE_CAT_NONE;
} else {
    $imgcatpermHandler =& xoops_getHandler('groupperm');
    if (is_object($GLOBALS['xoopsUser'])) {
        if (!$imgcatpermHandler->checkRight('imgcat_write', $imgcat_id, $GLOBALS['xoopsUser']->getGroups())) {
            $error = _CO_PUBLISHER_IMAGE_CAT_NONE;
        }
    } else {
        if (!$imgcatpermHandler->checkRight('imgcat_write', $imgcat_id, XOOPS_GROUP_ANONYMOUS)) {
            $error = _CO_PUBLISHER_IMAGE_CAT_NOPERM;
        }
/**
 * @param  bool        $another
 * @param  bool        $withRedirect
 * @param              $itemObj
 * @return bool|string
 */
function publisherUploadFile($another = false, $withRedirect = true, &$itemObj)
{
    include_once PUBLISHER_ROOT_PATH . '/class/uploader.php';
    //    global $publisherIsAdmin;
    $publisher =& PublisherPublisher::getInstance();
    $itemId = XoopsRequest::getInt('itemid', 0, 'POST');
    $uid = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->uid() : 0;
    $session =& PublisherSession::getInstance();
    $session->set('publisher_file_filename', XoopsRequest::getString('item_file_name', '', 'POST'));
    $session->set('publisher_file_description', XoopsRequest::getString('item_file_description', '', 'POST'));
    $session->set('publisher_file_status', XoopsRequest::getInt('item_file_status', 1, 'POST'));
    $session->set('publisher_file_uid', $uid);
    $session->set('publisher_file_itemid', $itemId);
    if (!is_object($itemObj)) {
        $itemObj =& $publisher->getHandler('item')->get($itemId);
    }
    $fileObj =& $publisher->getHandler('file')->create();
    $fileObj->setVar('name', XoopsRequest::getString('item_file_name', '', 'POST'));
    $fileObj->setVar('description', XoopsRequest::getString('item_file_description', '', 'POST'));
    $fileObj->setVar('status', XoopsRequest::getInt('item_file_status', 1, 'POST'));
    $fileObj->setVar('uid', $uid);
    $fileObj->setVar('itemid', $itemObj->getVar('itemid'));
    $fileObj->setVar('datesub', time());
    // Get available mimetypes for file uploading
    $allowedMimetypes =& $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 (!($ret = $fileObj->checkUpload('item_upload_file', $allowedMimetypes, $errors))) {
            $errorstxt = implode('<br />', $errors);
            $message = sprintf(_CO_PUBLISHER_MESSAGE_FILE_ERROR, $errorstxt);
            if ($withRedirect) {
                redirect_header('file.php?op=mod&itemid=' . $itemId, 5, $message);
            } else {
                return $message;
            }
        }
    }
    // Storing the file
    if (!$fileObj->store($allowedMimetypes)) {
        //        if ($withRedirect) {
        //            redirect_header("file.php?op=mod&itemid=" . $fileObj->itemid(), 3, _CO_PUBLISHER_FILEUPLOAD_ERROR . publisherFormatErrors($fileObj->getErrors()));
        //            exit;
        //        }
        try {
            if ($withRedirect) {
                throw new Exception(_CO_PUBLISHER_FILEUPLOAD_ERROR . publisherFormatErrors($fileObj->getErrors()));
            }
        } catch (Exception $e) {
            redirect_header('file.php?op=mod&itemid=' . $fileObj->itemid(), 3, _CO_PUBLISHER_FILEUPLOAD_ERROR . publisherFormatErrors($fileObj->getErrors()));
        }
        //    } else {
        //        return _CO_PUBLISHER_FILEUPLOAD_ERROR . publisherFormatErrors($fileObj->getErrors());
    }
    if ($withRedirect) {
        $redirectPage = $another ? 'file.php' : 'item.php';
        redirect_header($redirectPage . '?op=mod&itemid=' . $fileObj->itemid(), 2, _CO_PUBLISHER_FILEUPLOAD_SUCCESS);
    } else {
        return true;
    }
    return null;
}
Exemple #19
0
 * @since           1.0
 * @min_xoops       2.5.7
 * @author          Goffy - Wedega.com - Email:<*****@*****.**> - Website:<http://wedega.com>
 * @version         $Id: 1.0 infofields.php 1 Sun 2015/12/27 23:18:00Z Goffy - Wedega $
 */
include __DIR__ . '/header.php';
// It recovered the value of argument op in URL$
$op = XoopsRequest::getString('op', 'list');
// Request infofield_id
$addField_id = XoopsRequest::getInt('infofield_id', 0);
// Switch options
switch ($op) {
    case 'list':
    default:
        $start = XoopsRequest::getInt('start', 0);
        $limit = XoopsRequest::getInt('limit', $wgteams->getConfig('adminpager'));
        $templateMain = 'wgteams_admin_infofields.tpl';
        $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('infofields.php'));
        $adminMenu->addItemButton(_AM_WGTEAMS_INFOFIELD_ADD, 'infofields.php?op=new', 'add');
        $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
        $infofieldsCount = $infofieldsHandler->getCountInfofields();
        $infofieldsAll = $infofieldsHandler->getAllInfofields($start, $limit);
        $GLOBALS['xoopsTpl']->assign('infofields_count', $infofieldsCount);
        $GLOBALS['xoopsTpl']->assign('wgteams_url', WGTEAMS_URL);
        $GLOBALS['xoopsTpl']->assign('wgteams_upload_url', WGTEAMS_UPLOAD_URL);
        // Table view
        if ($infofieldsCount > 0) {
            foreach (array_keys($infofieldsAll) as $i) {
                $infofield = $infofieldsAll[$i]->getValuesInfofields();
                $GLOBALS['xoopsTpl']->append('infofields_list', $infofield);
                unset($infofield);
Exemple #20
0
     $res = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('users') . ' WHERE uid=' . XoopsRequest::getInt('to_userid', 0, 'POST') . '');
     list($count) = $xoopsDB->fetchRow($res);
     if ($count != 1) {
         echo '<br><br><div><h4>' . _PM_USERNOEXIST . '<br>';
         echo _PM_PLZTRYAGAIN . '</h4><br>';
         echo "[ <a href='javascript:history.go(-1)' title=''>" . _PM_GOBACK . '</a> ]</div>';
     } else {
         $pm_handler = xoops_getHandler('privmessage');
         $pm = $pm_handler->create();
         $msg_image = XoopsRequest::getCmd('icon', null, 'POST');
         if (in_array($msg_image, $subject_icons)) {
             $pm->setVar('msg_image', $msg_image);
         }
         $pm->setVar('subject', XoopsRequest::getString('subject', null, 'POST'));
         $pm->setVar('msg_text', XoopsRequest::getString('message', null, 'POST'));
         $pm->setVar('to_userid', XoopsRequest::getInt('to_userid', 0, 'POST'));
         $pm->setVar('from_userid', $xoopsUser->getVar('uid'));
         if (!$pm_handler->insert($pm)) {
             echo $pm->getHtmlErrors();
             echo "<br><a href='javascript:history.go(-1)' title=''>" . _PM_GOBACK . '</a>';
         } else {
             echo "<br><br><div style='text-align:center;'><h4>" . _PM_MESSAGEPOSTED . "</h4><br><a href=\"javascript:window.opener.location='" . XOOPS_URL . "/viewpmsg.php';window.close();\" title=\"\">" . _PM_CLICKHERE . "</a><br><br><a href=\"javascript:window.close();\" title=\"\">" . _PM_ORCLOSEWINDOW . '</a></div>';
         }
     }
 } elseif ($reply == 1 || $send == 1 || $send2 == 1) {
     include_once $GLOBALS['xoops']->path('include/xoopscodes.php');
     if ($reply == 1) {
         $pm_handler = xoops_getHandler('privmessage');
         $pm = $pm_handler->get($msg_id);
         if ($pm->getVar('to_userid') == $xoopsUser->getVar('uid')) {
             $pm_uname = XoopsUser::getUnameFromId($pm->getVar('from_userid'));
Exemple #21
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 <*****@*****.**>
 * @author          The SmartFactory <www.smartfactory.ca>
 * @version         $Id: item.php 10374 2012-12-12 23:39:48Z trabis $
 */
include_once __DIR__ . '/header.php';
$itemId = XoopsRequest::getInt('itemid', 0, 'GET');
$itemPageId = XoopsRequest::getInt('page', -1, 'GET');
if ($itemId == 0) {
    redirect_header('javascript:history.go(-1)', 1, _MD_PUBLISHER_NOITEMSELECTED);
    //    exit();
}
// Creating the item object for the selected item
$itemObj = $publisher->getHandler('item')->get($itemId);
// if the selected item was not found, exit
if (!$itemObj) {
    redirect_header('javascript:history.go(-1)', 1, _MD_PUBLISHER_NOITEMSELECTED);
    //    exit();
}
$xoopsOption['template_main'] = 'publisher_item.tpl';
include_once $GLOBALS['xoops']->path('header.php');
$xoTheme->addScript(XOOPS_URL . '/browse.php?Frameworks/jquery/jquery.js');
//$xoTheme->addScript(XOOPS_URL . '/browse.php?Frameworks/jquery/jquery-migrate-1.2.1.js');
Exemple #22
0
 * @author          The SmartFactory <www.smartfactory.ca>
 * @version         $Id:main.php  335 2011-12-05 20:24:01Z lusopoemas@gmail.com $
 */
include_once __DIR__ . '/admin_header.php';
include_once $GLOBALS['xoops']->path('class/xoopslists.php');
include_once $GLOBALS['xoops']->path('class/pagenav.php');
$itemid = XoopsRequest::getInt('itemid', 0, 'POST');
$pick = XoopsRequest::getInt('pick', XoopsRequest::getInt('pick', 0, 'GET'), 'POST');
$statussel = XoopsRequest::getInt('statussel', XoopsRequest::getInt('statussel', 0, 'GET'), 'POST');
$sortsel = XoopsRequest::getString('sortsel', XoopsRequest::getString('sortsel', 'itemid', 'GET'), 'POST');
$ordersel = XoopsRequest::getString('ordersel', XoopsRequest::getString('ordersel', 'DESC', 'GET'), 'POST');
$module_id = $publisher->getModule()->mid();
$gpermHandler =& xoops_getHandler('groupperm');
$groups = $GLOBALS['xoopsUser'] ? $GLOBALS['xoopsUser']->getGroups() : XOOPS_GROUP_ANONYMOUS;
// Code for the page
$startentry = XoopsRequest::getInt('startentry', 0, 'GET');
publisherCpHeader();
//publisher_adminMenu(0, _AM_PUBLISHER_INDEX);
// Total ITEMs -- includes everything on the table
$totalitems =& $publisher->getHandler('item')->getItemsCount();
// Total categories
$totalcategories =& $publisher->getHandler('category')->getCategoriesCount(-1);
// Total submitted ITEMs
$totalsubmitted =& $publisher->getHandler('item')->getItemsCount(-1, array(PublisherConstants::PUBLISHER_STATUS_SUBMITTED));
// Total published ITEMs
$totalpublished =& $publisher->getHandler('item')->getItemsCount(-1, array(PublisherConstants::PUBLISHER_STATUS_PUBLISHED));
// Total offline ITEMs
$totaloffline =& $publisher->getHandler('item')->getItemsCount(-1, array(PublisherConstants::PUBLISHER_STATUS_OFFLINE));
// Total rejected
$totalrejected =& $publisher->getHandler('item')->getItemsCount(-1, array(PublisherConstants::PUBLISHER_STATUS_REJECTED));
// Check Path Configuration
 /**
  * @param bool $showmenu
  * @param int  $categoryId
  * @param int  $nbSubCats
  * @param null $categoryObj
  */
 public static function editCategory($showmenu = false, $categoryId = 0, $nbSubCats = 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";
         publisherOpenCollapsableBar('edittable', 'edittableicon', _AM_PUBLISHER_EDITCOL, _AM_PUBLISHER_CATEGORY_EDIT_INFO);
     } else {
         if ($showmenu) {
             //publisher_adminMenu(1, _AM_PUBLISHER_CATEGORIES . " > " . _AM_PUBLISHER_CREATINGNEW);
         }
         publisherOpenCollapsableBar('createtable', 'createtableicon', _AM_PUBLISHER_CATEGORY_CREATE, _AM_PUBLISHER_CATEGORY_CREATE_INFO);
     }
     $sform = $categoryObj->getForm($nbSubCats);
     $sform->display();
     if (!$categoryId) {
         publisherCloseCollapsableBar('createtable', 'createtableicon');
     } else {
         publisherCloseCollapsableBar('edittable', 'edittableicon');
     }
     //Added by fx2024
     if ($categoryId) {
         $selCat = $categoryId;
         publisherOpenCollapsableBar('subcatstable', 'subcatsicon', _AM_PUBLISHER_SUBCAT_CAT, _AM_PUBLISHER_SUBCAT_CAT_DSC);
         // Get the total number of sub-categories
         $categoriesObj =& $publisher->getHandler('category')->get($selCat);
         $totalsubs =& $publisher->getHandler('category')->getCategoriesCount($selCat);
         // 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() . "/assets/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() . "/assets/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>';
             }
             //                unset($subcat);
         } else {
             echo '<tr>';
             echo "<td class='head' align='center' colspan= '7'>" . _AM_PUBLISHER_NOSUBCAT . '</td>';
             echo '</tr>';
         }
         echo "</table>\n";
         echo "<br />\n";
         publisherCloseCollapsableBar('subcatstable', 'subcatsicon');
         publisherOpenCollapsableBar('bottomtable', 'bottomtableicon', _AM_PUBLISHER_CAT_ITEMS, _AM_PUBLISHER_CAT_ITEMS_DSC);
         $startitem = XoopsRequest::getInt('startitem');
         // Get the total number of published ITEMS
         $totalitems =& $publisher->getHandler('item')->getItemsCount($selCat, array(PublisherConstants::PUBLISHER_STATUS_PUBLISHED));
         // creating the items objects that are published
         $itemsObj =& $publisher->getHandler('item')->getAllPublished($publisher->getConfig('idxcat_perpage'), $startitem, $selCat);
         $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() . "/assets/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() . "/assets/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]->getDatesub('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 = XoopsRequest::getInt('parentid', 0, 'GET');
         $pagenavExtraArgs = "op=mod&categoryid={$selCat}&parentid={$parentid}";
         xoops_load('XoopsPageNav');
         $pagenav = new XoopsPageNav($totalitems, $publisher->getConfig('idxcat_perpage'), $startitem, 'startitem', $pagenavExtraArgs);
         echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
         echo "<input type='button' name='button' onclick=\"location='item.php?op=mod&categoryid=" . $selCat . "'\" value='" . _AM_PUBLISHER_CREATEITEM . "'>&nbsp;&nbsp;";
         echo '</div>';
     }
     //end of fx2024 code
 }
Exemple #24
0
 */
######################################################################
# Original version:
# [11-may-2001] Kenneth Lee - http://www.nexgear.com/
######################################################################
include_once __DIR__ . '/header.php';
$xoopsOption['template_main'] = 'publisher_archive.tpl';
include_once $GLOBALS['xoops']->path('header.php');
include_once PUBLISHER_ROOT_PATH . '/footer.php';
xoops_loadLanguage('calendar');
//mb xoops_load('XoopsLocal');
$lastyear = 0;
$lastmonth = 0;
$monthsArray = 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 = XoopsRequest::getInt('year');
$frommonth = XoopsRequest::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($GLOBALS['xoopsModule']->name()));
$useroffset = '';
if (is_object($GLOBALS['xoopsUser'])) {
    $timezone = $GLOBALS['xoopsUser']->timezone();
    if (isset($timezone)) {
        $useroffset = $GLOBALS['xoopsUser']->timezone();