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


PHP CKunenaTools::reCountBoards方法代码示例

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


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

示例1: fbMovePosts

 function fbMovePosts($catid, $isMod, $return)
 {
     $app =& JFactory::getApplication();
     $backUrl = $app->getUserState("com_kunena.ActionBulk");
     $kunena_db =& JFactory::getDBO();
     $kunena_my =& JFactory::getUser();
     // $isMod if user is moderator in the current category
     if (!$isMod) {
         // Test also if user is a moderator in some other category
         $kunena_db->setQuery("SELECT userid FROM #__fb_moderation WHERE userid='{$kunena_my->id}'");
         $isMod = $kunena_db->loadResult();
         check_dberror("Unable to load moderation info.");
     }
     $isAdmin = CKunenaTools::isModOrAdmin();
     //isMod will stay until better group management comes in
     if (!$isAdmin && !$isMod) {
         $app->redirect($return, _POST_NOT_MODERATOR);
     }
     $catid = (int) $catid;
     if ($catid > 0) {
         $items = fbGetArrayInts("fbDelete");
         // start iterating here
         foreach ($items as $id => $value) {
             $id = (int) $id;
             $kunena_db->setQuery("SELECT subject, catid, time AS timestamp FROM #__fb_messages WHERE id='{$id}'");
             $oldRecord = $kunena_db->loadObjectList();
             check_dberror("Unable to load message detail.");
             $newCatObj = new jbCategory($kunena_db, $oldRecord[0]->catid);
             if (fb_has_moderator_permission($kunena_db, $newCatObj, $kunena_my->id, $isAdmin)) {
                 $newSubject = _MOVED_TOPIC . " " . $oldRecord[0]->subject;
                 $kunena_db->setQuery("SELECT MAX(time) AS timestamp FROM #__fb_messages WHERE thread='{$id}'");
                 $lastTimestamp = $kunena_db->loadResult();
                 check_dberror("Unable to load messages max(time).");
                 if ($lastTimestamp == "") {
                     $lastTimestamp = $oldRecord[0]->timestamp;
                 }
                 //perform the actual move
                 $kunena_db->setQuery("UPDATE #__fb_messages SET `catid`='{$catid}' WHERE `id`='{$id}' OR `thread`='{$id}'");
                 $kunena_db->query();
                 check_dberror("Unable to move thread.");
                 $err = _POST_SUCCESS_MOVE;
             } else {
                 $err = _POST_NOT_MODERATOR;
             }
         }
         //end foreach
     } else {
         $err = _POST_NO_DEST_CATEGORY;
     }
     CKunenaTools::reCountBoards();
     $app->redirect($return, $err);
 }
开发者ID:kaantunc,项目名称:MYK-BOR,代码行数:52,代码来源:class.kunena.php

