예제 #1
0
파일: score.php 프로젝트: Tfrez/jVarcade
 public function __construct()
 {
     parent::__construct();
     $this->global_conf = JFactory::getConfig();
     $this->db = JFactory::getDBO();
     $conf = jvarcadeModelCommon::getInst();
     $this->config = $conf->getConf();
 }
예제 #2
0
파일: helper.php 프로젝트: Tfrez/jVarcade
 public static function userlink($userid, $username)
 {
     static $jva_userlinks;
     $model = jvarcadeModelCommon::getInst();
     $config = $model->getConf();
     if (!($jva_userlinks && is_array($jva_userlinks) && count($jva_userlinks) && array_key_exists((int) $userid, $jva_userlinks))) {
         if (!is_array($jva_userlinks)) {
             $jva_userlinks = array();
         }
         $_name = '';
         // Guest
         if ((int) $userid == 0) {
             $_name = $config->guest_name;
             //Alpha User Points
         } elseif ((int) $config->scorelink == 3) {
             $api_AUP = JPATH_SITE . '/components/com_alphauserpoints/helper.php';
             if (file_exists($api_AUP)) {
                 require_once $api_AUP;
                 $linktoAUPprofil = AlphaUserPointsHelper::getAupLinkToProfil($userid, (int) $config->aup_itemid);
                 $_name = '<a href="' . $linktoAUPprofil . '">' . $username . '</a>';
             }
             //Community Builder
         } elseif ((int) $config->scorelink == 2) {
             $_name = '<a href="' . JRoute::_('index.php?option=com_comprofiler&task=userProfile&user='******'&Itemid=' . (int) $config->communitybuilder_itemid) . '">' . $username . '</a>';
             //JomSocial
         } elseif ((int) $config->scorelink == 1 && is_file(JPATH_ROOT . '/' . 'components' . '/' . 'com_community' . '/' . 'libraries' . '/' . 'core.php')) {
             include_once JPATH_ROOT . '/' . 'components' . '/' . 'com_community' . '/' . 'libraries' . '/' . 'core.php';
             $js_user = CFactory::getUser((int) $userid);
             $_name = '<a href="' . CRoute::_('index.php?option=com_community&view=profile&userid=' . (int) $userid) . '">' . $js_user->getDisplayName() . '</a>';
             // No integration
         } else {
             $_name = '<a href="' . JRoute::_('index.php?option=com_jvarcade&task=profile&id=' . (int) $userid) . '">' . $username . '</a>';
         }
         $jva_userlinks[(int) $userid] = $_name;
     }
     return $jva_userlinks[(int) $userid];
 }
예제 #3
0
파일: init.php 프로젝트: Tfrez/jVarcade
 * @package		jVArcade
 * @version		2.12
 * @date		2014-05-17
 * @copyright		Copyright (C) 2007 - 2014 jVitals Digital Technologies Inc. All rights reserved.
 * @license		http://www.gnu.org/copyleft/gpl.html GNU/GPLv3 or later
 * @link		http://jvitals.com
 */
// no direct access
defined('_JEXEC') or die('Restricted access');
require_once 'define.php';
require_once JPATH_COMPONENT . '/controller.php';
require_once JPATH_COMPONENT . '/controllers/score.php';
require_once 'model.php';
require_once JVA_HELPERS_INCPATH . 'helper.php';
// Load jVArcade configuration
$conf = jvarcadeModelCommon::getInst();
$config = $conf->getConf();
// define time/date formats
define('COM_JVARCADE_DATE_FORMAT', $config->date_format);
define('COM_JVARCADE_TIME_FORMAT', $config->time_format);
define('COM_JVARCADE_TIMEZONE', $config->timezone);
// Javascript includes and declarations
$document = JFactory::getDocument();
$jsconstants = 'var JVA_HOST_NAME = \'' . JURI::base() . '\';' . "\n";
$jsconstants .= 'var JVA_AJAX_URL = \'' . JURI::base() . '\';' . "\n";
$jsconstants .= 'var JVA_AJAX_RATING_URL = JVA_HOST_NAME + \'index.php?option=com_jvarcade&task=rategame&format=raw&gid=\';' . "\n";
$jsconstants .= 'var JVA_MAIN_URL = JVA_HOST_NAME + \'index.php\';' . "\n";
$document->addScriptDeclaration($jsconstants);
JHtml::_('jquery.framework');
JHtml::script('com_jvarcade/jquery.jva.js', false, true);
// Load the puarcade plugins