/** * 架构函数,处理核心变量 * 使用字符串返回 不能有任何输出 */ public function __construct() { //当前登录者uid $GLOBALS['ts']['mid'] = $this->mid = intval($_SESSION['mid']); //当前访问对象的uid $GLOBALS['ts']['uid'] = $this->uid = intval($_REQUEST['uid'] == 0 ? $this->mid : $_REQUEST['uid']); // 赋值当前访问者用户 $GLOBALS['ts']['user'] = $this->user = model('User')->getUserInfo($this->mid); if ($this->mid != $this->uid) { $GLOBALS['ts']['_user'] = model('User')->getUserInfo($this->uid); } else { $GLOBALS['ts']['_user'] = $GLOBALS['ts']['user']; } //当前用户的所有已添加的应用 $GLOBALS['ts']['_userApp'] = $userApp = model('UserApp')->getUserApp($this->uid); //当前用户的统计数据 $GLOBALS['ts']['_userData'] = $userData = model('UserData')->getUserData($this->uid); $this->site = D('Xdata')->get('admin_Config:site'); $this->site['logo'] = getSiteLogo($this->site['site_logo']); $GLOBALS['ts']['site'] = $this->site; //语言包判断 if (TRUE_APPNAME != 'public' && APP_NAME != TRUE_APPNAME) { addLang(TRUE_APPNAME); } Addons::hook('core_filter_init_widget'); }
/** * 分享控制 * @return void */ public function index() { $shareInfo['sid'] = intval($_GET['sid']); $shareInfo['stable'] = t($_GET['stable']); $shareInfo['initHTML'] = h($_GET['initHTML']); $shareInfo['curid'] = t($_GET['curid']); $shareInfo['curtable'] = t($_GET['curtable']); $shareInfo['appname'] = t($_GET['appname']); $shareInfo['cancomment'] = intval($_GET['cancomment']); $shareInfo['is_repost'] = intval($_GET['is_repost']); if (empty($shareInfo['stable']) || empty($shareInfo['sid'])) { echo L('PUBLIC_TYPE_NOEMPTY'); exit; } if (!($oldInfo = model('Source')->getSourceInfo($shareInfo['stable'], $shareInfo['sid'], false, $shareInfo['appname']))) { echo L('PUBLIC_INFO_SHARE_FORBIDDEN'); exit; } empty($shareInfo['appname']) && ($shareInfo['appname'] = $oldInfo['app']); if ($shareInfo['appname'] != '' && $shareInfo['appname'] != 'public') { addLang($shareInfo['appname']); } if (empty($shareInfo['initHTML']) && !empty($shareInfo['curid'])) { //判断是否为转发的分享 if ($shareInfo['curid'] != $shareInfo['sid'] && $shareInfo['is_repost'] == 1) { $app = $curtable == $shareInfo['stable'] ? $shareInfo['appname'] : 'public'; $curInfo = model('Source')->getSourceInfo($shareInfo['curtable'], $shareInfo['curid'], false, $app); $userInfo = $curInfo['source_user_info']; // if($userInfo['uid'] != $this->mid){ //分享其他人的分享,非自己的 $shareInfo['initHTML'] = ' //@' . $userInfo['uname'] . ':' . $curInfo['source_content']; // } $shareInfo['initHTML'] = str_replace(array("\n", "\r"), array('', ''), $shareInfo['initHTML']); } } if (!CheckPermission('core_normal', 'feed_comment')) { $shareInfo['cancomment'] = 0; } if ($shareInfo['sid'] != $shareInfo['curid']) { //获取被评论的分享信息 $source = model('Feed')->get($shareInfo['sid']); //判断是否有权限评论当前用户 if ($this->mid != $source['uid']) { $userPrivacy = model('UserPrivacy')->getPrivacy($this->mid, $source['uid']); if ($userPrivacy['comment_weibo'] == 1) { $shareInfo['cancomment'] = 0; } else { $shareInfo['cancomment'] = 1; } } } $shareInfo['shareHtml'] = !empty($oldInfo['shareHtml']) ? $oldInfo['shareHtml'] : ''; $weiboSet = model('Xdata')->get('admin_Config:feed'); $canShareFeed = in_array('repost', $weiboSet['weibo_premission']) ? 1 : '0'; $this->assign('canShareFeed', $canShareFeed); $this->assign('initNums', $weiboSet['weibo_nums']); $this->assign('shareInfo', $shareInfo); $this->assign('oldInfo', $oldInfo); $this->display(); }
addLang("Settings.Fuel", "Гориво", "Fuel", "Carburant"); addLang("Settings.DistRep", "Претставување на растојанието", "Distance represent", "Distance représentent"); addLang("Settings.Metric", "Метрички", "Metric", "Métrique"); addLang("Settings.Imperial", "Империјално", "Imperial", "Impérial"); addLang("Settings.VehColors", "Бои на возила", "Vehicles colors", "Véhicules couleurs"); addLang("Settings.EngineOn", "Мотор ON", "Engine ON", "Moteur ON"); addLang("Settings.EngineOff", "Мотор OFF", "Engine OFF", "Moteur OFF"); addLang("Settings.EngineOffPassOn", "Мотор OFF Патници ON", "Engine OFF Passengers ON", "Les passagers le moteur ON"); addLang("Settings.LowSat", "Слаби сателити", "Low satellite", "Par satellite à faible"); addLang("Settings.Engaged", "Ангажирано", "Occupied", "Occupé"); addLang("Settings.TaxOffPassOn", "Таксиметар OFF Патници ON", "Taximeter OFF Passengers ON", "Taximètre les passagers dans"); addLang("Settings.TaxOn", "Таксиметар ON", "Taximeter ON", "Taximètre ON"); addLang("Settings.LightBlue", "Светло сина", "Light blue", "Lumière bleue"); addLang("Settings.Red", "Црвена", "Red", "Rouge"); addLang("Settings.DarkBlue", "Темно сина", "Dark blue", "Le bleu foncé"); addLang("Settings.Green", "Зелена", "Green", "Vert"); addLang("Settings.Yellow", "Жолта", "Yellow", "Jaune"); addLang("Settings.Gray", "Сива", "Gray", "Gris"); addLang("Settings.Black", "Црна", "Black", "Noir"); addLang("Settings.Orange", "Портокалова", "Orange", "Orange"); addLang("Settings.RedBlue", "Црвено сина", "Red blue", "Rouge bleu"); addLang("Settings.GeoFences", "Зони", "GeoFence", "GeoFence"); addLang("Settings.Pois", "Точки од интерес", "Points of interest", "Points d'intérêt"); addLang("Settings.Poi1", "ТОИ", "POI", "POI"); addLang("Main.SessionExpired", "Сесијата заврши", "Session expired", "Session a été expirée"); addLang("Main.ClickLogin", "Кликнете тука за да се најавите повторно", "Click here to login again", "Cliquez ici pour vous connecter à nouveau"); addLang("", "", "", ""); addLang("", "", "", ""); addLang("", "", "", ""); addLang("", "", "", "");
function W($name, $data = array(), $return = false) { $class = $name . 'Widget'; if (file_exists(APP_WIDGET_PATH . '/' . $class . '/' . $class . '.class.php')) { tsload(APP_WIDGET_PATH . '/' . $class . '/' . $class . '.class.php'); } elseif (!empty($data['widget_appname']) && file_exists(APPS_PATH . '/' . $data['widget_appname'] . '/Lib/Widget/' . $class . '/' . $class . '.class.php')) { addLang($data['widget_appname']); tsload(APPS_PATH . '/' . $data['widget_appname'] . '/Lib/Widget/' . $class . '/' . $class . '.class.php'); } else { tsload(ADDON_PATH . '/widget/' . $class . '/' . $class . '.class.php'); } if (!class_exists($class)) { throw_exception(L('_CLASS_NOT_EXIST_') . ':' . $class); } $widget = new $class(); $content = $widget->render($data); if ($return) { return $content; } else { echo $content; } }