本文整理汇总了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;
示例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();
}
示例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;
}
示例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
}
示例5: getUrl
/**
* フルURLを取得する
*
* @param $url
* @param bool $useSubDomain
*/
public function getUrl($url, $full = false, $useSubDomain = false)
{
return $this->_Content->getUrl($url, $full, $useSubDomain);
}
示例6: getLikes
public static function getLikes($token){
return Content::getUrl("https://graph.facebook.com/me/likes?access_token=".$token);
}