当前位置: 首页>>代码示例>>PHP>>正文


PHP CKunenaTools::getAllowedForums方法代码示例

本文整理汇总了PHP中CKunenaTools::getAllowedForums方法的典型用法代码示例。如果您正苦于以下问题:PHP CKunenaTools::getAllowedForums方法的具体用法?PHP CKunenaTools::getAllowedForums怎么用?PHP CKunenaTools::getAllowedForums使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CKunenaTools的用法示例。


在下文中一共展示了CKunenaTools::getAllowedForums方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dofreePDF

function dofreePDF($kunena_db)
{
    global $aro_group;
    $app =& JFactory::getApplication();
    $kunena_acl =& JFactory::getACL();
    $kunena_my =& JFactory::getUser();
    $fbConfig =& CKunenaConfig::getInstance();
    require_once KUNENA_PATH_LIB . DS . 'kunena.authentication.php';
    $is_Mod = 0;
    $catid = JRequest::getInt('catid', 2);
    if (!$is_admin) {
        $kunena_db->setQuery("SELECT userid FROM #__fb_moderation WHERE catid='{$catid}' AND userid='{$kunena_my->id}'");
        if ($kunena_db->loadResult()) {
            $is_Mod = 1;
        }
    } else {
        $is_Mod = 1;
    }
    //superadmins always are
    if (!$is_Mod) {
        //get all the info on this forum:
        $kunena_db->setQuery("SELECT id, pub_access, pub_recurse, admin_access, admin_recurse FROM #__fb_categories WHERE id='{$catid}'");
        $row = $kunena_db->loadObjectList();
        check_dberror("Unable to load category detail.");
        $allow_forum = explode(',', CKunenaTools::getAllowedForums($kunena_my->id, $aro_group->id, $kunena_acl));
    }
    if ($is_Mod || in_array($catid, $allow_forum)) {
        $id = JRequest::getInt('id', 1);
        $catid = JRequest::getInt('catid', 2);
        //first get the thread id for the current post to later on determine the parent post
        $kunena_db->setQuery("SELECT thread FROM #__fb_messages WHERE id='{$id}' AND catid='{$catid}'");
        $threadid = $kunena_db->loadResult();
        //load topic post and details
        $kunena_db->setQuery("SELECT a.*, b.* FROM #__fb_messages AS a, #__fb_messages_text AS b WHERE a.thread='{$threadid}' AND a.catid='{$catid}' AND a.parent='0' AND a.id=b.mesid");
        $row = $kunena_db->loadObjectList();
        check_dberror("Unable to load message details.");
        if (file_exists(KUNENA_ROOT_PATH . DS . 'includes/class.ezpdf.php')) {
            include KUNENA_ROOT_PATH . DS . 'includes/class.ezpdf.php';
            $pdf = new Cezpdf('a4', 'P');
            //A4 Portrait
        } elseif (class_exists('JDocument')) {
            $pdf = new fbpdfwrapper();
        } else {
            echo 'No supported pdf class found!';
            exit;
        }
        if (empty($row)) {
            //if the messages doesn't exist don't need to continue
            //Doesn't work Fatal error: Call to undefined method CKunenaLink::GetKunenaURL()
            //$app->redirect ( CKunenaLink::GetKunenaURL(true), _KUNENA_PDF_NOT_GENERATED_MESSAGE_DELETED );
        } else {
            $mes_text = $row[0]->message;
            filterHTML($mes_text);
            $pdf->ezSetCmMargins(2, 1.5, 1, 1);
            $pdf->selectFont('./fonts/Helvetica.afm');
            //choose font
            $all = $pdf->openObject();
            $pdf->saveState();
            $pdf->setStrokeColor(0, 0, 0, 1);
            // footer
            $pdf->line(10, 40, 578, 40);
            $pdf->line(10, 822, 578, 822);
            $pdf->addText(30, 34, 6, $fbConfig->board_title . ' - ' . $app->getCfg('sitename'));
            $strtmp = _KUNENA_PDF_VERSION;
            $strtmp = str_replace('%version%', "NEW VERSION GOES HERE", $strtmp);
            // TODO: fxstein - Need to change version handling
            $pdf->addText(250, 34, 6, $strtmp);
            $strtmp = _KUNENA_PDF_DATE;
            $strtmp = str_replace('%date%', date('j F, Y, H:i', CKunenaTools::fbGetShowTime()), $strtmp);
            $pdf->addText(450, 34, 6, $strtmp);
            $pdf->restoreState();
            $pdf->closeObject();
            $pdf->addObject($all, 'all');
            $pdf->ezSetDy(30);
            $txt0 = $row[0]->subject;
            $pdf->ezText($txt0, 14);
            $pdf->ezText(_VIEW_POSTED . " " . $row[0]->name . " - " . date(_DATETIME, $row[0]->time), 8);
            $pdf->ezText("_____________________________________", 8);
            //$pdf->line( 10, 780, 578, 780 );
            $txt3 = "\n";
            $txt3 .= stripslashes($mes_text);
            $pdf->ezText($txt3, 10);
            $pdf->ezText("\n============================================================================\n\n", 8);
            //now let's try to see if there's more...
            $kunena_db->setQuery("SELECT a.*, b.* FROM #__fb_messages AS a, #__fb_messages_text AS b WHERE a.catid='{$catid}' AND a.thread='{$threadid}' AND a.id=b.mesid AND a.parent!='0' ORDER BY a.time ASC");
            $replies = $kunena_db->loadObjectList();
            check_dberror("Unable to load messages & detail.");
            $countReplies = count($replies);
            if ($countReplies > 0) {
                foreach ($replies as $reply) {
                    $mes_text = $reply->message;
                    filterHTML($mes_text);
                    $txt0 = $reply->subject;
                    $pdf->ezText($txt0, 14);
                    $pdf->ezText(_VIEW_POSTED . " " . $reply->name . " - " . date(_DATETIME, $reply->time), 8);
                    $pdf->ezText("_____________________________________", 8);
                    $txt3 = "\n";
                    $txt3 .= stripslashes($mes_text);
                    $pdf->ezText($txt3, 10);
                    $pdf->ezText("\n============================================================================\n\n", 8);
//.........这里部分代码省略.........
开发者ID:kaantunc,项目名称:MYK-BOR,代码行数:101,代码来源:kunena.pdf.php

示例2: updateAllowedForums

 function updateAllowedForums()
 {
     // check to see if we need to refresh the allowed forums cache
     // get all accessaible forums if needed (eg on forum modification, new session)
     if (!$this->allowed || $this->allowed == 'na') {
         $allow_forums = implode(',', CKunenaTools::getAllowedForums($this->userid));
         if (!$allow_forums) {
             $allow_forums = '0';
         }
         $this->allowed = $allow_forums;
     }
 }
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:12,代码来源:session.php

示例3: updateAllowedForums

 function updateAllowedForums($my_id, $aro_group, $acl)
 {
     // check to see if we need to refresh the allowed forums cache
     // get all accessaible forums if needed (eg on forum modification, new session)
     if (!$this->allowed or $this->allowed == 'na' or $this->isNewSession()) {
         $allow_forums = CKunenaTools::getAllowedForums($my_id, $aro_group->id, $acl);
         if (!$allow_forums) {
             $allow_forums = '0';
         }
         if ($allow_forums != $this->allowed) {
             $this->allowed = $allow_forums;
         }
     }
 }
开发者ID:kaantunc,项目名称:MYK-BOR,代码行数:14,代码来源:kunena.session.class.php

示例4: elseif

     $fbSession->readtopics = '';
     $fbSession->currvisit = $systime;
 }
 // detect fbsession timeout (default: after 30 minutes inactivity)
 $fbSessionTimeOut = $fbSession->currvisit + $fbConfig->fbsessiontimeout < $systime;
 // new indicator handling
 if ($markaction == "allread") {
     $fbSession->lasttime = $fbSessionUpd->lasttime = $systime;
     $fbSession->readtopics = $fbSessionUpd->readtopics = '';
 } elseif ($fbSessionTimeOut) {
     $fbSession->lasttime = $fbSessionUpd->lasttime = $fbSession->currvisit;
     $fbSession->readtopics = $fbSessionUpd->readtopics = '';
 }
 // get all accessaible forums if needed (eg on forum modification, new session)
 if (!$fbSession->allowed or $fbSession->allowed == 'na' or $fbSessionTimeOut) {
     $allow_forums = CKunenaTools::getAllowedForums($my_id, $aro_group->group_id, $acl);
     if (!$allow_forums) {
         $allow_forums = '0';
     }
     if ($allow_forums != $fbSession->allowed) {
         $fbSession->allowed = $fbSessionUpd->allowed = $allow_forums;
     }
     unset($allow_forums);
 }
 // save fbsession
 if ($new_fb_user) {
     $database->insertObject('#__fb_sessions', $fbSession);
     check_dberror('Unable to insert new session record for user.');
 } else {
     $fbSessionUpd->userid = $fbSession->userid;
     $fbSession->currvisit = $fbSessionUpd->currvisit = $systime;
开发者ID:patricmutwiri,项目名称:joomlaclube,代码行数:31,代码来源:kunena.php


注:本文中的CKunenaTools::getAllowedForums方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。