示例2: explode

         $kunena_db->query();
     }
     //end parenting foreach loop
     //inherit hits from old topic
     $kunena_db->setQuery("SELECT hits FROM #__fb_messages WHERE id='{$id}'");
     $hits = (int) $kunena_db->loadResult();
     $kunena_db->setQuery("UPDATE #__fb_messages set hits={$hits} WHERE id={$new_topic}");
     $kunena_db->query();
     //set the highest sorting for old topic
     $kunena_db->setQuery("UPDATE #__fb_messages set ordering='2' WHERE id={$id}");
     $kunena_db->query();
     //copy over sticky bit to new topic
     $kunena_db->setQuery("UPDATE #__fb_messages set ordering='{$sticky_bit}' WHERE id={$new_topic} AND parent=0");
     $kunena_db->query();
     //split succeeded
     CKunenaTools::reCountBoards();
     echo '<br /><br /><div align="center">' . _POST_SUCCESS_SPLIT . "</div><br />";
     echo CKunenaLink::GetLatestPostAutoRedirectHTML($fbConfig, $new_topic, $fbConfig->messages_per_page, $catid);
 } else {
     if ($do == "subscribe") {
         $catid = (int) $catid;
         $id = (int) $id;
         $success_msg = _POST_NO_SUBSCRIBED_TOPIC;
         $kunena_db->setQuery("SELECT thread, catid from #__fb_messages WHERE id='{$id}'");
         if ($id && $kunena_my->id && $kunena_db->query()) {
             $row = $kunena_db->loadObject();
             //check for permission
             if (!$is_Moderator) {
                 if ($fbSession->allowed != "na") {
                     $allow_forum = explode(',', $fbSession->allowed);
                 } else {
开发者ID:kaantunc,项目名称:MYK-BOR,代码行数:31,代码来源:post.php

示例3: trashrestore

function trashrestore($option, $cid)
{
    $kunena_app =& JFactory::getApplication();
    $kunena_db =& JFactory::getDBO();
    JArrayHelper::toInteger($cid);
    if ($cid) {
        foreach ($cid as $id) {
            $kunena_db->setQuery("SELECT * FROM #__kunena_messages WHERE id={$id} AND hold=2");
            $mes = $kunena_db->loadObject();
            if (KunenaError::checkDatabaseError()) {
                return;
            }
            $kunena_db->setQuery("UPDATE #__kunena_messages SET hold=0 WHERE hold IN (2,3) AND thread={$mes->thread} ");
            $kunena_db->query();
            if (KunenaError::checkDatabaseError()) {
                return;
            }
            CKunenaTools::reCountUserPosts();
            CKunenaTools::reCountBoards();
        }
    }
    while (@ob_end_clean()) {
    }
    $kunena_app->redirect(JURI::base() . "index.php?option={$option}&task=showtrashview", JText::_('COM_KUNENA_TRASH_RESTORE_DONE'));
}
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:25,代码来源:admin.kunena.php

示例4: undelete

 public function undelete($mesid)
 {
     if (!$this->parent || $this->parent->id != $mesid) {
         $this->loadMessage($mesid);
     }
     if (!$this->canUndelete()) {
         return false;
     }
     // Execute undelete
     $query = "UPDATE #__kunena_messages SET `hold`=0 WHERE `id`={$this->_db->quote($this->parent->id)};";
     $this->_db->setQuery($query);
     $this->_db->query();
     $dberror = $this->checkDatabaseError();
     if ($dberror) {
         return $this->setError('-undelete-', JText::_('COM_KUNENA_POST_ERROR_UNDELETE'));
     }
     // Last but not least update forum stats
     CKunenaTools::reCountBoards();
     $this->set('id', $this->parent->id);
     // Activity integration
     $activity = KunenaFactory::getActivityIntegration();
     $activity->onAfterUndelete($this);
     return empty($this->errors);
 }
开发者ID:redigy,项目名称:Kunena-1.6,代码行数:24,代码来源:kunena.posting.class.php

示例5: KUndelete

 function KUndelete()
 {
     $kunena_app = JFactory::getApplication();
     $kunena_db = JFactory::getDBO();
     $backUrl = $kunena_app->getUserState("com_kunena.ActionBulk");
     if (!JRequest::checkToken()) {
         $kunena_app->enqueueMessage(JText::_('COM_KUNENA_ERROR_TOKEN'), 'error');
         while (@ob_end_clean()) {
         }
         $kunena_app->redirect($backUrl);
     }
     require_once KUNENA_PATH_LIB . '/kunena.moderation.class.php';
     $kunena_mod = CKunenaModeration::getInstance();
     $items = KGetArrayInts("cb");
     // start iterating here
     foreach ($items as $id => $value) {
         // Need to get hold value to check if the message is right deleted
         $query = "SELECT MAX(IF(`hold`=2 OR `hold`=3, 1, 0)) FROM #__kunena_messages WHERE `thread`={$kunena_db->quote($id)} GROUP BY `thread`;";
         $kunena_db->setQuery($query);
         $messageHold = $kunena_db->loadResult();
         KunenaError::checkDatabaseError();
         if ($messageHold) {
             $delete = $kunena_mod->UndeleteThread($id, true);
             if (!$delete) {
                 $kunena_app->enqueueMessage($kunena_mod->getErrorMessage(), 'notice');
             } else {
                 $kunena_app->enqueueMessage(JText::_('COM_KUNENA_POST_SUCCESS_UNDELETE'));
             }
             // Last but not least update forum stats
             CKunenaTools::reCountBoards();
             // Activity integration
             $activity = KunenaFactory::getActivityIntegration();
             $activity->onAfterUndelete($this);
         }
     }
     //end foreach
     while (@ob_end_clean()) {
     }
     $kunena_app->redirect($backUrl);
 }
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:40,代码来源:class.kunena.php

示例6: delete

 /**
  * Method to delete the KunenaCategory object from the database
  *
  * @access	public
  * @return	boolean	True on success
  * @since 1.6
  */
 public function delete()
 {
     if (!$this->exists()) {
         return true;
     }
     // Create the user table object
     $table =& $this->getTable();
     $result = $table->delete($this->id);
     if (!$result) {
         $this->setError($table->getError());
     }
     $this->_exists = false;
     $db = JFactory::getDBO();
     // Clear sessions
     $queries[] = "UPDATE #__kunena_sessions SET allowed='na'";
     // Delete moderators
     $queries[] = "DELETE FROM #__kunena_moderation WHERE catid={$db->quote($this->id)}";
     // Delete favorites
     $queries[] = "DELETE f FROM #__kunena_favorites AS f LEFT JOIN #__kunena_messages AS m ON m.id=f.thread WHERE m.catid={$db->quote($this->id)}";
     // Delete subscriptions
     $queries[] = "DELETE s FROM #__kunena_subscriptions AS s LEFT JOIN #__kunena_messages AS m ON m.id=s.thread WHERE m.catid={$db->quote($this->id)}";
     // Delete category subscriptions
     $queries[] = "DELETE FROM #__kunena_subscriptions_categories WHERE catid={$db->quote($this->id)}";
     // Delete thank yous
     $queries[] = "DELETE t FROM #__kunena_thankyou AS t LEFT JOIN #__kunena_messages AS m ON m.id=t.postid WHERE m.catid={$db->quote($this->id)}";
     // Delete poll users
     $queries[] = "DELETE p FROM #__kunena_polls_users AS p LEFT JOIN #__kunena_messages AS m ON m.id=p.pollid WHERE m.catid={$db->quote($this->id)}";
     // Delete poll options
     $queries[] = "DELETE p FROM #__kunena_polls_options AS p LEFT JOIN #__kunena_messages AS m ON m.id=p.pollid WHERE m.catid={$db->quote($this->id)}";
     // Delete polls
     $queries[] = "DELETE p FROM #__kunena_polls AS p LEFT JOIN #__kunena_messages AS m ON m.id=p.threadid WHERE m.catid={$db->quote($this->id)}";
     // Delete messages
     $queries[] = "DELETE m, t FROM #__kunena_messages AS m INNER JOIN #__kunena_messages_text AS t ON m.id=t.mesid WHERE m.catid={$db->quote($this->id)}";
     // TODO: delete attachments
     foreach ($queries as $query) {
         $db->setQuery($query);
         $db->query();
         KunenaError::checkDatabaseError();
     }
     // TODO: remove dependency
     require_once KPATH_SITE . '/class.kunena.php';
     CKunenaTools::reCountUserPosts();
     CKunenaTools::reCountBoards();
     return $result;
 }
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:52,代码来源:category.php

示例7: stepFinish

 public function stepFinish()
 {
     $entryfiles = array(array(KPATH_ADMIN, 'api', 'php'), array(KPATH_ADMIN, 'admin.kunena', 'php'), array(KPATH_SITE, 'router', 'php'), array(KPATH_SITE, 'kunena', 'php'));
     $lang = JFactory::getLanguage();
     $lang->load('com_kunena', JPATH_SITE);
     // TODO: remove dependence
     require_once KPATH_ADMIN . '/api.php';
     kimport('factory');
     require_once KPATH_SITE . '/class.kunena.php';
     $this->createMenu(false);
     CKunenaTools::reCountBoards();
     foreach ($entryfiles as $fileparts) {
         list($path, $filename, $ext) = $fileparts;
         if (is_file("{$path}/{$filename}.new.{$ext}")) {
             $success = JFile::delete("{$path}/{$filename}.{$ext}");
             if (!$success) {
                 $this->addStatus(JText::_('COM_KUNENA_INSTALL_DELETE_STATUS_FAIL') . " {$filename}.{$ext}", false, '');
             }
             $success = JFile::move("{$path}/{$filename}.new.{$ext}", "{$path}/{$filename}.{$ext}");
             if (!$success) {
                 $this->addStatus(JText::_('COM_KUNENA_INSTALL_RENAMING_FAIL') . " {$filename}.new.{$ext}", false, '');
             }
         }
     }
     // Cleanup directory structure
     if (!Kunena::isSVN()) {
         if (JFolder::exists(KPATH_ADMIN . '/language')) {
             JFolder::delete(KPATH_ADMIN . '/language');
         }
         if (JFolder::exists(KPATH_SITE . '/language')) {
             JFolder::delete(KPATH_SITE . '/language');
         }
     }
     if (!$this->getError()) {
         $this->updateVersionState('');
         $this->addStatus(JText::_('COM_KUNENA_INSTALL_SUCCESS'), true, '');
         $this->setStep($this->getStep() + 1);
     }
 }
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:39,代码来源:model.php

示例8: _Delete


//.........这里部分代码省略.........
                 }
             }
             $this->deleteAttachments($MessageID);
             break;
         case KN_DEL_THREAD_PERMINANTLY:
             //Delete a complete thread from the databases
             $query = "SELECT `id`,`userid` FROM #__kunena_messages WHERE `thread`={$this->_db->Quote($currentMessage->thread)};";
             $this->_db->setQuery($query);
             $ThreadDatas = $this->_db->loadObjectList();
             if (KunenaError::checkDatabaseError()) {
                 return false;
             }
             $userid = array();
             $messid = array();
             if (is_array($ThreadDatas)) {
                 foreach ($ThreadDatas as $mes) {
                     $userid[] = $mes->userid;
                     $messid[] = $mes->id;
                     // Delete all attachments in this thread
                     if ($DeleteAttachments) {
                         $this->deleteAttachments($mes->id);
                     }
                 }
                 $sql2 = "DELETE FROM #__kunena_messages_text WHERE `mesid` IN ({$this->_db->Quote(implode(',', $messid))});";
                 $this->_db->setQuery($sql2);
                 $this->_db->query();
                 if (KunenaError::checkDatabaseError()) {
                     return false;
                 }
                 // Need to update number of posts of each users in this thread
                 if ($mes->userid > 0) {
                     $query = "UPDATE #__kunena_users SET posts=posts-1 WHERE `userid` IN ({$this->_db->Quote(implode(',', $userid))}); ";
                     $this->_db->setQuery($query);
                     $this->_db->query();
                     if (KunenaError::checkDatabaseError()) {
                         return false;
                     }
                 }
             }
             $sql = "DELETE FROM #__kunena_messages WHERE `thread`={$this->_db->Quote($currentMessage->thread)};";
             break;
         case KN_UNDELETE_THREAD:
             $sql1 = "UPDATE #__kunena_messages SET `hold`=0 WHERE `id`={$this->_db->Quote($MessageID)};";
             $this->_db->setQuery($sql1);
             $this->_db->query();
             if (KunenaError::checkDatabaseError()) {
                 return false;
             }
             $sql = "UPDATE #__kunena_messages SET `hold`=0 WHERE hold=3 AND `thread`={$this->_db->Quote($currentMessage->thread)} AND `id`!={$this->_db->Quote($MessageID)} ;";
             break;
         case KN_DEL_THREAD:
             //Delete a complete thread
             $sql1 = "UPDATE #__kunena_messages SET `hold`=2 WHERE `id`={$this->_db->Quote($MessageID)};";
             $this->_db->setQuery($sql1);
             $this->_db->query();
             if (KunenaError::checkDatabaseError()) {
                 return false;
             }
             $sql = "UPDATE #__kunena_messages SET `hold`=3 WHERE hold IN (0,1) AND `thread`={$this->_db->Quote($currentMessage->thread)} AND `id`!={$this->_db->Quote($MessageID)} ;";
             break;
         case KN_DEL_ATTACH:
             //Delete only the attachments
             require_once KUNENA_PATH_LIB . '/kunena.attachments.class.php';
             $attachments = CKunenaAttachments::getInstance();
             $attachments->deleteMessage($MessageID);
             break;
         default:
             // Unsupported mode - Error!
             $this->_errormsg = JText::_('COM_KUNENA_MODERATION_ERROR_UNSUPPORTED_MODE');
             return false;
     }
     // Execute delete
     if (isset($sql)) {
         $this->_db->setQuery($sql);
         $this->_db->query();
         if (KunenaError::checkDatabaseError()) {
             return false;
         }
     }
     // Remember to delete ghost post
     // FIXME: replies may have ghosts, too. What to do with them?
     $this->_db->setQuery("SELECT m.id FROM #__kunena_messages AS m INNER JOIN #__kunena_messages_text AS t ON m.`id`=t.`mesid`\n\t\t\tWHERE `moved`=1;");
     $ghostMessageID = $this->_db->loadResult();
     if (KunenaError::checkDatabaseError()) {
         return false;
     }
     if (!empty($ghostMessageID)) {
         $this->_db->setQuery("UPDATE #__kunena_messages SET `hold`=2 WHERE `id`={$this->_db->Quote($ghostMessageID)} AND `moved`=1;");
         $this->_db->query();
         if (KunenaError::checkDatabaseError()) {
             return false;
         }
     }
     // Check result to see if we need to abord and set error message
     // When done log the action
     $this->_Log('Delete', $MessageID, 0, '', 0, $mode);
     // Last but not least update forum stats
     CKunenaTools::reCountBoards();
     return true;
 }
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:101,代码来源:kunena.moderation.class.php


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