Пример #1
0
	function delete() {
		$app =  JFactory::getApplication ();
		$db = JFactory::getDBO ();

		if (! JRequest::checkToken ()) {
			$app->enqueueMessage ( JText::_ ( 'COM_KUNENA_ERROR_TOKEN' ), 'error' );
			$app->redirect ( KunenaRoute::_($this->baseurl, false) );
		}

		$cids = JRequest::getVar ( 'cid', array (), 'post', 'array' );

		if (! $cids) {
			$app->enqueueMessage ( JText::_ ( 'COM_KUNENA_NO_ATTACHMENTS_SELECTED' ), 'error' );
			$app->redirect ( KunenaRoute::_($this->baseurl, false) );
		}

		foreach( $cids as $id ) {
			kimport ('kunena.forum.message.attachment.helper');
			$attachment = KunenaForumMessageAttachmentHelper::get($id);
			$attachment->delete();
		}

		$app->enqueueMessage ( JText::_('COM_KUNENA_ATTACHMENTS_DELETED_SUCCESSFULLY') );
		$app->redirect ( KunenaRoute::_($this->baseurl, false) );
	}
Пример #2
0
 function shKUGetVersion()
 {
     static $version = null;
     if (is_null($version)) {
         // Make sure that Kunena API has been loaded
         $api = JPATH_ADMINISTRATOR . '/components/com_kunena/api.php';
         if (is_file($api)) {
             require_once $api;
         }
         if (class_exists('KunenaForum')) {
             $version = KunenaForum::versionMajor();
             // Initialize Kunena 2.0 support
             kimport('kunena.forum.category');
             kimport('kunena.forum.topic');
         } elseif (class_exists('Kunena')) {
             $version = '1.6';
             // Initialize Kunena 1.6 support
             require_once KUNENA_PATH . '/router.php';
             KunenaRouter::loadCategories();
         } elseif (is_file(JPATH_ROOT . '/components/com_kunena/lib/kunena.defines.php')) {
             $version = '1.5';
         } elseif (is_file(JPATH_ROOT . '/components/com_kunena/lib/kunena.version.php')) {
             $version = '1.0';
         } else {
             $version = false;
         }
     }
     return $version;
 }
Пример #3
0
	function recount() {
		$app = JFactory::getApplication ();
		$state = $app->getUserState ( 'com_kunena.admin.recount', null );

		if ($state === null) {
			// First run
			$query = "SELECT MAX(id) FROM #__kunena_messages";
			$db = JFactory::getDBO();
			$db->setQuery ( $query );
			$state = new StdClass();
			$state->step = 0;
			$state->maxId = (int) $db->loadResult ();
			$state->start = 0;
		}

		$this->checkTimeout();
		while (1) {
			$count = mt_rand(95000, 105000);
			switch ($state->step) {
				case 0:
					// Update topic statistics
					kimport('kunena.forum.topic.helper');
					KunenaForumTopicHelper::recount(false, $state->start, $state->start+$count);
					$state->start += $count;
					//$app->enqueueMessage ( JText::sprintf('COM_KUNENA_ADMIN_RECOUNT_TOPICS', min($state->start, $state->maxId), $state->maxId) );
					break;
				case 1:
					// Update usertopic statistics
					kimport('kunena.forum.topic.user.helper');
					KunenaForumTopicUserHelper::recount(false, $state->start, $state->start+$count);
					$state->start += $count;
					//$app->enqueueMessage ( JText::sprintf('COM_KUNENA_ADMIN_RECOUNT_USERTOPICS', min($state->start, $state->maxId), $state->maxId) );
					break;
				case 2:
					// Update user statistics
					kimport('kunena.user.helper');
					KunenaUserHelper::recount();
					//$app->enqueueMessage ( JText::sprintf('COM_KUNENA_ADMIN_RECOUNT_USER') );
					break;
				case 3:
					// Update category statistics
					kimport('kunena.forum.category.helper');
					KunenaForumCategoryHelper::recount();
					//$app->enqueueMessage ( JText::sprintf('COM_KUNENA_ADMIN_RECOUNT_CATEGORY') );
					break;
				default:
					$app->setUserState ( 'com_kunena.admin.recount', null );
					$app->enqueueMessage (JText::_('COM_KUNENA_RECOUNTFORUMS_DONE'));
					$this->setRedirect(KunenaRoute::_('index.php?option=com_kunena', false));
					return;
			}
			if (!$state->start || $state->start > $state->maxId) {
				$state->step++;
				$state->start = 0;
			}
			if ($this->checkTimeout()) break;
		}
		$app->setUserState ( 'com_kunena.admin.recount', $state );
		$this->setRedirect(KunenaRoute::_('index.php?option=com_kunena&view=recount&task=recount', false));
	}
