/**
  * Test get()
  */
 public function testGet()
 {
     $admin = KunenaFactory::getUser('admin');
     $topicuser = KunenaForumTopicUserHelper::get();
     $this->assertEquals(null, $topicuser->topic_id);
     $this->assertEquals(0, $topicuser->user_id);
 }
Exemplo n.º 2
0
 /**
  * @param $user
  * @param $sizex
  * @param $sizey
  *
  * @return string
  */
 protected function _getURL($user, $sizex, $sizey)
 {
     $user = KunenaFactory::getUser($user);
     $avatar = $user->avatar;
     $config = KunenaFactory::getConfig();
     $path = KPATH_MEDIA . "/avatars";
     $origPath = "{$path}/{$avatar}";
     if (!is_file($origPath)) {
         // If avatar does not exist use default image.
         if ($sizex <= 90) {
             $avatar = 's_nophoto.jpg';
         } else {
             $avatar = 'nophoto.jpg';
         }
         // Search from the template.
         $template = KunenaFactory::getTemplate();
         $origPath = JPATH_SITE . '/' . $template->getAvatarPath($avatar);
         $avatar = $template->name . '/' . $avatar;
     }
     $dir = dirname($avatar);
     $file = basename($avatar);
     if ($sizex == $sizey) {
         $resized = "resized/size{$sizex}/{$dir}";
     } else {
         $resized = "resized/size{$sizex}x{$sizey}/{$dir}";
     }
     // TODO: make timestamp configurable?
     $timestamp = '';
     if (!is_file("{$path}/{$resized}/{$file}")) {
         KunenaImageHelper::version($origPath, "{$path}/{$resized}", $file, $sizex, $sizey, intval($config->avatarquality), KunenaImage::SCALE_INSIDE, intval($config->avatarcrop));
         $timestamp = '?' . round(microtime(true));
     }
     return KURL_MEDIA . "avatars/{$resized}/{$file}{$timestamp}";
 }
Exemplo n.º 3
0
 /**
  * @param object $subject
  * @param array  $params
  */
 public function __construct(&$subject, $params)
 {
     $this->app = JFactory::getApplication();
     // Do not register plug-in in administration.
     if ($this->app->isAdmin()) {
         return;
     }
     // If scope isn't articles or Kunena, do not register plug-in.
     if ($this->app->scope != 'com_content' && $this->app->scope != 'com_kunena') {
         return;
     }
     // Kunena detection and version check
     $minKunenaVersion = '3.0';
     if (!class_exists('KunenaForum') || !KunenaForum::isCompatible($minKunenaVersion)) {
         $this->loadLanguage();
         $this->app->enqueueMessage(JText::sprintf('PLG_KUNENADISCUSS_DEPENDENCY_FAIL', $minKunenaVersion));
         return;
     }
     // Kunena online check
     if (!KunenaForum::enabled()) {
         return;
     }
     // Initialize variables
     $this->db = JFactory::getDbo();
     $this->user = KunenaFactory::getUser();
     $this->config = KunenaFactory::getConfig();
     // Initialize plugin
     parent::__construct($subject, $params);
     $this->debug("Constructor called in {$this->app->scope}");
 }
Exemplo n.º 4
0
	protected function _getURL($user, $sizex, $sizey)
	{
		$user = KunenaFactory::getUser($user);
		// Get CUser object
		 $avatar=AwdwallHelperUser::getBigAvatar51($user->userid);
		return $avatar;
	}
 /**
  * Test get()
  */
 public function testGet()
 {
     $admin = KunenaFactory::getUser('admin');
     $categoryuser = KunenaForumCategoryUserHelper::get(0, $admin->userid);
     $this->assertEquals(0, $categoryuser->category_id);
     $this->assertEquals($admin->userid, $categoryuser->user_id);
 }
Exemplo n.º 6
0
 protected function _getURL($user, $sizex, $sizey)
 {
     $user = KunenaFactory::getUser($user);
     $user = FD::user($user->userid);
     $avatar = $user->getAvatar(SOCIAL_AVATAR_LARGE);
     return $avatar;
 }
