b2evolution PHP Cross Reference Blogging Systems

Source: /skins/_wp_compatibility.inc.php - 319 lines - 7499 bytes - Summary - Text - Print

Description: This is the WordPress compatibility include. This includes a lot of dull template tags stubs that emulate wordpress template tags. This is designed to make skin porting easier. This should not be used in redistributed skins as this will NOT provide FULL b2evo functionality.

   1  <?php
   2  /**
   3   * This is the WordPress compatibility include.
   4   *
   5   * This includes a lot of dull template tags stubs that emulate wordpress template tags.
   6   * This is designed to make skin porting easier.
   7   * This should not be used in redistributed skins as this will NOT provide FULL b2evo functionality.
   8   *
   9   * For a quick explanation of b2evo 2.0 skins, please start here:
  10   * {@link http://b2evolution.net/man/skin-structure}
  11   *
  12   * @package evoskins
  13   */
  14  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  15  
  16  
  17  /**
  18   * WP compatibility variable - UNSUPPORTED.
  19   */
  20  global $siteurl;
  21  $siteurl = $Blog->get('url');
  22  
  23  
  24  
  25  /**
  26   * WP compatibility template tag - UNSUPPORTED.
  27   */
  28  function get_calendar()
  29  {
  30      global $Plugins;
  31      // ------------------------------- START OF CALENDAR ---------------------------------
  32      // Call the Calendar plugin (if installed):
  33      $Plugins->call_by_code( 'evo_Calr', array(    // Params follow:
  34              'block_start' => '',
  35              'block_end' => '',
  36              'displaycaption' => true,
  37              'linktomontharchive' => false,
  38              'headerdisplay' => 'e',
  39              'tablestart' => '<table id="wp-calendar" class="bCalendarTable" cellspacing="0" summary="Monthly calendar with links to each day\'s posts">'."\n",
  40          ) );
  41      // -------------------------------- END OF CALENDAR ----------------------------------
  42  }
  43  
  44  
  45  /**
  46   * WP compatibility template tag - UNSUPPORTED.
  47   */
  48  function wp_list_cats()
  49  {
  50      // --------------------------------- START OF CATEGORY LIST --------------------------------
  51      skin_widget( array(
  52              // CODE for the widget:
  53              'widget' => 'coll_category_list',
  54              // Optional display params
  55              'block_start' => '<div class="bSideItem">',
  56              'block_end' => '</div>',
  57              'block_title_start' => '<h3 class="sideItemTitle">',
  58              'block_title_end' => '</h3>',
  59          ) );
  60      // ---------------------------------- END OF CATEGORY LIST ---------------------------------
  61  }
  62  
  63  
  64  /**
  65   * WP compatibility template tag - UNSUPPORTED.
  66   */
  67  function wp_tag_cloud()
  68  {
  69      skin_widget( array(
  70              // CODE for the widget:
  71              'widget' => 'coll_tag_cloud',
  72              // Optional display params
  73              'block_start' => '<div class="tag_cloud">',
  74              'block_end' => '</div>',
  75              'block_title_start' => '<h3 class="sideItemTitle">',
  76              'title' => 'Tag Cloud:',
  77              'block_title_end' => '</h3>',
  78              'max_tags' => 100,
  79              'min_size' => 8,
  80              'max_size' => 22,
  81          ) );
  82  }
  83  
  84  
  85  /**
  86   * WP compatibility template tag - UNSUPPORTED.
  87   */
  88  function get_permalink()
  89  {
  90      global $Item;
  91      $Item->permanent_url();
  92  }
  93  
  94  
  95  /**
  96   * WP compatibility template tag - UNSUPPORTED.
  97   */
  98  function the_title()
  99  {
 100      global $Item;
 101      $Item->title( array(
 102          'link_type'   => 'none',
 103       ) );
 104  }
 105  
 106  
 107  /**
 108   * WP compatibility template tag - UNSUPPORTED.
 109   */
 110  function the_content()
 111  {
 112      // ---------------------- POST CONTENT INCLUDED HERE ----------------------
 113      skin_include( '_item_content.inc.php', array(
 114              'image_size'    =>    'fit-400x320',
 115          ) );
 116      // Note: You can customize the default item feedback by copying the generic
 117      // /skins/_item_feedback.inc.php file into the current skin folder.
 118      // -------------------------- END OF POST CONTENT -------------------------
 119  }
 120  
 121  
 122  /**
 123   * WP compatibility template tag - UNSUPPORTED.
 124   */
 125  function is_home()
 126  {
 127      return is_default_page();
 128  }
 129  
 130  
 131  /**
 132   * WP compatibility template tag - UNSUPPORTED.
 133   */
 134  function is_page()
 135  {
 136      global $disp;
 137  
 138      return ($disp == 'page');
 139  }
 140  
 141  
 142  /**
 143   * WP compatibility template tag - UNSUPPORTED.
 144   */
 145  function is_tag()
 146  {
 147      global $disp_detail;
 148  
 149      return ($disp_detail == 'posts-tag' );
 150  }
 151  
 152  
 153  /**
 154   * WP compatibility template tag - UNSUPPORTED.
 155   */
 156  function the_time( $format = '#' )
 157  {
 158      global $Item;
 159      $Item->issue_time( array(
 160              'time_format' => $format,
 161          ) );
 162  }
 163  
 164  
 165  /**
 166   * WP compatibility template tag - UNSUPPORTED.
 167   */
 168  function trackback_url()
 169  {
 170      global $Item;
 171      $Item->trackback_url();
 172  }
 173  
 174  
 175  /**
 176   * WP compatibility template tag - UNSUPPORTED.
 177   */
 178  function comments_popup_link( $zero = '#', $one = '#', $more = '#' )
 179  {
 180      global $Item;
 181      $Item->feedback_link( array(
 182                                      'type' => 'feedbacks',
 183                                      'status' => 'published',
 184                                      'link_before' => '',
 185                                      'link_after' => '',
 186                                      'link_text_zero' => $zero,
 187                                      'link_text_one' => $one,
 188                                      'link_text_more' => str_replace( '%', '%d', $more ),
 189                                      'link_title' => '#',
 190                                      'use_popup' => false,
 191                                      'url' => '#',
 192                                  ) );
 193  }
 194  
 195  
 196  /**
 197   * WP compatibility template tag - UNSUPPORTED.
 198   */
 199  function comments_rss_link( $link_text = 'Comments RSS', $commentsrssfilename = 'nolongerused' )
 200  {
 201      global $Item;
 202      $Item->feedback_feed_link( '_rss2', '', '', $link_text );
 203  }
 204  
 205  
 206  /**
 207   * WP compatibility template tag - UNSUPPORTED.
 208   */
 209  function the_category( $separator )
 210  {
 211      global $Item;
 212      $Item->categories( array(
 213                  'before'          => ' ',
 214                  'after'           => ' ',
 215                  'include_main'    => true,
 216                  'include_other'   => true,
 217                  'include_external'=> true,
 218                  'before_main'     => '',       // string fo display before the MAIN category,
 219                  'after_main'      => '',       // string fo display after the MAIN category
 220                  'before_other'    => '',       // string fo display before OTHER categories
 221                  'after_other'     => '',       // string fo display after OTHER categories
 222                  'before_external' => '<em>',   // string fo display before EXTERNAL categories
 223                  'after_external'  => '</em>',  // string fo display after EXTERNAL categories,
 224                  'separator'       => $separator,
 225                  'link_categories' => true,
 226                  'link_title'      => '#',
 227                  'format'          => 'htmlbody',
 228              ) );
 229  }
 230  
 231  
 232  /**
 233   * WP compatibility template tag - UNSUPPORTED.
 234   */
 235  function the_tags( $before = 'Tags: ', $sep = ', ', $after = '' )
 236  {
 237      global $Item;
 238      $Item->tags( array(
 239                  'before' =>           $before,
 240                  'after' =>            $after,
 241                  'separator' =>        $sep,
 242                  'links' =>            true,
 243              ) );
 244  }
 245  
 246  
 247  /**
 248   * WP compatibility template tag - UNSUPPORTED.
 249   */
 250  function edit_post_link()
 251  {
 252      global $Item;
 253      $Item->edit_link();
 254  }
 255  
 256  
 257  /**
 258   * WP compatibility template tag - UNSUPPORTED.
 259   */
 260  function comments_template()
 261  {
 262      // ------------------ FEEDBACK (COMMENTS/TRACKBACKS) INCLUDED HERE ------------------
 263      skin_include( '_item_feedback.inc.php', array(
 264              'before_section_title' => '<h3>',
 265              'after_section_title'  => '</h3>',
 266              'comment_list_start'  => "\n<ol>\n",
 267              'comment_list_end'  => "\n</ol>\n",
 268              'comment_start'  => '<li>',
 269              'comment_end'  => '</li>',
 270          'preview_start'  => '<ul><li id="comment_preview">',
 271          'preview_end'    => '</li></ul>',
 272          'comment_template'   => '_item_comment_wp.inc.php',    // The template used for displaying individual comments (including preview)
 273          ) );
 274      // Note: You can customize the default item feedback by copying the generic
 275      // /skins/_item_feedback.inc.php file into the current skin folder.
 276      // ---------------------- END OF FEEDBACK (COMMENTS/TRACKBACKS) ---------------------
 277  }
 278  
 279  
 280  /**
 281   * WP compatibility template tag - UNSUPPORTED.
 282   */
 283  function previous_posts_link( $link_text = 'Previous' )
 284  {
 285      global $MainList;
 286      if( !isset($MainList) )
 287      {
 288          return;
 289      }
 290      $MainList->page_links( array(
 291                  'block_start' => ' ',
 292                  'block_end' => ' ',
 293                  'block_single' => '',
 294                  'links_format' => '$prev$',
 295                  'prev_text' => $link_text,
 296              ) );
 297  }
 298  
 299  
 300  /**
 301   * WP compatibility template tag - UNSUPPORTED.
 302   */
 303  function next_posts_link( $link_text = 'Next' )
 304  {
 305      global $MainList;
 306      if( !isset($MainList) )
 307      {
 308          return;
 309      }
 310      $MainList->page_links( array(
 311                  'block_start' => ' ',
 312                  'block_end' => ' ',
 313                  'block_single' => '',
 314                  'links_format' => '$next$',
 315                  'next_text' => $link_text,
 316              ) );
 317  }
 318  
 319  ?>

title

Description

title

Description

title

Description

title

title

Body