Пример #4
0
	/**
	 * Get Kunena session object
	 *
	 * Returns the global {@link KunenaSession} object, only creating it if it doesn't already exist.
	 *
	 * @param array An array containing session options
	 * @return object KunenaSession
	 */
	public static function getSession($update = false)
	{
		kimport('kunena.session');
		if (!is_object(KunenaFactory::$session)) {
			KunenaFactory::$session = KunenaSession::getInstance($update);
		}
		return KunenaFactory::$session;
	}
Пример #5
0
 /**
  * Contructor
  *
  * @since 1.6
  */
 function __construct()
 {
     $this->pid = JRequest::getInt('pid', '');
     $this->catid = JRequest::getInt('catid', '');
     $this->my =& JFactory::getUser();
     $this->config = KunenaFactory::getConfig();
     $this->_db =& JFactory::getDBO();
     $this->_app =& JFactory::getApplication();
     kimport('thankyou');
 }
Пример #6
0
 protected static function kunenaOnline()
 {
     // Kunena detection and version check
     $minKunenaVersion = '1.6.3';
     if (!class_exists('Kunena') || Kunena::versionBuild() < 4344) {
         JFactory::getApplication()->enqueueMessage(JText::sprintf('PLG_COMMUNITY_KUNENAGROUPS_KUNENA_NOT_INSTALLED', $minKunenaVersion), 'notice');
         return false;
     }
     // Kunena online check
     if (!Kunena::enabled()) {
         JFactory::getApplication()->enqueueMessage(JText::_('PLG_COMMUNITY_KUNENAGROUPS_KUNENA_OFFLINE'), 'notice');
         return false;
     }
     // Initialize session
     $session = KunenaFactory::getSession();
     $session->updateAllowedForums();
     kimport('category');
     return true;
 }
Пример #7
0
	public function onAfterReply($message) {
		CFactory::load ( 'libraries', 'userpoints' );
		CUserPoints::assignPoint ( 'com_kunena.thread.reply' );

		// Check for permisions of the current category - activity only if public or registered
		if ($message->getCategory()->pub_access <= 0) {
			//activity stream - reply post
			require_once KPATH_SITE.'/lib/kunena.link.class.php';
			$JSPostLink = CKunenaLink::GetThreadPageURL ( 'view', $message->catid, $message->thread, 0 );

			kimport('kunena.html.parser');
			$content = KunenaHtmlParser::plainBBCode($message->message, $this->_config->activity_limit);

			// Add readmore link
			$content .= '<br /><a href="'.
					CKunenaLink::GetMessageURL($message->id, $message->catid).
					'" class="small profile-newsfeed-item-action">'.JText::sprintf('Read more...').'</a>';

			$act = new stdClass ();
			$act->cmd = 'wall.write';
			$act->actor = $message->userid;
			$act->target = 0; // no target
			$act->title = JText::_ ( '{single}{actor}{/single}{multiple}{actors}{/multiple} ' . JText::_ ( 'COM_KUNENA_JS_ACTIVITYSTREAM_REPLY_MSG1' ) . ' <a href="' . $JSPostLink . '">' . $message->subject . '</a> ' . JText::_ ( 'COM_KUNENA_JS_ACTIVITYSTREAM_REPLY_MSG2' ) );
			$act->content = $content;
			$act->app = 'kunena.post';
			$act->cid = $message->thread;

			// jomsocial 0 = public, 20 = registered members
			if ($message->getCategory()->pub_access == 0) {
				$act->access = 0;
			} else {
				$act->access = 20;
			}

			CFactory::load ( 'libraries', 'activities' );
			CActivityStream::add ( $act );
		}
	}