Exemplo n.º 7
0
 protected function _getURL($user, $sizex, $sizey)
 {
     $user = KunenaFactory::getUser($user);
     $avatar = $user->avatar;
     $config = KunenaFactory::getConfig();
     $path = KPATH_MEDIA . "/avatars";
     if (!is_file("{$path}/{$avatar}")) {
         // If avatar does not exist use default image
         if ($sizex <= 90) {
             $avatar = 's_nophoto.jpg';
         } else {
             $avatar = 'nophoto.jpg';
         }
     }
     $dir = dirname($avatar);
     $file = basename($avatar);
     if ($sizex == $sizey) {
         $resized = "resized/size{$sizex}/{$dir}";
     } else {
         $resized = "resized/size{$sizex}x{$sizey}/{$dir}";
     }
     if (!is_file("{$path}/{$resized}/{$file}")) {
         require_once KPATH_SITE . '/lib/kunena.image.class.php';
         CKunenaImageHelper::version("{$path}/{$avatar}", "{$path}/{$resized}", $file, $sizex, $sizey, intval($config->avatarquality));
     }
     return KURL_MEDIA . "avatars/{$resized}/{$file}";
 }
Exemplo n.º 8
0
 protected function _getURL($user, $sizex, $sizey)
 {
     global $_CB_framework;
     $app = JFactory::getApplication();
     $user = KunenaFactory::getUser($user);
     if ($app->getClientId() == 0) {
         $cbclient_id = 1;
     }
     if ($app->getClientId() == 1) {
         $cbclient_id = 2;
     }
     $_CB_framework->cbset('_ui', $cbclient_id);
     // Get CUser object
     $cbUser = null;
     if ($user->userid) {
         $cbUser = CBuser::getInstance($user->userid);
     }
     if ($cbUser === null) {
         if ($sizex <= 90) {
             return selectTemplate() . 'images/avatar/tnnophoto_n.png';
         }
         return selectTemplate() . 'images/avatar/nophoto_n.png';
     }
     if ($sizex <= 90) {
         return $cbUser->getField('avatar', null, 'csv');
     }
     return $cbUser->getField('avatar', null, 'csv', 'none', 'list');
 }
 /**
  * Test getInstance()
  *
  * @param KunenaForumCategoryUser $categoryuser
  * @return KunenaForumCategoryUser
  * @depends testCreate
  */
 public function testGetInstance(KunenaForumCategoryUser $categoryuser)
 {
     $admin = KunenaFactory::getUser('admin');
     $categoryuser2 = KunenaForumCategoryUser::getInstance($categoryuser->category_id, $admin->userid);
     $this->assertSame($categoryuser, $categoryuser2);
     return $categoryuser;
 }
Exemplo n.º 10
0
 /**
  * Method to display the layout of search results
  *
  * @return void
  */
 public function displayRows()
 {
     // Run events
     $params = new JRegistry();
     $params->set('ksource', 'kunena');
     $params->set('kunena_view', 'search');
     $params->set('kunena_layout', 'default');
     $dispatcher = JDispatcher::getInstance();
     JPluginHelper::importPlugin('kunena');
     $dispatcher->trigger('onKunenaPrepare', array('kunena.messages', &$this->results, &$params, 0));
     foreach ($this->results as $this->message) {
         $this->topic = $this->message->getTopic();
         $this->category = $this->message->getCategory();
         $this->categoryLink = $this->getCategoryLink($this->category->getParent()) . ' / ' . $this->getCategoryLink($this->category);
         $ressubject = KunenaHtmlParser::parseText($this->message->subject);
         $resmessage = KunenaHtmlParser::parseBBCode($this->message->message, 500);
         $profile = KunenaFactory::getUser((int) $this->message->userid);
         $this->useravatar = $profile->getAvatarImage('kavatar', 'post');
         foreach ($this->searchwords as $searchword) {
             if (empty($searchword)) {
                 continue;
             }
             $ressubject = preg_replace("/" . preg_quote($searchword, '/') . "/iu", '<span  class="searchword" >' . $searchword . '</span>', $ressubject);
             // FIXME: enable highlighting, but only after we can be sure that we do not break html
             // $resmessage = preg_replace ( "/" . preg_quote ( $searchword, '/' ) . "/iu", '<span  class="searchword" >' . $searchword . '</span>', $resmessage );
         }
         $this->author = $this->message->getAuthor();
         $this->topicAuthor = $this->topic->getAuthor();
         $this->topicTime = $this->topic->first_post_time;
         $this->subjectHtml = $ressubject;
         $this->messageHtml = $resmessage;
         $contents = $this->subLayout('Search/Results/Row')->setProperties($this->getProperties());
         echo $contents;
     }
 }
	/**
	 * Delete a user
	 *
	 * @access protected
	 * @param unknown_type $UserID
	 * @return boolean
	 */
	protected function _deleteUser($UserID) {
		// Sanitize parameters!
		$UserID = intval ( $UserID );
		$user = KunenaFactory::getUser($UserID);

		if ( !$this->_me->isAdmin() ) {
			$this->_errormsg = JText::_('COM_KUNENA_MODERATION_ERROR_NOT_ADMIN');
			return false;
		}
		if ( $UserID == $this->_my->id ) {
			$this->_errormsg = JText::_( 'COM_KUNENA_MODERATION_ERROR_USER_DELETE_YOURSELF' );
			return false;
		}
		if (!$UserID) {
			$this->_errormsg = JText::_( 'COM_KUNENA_MODERATION_ERROR_USER_DELETE_ANONYMOUS' );
			return false;
		}
		$user = JUser::getInstance($UserID);
		if (!$user->id) {
			$this->_errormsg = JText::_( 'COM_KUNENA_MODERATION_ERROR_USER_DELETE_NO_USER', $UserID );
			return false;
		}
		// Nobody can delete admins
		if ( $user->isAdmin() ) {
			$this->_errormsg = JText::_( 'COM_KUNENA_MODERATION_ERROR_USER_DELETE_ADMIN', $user->username );
			return false;
		}

		$user->delete();
		$this->_db->setQuery ( "DELETE FROM #__kunena_users WHERE `userid`={$this->_db->Quote($UserID)};" );
		$this->_db->query ();
		if (KunenaError::checkDatabaseError()) return false;

		return true;
	}
