Beispiel #1
0
	public function __construct() {
		$this->integration = KunenaIntegration::getInstance ('communitybuilder');
		if (! $this->integration || ! $this->integration->isLoaded())
			return;
		$this->joomlaAccess = KunenaIntegration::initialize ( 'access', 'joomla');
		$this->priority = 50;
	}
Beispiel #2
0
	public function __construct() {
		$this->integration = KunenaIntegration::getInstance ('communitybuilder');
		if (! $this->integration || ! $this->integration->isLoaded())
			return;
		$this->joomlalogin = KunenaLogin::getInstance('joomla');
		$this->priority = 50;
	}
Beispiel #3
0
	public function __construct() {
		$this->integration = KunenaIntegration::getInstance ( 'jomsocial' );
		if (! $this->integration || ! $this->integration->isLoaded ())
			return;
		$this->priority = 40;
		$this->_config = KunenaFactory::getConfig ();
	}
Beispiel #4
0
	public function __construct() {
		$this->integration = KunenaIntegration::getInstance ('jomsocial');
		if (! $this->integration || ! $this->integration->isLoaded())
			return;
		CFactory::load('libraries', 'messaging');
		$this->priority = 40;
	}
Beispiel #5
0
	static public function getInstance($integration = null) {
		KUNENA_PROFILER ? KunenaProfiler::instance()->start('function '.__CLASS__.'::'.__FUNCTION__.'()') : null;
		if (self::$instance === false) {
			if (! $integration) {
				$integration = KunenaFactory::getConfig ()->integration_access;
			}
			self::$instance = KunenaIntegration::initialize ( 'access', $integration );

			// Load administrators and moderators
			$cache = JFactory::getCache('com_kunena', 'output');
			$data = $cache->get(self::$cacheKey, 'com_kunena');
			if ($data) {
				$data = unserialize($data);
				self::$adminsByCatid = (array)$data['ac'];
				self::$adminsByUserid = (array)$data['au'];
				self::$moderatorsByCatid = (array)$data['mc'];
				self::$moderatorsByUserid = (array)$data['mu'];
			}
			//$my = JFactory::getUser();
			// If values were not cached (or users permissions have been changed), force reload
			if (!$data) { // || ($my->id && $my->authorize('com_kunena', 'administrator') == empty(self::$adminsByUserid[$my->id][0]) )) {
				self::$instance->clearCache();
			}
		}
		KUNENA_PROFILER ? KunenaProfiler::instance()->stop('function '.__CLASS__.'::'.__FUNCTION__.'()') : null;
		return self::$instance;
	}
Beispiel #6
0
 public function __construct()
 {
     $this->integration = KunenaIntegration::getInstance('jomsocial');
     if (!$this->integration || !$this->integration->isLoaded()) {
         return;
     }
     $this->priority = 50;
 }
Beispiel #7
0
	public function __construct() {
		$this->integration = KunenaIntegration::getInstance ('uddeim');
		if (! $this->integration || ! $this->integration->isLoaded())
			return;
		$this->uddeim = new uddeIMAPI();
		if ($this->uddeim->version() < 1) return;
		$this->priority = 40;
	}
Beispiel #8
0
	static public function getInstance($integration = null) {
		if (self::$instance === false) {
			$config = KunenaFactory::getConfig ();
			if (! $integration)
				$integration = $config->integration_login;
			self::$instance = KunenaIntegration::initialize ( 'login', $integration );
		}
		return self::$instance;
	}
Beispiel #9
0
	static public function getConfigOptions($name) {
		$config = KunenaFactory::getConfig ();
		$options = KunenaIntegration::detectIntegration($name);
		$integration = 'integration_' . $name;
		if (isset($options['none'])) {
			 $none = $options['none'];
			 unset ($options['none']);
		}

		$opt[] = JHTML::_('select.option', 'auto',JText::_('COM_KUNENA_INTEGRATION_AUTO'));
		foreach ($options as $component=>$status) {
			if ($component == 'joomla15' || $component == 'joomla16') {
				if (!$status) continue;
				$component = 'joomla';
			}

			$opt[] = JHTML::_('select.option', $component, JText::_('COM_KUNENA_INTEGRATION_'.strtoupper($component)), 'value', 'text', !$status);
		}
		if (isset($none)) {
			$opt[] = JHTML::_('select.option', 'none', JText::_('COM_KUNENA_INTEGRATION_NONE'), 'value', 'text', !$none);
		}
		return JHTML::_('select.genericlist', $opt, 'cfg_'.$integration, 'class="inputbox" size="1"', 'value', 'text', $config->$integration);
	}
Beispiel #10
0
	function GetMyProfileURL($userid = 0, $task = '', $xhtml = true, $extra = '') {
		if (!$task) {
			// Workaround for menu redirect: be more verbose
			kimport('kunena.integration');
			$profileIntegration = KunenaIntegration::detectIntegration('profile', true);
			if ($profileIntegration != 'kunena') $task='summary';
		}
		$my = JFactory::getUser();
		if ($userid && $userid!=$my->id) $userid = "&userid=$userid";
		else $userid = '';
		if ($task) $task = "&do=$task";
		return KunenaRoute::_ ( "index.php?option=com_kunena&view=profile{$userid}{$task}{$extra}", $xhtml );
	}