Пример #8
0
 function __construct($parent, $message)
 {
     kimport('html.parser');
     $this->limitstart = $parent->limitstart;
     $this->limit = $parent->limit;
     $this->mesid = $parent->mesid;
     $this->replynum = $parent->replynum;
     $this->replycnt = $parent->total_messages;
     $this->mmm = $parent->mmm;
     $this->topicLocked = $parent->topicLocked;
     $this->allow_anonymous = $parent->allow_anonymous;
     $this->anonymous = $parent->anonymous;
     $this->myname = $parent->myname;
     $this->templatepath = $parent->templatepath;
     $this->msg = $message;
     $this->my = JFactory::getUser();
     $this->me = KunenaFactory::getUser();
     $this->config = KunenaFactory::getConfig();
     $this->db = JFactory::getDBO();
     $template = KunenaFactory::getTemplate();
     $this->params = $template->params;
     $this->cansubscribe = $parent->cansubscribe;
 }
Пример #9
0
	function displayFooter($tpl = null) {
		require_once KPATH_SITE . '/lib/kunena.link.class.php';
		$catid = 0;
		if (KunenaFactory::getConfig ()->enablerss) {
			if ($catid > 0) {
				kimport ( 'kunena.forum.category.helper' );
				$category = KunenaForumCategoryHelper::get ( $catid );
				if ($category->pub_access == 0 && $category->parent)
					$rss_params = '&catid=' . ( int ) $catid;
			} else {
				$rss_params = '';
			}
			if (isset ( $rss_params )) {
				$document = JFactory::getDocument ();
				$document->addCustomTag ( '<link rel="alternate" type="application/rss+xml" title="' . JText::_ ( 'COM_KUNENA_LISTCAT_RSS' ) . '" href="' . CKunenaLink::GetRSSURL ( $rss_params ) . '" />' );
				$this->assign ( 'rss', CKunenaLink::GetRSSLink ( $this->getIcon ( 'krss', JText::_('COM_KUNENA_LISTCAT_RSS') ), 'follow', $rss_params ));
			}
		}
		$template = KunenaFactory::getTemplate ();
		$credits = CKunenaLink::GetTeamCreditsLink ( $catid, JText::_('COM_KUNENA_POWEREDBY') ) . ' ' . CKunenaLink::GetCreditsLink ();
		if ($template->params->get('templatebyText') !='') {
			$credits .= ' :: <a href ="'. $template->params->get('templatebyLink').'" rel="follow">' . $template->params->get('templatebyText') .' '. $template->params->get('templatebyName') .'</a>';
		}
		$this->assign ( 'credits', $credits );
		$result = $this->loadTemplate($tpl);
		if (JError::isError($result)) {
			return $result;
		}
		echo $result;
	}
Пример #10
0
	function delfile() {
		$app = JFactory::getApplication ();
		if (! JRequest::checkToken ()) {
			$app->enqueueMessage ( JText::_ ( 'COM_KUNENA_ERROR_TOKEN' ), 'error' );
			$this->redirectBack ();
		}
		$cids = JRequest::getVar ( 'cid', array (), 'post', 'array' );

		$number = count($cids);

		foreach( $cids as $id ) {
			kimport ('kunena.forum.message.attachment.helper');
			$attachment = KunenaForumMessageAttachmentHelper::get($id);
			$attachment->delete();
		}

		$app->enqueueMessage ( JText::sprintf( 'COM_KUNENA_ATTACHMENTS_DELETE_SUCCESSFULLY', $number) );
		$this->redirectBack ();
	}
Пример #11
0
	public function newTopic($fields=array(), $user=null) {
		kimport ('kunena.forum.topic');
		kimport ('kunena.forum.message');

		$catid = $this->getNewTopicCategory()->id;
		$user = KunenaUserHelper::get($user);
		$message = new KunenaForumMessage();
		$message->catid = $catid;
		$message->name = $user->getName('');
		$message->userid = $user->userid;
		$message->ip = $_SERVER ["REMOTE_ADDR"];
		$message->hold = $this->review ? (int)!$this->authorise ('moderate', $user, true) : 0;
		$message->bind($fields, array ('name', 'email', 'subject', 'message'));

		$topic = new KunenaForumTopic();
		$topic->category_id = $catid;
		$topic->hold = $message->hold;
		$topic->bind($fields, array ('subject','icon_id'));

		$message->setTopic($topic);
		return array($topic, $message);
	}
