本文整理汇总了PHP中Articles::get_short_url方法的典型用法代码示例。如果您正苦于以下问题:PHP Articles::get_short_url方法的具体用法?PHP Articles::get_short_url怎么用?PHP Articles::get_short_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Articles
的用法示例。
在下文中一共展示了Articles::get_short_url方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
// add extra information from the overlay, if any
if (is_object($overlay)) {
$context['components']['overlay'] = $overlay->get_text('extra', $item);
}
// add extra information from this item, if any
if (isset($item['extra']) && $item['extra']) {
$context['components']['boxes'] = Codes::beautify_extra($item['extra']);
}
// 'Share' box
//
$lines = array();
// facebook, twitter, linkedin
if ($item['active'] == 'Y' && (!isset($context['without_internet_visibility']) || $context['without_internet_visibility'] != 'Y')) {
// the best suited link to use
if ($context['with_friendly_urls'] == 'R') {
$url = $context['url_to_home'] . $context['url_to_root'] . Articles::get_short_url($item);
} else {
$url = Articles::get_permalink($item);
}
// facebook
Skin::define_img('PAGERS_FACEBOOK_IMG', 'pagers/facebook.gif');
$lines[] = Skin::build_link('http://www.facebook.com/share.php?u=' . urlencode($url) . '&t=' . urlencode($item['title']), PAGERS_FACEBOOK_IMG . i18n::s('Post to Facebook'), 'basic', i18n::s('Spread the word'));
// twitter
Skin::define_img('PAGERS_TWITTER_IMG', 'pagers/twitter.gif');
$lines[] = Skin::build_link('http://twitter.com/home?status=' . urlencode($item['title'] . ' ' . $url), PAGERS_TWITTER_IMG . i18n::s('Tweet about this'), 'basic', i18n::s('Spread the word'));
// linked in
Skin::define_img('PAGERS_LINKEDIN_IMG', 'pagers/linkedin.gif');
$lines[] = Skin::build_link('http://www.linkedin.com/shareArticle?mini=true&url=' . $url . '&title=' . urlencode($item['title']) . '&summary=' . urlencode($item['introduction']) . '&source=' . urlencode($anchor->get_title()), PAGERS_LINKEDIN_IMG . i18n::s('Share at LinkedIn'), 'basic', i18n::s('Spread the word'));
}
// invite participants
if (($cur_article->is_owned() || $item['active'] == 'Y') && isset($context['with_email']) && $context['with_email'] == 'Y') {
示例2: ucfirst
$details[] = LOCKED_FLAG . ' ' . i18n::s('page is locked.');
}
// in-line details
if (count($details)) {
$text .= ucfirst(implode(', ', $details));
}
// reference this item
if (Surfer::is_member()) {
$text .= BR . sprintf(i18n::s('Code to reference this page: %s'), '[article=' . $item['id'] . ']');
// the nick name
if ($item['nick_name'] && ($link = normalize_shortcut($item['nick_name'], TRUE))) {
$text .= BR . sprintf(i18n::s('Name: %s'), $link);
}
// short link
if ($context['with_friendly_urls'] == 'R') {
$text .= BR . sprintf(i18n::s('Shortcut: %s'), $context['url_to_home'] . $context['url_to_root'] . Articles::get_short_url($item));
}
}
// no more details
$text .= "</p>\n";
// update page details
$context['page_details'] = $text;
}
//
// compute main panel -- $context['text']
//
// insert anchor prefix
if (is_object($anchor)) {
$context['text'] .= $anchor->get_prefix();
}
// links to previous and next pages, if any