Exemplo n.º 12
0
	public function onUserAfterSave($user, $isnew, $success, $msg) {
		//Don't continue if the user wasn't stored succesfully
		if (! $success) {
			return false;
		}
		if ($isnew) {
			$user = KunenaFactory::getUser(intval($user ['id']));
			$user->save();
		}

		/*
		// See: http://www.kunena.org/forum/159-k-16-common-questions/63438-category-subscriptions-default-subscribed#63554
		// TODO: Subscribe user to every category if he is new and Kunena is configured to do so
		if ($isnew) {
			$subscribedCategories = '1,2,3,4,5,6,7,8,9,10';
			$db = Jfactory::getDBO();
			$query = "INSERT INTO #__kunena_user_categories (user_id,category_id)
				SELECT {$user->userid} AS user_id, c.id as category_id
				FROM #__kunena_categories AS c
				LEFT JOIN #__kunena_user_categories AS s ON c.id=s.category_id AND s.user_id={$user->userid}
				WHERE c.parent>0 AND c.id IN ({$subscribedCategories}) AND s.user_id IS NULL";
			$db->setQuery ( $query );
			$db->query ();
			KunenaError::checkDatabaseError();

			// Here's also query to subscribe all users (including blocked) to all existing cats:
			$query = "INSERT INTO #__kunena_user_categories (user_id,category_id)
				SELECT u.id AS user_id, c.id AS category_id
				FROM #__users AS u
				JOIN #__kunena_categories AS c ON c.parent>0
				LEFT JOIN #__kunena_user_categories AS s ON u.id=s.user_id
				WHERE c.id IN ({$subscribedCategories}) AND s.user_id IS NULL";
		}
		*/
	}
Exemplo n.º 13
0
 /**
  * Display module contents.
  */
 public final function display()
 {
     // Load CSS only once
     if (static::$css) {
         $this->document->addStyleSheet(JURI::root(true) . static::$css);
         static::$css = null;
     }
     // Use caching also for registered users if enabled.
     if ($this->params->get('owncache', 0)) {
         /** @var $cache JCacheControllerOutput */
         $cache = JFactory::getCache('com_kunena', 'output');
         $me = KunenaFactory::getUser();
         $cache->setLifeTime($this->params->get('cache_time', 180));
         $hash = md5(serialize($this->params));
         if ($cache->start("display.{$me->userid}.{$hash}", 'mod_kunenalatest')) {
             return;
         }
     }
     // Initialize Kunena.
     KunenaForum::setup();
     // Display module.
     $this->_display();
     // Store cached page.
     if (isset($cache)) {
         $cache->end();
     }
 }
