本文整理汇总了PHP中Social::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Social::getInstance方法的具体用法?PHP Social::getInstance怎么用?PHP Social::getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Social
的用法示例。
在下文中一共展示了Social::getInstance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
public function show()
{
// sitemap
$this->controller->setView('SitemapView');
$sitemap = $this->controller->display();
// legal notice
$left = array_key_exists('legal_notice', $this->config) ? $this->config['legal_notice'] : '';
$left = '<div class="col-md-6 col-md-offset-2"><p>' . $left . '</p></div>';
$right = '<div class="col-md-2"><p class="pull-right"><a href="#">Back to top</a></p></div>';
// social
$social = '';
$general = Config::getInstance()->getGeneralArray('general');
if (array_key_exists('social', $general) && $general['social']) {
$buttons = Social::getInstance()->socialButtons('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], Head::getInstance()->getTitle());
$span = floor(6 / count($buttons));
foreach ($buttons as $b) {
$social .= '<div class="col-xs-2 col-md-' . $span . ' text-center">' . $b . '</div>';
}
$x = floor((8 - count($buttons)) / 2);
$social = '<div class="row"><div class="col-md-offset-2 col-md-' . $x . '"></div>' . $social . '</div>';
}
// powered by
$poweredby = '';
if (isset($this->config['poweredby'])) {
$poweredby = '<p class="poweredby text-center">' . $this->config['poweredby'] . '</p>';
$poweredby = '<div class="row"><div class="col-md-8 col-md-offset-2">' . $poweredby . '</div></div>';
}
// put it together
return $sitemap . '<div class="footer-inner row">' . $left . $right . '</div>' . $social . $poweredby;
}
示例2: markup
public function markup(Markup $model, $arg)
{
$body = '<div class="preview"><div class="text">' . $model->parse($arg) . '</div></div>';
$body = '<div class="row content-item"><div class="col-md-12">' . $body . '</div></div>';
if (array_key_exists('static', $model->config) && $model->config['static']) {
$href = Config::getInstance()->app_root . $model->config['static'] . '/' . preg_replace('/\\.[^.\\s]{2,4}$/', '', basename($model->config['path']));
// social
$social = '';
$general = Config::getInstance()->getGeneralArray('general');
// TODO description
if (array_key_exists('social', $general) && $general['social']) {
$buttons = Social::getInstance()->socialButtons('https://' . $_SERVER['HTTP_HOST'] . $href, Head::getInstance()->getTitle());
$span = floor(6 / count($buttons));
foreach ($buttons as $b) {
$social .= '<div class="col-xs-2 col-md-' . $span . ' text-center">' . $b . '</div>';
}
}
$static = '<a class="btn" href="' . $href . '">More <i class="fa fa-angle-double-right"></i></a>';
$body .= '<div class="row socials"><div class="col-md-5"><div class="row">' . $social . '</div></div><div class="col-md-7 text-right">' . $static . '</div></div>';
}
return self::head($model->parseTags($model->config['path'])) . $body;
}
示例3: markup
public function markup(Markup $model, $arg, $bool)
{
// parse head
$head = '';
$tags = $model->parseTags();
if (!empty($tags)) {
$left = '';
if (isset($tags['published'])) {
$left .= $tags['published'];
}
if (isset($tags['author'])) {
$left = $left ? $left . ' | ' . $tags['author'] : $tags['author'];
}
$left = $left ? '<div class="col-md-7"><p>' . $left . '</p></div>' : '';
$right = '';
if (isset($tags['category'])) {
$href = Config::getInstance()->app_root . URLs::getInstance()->getURI() . '?' . QueryString::removeAll(['tag', 'page'], $_SERVER['QUERY_STRING']);
foreach ($tags['category'] as $c) {
$right .= ' | <a href="' . $href . '&tag=' . $c . '">#' . trim($c) . '</a>';
// $right .= ' | #' . trim($c);
}
$right = '<div class="col-md-5 pull-right text-right">' . substr($right, 3) . '</div>';
}
$head = $left . $right ? '<div class="row content-head">' . $left . $right . '</div>' : '';
}
// parse body
$body = '<div class="row content-body"><div class="col-md-12">' . $model->parse($arg) . '</div></div>';
if (array_key_exists('static', $model->config) && $model->config['static']) {
$href = Config::getInstance()->app_root . URLs::getInstance()->getURI() . '/' . preg_replace('/\\.[^.\\s]{2,4}$/', '', basename($model->config['path']));
// social
$social = '';
$general = Config::getInstance()->getGeneralArray('general');
// TODO description
if (array_key_exists('social', $general) && $general['social']) {
$buttons = Social::getInstance()->socialButtons('https://' . $_SERVER['HTTP_HOST'] . $href, Head::getInstance()->getTitle());
$span = floor(6 / count($buttons));
foreach ($buttons as $b) {
$social .= '<div class="col-xs-2 col-md-' . $span . ' text-center">' . $b . '</div>';
}
}
$static = '<a class="btn btn-default" href="' . $href . '" role="button">Static <i class="fa fa-share-alt"></i></a>';
$body .= '<div class="row content-foot"><div class="col-md-5"><div class="row">' . $social . '</div></div><div class="col-md-7 text-right">' . $static . '</div></div>';
}
return '<div class="row content-item"><div class="col-md-12">' . $head . $body . '</div></div>';
}