当前位置: 首页>>代码示例>>PHP>>正文


PHP Content::getUrl方法代码示例

本文整理汇总了PHP中Content::getUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Content::getUrl方法的具体用法?PHP Content::getUrl怎么用?PHP Content::getUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Content的用法示例。


在下文中一共展示了Content::getUrl方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: catch

							'id_user' => $_SESSION['user']['id'],
							'id_like' => $group['gid'],
						);
				dibi::query('INSERT IGNORE INTO [user_like]', $arr);
			} catch (DibiException $exception) {
				echo get_class($exception), ': ', $exception->getMessage();
				$error = true;
			}
			dibi::rollback();
			
		}
		
		/*
		 * Parse pages
		 */
		$pages = json_decode(Content::getUrl("https://api.facebook.com/method/pages.getinfo?fields=name%2Ccompany_overview%2Cdescription&access_token=".$_SESSION['access_token']."&format=json"), true);
		foreach ($pages as $page){
			//echo $page['page_id'], " : ", $page['name'], " : ", $page['description'], "<br>";
			$pDescription = strtolower(strip_tags($page['description']));
			$pDescription = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', ' ', $pDescription);
			
			/*
			 * Parse words from page name
			 */ 
			$words_tmp = preg_split('/([\s\-_,:;?!\'=\/\(\)\[\]@{}<>\r\n"]|(?<!\d)\.(?!\d))/', $page['name'], null, PREG_SPLIT_NO_EMPTY);
			foreach ($words_tmp as $word){
						$word = $text->prepareWord($word);
						if (is_numeric($word)) continue;
						if (strlen($word)<=2) continue;
						if ($sWords->isStopWord($word)) continue;
						$words[] = $word;
开发者ID:nosko,项目名称:socialSearch,代码行数:31,代码来源:profile.php

示例2: getUrlFromURL

 public function getUrlFromURL($url)
 {
     // Get canonical URL from URL
     $content = new Content();
     $content->loadFromUrl($url, false, false);
     if ($content->getUrl() != $url) {
         return "#";
     }
     $rootdir = str_replace(dirname(__DIR__ . "/../../nutmouse.php"), "", $_SERVER['DOCUMENT_ROOT']);
     return "/" . $rootdir . $content->getUrl();
 }
开发者ID:julianburr,项目名称:project-nutmouse,代码行数:11,代码来源:View.php

示例3: getFbResult

	public function getFbResult($word){
		$result = array();
		$content = json_decode(Content::getUrl("https://graph.facebook.com/search?q=".$word."&type=page&limit=200"), true);
		
		foreach ($content['data'] as $item) {
			$item = TextPreparation::prepareWord($item['name']);
			$result[] = TextPreparation::sentence2Words($item);
		}
		return $result;
	}
开发者ID:nosko,项目名称:socialSearch,代码行数:10,代码来源:classContext.php

示例4: analyzeUrl

 public function analyzeUrl()
 {
     // Check if URL is set in general
     if (is_null($this->url)) {
         throw new Exception("No request URL set!");
         return;
     }
     // Check for rewrtite rules
     $rewrite = new Rewrite($this->url);
     $rewrite->applyRules();
     if ($rewrite->getTargetUrl() != $this->url) {
         if (!$rewrite->transportQueryParameter()) {
             $_GET = array();
             $_POST = array();
         }
         if ($rewrite->isRedirect()) {
             $this->redirectToUrl($rewrite->getTargetUrl(), $_POST);
         }
         $this->setUrl($rewrite->getTargetUrl());
         $this->analyzeRequest(!$rewrite->isLastForward());
     }
     // Check access rights to requested content
     $access = new AccessOfficer("content", $this->content_id, $this->session->getUser(), $this->content_parents);
     if (!$access->check()) {
         // Access denied
         if (!$access->getDeniedContentID()) {
             // No content to be shown as 403 page set
             // TODO set up default 403 (and 404) templates
             throw new Exception("Access denied and no denied content defined!");
             return;
         }
         // Should parameters be transported through the redirects / rewrites
         if (!$access->transportQueryParameter()) {
             $_GET = array();
             $_POST = array();
         }
         // Show 403 error page or redirect if neccessary
         $newcontent = new Content($access->getDeniedContentID());
         if ($access->isRedirect() && $newcontent->getID() != $this->content_id) {
             // Redirect, but keep requested URL as origin parameter
             // TODO: keep origin request parameters as well!
             $this->redirectToUrl("/" . $newcontent->getUrl() . "?origin=" . $this->url, $_POST);
         }
         $this->setUrl($newcontent->getUrl());
         $this->analyzeRequest(!$access->isLastForward());
     }
     // TODO: HookPoints to manipulate this behaviour
 }
开发者ID:julianburr,项目名称:project-nutmouse,代码行数:48,代码来源:Controller.php

示例5: getUrl

 /**
  * フルURLを取得する
  *
  * @param $url
  * @param bool $useSubDomain
  */
 public function getUrl($url, $full = false, $useSubDomain = false)
 {
     return $this->_Content->getUrl($url, $full, $useSubDomain);
 }
开发者ID:baserproject,项目名称:basercms,代码行数:10,代码来源:BcContentsHelper.php

示例6: getLikes

	public static function getLikes($token){
		return Content::getUrl("https://graph.facebook.com/me/likes?access_token=".$token);
	}
开发者ID:nosko,项目名称:socialSearch,代码行数:3,代码来源:classFacebookDownload.php


注:本文中的Content::getUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。