Exemplo n.º 14
0
 function displayDefault($tpl = null)
 {
     if (!$this->config->enablerss) {
         JError::raiseError(404, JText::_('COM_KUNENA_RSS_DISABLED'));
     }
     KunenaHtmlParser::$relative = false;
     $this->category = $this->get('Category');
     if (!$this->category->authorise('read')) {
         JError::raiseError(404, $this->category->getError());
     }
     $this->topics = $this->get('Topics');
     $title = JText::_('COM_KUNENA_THREADS_IN_FORUM') . ': ' . $this->category->name;
     $this->setTitle($title);
     $metaDesc = $this->document->getDescription() . '. ' . $this->escape("{$this->category->name} - {$this->config->board_title}");
     $this->document->setDescription($metaDesc);
     // Create image for feed
     $image = new JFeedImage();
     $image->title = $this->document->getTitle();
     $image->url = $this->ktemplate->getImagePath('icons/rss.png');
     $image->description = $this->document->getDescription();
     $this->document->image = $image;
     foreach ($this->topics as $topic) {
         $description = $topic->last_post_message;
         $date = new JDate($topic->last_post_time);
         $userid = $topic->last_post_userid;
         $username = KunenaFactory::getUser($userid)->getName($topic->last_post_guest_name);
         $title = $topic->subject;
         $category = $topic->getCategory();
         $url = $topic->getUrl($category, true, 'last');
         $this->createItem($title, $url, $description, $category->name, $date, $userid, $username);
     }
 }
 /**
  * Test getInstance()
  *
  * @param KunenaForumTopicUser $topicuser
  * @return KunenaForumTopicUser
  * @depends testCreate
  */
 public function testGetInstance(KunenaForumTopicUser $topicuser)
 {
     $admin = KunenaFactory::getUser('admin');
     $topicuser2 = KunenaForumTopicUser::getInstance($topicuser->topic_id, $admin->userid);
     $this->assertSame($topicuser, $topicuser2);
     return $topicuser;
 }
Exemplo n.º 16
0
 public function _getURL($user, $sizex, $sizey)
 {
     if (!$user->userid == 0) {
         $user = KunenaFactory::getUser($user->userid);
         $user = JsnHelper::getUser($user->userid);
         if ($sizex <= 50) {
             $avatar = JURI::root(true) . '/' . $user->getValue('avatar_mini');
         } else {
             $avatar = JURI::root(true) . '/' . $user->getValue('avatar');
         }
     } elseif ($this->params->get('guestavatar', "easyprofile") == "easyprofile") {
         $avatar = JUri::root(true) . '/components/com_jsn/assets/img/default.jpg';
     } else {
         $db = JFactory::getDbo();
         $query = $db->getQuery(true);
         $query->select('params')->from('#__jsn_fields')->where('alias=\'avatar\'');
         $db->setQuery($query);
         $params = $db->loadResult();
         $registry = new JRegistry();
         $registry->loadString($params);
         $params = $registry->toArray();
         if ($params['image_defaultvalue'] != "") {
             $avatar = JUri::root(true) . '/' . $params['image_defaultvalue'];
         } else {
             $avatar = JUri::root(true) . '/components/com_jsn/assets/img/default.jpg';
         }
     }
     return $avatar;
 }
Exemplo n.º 17
0
	protected function populateState() {
		$app = JFactory::getApplication ();
		$params = $this->getParameters();
		$this->setState ( 'params', $params );
		$config = KunenaFactory::getConfig ();

		$active = $app->getMenu ()->getActive ();
		$active = $active ? (int) $active->id : 0;
		$layout = $this->getWord ( 'layout', 'default' );
		$this->setState ( 'layout', $layout );

		$userid = $this->getInt ( 'userid', -1 );
		if ($userid < 0) {
			$userid = KunenaFactory::getUser()->userid;
		} elseif($userid > 0) {
			$userid = KunenaFactory::getUser($userid)->userid;
		} else {
			$userid = 0;
		}
		$this->setState ( 'user', $userid );

		$mode = $this->getWord ( 'mode', 'default' );
		$this->setState ( 'list.mode', $mode );

		$catid = $this->getInt ( 'catid' );
		if ($catid) {
			$latestcategory = array($catid);
			$latestcategory_in = true;
		} else {
			$latestcategory = $params->get('topics_categories', $config->latestcategory );
			if (!is_array($latestcategory)) $latestcategory = explode ( ',', $latestcategory );
			if (empty($latestcategory) || in_array(0, $latestcategory)) {
				$latestcategory = false;
			}
			$latestcategory_in = (bool)$params->get('topics_catselection', $config->latestcategory_in);
		}
		$this->setState ( 'list.categories', $latestcategory );
		$this->setState ( 'list.categories.in', $latestcategory_in );

		$value = $this->getUserStateFromRequest ( "com_kunena.topics_{$active}_{$layout}_{$mode}_list_time", 'sel', $params->get('topics_time', $config->show_list_time), 'int' );
		$this->setState ( 'list.time', $value );

		// List state information
		$value = $this->getUserStateFromRequest ( "com_kunena.topics_{$active}_{$layout}_{$mode}_list_limit", 'limit', 0, 'int' );
		if ($value < 1) $value = $config->threads_per_page;
		$this->setState ( 'list.limit', $value );

		$value = $this->getUserStateFromRequest ( "com_kunena.topics_{$active}_{$layout}_{$mode}_list_ordering", 'filter_order', 'time', 'cmd' );
		//$this->setState ( 'list.ordering', $value );

		$value = $this->getUserStateFromRequest ( "com_kunena.topics_{$active}_{$layout}_{$mode}_list_start", 'limitstart', 0, 'int' );
		//$value = $this->getInt ( 'limitstart', 0 );
		$this->setState ( 'list.start', $value );

		$value = $this->getUserStateFromRequest ( "com_kunena.topics_{$active}_{$layout}_{$mode}_list_direction", 'filter_order_Dir', 'desc', 'word' );
		if ($value != 'asc')
			$value = 'desc';
		$this->setState ( 'list.direction', $value );
	}