Beispiel #11
0
function showConfig($option)
{
    require_once KUNENA_PATH_LIB . '/kunena.timeformat.class.php';
    $kunena_db =& JFactory::getDBO();
    $kunena_config = KunenaFactory::getConfig();
    $lists = array();
    // options to be used later
    $rss_yesno = array();
    $rss_yesno[] = JHTML::_('select.option', '0', JText::_('COM_KUNENA_A_NO'));
    $rss_yesno[] = JHTML::_('select.option', '1', JText::_('COM_KUNENA_A_YES'));
    // ------
    $rss_type = array();
    $rss_type[] = JHTML::_('select.option', 'post', JText::_('COM_KUNENA_A_RSS_TYPE_POST'));
    $rss_type[] = JHTML::_('select.option', 'topic', JText::_('COM_KUNENA_A_RSS_TYPE_TOPIC'));
    $rss_type[] = JHTML::_('select.option', 'recent', JText::_('COM_KUNENA_A_RSS_TYPE_RECENT'));
    // build the html select list
    $lists['rss_type'] = JHTML::_('select.genericlist', $rss_type, 'cfg_rss_type', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->rss_type);
    // ------
    $rss_timelimit = array();
    $rss_timelimit[] = JHTML::_('select.option', 'week', JText::_('COM_KUNENA_A_RSS_TIMELIMIT_WEEK'));
    $rss_timelimit[] = JHTML::_('select.option', 'month', JText::_('COM_KUNENA_A_RSS_TIMELIMIT_MONTH'));
    $rss_timelimit[] = JHTML::_('select.option', 'year', JText::_('COM_KUNENA_A_RSS_TIMELIMIT_YEAR'));
    // build the html select list
    $lists['rss_timelimit'] = JHTML::_('select.genericlist', $rss_timelimit, 'cfg_rss_timelimit', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->rss_timelimit);
    // ------
    $rss_specification = array();
    $rss_specification[] = JHTML::_('select.option', 'rss0.91', 'RSS 0.91');
    $rss_specification[] = JHTML::_('select.option', 'rss1.0', 'RSS 1.0');
    $rss_specification[] = JHTML::_('select.option', 'rss2.0', 'RSS 2.0');
    $rss_specification[] = JHTML::_('select.option', 'atom1.0', 'Atom 1.0');
    // build the html select list
    $lists['rss_specification'] = JHTML::_('select.genericlist', $rss_specification, 'cfg_rss_specification', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->rss_specification);
    // ------
    $rss_author_format = array();
    $rss_author_format[] = JHTML::_('select.option', 'name', JText::_('COM_KUNENA_A_RSS_AUTHOR_FORMAT_NAME'));
    $rss_author_format[] = JHTML::_('select.option', 'email', JText::_('COM_KUNENA_A_RSS_AUTHOR_FORMAT_EMAIL'));
    $rss_author_format[] = JHTML::_('select.option', 'both', JText::_('COM_KUNENA_A_RSS_AUTHOR_FORMAT_BOTH'));
    // build the html select list
    $lists['rss_author_format'] = JHTML::_('select.genericlist', $rss_author_format, 'cfg_rss_author_format', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->rss_author_format);
    // ------
    // build the html select list
    $lists['rss_author_in_title'] = JHTML::_('select.genericlist', $rss_yesno, 'cfg_rss_author_in_title', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->rss_author_in_title);
    // ------
    $rss_word_count = array();
    $rss_word_count[] = JHTML::_('select.option', '0', JText::_('COM_KUNENA_A_RSS_WORD_COUNT_ALL'));
    $rss_word_count[] = JHTML::_('select.option', '50', '50');
    $rss_word_count[] = JHTML::_('select.option', '100', '100');
    $rss_word_count[] = JHTML::_('select.option', '250', '250');
    $rss_word_count[] = JHTML::_('select.option', '500', '500');
    $rss_word_count[] = JHTML::_('select.option', '750', '750');
    $rss_word_count[] = JHTML::_('select.option', '1000', '1000');
    // build the html select list
    $lists['rss_word_count'] = JHTML::_('select.genericlist', $rss_word_count, 'cfg_rss_word_count', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->rss_word_count);
    // ------
    // build the html select list
    $lists['rss_allow_html'] = JHTML::_('select.genericlist', $rss_yesno, 'cfg_rss_allow_html', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->rss_allow_html);
    // ------
    // build the html select list
    $lists['rss_old_titles'] = JHTML::_('select.genericlist', $rss_yesno, 'cfg_rss_old_titles', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->rss_old_titles);
    // ------
    $rss_cache = array();
    $rss_cache[] = JHTML::_('select.option', '0', '0');
    // disable
    $rss_cache[] = JHTML::_('select.option', '60', '1');
    $rss_cache[] = JHTML::_('select.option', '300', '5');
    $rss_cache[] = JHTML::_('select.option', '900', '15');
    $rss_cache[] = JHTML::_('select.option', '1800', '30');
    $rss_cache[] = JHTML::_('select.option', '3600', '60');
    $lists['rss_cache'] = JHTML::_('select.genericlist', $rss_cache, 'cfg_rss_cache', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->rss_cache);
    // ------
    // build the html select list - (moved enablerss here, to keep all rss-related features together)
    $lists['enablerss'] = JHTML::_('select.genericlist', $rss_yesno, 'cfg_enablerss', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->enablerss);
    // build the html select list
    // make a standard yes/no list
    $yesno = array();
    $yesno[] = JHTML::_('select.option', '0', JText::_('COM_KUNENA_A_NO'));
    $yesno[] = JHTML::_('select.option', '1', JText::_('COM_KUNENA_A_YES'));
    $lists['jmambot'] = JHTML::_('select.genericlist', $yesno, 'cfg_jmambot', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->jmambot);
    $lists['disemoticons'] = JHTML::_('select.genericlist', $yesno, 'cfg_disemoticons', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->disemoticons);
    $lists['regonly'] = JHTML::_('select.genericlist', $yesno, 'cfg_regonly', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->regonly);
    $lists['board_offline'] = JHTML::_('select.genericlist', $yesno, 'cfg_board_offline', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->board_offline);
    $lists['pubwrite'] = JHTML::_('select.genericlist', $yesno, 'cfg_pubwrite', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->pubwrite);
    $lists['useredit'] = JHTML::_('select.genericlist', $yesno, 'cfg_useredit', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->useredit);
    $lists['showhistory'] = JHTML::_('select.genericlist', $yesno, 'cfg_showhistory', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->showhistory);
    $lists['showannouncement'] = JHTML::_('select.genericlist', $yesno, 'cfg_showannouncement', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->showannouncement);
    $lists['avataroncat'] = JHTML::_('select.genericlist', $yesno, 'cfg_avataroncat', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->avataroncat);
    $lists['showchildcaticon'] = JHTML::_('select.genericlist', $yesno, 'cfg_showchildcaticon', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->showchildcaticon);
    $lists['showuserstats'] = JHTML::_('select.genericlist', $yesno, 'cfg_showuserstats', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->showuserstats);
    $lists['showwhoisonline'] = JHTML::_('select.genericlist', $yesno, 'cfg_showwhoisonline', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->showwhoisonline);
    $lists['showpopsubjectstats'] = JHTML::_('select.genericlist', $yesno, 'cfg_showpopsubjectstats', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->showpopsubjectstats);
    $lists['showgenstats'] = JHTML::_('select.genericlist', $yesno, 'cfg_showgenstats', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->showgenstats);
    $lists['showpopuserstats'] = JHTML::_('select.genericlist', $yesno, 'cfg_showpopuserstats', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->showpopuserstats);
    $lists['subscriptionschecked'] = JHTML::_('select.genericlist', $yesno, 'cfg_subscriptionschecked', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->subscriptionschecked);
    $lists['allowfavorites'] = JHTML::_('select.genericlist', $yesno, 'cfg_allowfavorites', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->allowfavorites);
    $lists['mailmod'] = JHTML::_('select.genericlist', $yesno, 'cfg_mailmod', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->mailmod);
    $lists['mailadmin'] = JHTML::_('select.genericlist', $yesno, 'cfg_mailadmin', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->mailadmin);
    $lists['showemail'] = JHTML::_('select.genericlist', $yesno, 'cfg_showemail', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->showemail);
    $lists['askemail'] = JHTML::_('select.genericlist', $yesno, 'cfg_askemail', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->askemail);
    $lists['changename'] = JHTML::_('select.genericlist', $yesno, 'cfg_changename', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->changename);
    $lists['allowavatarupload'] = JHTML::_('select.genericlist', $yesno, 'cfg_allowavatarupload', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->allowavatarupload);
    $lists['allowavatargallery'] = JHTML::_('select.genericlist', $yesno, 'cfg_allowavatargallery', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->allowavatargallery);
    $lists['showstats'] = JHTML::_('select.genericlist', $yesno, 'cfg_showstats', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->showstats);
    $lists['showranking'] = JHTML::_('select.genericlist', $yesno, 'cfg_showranking', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->showranking);
    $lists['rankimages'] = JHTML::_('select.genericlist', $yesno, 'cfg_rankimages', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->rankimages);
    $lists['username'] = JHTML::_('select.genericlist', $yesno, 'cfg_username', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->username);
    $lists['shownew'] = JHTML::_('select.genericlist', $yesno, 'cfg_shownew', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->shownew);
    $lists['allowimageupload'] = JHTML::_('select.genericlist', $yesno, 'cfg_allowimageupload', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->allowimageupload);
    $lists['allowimageregupload'] = JHTML::_('select.genericlist', $yesno, 'cfg_allowimageregupload', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->allowimageregupload);
    $lists['allowfileupload'] = JHTML::_('select.genericlist', $yesno, 'cfg_allowfileupload', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->allowfileupload);
    $lists['allowfileregupload'] = JHTML::_('select.genericlist', $yesno, 'cfg_allowfileregupload', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->allowfileregupload);
    $lists['editmarkup'] = JHTML::_('select.genericlist', $yesno, 'cfg_editmarkup', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->editmarkup);
    $lists['showkarma'] = JHTML::_('select.genericlist', $yesno, 'cfg_showkarma', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->showkarma);
    $lists['enablepdf'] = JHTML::_('select.genericlist', $yesno, 'cfg_enablepdf', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->enablepdf);
    $lists['enableforumjump'] = JHTML::_('select.genericlist', $yesno, 'cfg_enableforumjump', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->enableforumjump);
    $lists['userlist_online'] = JHTML::_('select.genericlist', $yesno, 'cfg_userlist_online', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->userlist_online);
    $lists['userlist_avatar'] = JHTML::_('select.genericlist', $yesno, 'cfg_userlist_avatar', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->userlist_avatar);
    $lists['userlist_name'] = JHTML::_('select.genericlist', $yesno, 'cfg_userlist_name', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->userlist_name);
    $lists['userlist_username'] = JHTML::_('select.genericlist', $yesno, 'cfg_userlist_username', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->userlist_username);
    $lists['userlist_posts'] = JHTML::_('select.genericlist', $yesno, 'cfg_userlist_posts', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->userlist_posts);
    $lists['userlist_karma'] = JHTML::_('select.genericlist', $yesno, 'cfg_userlist_karma', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->userlist_karma);
    $lists['userlist_email'] = JHTML::_('select.genericlist', $yesno, 'cfg_userlist_email', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->userlist_email);
    $lists['userlist_usertype'] = JHTML::_('select.genericlist', $yesno, 'cfg_userlist_usertype', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->userlist_usertype);
    $lists['userlist_joindate'] = JHTML::_('select.genericlist', $yesno, 'cfg_userlist_joindate', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->userlist_joindate);
    $lists['userlist_lastvisitdate'] = JHTML::_('select.genericlist', $yesno, 'cfg_userlist_lastvisitdate', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->userlist_lastvisitdate);
    $lists['userlist_userhits'] = JHTML::_('select.genericlist', $yesno, 'cfg_userlist_userhits', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->userlist_userhits);
    $lists['usernamechange'] = JHTML::_('select.genericlist', $yesno, 'cfg_usernamechange', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->usernamechange);
    $lists['reportmsg'] = JHTML::_('select.genericlist', $yesno, 'cfg_reportmsg', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->reportmsg);
    $lists['captcha'] = JHTML::_('select.genericlist', $yesno, 'cfg_captcha', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->captcha);
    $lists['mailfull'] = JHTML::_('select.genericlist', $yesno, 'cfg_mailfull', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->mailfull);
    // New for 1.0.5
    $lists['showspoilertag'] = JHTML::_('select.genericlist', $yesno, 'cfg_showspoilertag', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->showspoilertag);
    $lists['showvideotag'] = JHTML::_('select.genericlist', $yesno, 'cfg_showvideotag', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->showvideotag);
    $lists['showebaytag'] = JHTML::_('select.genericlist', $yesno, 'cfg_showebaytag', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->showebaytag);
    $lists['trimlongurls'] = JHTML::_('select.genericlist', $yesno, 'cfg_trimlongurls', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->trimlongurls);
    $lists['autoembedyoutube'] = JHTML::_('select.genericlist', $yesno, 'cfg_autoembedyoutube', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->autoembedyoutube);
    $lists['autoembedebay'] = JHTML::_('select.genericlist', $yesno, 'cfg_autoembedebay', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->autoembedebay);
    $lists['highlightcode'] = JHTML::_('select.genericlist', $yesno, 'cfg_highlightcode', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->highlightcode);
    // New for 1.5.8 -> SEF
    $lists['sef'] = JHTML::_('select.genericlist', $yesno, 'cfg_sef', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->sef);
    $lists['sefcats'] = JHTML::_('select.genericlist', $yesno, 'cfg_sefcats', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->sefcats);
    $lists['sefutf8'] = JHTML::_('select.genericlist', $yesno, 'cfg_sefutf8', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->sefutf8);
    // New for 1.6 -> Hide images and files for guests
    $lists['showimgforguest'] = JHTML::_('select.genericlist', $yesno, 'cfg_showimgforguest', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->showimgforguest);
    $lists['showfileforguest'] = JHTML::_('select.genericlist', $yesno, 'cfg_showfileforguest', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->showfileforguest);
    // New for 1.6 -> Check Image MIME types
    $lists['checkmimetypes'] = JHTML::_('select.genericlist', $yesno, 'cfg_checkmimetypes', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->checkmimetypes);
    //New for 1.6 -> Poll
    $lists['pollallowvoteone'] = JHTML::_('select.genericlist', $yesno, 'cfg_pollallowvoteone', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->pollallowvoteone);
    $lists['pollenabled'] = JHTML::_('select.genericlist', $yesno, 'cfg_pollenabled', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->pollenabled);
    $lists['showpoppollstats'] = JHTML::_('select.genericlist', $yesno, 'cfg_showpoppollstats', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->showpoppollstats);
    $lists['pollresultsuserslist'] = JHTML::_('select.genericlist', $yesno, 'cfg_pollresultsuserslist', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->pollresultsuserslist);
    //New for 1.6 -> Choose ordering system
    $ordering_system_list = array();
    $ordering_system_list[] = JHTML::_('select.option', 'mesid', JText::_('COM_KUNENA_COM_A_ORDERING_SYSTEM_NEW'));
    $ordering_system_list[] = JHTML::_('select.option', 'replyid', JText::_('COM_KUNENA_COM_A_ORDERING_SYSTEM_OLD'));
    $lists['ordering_system'] = JHTML::_('select.genericlist', $ordering_system_list, 'cfg_ordering_system', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->ordering_system);
    // New for 1.6: datetime
    require_once KUNENA_PATH_LIB . '/kunena.timeformat.class.php';
    $dateformatlist = array();
    $time = CKunenaTimeformat::internalTime() - 80000;
    $dateformatlist[] = JHTML::_('select.option', 'none', JText::_('COM_KUNENA_OPTION_DATEFORMAT_NONE'));
    $dateformatlist[] = JHTML::_('select.option', 'ago', CKunenaTimeformat::showDate($time, 'ago'));
    $dateformatlist[] = JHTML::_('select.option', 'datetime_today', CKunenaTimeformat::showDate($time, 'datetime_today'));
    $dateformatlist[] = JHTML::_('select.option', 'datetime', CKunenaTimeformat::showDate($time, 'datetime'));
    $lists['post_dateformat'] = JHTML::_('select.genericlist', $dateformatlist, 'cfg_post_dateformat', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->post_dateformat);
    $lists['post_dateformat_hover'] = JHTML::_('select.genericlist', $dateformatlist, 'cfg_post_dateformat_hover', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->post_dateformat_hover);
    // New for 1.6: hide ip
    $lists['hide_ip'] = JHTML::_('select.genericlist', $yesno, 'cfg_hide_ip', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->hide_ip);
    //New for 1.6: choose if you want that ghost message box checked by default
    $lists['boxghostmessage'] = JHTML::_('select.genericlist', $yesno, 'cfg_boxghostmessage', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->boxghostmessage);
    // New for 1.6 -> Thank you button
    $lists['showthankyou'] = JHTML::_('select.genericlist', $yesno, 'cfg_showthankyou', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->showthankyou);
    kimport('integration.integration');
    $lists['integration_access'] = KunenaIntegration::getConfigOptions('access');
    $lists['integration_activity'] = KunenaIntegration::getConfigOptions('activity');
    $lists['integration_avatar'] = KunenaIntegration::getConfigOptions('avatar');
    $lists['integration_login'] = KunenaIntegration::getConfigOptions('login');
    $lists['integration_profile'] = KunenaIntegration::getConfigOptions('profile');
    $lists['integration_private'] = KunenaIntegration::getConfigOptions('private');
    $listUserDeleteMessage = array();
    $listUserDeleteMessage[] = JHTML::_('select.option', '0', JText::_('COM_KUNENA_A_DELETEMESSAGE_NOT_ALLOWED'));
    $listUserDeleteMessage[] = JHTML::_('select.option', '1', JText::_('COM_KUNENA_A_DELETEMESSAGE_ALLOWED_IF_REPLIES'));
    $listUserDeleteMessage[] = JHTML::_('select.option', '2', JText::_('COM_KUNENA_A_DELETEMESSAGE_ALWAYS_ALLOWED'));
    $lists['userdeletetmessage'] = JHTML::_('select.genericlist', $listUserDeleteMessage, 'cfg_userdeletetmessage', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->userdeletetmessage);
    $latestCategoryIn = array();
    $latestCategoryIn[] = JHTML::_('select.option', '0', JText::_('COM_KUNENA_COM_A_LATESTCATEGORY_IN_HIDE'));
    $latestCategoryIn[] = JHTML::_('select.option', '1', JText::_('COM_KUNENA_COM_A_LATESTCATEGORY_IN_SHOW'));
    $lists['latestcategory_in'] = JHTML::_('select.genericlist', $latestCategoryIn, 'cfg_latestcategory_in', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->latestcategory_in);
    $optionsShowHide = array();
    $optionsShowHide[] = JHTML::_('select.option', 0, JText::_('COM_KUNENA_COM_A_LATESTCATEGORY_SHOWALL'));
    $lists['latestcategory'] = CKunenaTools::KSelectList('cfg_latestcategory[]', $optionsShowHide, 'class="inputbox" multiple="multiple"', false, 'latestcategory', explode(',', $kunena_config->latestcategory));
    $lists['topicicons'] = JHTML::_('select.genericlist', $yesno, 'cfg_topicicons', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->topicicons);
    $lists['onlineusers'] = JHTML::_('select.genericlist', $yesno, 'cfg_onlineusers', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->onlineusers);
    $lists['debug'] = JHTML::_('select.genericlist', $yesno, 'cfg_debug', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->debug);
    $lists['showbannedreason'] = JHTML::_('select.genericlist', $yesno, 'cfg_showbannedreason', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->showbannedreason);
    $lists['version_check'] = JHTML::_('select.genericlist', $yesno, 'cfg_version_check', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->version_check);
    $lists['showpopthankyoustats'] = JHTML::_('select.genericlist', $yesno, 'cfg_showpopthankyoustats', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->showpopthankyoustats);
    $seerestoredeleted = array();
    $seerestoredeleted[] = JHTML::_('select.option', 2, JText::_('COM_KUNENA_A_SEE_RESTORE_DELETED_NOBODY'));
    $seerestoredeleted[] = JHTML::_('select.option', 0, JText::_('COM_KUNENA_A_SEE_RESTORE_DELETED_ADMINS'));
    $seerestoredeleted[] = JHTML::_('select.option', 1, JText::_('COM_KUNENA_A_SEE_RESTORE_DELETED_ADMINSMODS'));
    $lists['mod_see_deleted'] = JHTML::_('select.genericlist', $seerestoredeleted, 'cfg_mod_see_deleted', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->mod_see_deleted);
    $listBbcodeImgSecure = array();
    $listBbcodeImgSecure[] = JHTML::_('select.option', 'text', JText::_('COM_KUNENA_COM_A_BBCODE_IMG_SECURE_OPTION_TEXT'));
    $listBbcodeImgSecure[] = JHTML::_('select.option', 'link', JText::_('COM_KUNENA_COM_A_BBCODE_IMG_SECURE_OPTION_LINK'));
    $listBbcodeImgSecure[] = JHTML::_('select.option', 'image', JText::_('COM_KUNENA_COM_A_BBCODE_IMG_SECURE_OPTION_IMAGE'));
    $lists['bbcode_img_secure'] = JHTML::_('select.genericlist', $listBbcodeImgSecure, 'cfg_bbcode_img_secure', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->bbcode_img_secure);
    $lists['listcat_show_moderators'] = JHTML::_('select.genericlist', $yesno, 'cfg_listcat_show_moderators', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->listcat_show_moderators);
    $showlightbox = $yesno;
    $showlightbox[] = JHTML::_('select.option', 2, JText::_('COM_KUNENA_A_LIGHTBOX_NO_JS'));
    $lists['lightbox'] = JHTML::_('select.genericlist', $showlightbox, 'cfg_lightbox', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->lightbox);
    $timesel[] = JHTML::_('select.option', 0, JText::_('COM_KUNENA_SHOW_LASTVISIT'));
    $timesel[] = JHTML::_('select.option', 4, JText::_('COM_KUNENA_SHOW_4_HOURS'));
    $timesel[] = JHTML::_('select.option', 8, JText::_('COM_KUNENA_SHOW_8_HOURS'));
    $timesel[] = JHTML::_('select.option', 12, JText::_('COM_KUNENA_SHOW_12_HOURS'));
    $timesel[] = JHTML::_('select.option', 24, JText::_('COM_KUNENA_SHOW_24_HOURS'));
    $timesel[] = JHTML::_('select.option', 48, JText::_('COM_KUNENA_SHOW_48_HOURS'));
    $timesel[] = JHTML::_('select.option', 168, JText::_('COM_KUNENA_SHOW_WEEK'));
    $timesel[] = JHTML::_('select.option', 720, JText::_('COM_KUNENA_SHOW_MONTH'));
    $timesel[] = JHTML::_('select.option', 8760, JText::_('COM_KUNENA_SHOW_YEAR'));
    // build the html select list
    $lists['show_list_time'] = JHTML::_('select.genericlist', $timesel, 'cfg_show_list_time', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->show_list_time);
    $sessiontimetype[] = JHTML::_('select.option', 0, JText::_('COM_KUNENA_SHOW_SESSION_TYPE_ALL'));
    $sessiontimetype[] = JHTML::_('select.option', 1, JText::_('COM_KUNENA_SHOW_SESSION_TYPE_VALID'));
    $sessiontimetype[] = JHTML::_('select.option', 2, JText::_('COM_KUNENA_SHOW_SESSION_TYPE_TIME'));
    $lists['show_session_type'] = JHTML::_('select.genericlist', $sessiontimetype, 'cfg_show_session_type', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->show_session_type);
    $userlist_allowed = array();
    $userlist_allowed[] = JHTML::_('select.option', '1', JText::_('COM_KUNENA_A_NO'));
    $userlist_allowed[] = JHTML::_('select.option', '0', JText::_('COM_KUNENA_A_YES'));
    $lists['userlist_allowed'] = JHTML::_('select.genericlist', $userlist_allowed, 'cfg_userlist_allowed', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->userlist_allowed);
    $lists['pubprofile'] = JHTML::_('select.genericlist', $yesno, 'cfg_pubprofile', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->pubprofile);
    $userlist_count_users[] = JHTML::_('select.option', 0, JText::_('COM_KUNENA_SHOW_USERLIST_COUNTUNSERS_ALL'));
    $userlist_count_users[] = JHTML::_('select.option', 1, JText::_('COM_KUNENA_SHOW_USERLIST_COUNTUNSERS_ACTIVATED_ACCOUNT'));
    $userlist_count_users[] = JHTML::_('select.option', 2, JText::_('COM_KUNENA_SHOW_USERLIST_COUNTUNSERS_ACTIVE'));
    $userlist_count_users[] = JHTML::_('select.option', 3, JText::_('COM_KUNENA_SHOW_USERLIST_COUNTUNSERS_NON_BLOCKED_USERS'));
    $lists['userlist_count_users'] = JHTML::_('select.genericlist', $userlist_count_users, 'cfg_userlist_count_users', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->userlist_count_users);
    // Added new options into K1.6.4
    $lists['allowsubscriptions'] = JHTML::_('select.genericlist', $yesno, 'cfg_allowsubscriptions', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->allowsubscriptions);
    $category_subscriptions = array();
    $category_subscriptions[] = JHTML::_('select.option', 'disabled', JText::_('COM_KUNENA_OPTION_CATEGORY_SUBSCRIPTIONS_DISABLED'));
    $category_subscriptions[] = JHTML::_('select.option', 'topic', JText::_('COM_KUNENA_OPTION_CATEGORY_SUBSCRIPTIONS_TOPIC'));
    $category_subscriptions[] = JHTML::_('select.option', 'post', JText::_('COM_KUNENA_OPTION_CATEGORY_SUBSCRIPTIONS_POST'));
    $lists['category_subscriptions'] = JHTML::_('select.genericlist', $category_subscriptions, 'cfg_category_subscriptions', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->category_subscriptions);
    $topic_subscriptions = array();
    $topic_subscriptions[] = JHTML::_('select.option', 'disabled', JText::_('COM_KUNENA_OPTION_TOPIC_SUBSCRIPTIONS_DISABLED'));
    $topic_subscriptions[] = JHTML::_('select.option', 'first', JText::_('COM_KUNENA_OPTION_TOPIC_SUBSCRIPTIONS_FIRST'));
    $topic_subscriptions[] = JHTML::_('select.option', 'every', JText::_('COM_KUNENA_OPTION_TOPIC_SUBSCRIPTIONS_EVERY'));
    $lists['topic_subscriptions'] = JHTML::_('select.genericlist', $topic_subscriptions, 'cfg_topic_subscriptions', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->topic_subscriptions);
    // Added new options into K1.6.6
    $email_recipient_privacy = array();
    $email_recipient_privacy[] = JHTML::_('select.option', 'to', JText::_('COM_KUNENA_A_SUBSCRIPTIONS_EMAIL_RECIPIENT_PRIVACY_OPTION_TO'));
    $email_recipient_privacy[] = JHTML::_('select.option', 'cc', JText::_('COM_KUNENA_A_SUBSCRIPTIONS_EMAIL_RECIPIENT_PRIVACY_OPTION_CC'));
    $email_recipient_privacy[] = JHTML::_('select.option', 'bcc', JText::_('COM_KUNENA_A_SUBSCRIPTIONS_EMAIL_RECIPIENT_PRIVACY_OPTION_BCC'));
    $lists['email_recipient_privacy'] = JHTML::_('select.genericlist', $email_recipient_privacy, 'cfg_email_recipient_privacy', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->email_recipient_privacy);
    $recaptcha_theme = array();
    $recaptcha_theme[] = JHTML::_('select.option', 'red', JText::_('COM_KUNENA_A_RECAPTCHA_THEME_OPTION_RED'));
    $recaptcha_theme[] = JHTML::_('select.option', 'white', JText::_('COM_KUNENA_A_RECAPTCHA_THEME_OPTION_WHITE'));
    $recaptcha_theme[] = JHTML::_('select.option', 'blackglass', JText::_('COM_KUNENA_A_RECAPTCHA_THEME_OPTION_BLACK'));
    $recaptcha_theme[] = JHTML::_('select.option', 'clean', JText::_('COM_KUNENA_A_RECAPTCHA_THEME_OPTION_CLEAN'));
    $lists['recaptcha_theme'] = JHTML::_('select.genericlist', $recaptcha_theme, 'cfg_recaptcha_theme', 'class="inputbox" size="1"', 'value', 'text', $kunena_config->recaptcha_theme);
    html_Kunena::showConfig($kunena_config, $lists, $option);
}
Beispiel #12
0
 private function getBirthdayUser()
 {
     $from = $this->timeo->format('z', true) + 1;
     $to = $this->datemaxo->format('z', true) + 1;
     if ($this->integration == 'auto') {
         $this->integration = KunenaIntegration::detectIntegration('profile', true);
     }
     $db = JFactory::getDBO();
     $query = $db->getQuery(true);
     $query->select('b.username');
     $query->select('b.name');
     $query->select('b.id AS userid');
     $jomsocial = '';
     if ($this->integration === 'jomsocial') {
         $birthdate = 'value';
         $fromtable = '#__community_fields_values';
         $jomsocial = ' AND a.field_id = 3 ';
         $userid = 'user_id';
     } elseif ($this->integration === 'communitybuilder') {
         //get the list of user birthdays
         $cbfield = $this->params->get('swkbcbfield', 'cb_birthday');
         $birthdate = $db->getEscaped($cbfield);
         $fromtable = '#__comprofiler';
         $userid = 'id';
     } else {
         $birthdate = 'birthdate';
         $fromtable = '#__kunena_users';
         $userid = 'userid';
     }
     $query->select('YEAR(a.' . $birthdate . ') AS year');
     $query->select('MONTH(a.' . $birthdate . ') AS month');
     $query->select('DAYOFMONTH(a.' . $birthdate . ') AS day');
     $query->select('DATEDIFF(DATE(a.' . $birthdate . ') +
                     INTERVAL(YEAR(CURDATE()) - YEAR(a.' . $birthdate . ') + (RIGHT(CURDATE(),5)>RIGHT(DATE(a.' . $birthdate . '),5)))
                     YEAR, CURDATE()) AS till');
     if ($this->params->get('displayage')) {
         $query->select('(YEAR(CURDATE()) - YEAR(a.' . $birthdate . ') + (DAYOFYEAR(CURDATE())>DAYOFYEAR(a.' . $birthdate . '))) AS age');
     }
     $query->from($fromtable . ' AS a');
     $query->innerJoin('#__users AS b ON a.' . $userid . ' = b.id' . $jomsocial);
     $query->where('(DAYOFYEAR(a.' . $birthdate . ')>=' . $db->getEscaped($from));
     if ($from > $to || $this->btimeline >= 365) {
         $query->where('DAYOFYEAR(a.' . $birthdate . ')<=366) OR (DAYOFYEAR(a.' . $birthdate . ')>=0');
         $query->where('DAYOFYEAR(a.' . $birthdate . ')<=' . $db->getEscaped($to) . ')');
     } else {
         $query->where('DAYOFYEAR(a.' . $birthdate . ')<=' . $db->getEscaped($to) . ')');
     }
     $query->order('till');
     if ($this->username == 0) {
         $order = 'name';
     } else {
         $order = 'username';
     }
     $query->order($db->getEscaped($order));
     $db->setQuery($query, 0, $this->params->get('limit'));
     $res = $db->loadAssocList();
     //die();
     if ($db->getErrorMsg()) {
         KunenaError::checkDatabaseError();
         if ($this->integration === 'communitybuilder') {
             $this->app->enqueueMessage(JText::_('SW_KBIRTHDAY_NOCBFIELD_IF'), 'error');
         }
     }
     if (!empty($res)) {
         //setting up the right birthdate
         $todayyear = $this->timeo->format('Y', true);
         foreach ($res as $k => $v) {
             if ($v['year'] == 1 || empty($v['year'])) {
                 unset($res[$k]);
             } else {
                 $res[$k]['birthdate'] = new JDate(mktime(0, 0, 0, $v['month'], $v['day'], $v['year']), $this->soffset);
                 $res[$k]['leapcorrection'] = $res[$k]['birthdate']->format('z', true) + 1;
                 $useryear = $res[$k]['birthdate']->format('Y', true);
                 //we have NOT a leap year?
                 if ($todayyear % 400 != 0 || !($todayyear % 4 == 0 && $todayyear % 100 != 0)) {
                     //was the birthdate in a leap year?
                     if ($useryear % 400 == 0 || $useryear % 4 == 0 && $useryear % 100 != 0) {
                         //if we haven't leap year and birthdate was in leapyear we have to cut yday after february
                         if ($res[$k]['birthdate']->format('m', true) > 2) {
                             $res[$k]['leapcorrection'] -= 1;
                             if ($this->timeo->format('z', true) + 1 > $res[$k]['leapcorrection']) {
                                 unset($res[$k]);
                             }
                         }
                         //was birthday on 29 february? then show it on 1 march
                         if ($v['month'] == 2 && $v['day'] == 29) {
                             $res[$k]['birthdate'] = $res[$k]['birthdate']->add(new DateInterval('P1D'));
                         }
                     }
                 } else {
                     //We have a leap year
                     //Is the birthday not in a leap year?
                     if ($useryear % 400 != 0 || !($useryear % 4 == 0 && $useryear % 100 != 0)) {
                         //if we have leap year and birthday was not, need to increment birthdays after february
                         if ($res[$k]['birthdate']->format('m', true) > 2) {
                             $res[$k]['leapcorrection'] += 1;
                         }
                     }
                 }
             }
         }
     }
     return $res;
 }
 function GetMyProfileURL($userid = 0, $task = '', $xhtml = true, $extra = '')
 {
     if (!$task) {
         // Workaround for menu redirect: be more verbose
         kimport('integration.integration');
         $profileIntegration = KunenaIntegration::detectIntegration('profile', true);
         if ($profileIntegration != 'kunena') {
             $task = 'summary';
         }
     }
     $my = JFactory::getUser();
     if ($userid && $userid != $my->id) {
         $userid = "&userid={$userid}";
     } else {
         $userid = '';
     }
     if ($task) {
         $task = "&do={$task}";
     }
     return KunenaRoute::_(KUNENA_LIVEURLREL . "&func=profile{$userid}{$task}{$extra}", $xhtml);
 }