Beispiel #1
0
function getAllChildrenCount($currentuid, $cat_id, $user_id = 0)
{
    $weblog =& Weblog::getInstance();
    $weblogcat =& WeblogCategories::getInstance();
    $count = $weblog->getCountByCategory($currentuid, $cat_id, $user_id);
    $arr = $weblogcat->getAllChildrenIds($cat_id);
    $size = count($arr);
    for ($i = 0; $i < $size; $i++) {
        $count += $weblog->getCountByCategory($currentuid, $arr[$i], $user_id);
    }
    return $count;
}
Beispiel #2
0
    $useroffset = $xoopsConfig['default_TZ'] - $xoopsConfig['server_TZ'];
}
$isAdmin = $currentUser->isAdmin($xoopsModule->mid());
$currentuid = $currentUser->getVar('uid');
// privilege check
include_once sprintf('%s/modules/%s/include/privilege.inc.php', XOOPS_ROOT_PATH, $xoopsModule->dirname());
if (!$isAdmin && !checkprivilege("read_detail", $xoopsModule->dirname())) {
    redirect_header(sprintf('%s/index.php', XOOPS_URL), 5, _BL_CANNOT_READ_SORRY);
    exit;
}
// specify template
$xoopsOption['template_main'] = 'weblog' . $mydirnumber . '_details.html';
// obtain class instances
$myts =& MyTextSanitizer::getInstance();
$weblog =& Weblog::getInstance();
$weblogcat =& WeblogCategories::getInstance();
$entryObject =& $weblog->getEntry($currentuid, $blog_id, 0, $useroffset);
if (!$entryObject) {
    redirect_header(sprintf('%s/modules/%s/index.php', XOOPS_URL, $xoopsModule->dirname()), 5, _BL_PRIVATE_NOTEXIST_SORRY);
    exit;
}
// obtain trackback
$tb_operator =& Weblog_Trackback_Operator::getInstance();
$trackback_array = $tb_operator->handler->get($entryObject->getVar('blog_id'));
$trackback_transmit = array();
$trackback_recieved = array();
if ($trackback_array) {
    foreach ($trackback_array as $trackback_obj) {
        $trackback_data = array("tb_url" => $trackback_obj->getVar('tb_url'), "blog_name" => $trackback_obj->getVar('blog_name'), "title" => $trackback_obj->getVar('title'), "description" => xoops_substr($trackback_obj->getVar('description'), 0, 120), "link" => $trackback_obj->getVar('link'), "trackback_created" => formatTimestamp($trackback_obj->getVar('trackback_created'), 'Y-m-d/H:i:s', $xoopsConfig['default_TZ']));
        if ($trackback_obj->getVar('direction') == "transmit") {
            $trackback_transmit[] = $trackback_data;
Beispiel #3
0
function modifyCategory($post)
{
    global $xoopsModule, $xoopsModuleConfig;
    include_once sprintf('%s/modules/%s/class/class.weblogcategories.php', XOOPS_ROOT_PATH, $xoopsModule->dirname());
    $cat_id = isset($post['cat_id']) ? intval($post['cat_id']) : 0;
    $modid = $xoopsModule->getVar('mid');
    if ($cat_id) {
        $cathandler =& xoops_getmodulehandler('category');
        $gperm_handler =& xoops_gethandler('groupperm');
        $count = $cathandler->getCount();
        $weblogcats =& WeblogCategories::getInstance();
        $wb_cat =& $cathandler->get($cat_id);
        $cat_pid = $wb_cat->getVar('cat_pid');
        $cat_title = $wb_cat->getVar('cat_title', 's');
    } else {
        redirect_header('catmanager.php', 2, _AM_WEBLOG_CATNOTMODED);
        exit;
    }
    xoops_cp_header();
    echo sprintf('<h4>%s&nbsp;&raquo;&raquo;&nbsp;%s&nbsp;&raquo;&raquo;&nbsp;%s</h4>', indexLink(), catManagerLink(), _AM_WEBLOG_MODCAT);
    include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
    $form_add = new XoopsThemeForm(_AM_WEBLOG_MODCAT, 'weblog_cat_form', 'catmanager.php');
    $form_add->addElement(new XoopsFormLabel(_AM_WEBLOG_CHOSECAT, $cat_title));
    $form_add->addElement(new XoopsFormText(_AM_WEBLOG_TITLE, 'cat_title', 50, 255, $cat_title), true);
    $form_add->addElement(new XoopsFormLabel(_AM_WEBLOG_PCAT, $weblogcats->getMySelectBox($cat_pid, 1, 'cat_pid')));
    if (isset($xoopsModuleConfig['category_post_permission']) && $xoopsModuleConfig['category_post_permission']) {
        $form_add->addElement(new XoopsFormSelectGroup(_AM_WEBLOG_CAT_GPERM, 'postgroup', true, $gperm_handler->getGroupIds('weblog_cat_post', $cat_id, $modid), 5, true));
    }
    $form_add->addElement(new XoopsFormHidden('cat_id', $cat_id));
    $form_add->addElement(new XoopsFormHidden('action', 'modCatS'));
    $form_add->addElement(new XoopsFormLabel(_AM_WEBLOG_CAT_OPERATE, sprintf('<input type=submit value=\'%s\'>', _AM_WEBLOG_MODIFY) . "&nbsp;" . sprintf('<input type=button value=\'%s\' onClick="location=\'catmanager.php?cat_pid=%d&amp;cat_id=%d&amp;action=delCat\'">', _AM_WEBLOG_DELETE, $wb_cat->getVar('cat_pid'), $wb_cat->getVar('cat_id')) . "&nbsp;" . sprintf('<input type=button value="%s"  onclick="location=\'catmanager.php\'" />', _AM_WEBLOG_CANCEL)));
    $form_add->display();
    xoops_cp_footer();
}