亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? api.php

?? 一款可以和GOOGLE媲美的開源統計系統,運用AJAX.功能強大. 無色提示:按照需要PHP5.1以上和MySQL數據庫支持。
?? PHP
字號:
<?php/** * Piwik - Open source web analytics *  * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later * @version $Id: API.php 654 2008-10-28 16:05:33Z matt $ *  * @package Piwik_SitesManager *//** *  * @package Piwik_SitesManager */class Piwik_SitesManager_API extends Piwik_Apiable{	static private $instance = null;	static public function getInstance()	{		if (self::$instance == null)		{            			$c = __CLASS__;			self::$instance = new $c();		}		return self::$instance;	}		static public $methodsNotToPublish = array();		/**	 * Returns the javascript tag for the given idSite.	 * This tag must be included on every page to be tracked by Piwik	 *	 * @param int $idSite	 * @return string The Javascript tag ready to be included on the HTML pages	 */	static public function getJavascriptTag( $idSite, $piwikUrl = '', $actionName = '')	{		Piwik::checkUserHasViewAccess($idSite);				$actionName = "'".addslashes(Piwik_Common::sanitizeInputValues($actionName))."'";		if(empty($piwikUrl))		{			$piwikUrl = Piwik_Url::getCurrentUrlWithoutFileName();		}		$piwikUrl = addslashes(Piwik_Common::sanitizeInputValues($piwikUrl));				$htmlEncoded = Piwik::getJavascriptCode($idSite, $piwikUrl, $actionName);		$htmlEncoded = str_replace(array('<br>','<br />','<br/>'), '', $htmlEncoded);		return html_entity_decode($htmlEncoded);	}		/**	 * Returns the website information : name, main_url	 * 	 * @exception if the site ID doesn't exist or the user doesn't have access to it	 * @return array	 */	static public function getSiteFromId( $idSite )	{		Piwik::checkUserHasViewAccess( $idSite );		$site = Zend_Registry::get('db')->fetchRow("SELECT * FROM ".Piwik::prefixTable("site")." WHERE idsite = ?", $idSite);		return $site;	}		/**	 * Returns the list of alias URLs registered for the given idSite.	 * The website ID must be valid when calling this method!	 * 	 * @return array list of alias URLs	 */	static private function getAliasSiteUrlsFromId( $idsite )	{		$db = Zend_Registry::get('db');		$urls = $db->fetchCol("SELECT url 								FROM ".Piwik::prefixTable("site_url"). " 								WHERE idsite = ?", $idsite);		return $urls;	}		/**	 * Returns the list of all URLs registered for the given idSite (main_url + alias URLs).	 * 	 * @exception if the website ID doesn't exist or the user doesn't have access to it	 * @return array list of URLs	 */	static public function getSiteUrlsFromId( $idSite )	{		Piwik::checkUserHasViewAccess($idSite);		$site = self::getSiteFromId($idSite);		$urls = self::getAliasSiteUrlsFromId($idSite);		return array_merge(array($site['main_url']), $urls);	}		/**	 * Returns the list of all the websites ID registered	 * 	 * @return array the list of websites ID	 */	static public function getAllSitesId()	{		Piwik::checkUserIsSuperUser();		return Zend_Registry::get('db')->fetchCol("SELECT idsite FROM ".Piwik::prefixTable('site'));	}			/**	 * Returns the list of websites with the 'admin' access for the current user.	 * For the superUser it returns all the websites in the database.	 * 	 * @return array for each site, an array of information (idsite, name, main_url, etc.)	 */	static public function getSitesWithAdminAccess()	{		$sitesId = self::getSitesIdWithAdminAccess();		return self::getSitesFromIds($sitesId);	}		/**	 * Returns the list of websites with the 'view' access for the current user.	 * For the superUser it doesn't return any result because the superUser has admin access on all the websites (use getSitesWithAtLeastViewAccess() instead).	 * 	 * @return array for each site, an array of information (idsite, name, main_url, etc.)	 */	static public function getSitesWithViewAccess()	{		$sitesId = self::getSitesIdWithViewAccess();		return self::getSitesFromIds($sitesId);	}		/**	 * Returns the list of websites with the 'view' or 'admin' access for the current user.	 * For the superUser it returns all the websites in the database.	 * 	 * @return array array for each site, an array of information (idsite, name, main_url, etc.)	 */	static public function getSitesWithAtLeastViewAccess()	{		$sitesId = self::getSitesIdWithAtLeastViewAccess();		return self::getSitesFromIds($sitesId);	}		/**	 * Returns the list of websites ID with the 'admin' access for the current user.	 * For the superUser it returns all the websites in the database.	 * 	 * @return array list of websites ID	 */	static public function getSitesIdWithAdminAccess()	{		$sitesId = Zend_Registry::get('access')->getSitesIdWithAdminAccess();		return $sitesId;	}		/**	 * Returns the list of websites ID with the 'view' access for the current user.	 * For the superUser it doesn't return any result because the superUser has admin access on all the websites (use getSitesIdWithAtLeastViewAccess() instead).	 * 	 * @return array list of websites ID	 */	static public function getSitesIdWithViewAccess()	{		return Zend_Registry::get('access')->getSitesIdWithViewAccess();	}		/**	 * Returns the list of websites ID with the 'view' or 'admin' access for the current user.	 * For the superUser it returns all the websites in the database.	 * 	 * @return array list of websites ID	 */	static public function getSitesIdWithAtLeastViewAccess()	{		return Zend_Registry::get('access')->getSitesIdWithAtLeastViewAccess();	}	/**	 * Returns the list of websites from the ID array in parameters.	 * The user access is not checked in this method so the ID have to be accessible by the user!	 * 	 * @param array list of website ID	 */	static private function getSitesFromIds( $idSites )	{		if(count($idSites) === 0)		{			return array();		}		$db = Zend_Registry::get('db');		$sites = $db->fetchAll("SELECT * 								FROM ".Piwik::prefixTable("site")." 								WHERE idsite IN (".implode(", ", $idSites).")								ORDER BY idsite ASC");		return $sites;	}		/**	 * Add a website in the database.	 * 	 * The website is defined by a name and an array of URLs.	 * The name must not be empty.	 * The URLs array must contain at least one URL called the 'main_url' ; 	 * if several URLs are provided in the array, they will be recorded as Alias URLs for	 * this website.	 * 	 * Requires Super User access.	 * 	 * @return int the website ID created	 */	static public function addSite( $siteName, $urls )	{		Piwik::checkUserIsSuperUser();				self::checkName($siteName);		$urls = self::cleanParameterUrls($urls);		self::checkUrls($urls);		self::checkAtLeastOneUrl($urls);				$db = Zend_Registry::get('db');				$url = $urls[0];		$urls = array_slice($urls, 1);				$db->insert(Piwik::prefixTable("site"), array(									'name' => $siteName,									'main_url' => $url,									)								);											$idSite = $db->lastInsertId();				self::insertSiteUrls($idSite, $urls);				// we reload the access list which doesn't yet take in consideration this new website		Zend_Registry::get('access')->loadAccess();		return (int)$idSite;	}		/**	 * Delete a website from the database, given its Id.	 * 	 * Requires Super User access. 	 *	 * @param int $idSite	 */	static public function deleteSite( $idSite )	{		Piwik::checkUserIsSuperUser();				$nbSites = count(Piwik_SitesManager_API::getAllSitesId());		if($nbSites == 1)		{			throw new Exception(Piwik_TranslateException("SitesManager_ExceptionDeleteSite"));		}				$db = Zend_Registry::get('db');				$db->query("DELETE FROM ".Piwik::prefixTable("site")." 					WHERE idsite = ?", $idSite);				$db->query("DELETE FROM ".Piwik::prefixTable("site_url")." 					WHERE idsite = ?", $idSite);				$db->query("DELETE FROM ".Piwik::prefixTable("access")." 					WHERE idsite = ?", $idSite);				// TODO we should also delete all the data relative to this website...		// post an event here that will be catched by the core and plugins to clean the data	}			/**	 * Checks that the array has at least one element	 * 	 * @exception if the parameter is not an array or if array empty 	 */	static private function checkAtLeastOneUrl( $urls )	{		if(!is_array($urls)			|| count($urls) == 0)		{			throw new Exception(Piwik_TranslateException("SitesManager_ExceptionNoUrl"));		}	}	/**	 * Add a list of alias Urls to the given idSite	 * 	 * If some URLs given in parameter are already recorded as alias URLs for this website,	 * they won't be duplicated. The 'main_url' of the website won't be affected by this method.	 * 	 * @return int the number of inserted URLs	 */	static public function addSiteAliasUrls( $idSite,  $urls)	{		Piwik::checkUserHasAdminAccess( $idSite );				$urls = self::cleanParameterUrls($urls);		self::checkUrls($urls);				$urlsInit = self::getSiteUrlsFromId($idSite);		$toInsert = array_diff($urls, $urlsInit);		self::insertSiteUrls($idSite, $toInsert);				return count($toInsert);	}		/**	 * Update an existing website.	 * If only one URL is specified then only the main url will be updated.	 * If several URLs are specified, both the main URL and the alias URLs will be updated.	 * 	 * @param int website ID defining the website to edit	 * @param string website name	 * @param string|array the website URLs	 * 	 * @exception if any of the parameter is not correct	 * 	 * @return bool true on success	 */	static public function updateSite( $idSite, $siteName, $urls = null)	{		Piwik::checkUserHasAdminAccess($idSite);		self::checkName($siteName);				// SQL fields to update		$bind = array();				if(!is_null($urls))		{			$urls = self::cleanParameterUrls($urls);			self::checkUrls($urls);			self::checkAtLeastOneUrl($urls);			$url = $urls[0];						$bind['main_url'] = $url;		}				$bind['name'] = $siteName;				$db = Zend_Registry::get('db');		$db->update(Piwik::prefixTable("site"), 							$bind,							"idsite = $idSite"								);										// we now update the main + alias URLs		self::deleteSiteAliasUrls($idSite);		if(count($urls) > 1)		{			$insertedUrls = self::addSiteAliasUrls($idSite, array_slice($urls,1));		}	}		/**	 * Insert the list of alias URLs for the website.	 * The URLs must not exist already for this website!	 */	static private function insertSiteUrls($idSite, $urls)	{		if(count($urls) != 0)		{			$db = Zend_Registry::get('db');			foreach($urls as $url)			{				$db->insert(Piwik::prefixTable("site_url"), array(										'idsite' => $idSite,										'url' => $url										)									);			}		}	}		/**	 * Delete all the alias URLs for the given idSite.	 */	static private function deleteSiteAliasUrls($idsite)	{		$db = Zend_Registry::get('db');		$db->query("DELETE FROM ".Piwik::prefixTable("site_url") ." 					WHERE idsite = ?", $idsite);	}		/**	 * Remove the final slash in the URLs if found	 * 	 * @return string the URL without the trailing slash	 */	static private function removeTrailingSlash($url)	{		// if there is a final slash, we take the URL without this slash (expected URL format)		if(strlen($url) > 5			&& $url[strlen($url)-1] == '/')		{			$url = substr($url,0,strlen($url)-1);		}		return $url;	}		/**	 * Tests if the URL is a valid URL	 * 	 * @return bool	 */	static private function isValidUrl( $url )	{		return ereg('^http[s]?://([A-Za-z0-9\/_%~.:-])*$', $url);	}		/**	 * Check that the website name has a correct format.	 * 	 * @exception if the website name is empty	 */	static private function checkName($siteName)	{		if(empty($siteName))		{			throw new Exception(Piwik_TranslateException("SitesManager_ExceptionEmptyName"));		}	}	/**	 * Check that the array of URLs are valid URLs	 * 	 * @exception if any of the urls is not valid	 * @param array	 */	static private function checkUrls($urls)	{		foreach($urls as $url)		{						if(!self::isValidUrl($url))			{				throw new Exception(sprintf(Piwik_TranslateException("SitesManager_ExceptionInvalidUrl"),$url));			}		}	}		/**	 * Clean the parameter URLs:	 * - if the parameter is a string make it an array	 * - remove the trailing slashes if found	 * 	 * @param string|array urls	 * @return array the array of cleaned URLs	 */	static private function cleanParameterUrls( $urls )	{		if(!is_array($urls))		{			$urls = array($urls);		}		foreach($urls as &$url)		{			$url = self::removeTrailingSlash($url);		}		$urls = array_unique($urls);				return $urls;	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
激情伊人五月天久久综合| 午夜视频一区二区三区| 日韩一区二区在线看片| 欧美中文字幕久久| 99热99精品| 国产精品免费人成网站| 蜜桃av一区二区三区| 亚洲理论在线观看| 中文字幕一区二区日韩精品绯色| 欧美激情在线看| 欧美日韩国产天堂| 韩国在线一区二区| 成人黄页毛片网站| 久久久久久免费| 日本午夜一本久久久综合| 色综合色综合色综合色综合色综合 | 性做久久久久久免费观看| 国产成人精品免费在线| 久久综合九色综合97婷婷女人 | 久久成人免费网站| 欧美日韩精品一区二区在线播放| 国产精品网曝门| 国产精品资源在线观看| 精品久久久久久久久久久久久久久| 亚洲18女电影在线观看| 欧美亚洲综合色| 亚洲日穴在线视频| 色综合久久精品| 一区二区久久久久| 色悠久久久久综合欧美99| 亚洲欧洲日产国码二区| eeuss鲁片一区二区三区| 国产农村妇女毛片精品久久麻豆| 国产一区二区精品久久| 久久婷婷色综合| 丁香六月综合激情| 亚洲欧美综合在线精品| 色婷婷狠狠综合| 亚洲一卡二卡三卡四卡五卡| 欧美日韩一区二区在线观看视频| 亚洲一区中文在线| 在线不卡免费欧美| 久久99精品国产91久久来源| 久久天堂av综合合色蜜桃网| 成人精品一区二区三区中文字幕| 亚洲人午夜精品天堂一二香蕉| 91日韩精品一区| 亚洲国产精品综合小说图片区| 欧美日韩久久久| 久久精品99国产国产精| 国产三级欧美三级日产三级99 | 狠狠色伊人亚洲综合成人| 久久精品一级爱片| jizz一区二区| 亚洲超碰精品一区二区| 久久一日本道色综合| 成人短视频下载| 亚洲国产美女搞黄色| 精品国产一区久久| caoporen国产精品视频| 亚洲已满18点击进入久久| 欧美成人伊人久久综合网| 成人美女视频在线观看| 亚洲国产成人porn| 久久婷婷综合激情| 精品视频一区 二区 三区| 精品一二三四在线| 亚洲自拍欧美精品| 久久色视频免费观看| 欧美亚洲综合久久| 国产成人99久久亚洲综合精品| 亚洲三级电影网站| 久久久久综合网| 欧美视频一二三区| 亚洲精品精品亚洲| 亚洲精品在线观看网站| 日本高清不卡一区| 国产在线播放一区三区四| 一区二区三区影院| 国产丝袜美腿一区二区三区| 欧美精品在线观看一区二区| 成人小视频在线观看| 视频一区在线播放| 综合久久给合久久狠狠狠97色| 欧美不卡激情三级在线观看| 色系网站成人免费| 成人激情电影免费在线观看| 精品一区二区在线播放| 亚洲妇熟xx妇色黄| 综合久久久久久| 日本一区二区三区久久久久久久久不 | 国产精品一二三区在线| 午夜国产精品影院在线观看| 国产精品久久99| 亚洲精品在线一区二区| 91精品国产综合久久国产大片| 99精品视频在线观看| 国产福利精品导航| 国产一区二区三区综合| 日本亚洲电影天堂| 日韩精品1区2区3区| 亚洲亚洲精品在线观看| 亚洲视频在线观看一区| 中文欧美字幕免费| 日本一区二区免费在线| 久久久www成人免费毛片麻豆| 欧美va亚洲va| 久久综合色婷婷| 久久综合色播五月| 精品少妇一区二区三区日产乱码| 欧美男女性生活在线直播观看| 91高清视频在线| 欧美日韩中文字幕一区二区| 欧美午夜一区二区三区免费大片| 91黄色激情网站| 欧美性色综合网| 欧美剧情电影在线观看完整版免费励志电影| www.日韩av| 色94色欧美sute亚洲线路一ni | 日韩欧美电影一二三| 91精品国产日韩91久久久久久| 欧美高清dvd| 欧美高清视频www夜色资源网| 欧美年轻男男videosbes| 91精品国产91综合久久蜜臀| 欧美一卡二卡三卡| 精品日韩99亚洲| 国产欧美日韩视频一区二区| 中文字幕在线一区| 亚洲精品乱码久久久久久日本蜜臀 | 美女视频网站久久| 国产伦精品一区二区三区免费迷 | 日本一区二区久久| 日韩一区有码在线| 午夜精品久久久久久久99樱桃| 五月天激情综合| 精品综合久久久久久8888| 国产精品一级片| 色诱视频网站一区| 欧美成va人片在线观看| 国产精品久久久久久久久快鸭| 亚洲一区二区三区中文字幕| 三级久久三级久久| 国产一区二区福利| 欧洲视频一区二区| 精品国产91洋老外米糕| 中文字幕亚洲电影| 天天亚洲美女在线视频| 国产精品1024| 欧美区在线观看| 久久综合狠狠综合| 亚洲超丰满肉感bbw| 国产福利视频一区二区三区| 欧美日韩中文精品| 中文字幕国产一区| 天天综合天天综合色| 成人av免费网站| 日韩一区二区视频在线观看| 国产精品免费视频观看| 日韩电影免费在线看| 91在线无精精品入口| 欧美大片一区二区三区| 中文字幕一区二区三区四区| 天堂一区二区在线免费观看| 99久久久精品| 久久婷婷国产综合国色天香| 亚洲狠狠爱一区二区三区| 国产成人h网站| 欧美一区二区三区系列电影| 亚洲欧美日韩综合aⅴ视频| 国产在线精品一区在线观看麻豆| 色天使色偷偷av一区二区| 久久久不卡影院| 日本视频在线一区| 欧美少妇一区二区| 亚洲乱码日产精品bd| 国产成人无遮挡在线视频| 欧美一区二区三区免费视频| 亚洲猫色日本管| 成人一级片网址| 久久先锋资源网| 激情综合亚洲精品| 91精品视频网| 午夜激情综合网| 69久久99精品久久久久婷婷| 国产精品网站在线| 国产成人福利片| 久久精品一二三| 国产乱码字幕精品高清av | 欧美久久久久久久久| 一区二区三区免费网站| 国产91精品精华液一区二区三区| 欧美电影免费观看高清完整版 | 久久婷婷国产综合国色天香| 久久99蜜桃精品| 日韩视频免费直播| 久久国产精品色| 久久人人超碰精品| 国产人成亚洲第一网站在线播放| 不卡的电视剧免费网站有什么|