Exemplo n.º 18
0
 public function showProfile($user, &$msg_params)
 {
     global $_PLUGINS;
     $kunenaConfig = KunenaFactory::getConfig();
     $user = KunenaFactory::getUser($user);
     $_PLUGINS->loadPluginGroup('user');
     return implode('', $_PLUGINS->trigger('forumSideProfile', array('kunena', null, $user->userid, array('config' => &$kunenaConfig, 'userprofile' => &$user, 'msg_params' => &$msg_params))));
 }
Exemplo n.º 19
0
 protected function _getURL($user, $sizex, $sizey)
 {
     $user = KunenaFactory::getUser($user);
     $gravatar = new KunenaGravatar($user->email);
     $gravatar->size = min($sizex, $sizey);
     $gravatar->rating = "G";
     return $gravatar;
 }
Exemplo n.º 20
0
	protected function _getURL($user, $sizex, $sizey) {
		$user = KunenaFactory::getUser($user);
		$gravatar = new KunenaGravatar($user->email);
		$gravatar->setAvatarSize(min($sizex, $sizey));
		$gravatar->setDefaultImage(false);
		$gravatar->setMaxRating('g');
		return $gravatar->buildGravatarURL( true );
	}
Exemplo n.º 21
0
 static function GetMyProfileLink($userid, $name = null, $rel = 'nofollow', $task = '', $class = '')
 {
     if (!$name) {
         $profile = KunenaFactory::getUser($userid);
         $name = htmlspecialchars($profile->getName(), ENT_COMPAT, 'UTF-8');
     }
     return self::GetHrefLink(self::GetMyProfileURL($userid, $task), $name, '', $rel, $class);
 }
Exemplo n.º 22
0
 function kunenaAvatar($userid)
 {
     $kunena_user = KunenaFactory::getUser((int) $userid);
     $username = $kunena_user->getName();
     // Takes care of realname vs username setting
     $avatarlink = $kunena_user->getAvatarLink('', $this->params->get('avatar_w'), $this->params->get('avatar_h'));
     return CKunenaLink::GetProfileLink($userid, $avatarlink, $username);
 }
