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


PHP Social::getInstance方法代码示例

本文整理汇总了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;
 }
开发者ID:Stephan123,项目名称:markdown_blog,代码行数:30,代码来源:Footer.php

示例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;
 }
开发者ID:Stephan123,项目名称:markdown_blog,代码行数:22,代码来源:PreView.php

示例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>';
 }
开发者ID:phgamper,项目名称:markdown_blog,代码行数:45,代码来源:AbstractPage.php


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