Пример #12
0
/**
 * @version $Id$
 * Kunena Component
 * @package Kunena
 *
 * @Copyright (C) 2008 - 2011 Kunena Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link http://www.kunena.org
 **/
defined ( '_JEXEC' ) or die ();

kimport ( 'kunena.model' );
kimport('kunena.forum.category.helper');
kimport('kunena.forum.topic.helper');
kimport('kunena.forum.message.helper');
kimport('kunena.user.helper');

/**
 * Topics Model for Kunena
 *
 * @package		Kunena
 * @subpackage	com_kunena
 * @since		2.0
 */
class KunenaModelTopics extends KunenaModel {
	protected $topics = false;
	protected $messages = false;
	protected $total = 0;
	protected $topicActions = false;
	protected $actionMove = false;
Пример #13
0
	function unblock() {
		$app = JFactory::getApplication ();
		kimport('kunena.user.ban');
		if (! JRequest::checkToken ()) {
			$app->enqueueMessage ( JText::_ ( 'COM_KUNENA_ERROR_TOKEN' ), 'error' );
			$app->redirect ( KunenaRoute::_($this->baseurl, false) );
		}

		$cid = JRequest::getVar ( 'cid', array (), 'post', 'array' );
		$userid = (int)array_shift($cid);

		if ($userid < 0 ) {
			$app->enqueueMessage ( JText::_('COM_KUNENA_PROFILE_NO_USER'), 'error' );
			$app->redirect ( KunenaRoute::_($this->baseurl, false) );
		}

		$ban = KunenaUserBan::getInstanceByUserid ( $userid, true );
		if (! $ban->id) {
			$ban->ban ( $userid, null, 1 );
			$success = $ban->save ();
		} else {
			jimport ('joomla.utilities.date');
			$now = new JDate();
			$ban->setExpiration ( $now );
			$success = $ban->save ();
		}

		$message = JText::_ ( 'COM_KUNENA_USER_UNBLOCK_DONE' );

		if (! $success) {
			$app->enqueueMessage ( $ban->getError (), 'error' );
		} else {
			$app->enqueueMessage ( $message );
		}

		$app->redirect ( KunenaRoute::_($this->baseurl, false) );
	}
Пример #14
0
/**
 * @version $Id: kunenacategories.php 4220 2011-01-18 09:13:04Z mahagr $
 * Kunena Component
 * @package Kunena
 *
 * @Copyright (C) 2008 - 2011 Kunena Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link http://www.kunena.org
 **/
defined ( '_JEXEC' ) or die ();

require_once KPATH_ADMIN . '/libraries/integration/integration.php';
kimport ( 'kunena.error' );
kimport ( 'kunena.forum.category.helper' );
kimport ( 'kunena.forum.topic.helper' );
kimport ( 'kunena.databasequery' );

abstract class KunenaAccess {
	public $priority = 0;

	protected static $instance = false;
	protected static $adminsByCatid = array();
	protected static $adminsByUserid = array();
	protected static $moderatorsByCatid = array();
	protected static $moderatorsByUserid = array();

	protected static $cacheKey = 'com_kunena.access.global';

	abstract public function __construct();