Exemplo n.º 23
0
 /**
  * adds the link for the connect param
  * @since 1.7.3
  * @param  $user pass-by-reference
  * @return void
  */
 private function getUserLink(&$user)
 {
     $username = KunenaFactory::getUser($user['userid'])->getName();
     if ($user['leapcorrection'] == $this->timeo->format('z', true) + 1) {
         $subject = getSubject($username);
         $db = JFactory::getDBO();
         $query = "SELECT id,catid,subject,time as year FROM #__kunena_messages WHERE subject='{$subject}'";
         $db->setQuery($query, 0, 1);
         $post = $db->loadAssoc();
         if ($db->getErrorMsg()) {
             KunenaError::checkDatabaseError();
         }
         $catid = $this->params->get('bcatid');
         $postyear = new JDate($post['year'], $this->soffset);
         if (empty($post) && !empty($catid) || !empty($post) && !empty($catid) && $postyear->format('Y', true) < $this->timeo->format('Y', true)) {
             $botname = $this->params->get('swkbbotname', JText::_('SW_KBIRTHDAY_FORUMPOST_BOTNAME_DEF'));
             $botid = $this->params->get('swkbotid');
             $time = CKunenaTimeformat::internalTime();
             //Insert the birthday thread into DB
             $query = "INSERT INTO #__kunena_messages (catid,name,userid,email,subject,time, ip)\n\t\t    \t\tVALUES({$catid},'{$botname}',{$botid}, '','{$subject}', {$time}, '')";
             $db->setQuery($query);
             $db->query();
             if ($db->getErrorMsg()) {
                 KunenaError::checkDatabaseError();
             }
             //What ID get our thread?
             $messid = (int) $db->insertID();
             //Insert the thread message into DB
             $message = getMessage($username);
             $query = "INSERT INTO #__kunena_messages_text (mesid,message)\n                    VALUES({$messid},'{$message}')";
             $db->setQuery($query);
             $db->query();
             if ($db->getErrorMsg()) {
                 KunenaError::checkDatabaseError();
             }
             //We know the thread ID so we can update the parent thread id with it's own ID because we know it's
             //the first post
             $query = "UPDATE #__kunena_messages SET thread={$messid} WHERE id={$messid}";
             $db->setQuery($query);
             $db->query();
             if ($db->getErrorMsg()) {
                 KunenaError::checkDatabaseError();
             }
             // now increase the #s in categories
             CKunenaTools::modifyCategoryStats($messid, 0, $time, $catid);
             $user['link'] = CKunenaLink::GetViewLink('view', $messid, $catid, '', $username);
             $uri = JFactory::getURI();
             if ($uri->getVar('option') == 'com_kunena') {
                 $app =& JFactory::getApplication();
                 $app->redirect($uri->toString());
             }
         } elseif (!empty($post)) {
             $user['link'] = CKunenaLink::GetViewLink('view', $post['id'], $post['catid'], '', $username);
         }
     } else {
         $user['link'] = CKunenaLink::GetProfileLink($user['userid']);
     }
 }
Exemplo n.º 24
0
	protected function _getURL($user, $sizex, $sizey)
	{
		$user = KunenaFactory::getUser($user);
		// Get CUser object
		$user =& CFactory::getUser($user->userid);
		if ($sizex<=90)	$avatar = $user->getThumbAvatar();
		else $avatar = $user->getAvatar();
		return $avatar;
	}
Exemplo n.º 25
0
	public function getLastestCategories() {
		if ( $this->items === false ) {
			$this->items = array();
			$user = KunenaFactory::getUser();
			list($total,$categories) = KunenaForumCategoryHelper::getLatestSubscriptions($user->userid);
			$this->items = $categories;
		}
		return $this->items;
	}
Exemplo n.º 26
0
 public function getAvatar($profile)
 {
     $id = $profile->id;
     if (!$id) {
         $id = 0;
     }
     $user = KunenaFactory::getUser($id);
     $avatar = $user->getAvatarURL('kavatar');
     return $avatar;
 }
Exemplo n.º 27
0
	public function getProfileURL($user, $task='', $xhtml = true)
	{
		if ($user == 0) return false;
		$user = KunenaFactory::getUser($user);
		$my = JFactory::getUser();
		if ($user === false) return false;
		$userid = "&userid={$user->userid}";
		$do = $task ? '&do='.$task : '';
		return KunenaRoute::_("index.php?option=com_kunena&func=profile{$do}{$userid}", $xhtml);
	}
Exemplo n.º 28
0
 function __construct($userid = null)
 {
     $this->_config = KunenaFactory::getConfig();
     $this->_session = KunenaFactory::getSession();
     $this->_db = JFactory::getDBO();
     $this->_my = JFactory::getUser($userid);
     $this->_myuser = KunenaFactory::getUser($userid);
     $this->_app = JFactory::getApplication();
     $this->setError('-load-', JText::_('COM_KUNENA_POSTING_NOT_LOADED'));
 }
Exemplo n.º 29
0
	protected function __construct($db, $config) {
		kimport('kunena.forum.category.helper');
		$this->_db = $db;
		$this->_my = &JFactory::getUser ();
		$this->_me = KunenaFactory::getUser ();
		$this->_session = KunenaFactory::getSession ();
		// FIXME:
		$this->_allowed = array();
		$this->_ResetErrorMessage ();
		$this->_config = $config;
	}
Exemplo n.º 30
0
 public function _getURL($user, $sizex, $sizey)
 {
     if (!$user->userid == 0) {
         $user = KunenaFactory::getUser($user->userid);
         $user = EB::user($user->userid);
         $avatar = $user->getAvatar();
     } else {
         $avatar = JUri::root(true) . '/components/com_easyblog/assets/images/default_blogger.png';
     }
     return $avatar;
 }