	static public function getInstance($integration = null) {
Пример #15
0
	function permdel_posts() {
		kimport('kunena.forum.message.helper');

		$app = JFactory::getApplication ();
		if (! JRequest::checkToken ()) {
			$app->enqueueMessage ( JText::_ ( 'COM_KUNENA_ERROR_TOKEN' ), 'error' );
			$this->redirectBack ();
		}

		$success = 0;
		$messages = KunenaForumMessageHelper::getMessages(array_keys(JRequest::getVar('posts', array ( 0 ), 'post', 'array')));
		if (!$messages) {
			$app->enqueueMessage ( JText::_ ( 'COM_KUNENA_NO_MESSAGES_SELECTED' ) );
		} else {
			foreach ( $messages as $message ) {
				if ($message->authorise('permdelete') && $message->delete()) {
					$success++;
				} else {
					$app->enqueueMessage ( $message->getError (), 'notice' );
				}
			}
		}
		if ($success) $app->enqueueMessage ( JText::_ ( 'COM_KUNENA_BULKMSG_DELETED' ) );
		$this->redirectBack ();
	}
Пример #16
0
	public function getPagination($limitstart=0, $limit=6, $display=4, $prefix='') {
		if (!$this->_pagination) {
			kimport ('kunena.html.pagination');
			$this->_pagination = new KunenaHtmlPagination($this->posts, $limitstart, $limit, $prefix);
			$this->_pagination->setDisplay($display, "index.php?option=com_kunena&view=topic&catid={$this->category_id}&id={$this->id}");
		}
		return $this->_pagination;
	}
Пример #17
0
 function ban()
 {
     $userid = JRequest::getInt('userid', 0);
     $ip = JRequest::getVar('ip', '');
     $block = JRequest::getInt('block', 0);
     $expiration = JRequest::getString('expiration', '');
     $reason_private = JRequest::getString('reason_private', '');
     $reason_public = JRequest::getString('reason_public', '');
     $comment = JRequest::getString('comment', '');
     if (!JRequest::checkToken()) {
         while (@ob_end_clean()) {
         }
         $this->_app->redirect(CKunenaLink::GetProfileURL($this->profile->userid, false), COM_KUNENA_ERROR_TOKEN, 'error');
         return false;
     }
     kimport('userban');
     $ban = KunenaUserBan::getInstanceByUserid($userid, true);
     if (!$ban->id) {
         $ban->ban($userid, $ip, $block, $expiration, $reason_private, $reason_public, $comment);
         $success = $ban->save();
     } else {
         $delban = JRequest::getString('delban', '');
         if ($delban) {
             $ban->unBan($comment);
             $success = $ban->save();
         } else {
             $ban->blocked = $block;
             $ban->setExpiration($expiration, $comment);
             $ban->setReason($reason_public, $reason_private);
             $success = $ban->save();
         }
     }
     if ($block) {
         if ($ban->isEnabled()) {
             $message = JText::_('COM_KUNENA_USER_BLOCKED_DONE');
         } else {
             $message = JText::_('COM_KUNENA_USER_UNBLOCKED_DONE');
         }
     } else {
         if ($ban->isEnabled()) {
             $message = JText::_('COM_KUNENA_USER_BANNED_DONE');
         } else {
             $message = JText::_('COM_KUNENA_USER_UNBANNED_DONE');
         }
     }
     if (!$success) {
         $this->_app->enqueueMessage($ban->getError(), 'error');
     } else {
         $this->_app->enqueueMessage($message);
     }
     $banDelPosts = JRequest::getVar('bandelposts', '');
     $DelAvatar = JRequest::getVar('delavatar', '');
     $DelSignature = JRequest::getVar('delsignature', '');
     $DelProfileInfo = JRequest::getVar('delprofileinfo', '');
     if (!empty($DelAvatar)) {
         jimport('joomla.filesystem.file');
         $userprofile = KunenaFactory::getUser($userid);
         $this->_db->setQuery("UPDATE #__kunena_users SET avatar=null WHERE userid={$this->_db->Quote($userid)}");
         $this->_db->Query();
         KunenaError::checkDatabaseError();
         $avatar_deleted = '';
         // Delete avatar from file system
         if (JFile::exists(KUNENA_PATH_AVATAR_UPLOADED . '/' . $userprofile->avatar) && !stristr($userprofile->avatar, 'gallery/')) {
             JFile::delete(KUNENA_PATH_AVATAR_UPLOADED . '/' . $userprofile->avatar);
             $avatar_deleted = $this->_app->enqueueMessage(JText::_('COM_KUNENA_MODERATE_DELETED_BAD_AVATAR_FILESYSTEM'));
         }
         $this->_app->enqueueMessage(JText::_('COM_KUNENA_MODERATE_DELETED_BAD_AVATAR') . $avatar_deleted);
     }
     if (!empty($DelSignature)) {
         $this->_db->setQuery("UPDATE #__kunena_users SET signature=null WHERE userid={$this->_db->Quote($userid)}");
         $this->_db->Query();
         KunenaError::checkDatabaseError();
         $this->_app->enqueueMessage(JText::_('COM_KUNENA_MODERATE_DELETED_BAD_SIGNATURE'));
     }
     if (!empty($DelProfileInfo)) {
         $this->_db->setQuery("UPDATE #__kunena_users SET signature=null,avatar=null,karma=null,personalText=null,gender=0,birthdate=0000-00-00,location=null,ICQ=null,AIM=null,YIM=null,MSN=null,SKYPE=null,GTALK=null,websitename=null,websiteurl=null,rank=0,TWITTER=null,FACEBOOK=null,MYSPACE=null,LINKEDIN=null,DELICIOUS=null,FRIENDFEED=null,DIGG=null,BLOGSPOT=null,FLICKR=null,BEBO=null WHERE userid={$this->_db->Quote($userid)}");
         $this->_db->Query();
         KunenaError::checkDatabaseError();
         $this->_app->enqueueMessage(JText::_('COM_KUNENA_MODERATE_DELETED_BAD_PROFILEINFO'));
     }
     if (!empty($banDelPosts)) {
         //select only the messages which aren't already in the trash
         $this->_db->setQuery("UPDATE #__kunena_messages SET hold=2 WHERE hold!=2 AND userid={$this->_db->Quote($userid)}");
         $idusermessages = $this->_db->loadObjectList();
         KunenaError::checkDatabaseError();
         $this->_app->enqueueMessage(JText::_('COM_KUNENA_MODERATE_DELETED_BAD_MESSAGES'));
     }
     while (@ob_end_clean()) {
     }
     $this->_app->redirect(CKunenaLink::GetProfileURL($this->profile->userid, false));
 }
Пример #18
0
<?php
/**
 * @version $Id: default.php 4381 2011-02-05 20:55:31Z mahagr $
 * Kunena Component
 * @package Kunena
 *
 * @Copyright (C) 2008 - 2011 Kunena Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link http://www.kunena.org
 **/
defined ( '_JEXEC' ) or die ();

jimport ( 'joomla.application.component.model' );
kimport('kunena.model');

/**
 * Cpanel Model for Kunena
 *
 * @package		Kunena
 * @subpackage	com_kunena
 * @since		1.6
 */
class KunenaAdminModelCpanel extends KunenaModel {
	function getLatestVersion() {
		$latestVersion = $this->getLatestKunenaVersion();

		if ( $latestVersion['connect'] ) {
			if ( version_compare($latestVersion['latest_version'], KunenaForum::version(), '<=') ) {
				$needUpgrade = JText::sprintf('COM_KUNENA_COM_A_CHECK_VERSION_CORRECT', KunenaForum::version());
			} else {
				$needUpgrade = JText::sprintf('COM_KUNENA_COM_A_CHECK_VERSION_NEED_UPGRADE',$latestVersion['latest_version'],$latestVersion['released']);
Пример #19
0
<?php
/**
 * @version $Id: view.html.php 4469 2011-02-21 16:55:20Z xillibit $
 * Kunena Component
 * @package Kunena
 *
 * @Copyright (C) 2008 - 2011 Kunena Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link http://www.kunena.org
 **/
defined ( '_JEXEC' ) or die ();

kimport ( 'kunena.view' );
kimport ('kunena.forum.message.attachment.helper');

/**
 * Attachments view for Kunena backend
 */
class KunenaAdminViewAttachments extends KunenaView {
	function displayDefault() {
		$this->items = $this->get('Items');
		$this->navigation = $this->get ( 'AdminNavigation' );
		$this->setToolBarDefault();

		$this->display ();
	}

	protected function setToolBarDefault() {
		// Set the titlebar text
		JToolBarHelper::title ( '&nbsp;', 'kunena.png' );
		JToolBarHelper::spacer();
Пример #20
0
<?php

/**
 * @version $Id$
 * Kunena Component - CKunenaUser class
 * @package Kunena
 *
 * @Copyright (C) 2008-2011 www.kunena.org All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link http://www.kunena.org
 **/
// Dont allow direct linking
defined('_JEXEC') or die;
require_once dirname(__FILE__) . '/kunena.php';
kimport('error');
/**
 * Kunena Category Table
 * Provides access to the #__kunena_category table
 */
class TableKunenaCategory extends KunenaTable
{
    var $id = null;
    var $parent = null;
    var $name = null;
    var $cat_emoticon = null;
    var $locked = null;
    var $alert_admin = null;
    var $moderated = null;
    var $moderators = null;
    var $accesstype = null;
    var $access = null;
Пример #21
0
<?php
/**
 * @version $Id$
 * Kunena Component
 * @package Kunena
 *
 * @Copyright (C) 2008 - 2011 Kunena Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link http://www.kunena.org
 **/
defined ( '_JEXEC' ) or die ();

kimport ( 'kunena.forum.message.helper' );
/**
 * Kunena Forum Message Thank You Class
 */
class KunenaForumMessageThankyou extends JObject {
	protected $id = 0;
	protected $users = array();
	/**
	 * Constructor -- please use getInstance()
	 *
	 * @access	protected
	 */
	public function __construct($id) {
		$this->id = (int) $id;
	}

	/**
	 * Returns KunenaForumMessage object
	 *
Пример #22
0
	public function getModerators($catid);
	public function isModerator($catid, $userid);
	public function addModerator($catid, $userid);
	public function removeModerator($catid, $userid);

	public function getLatestThreads($start = 0, $limit = 10);
	public function getUnansweredThreads($start = 0, $limit = 10);
	public function getCategoryThreads($catid, $start = 0, $limit = 10);
}

interface iKunenaPostAPI {
	public function __construct();
	public static function version();

	public function canRead($mesid);
	public function canPost($catid);
	public function canReply($mesid);
	public function canEdit($mesid);
	public function canDelete($mesid);

	public function get($mesid);
	public function post($catid, $msginfo);
	public function reply($mesid, $msginfo);
	public function edit($mesid, $msginfo);
	public function delete($mesid);
}
*/
kimport('api');
// Kunena has been initialized
define('KUNENA_LOADED', 1);
Пример #23
0
	/**
	 * Method to get details on selected items.
	 *
	 * @return	Array
	 * @since	1.6
	 */
	public function getPurgeItems() {
		kimport('kunena.error');

		$app = JFactory::getApplication ();

		$ids = $app->getUserState ( 'com_kunena.purge' );
		$topic = $app->getUserState('com_kunena.topic');
		$message = $app->getUserState('com_kunena.message');

		$ids = implode ( ',', $ids );

		if ( $topic ) {
			$items = KunenaForumTopicHelper::getTopics($ids);
		} elseif ( $message ) {
			$items = KunenaForumMessageHelper::getMessages($ids);
		} else {

		}

		return $items;
	}
Пример #24
0
 * @version $Id$
 * Kunena Component
 * @package Kunena
 *
 * @Copyright (C) 2008 - 2011 Kunena Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link http://www.kunena.org
 **/
defined ( '_JEXEC' ) or die ();

kimport ( 'kunena.model' );
kimport('kunena.forum.category.helper');
kimport('kunena.forum.topic.helper');
kimport('kunena.forum.message.helper');
kimport('kunena.user.helper');
kimport('kunena.forum.topic.poll.helper');

/**
 * Topic Model for Kunena
 *
 * @package		Kunena
 * @subpackage	com_kunena
 * @since		2.0
 */
class KunenaModelTopic extends KunenaModel {
	protected $topics = false;
	protected $messages = false;
	protected $items = false;

	protected function populateState() {
		$app = JFactory::getApplication ();
Пример #25
0
<?php
/**
 * @version $Id: topicicons.php 4488 2011-02-24 09:41:43Z xillibit $
 * Kunena Component
 * @package Kunena
 *
 * @Copyright (C) 2008 - 2011 Kunena Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link http://www.kunena.org
 **/
defined ( '_JEXEC' ) or die ();

kimport ( 'kunena.controller' );

/**
 * Kunena Topicicons Controller
 *
 * @package		Kunena
 * @subpackage	com_kunena
 * @since		1.6
 */
class KunenaAdminControllerTopicicons extends KunenaController {
	protected $baseurl = null;

	public function __construct($config = array()) {
		parent::__construct($config);
		$this->baseurl = 'index.php?option=com_kunena&view=topicicons';
	}

	function add() {
		$app = JFactory::getApplication ();
Пример #26
0
<?php
/**
 * @version $Id$
 * Kunena Component
 * @package Kunena
 *
 * @Copyright (C) 2008 - 2011 Kunena Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link http://www.kunena.org
 **/
defined ( '_JEXEC' ) or die ();

kimport ( 'kunena.error' );
kimport ( 'kunena.forum.message.thankyou' );

/**
 * Kunena Forum Message Thank You Helper Class
 * @since 2.0
 */
class KunenaForumMessageThankyouHelper {
	protected static $_instances = array();

	/**
	 * Returns KunenaForumMessageThankyou object
	 *
	 * @access	public
	 * @param	identifier		The message to load - Can be only an integer.
	 * @return	KunenaForumMessageThankyou		The thankyou object.
	 * @since	1.7
	 */
	static public function get($identifier, $reload = false) {
Пример #27
0
/**
 * @version $Id$
 * Kunena Component
 * @package Kunena
 *
 * @Copyright (C) 2008 - 2011 Kunena Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link http://www.kunena.org
 **/
defined ( '_JEXEC' ) or die ();

jimport ( 'joomla.application.component.view' );
kimport ( 'kunena.html.parser' );
kimport ('kunena.date');
kimport ('kunena.user.helper');
kimport ('kunena.profiler');

/**
 * Kunena View Class
 */
class KunenaView extends JView {
	protected $_row = 0;

	function __construct($config = array()){
		parent::__construct($config);
		$this->profiler = KunenaProfiler::instance('Kunena');
		$this->me = KunenaUserHelper::getMyself();
		$this->config = KunenaFactory::getConfig();
		$this->template = KunenaFactory::getTemplate();
	}
Пример #28
0
function showStats()
{
    kimport('thankyou');
    include_once KPATH_ADMIN . '/html/stats.php';
}
Пример #29
0
 static function remove_forum_k1($course_id, $forum_id)
 {
     require_once JPATH_ADMINISTRATOR . '/components/com_kunena/libraries/category.php';
     $db = JFactory::getDBO();
     kimport('tables.kunenacategory');
     $row = new TableKunenaCategory($db);
     $kunena_forum_id = JoomdleHelperForum::get_kunena_forum_id($course_id, $forum_id);
     $row->delete($kunena_forum_id);
     $query = 'DELETE ' . ' FROM #__joomdle_course_forums' . " WHERE course_id = " . $db->Quote($course_id);
     $query .= " AND moodle_forum_id = " . $db->Quote($forum_id);
     $db->setQuery($query);
     $db->query();
 }
Пример #30
0
	function GetMessageURL($pid, $catid=0, $limit = 0, $xhtml = true) {
		kimport ('kunena.error');
		$config = KunenaFactory::getConfig ();
		$myprofile = KunenaFactory::getUser ();
		if ($myprofile->ordering != '0') {
			$topic_ordering = $myprofile->ordering == '1' ? '>=' : '<=';
		} else {
			$topic_ordering = $config->default_sort == 'asc' ? '<=' : '>=';
		}
		$maxmin = $topic_ordering == '<=' ? 'MAX' : 'MIN';
		if ($limit < 1) $limit = $config->messages_per_page;
		$access = KunenaFactory::getAccessControl();
		$hold = $access->getAllowedHold($myprofile, $catid);
		$db = JFactory::getDBO ();
		// First determine the thread, latest post and number of posts for the post supplied
		$db->setQuery ( "SELECT a.thread AS thread, {$maxmin}(a.id) AS latest_id, MAX(a.catid) AS catid, COUNT(*) AS totalmessages
                             FROM #__kunena_messages AS a, (SELECT thread FROM #__kunena_messages WHERE id={$db->Quote($pid)}) AS b
                             WHERE a.thread = b.thread AND a.hold IN ({$hold}) AND a.id {$topic_ordering} {$db->Quote($pid)}
                             GROUP BY a.thread" );
		$result = $db->loadObject ();
		if (KunenaError::checkDatabaseError()) return;
		if (! is_object ( $result ))
			return KunenaRoute::_ ( "index.php?option=com_kunena&view=showcat&catid={$catid}", $xhtml );
		return self::GetThreadPageURL ( 'view', $catid, $result->thread, $result->totalmessages, $limit, $result->latest_id, $xhtml );
	}