[ Index ] |
|
Code source de b2evolution 2.1.0-beta |
1 <?php 2 /** 3 * This is a demo template displaying multiple blogs on the same page 4 * 5 * If you're new to b2evolution templates or skins, you should not start with this file 6 * It will be easier to start examining blog_a.php or noskin_a.php for instance... 7 * 8 * @package evoskins 9 * @subpackage noskin 10 */ 11 12 # First blog will be displayed the regular way (why bother?) 13 $blog = 1; 14 15 # Tell b2evolution you don't want to use evoSkins 16 # (evoSkins are designed to display only one blog at once + optionnaly a linkblog) 17 $skin = ''; 18 19 # This setting retricts posts to those published, thus hiding drafts. 20 # You should not have to change this. 21 $show_statuses = array(); 22 23 # Here you can set a limit before which posts will be ignored 24 # You can use a unix timestamp value or 'now' which will hide all posts in the past 25 $timestamp_min = ''; 26 27 # Here you can set a limit after which posts will be ignored 28 # You can use a unix timestamp value or 'now' which will hide all posts in the future 29 $timestamp_max = 'now'; 30 31 # Additionnaly, you can set other values (see URL params in the manual)... 32 # $order = 'ASC'; // This for example would display the blog in chronological order... 33 34 /** 35 * Let b2evolution handle the query string and load the blog data: 36 */ 37 require_once dirname(__FILE__).'/conf/_config.php'; 38 39 require_once $inc_path.'_blog_main.inc.php'; 40 41 // Make sure includes will check in the current folder! 42 $ads_current_skin_path = dirname(__FILE__).'/'; 43 44 45 # Now, below you'll find the magic template... 46 47 48 // This is the main template; it may be used to display very different things. 49 // Do inits depending on current $disp: 50 skin_init( $disp ); 51 52 header( 'Content-type: text/html; charset='.$io_charset ); 53 ?> 54 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 55 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php locale_lang() ?>" lang="<?php locale_lang() ?>"><!-- InstanceBegin template="/Templates/Standard.dwt" codeOutsideHTMLIsLocked="false" --> 56 <head> 57 <!-- InstanceBeginEditable name="doctitle" --> 58 <title><?php 59 // ------------------------- TITLE FOR THE CURRENT REQUEST ------------------------- 60 request_title( array( 61 'title_before'=> '', 62 'title_after' => ' - ', 63 'title_none' => '', 64 'glue' => ' - ', 65 'format' => 'htmlhead', 66 ) ); 67 // ------------------------------ END OF REQUEST TITLE ----------------------------- 68 ?>Multiblog Demo</title> 69 <!-- InstanceEndEditable --> 70 <link rel="stylesheet" href="rsc/css/fp02.css" type="text/css" /> 71 <!-- InstanceBeginEditable name="head" --> 72 <?php skin_base_tag(); /* You're not using any skin here but this won't hurt. However it will be very helpful to have this here when you make the switch to a skin! */ ?> 73 <meta name="description" content="<?php $Blog->disp( 'shortdesc', 'htmlattr' ); ?>" /> 74 <meta name="keywords" content="<?php $Blog->disp( 'keywords', 'htmlattr' ); ?>" /> 75 <meta name="generator" content="b2evolution <?php echo $app_version ?>" /> <!-- Please leave this for stats --> 76 <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php $Blog->disp( 'rss2_url', 'raw' ) ?>" /> 77 <link rel="alternate" type="application/atom+xml" title="Atom" href="<?php $Blog->disp( 'atom_url', 'raw' ) ?>" /> 78 <!-- InstanceEndEditable --> 79 </head> 80 <body> 81 <!-- InstanceBeginEditable name="ToolBar" --> 82 <?php 83 // ---------------------------- TOOLBAR INCLUDED HERE ---------------------------- 84 require $skins_path.'_toolbar.inc.php'; 85 // ------------------------------- END OF TOOLBAR -------------------------------- 86 ?> 87 <!-- InstanceEndEditable --> 88 89 <div class="pageHeader"> 90 <div class="pageHeaderContent"> 91 92 <!-- InstanceBeginEditable name="NavBar2" --> 93 <?php 94 // --------------------------------- START OF BLOG LIST -------------------------------- 95 skin_widget( array( 96 // CODE for the widget: 97 'widget' => 'colls_list_public', 98 // Optional display params 99 'block_start' => '<div class="NavBar">', 100 'block_end' => '</div>', 101 'block_display_title' => false, 102 'list_start' => '', 103 'list_end' => '', 104 'item_start' => '', 105 'item_end' => '', 106 'item_selected_start' => '', 107 'item_selected_end' => '', 108 'link_selected_class' => 'NavButton2', 109 'link_default_class' => 'NavButton2', 110 ) ); 111 // ---------------------------------- END OF BLOG LIST --------------------------------- 112 ?> 113 <!-- InstanceEndEditable --> 114 115 <div class="NavBar"> 116 <div class="pageTitle"> 117 <h1 id="pageTitle"><!-- InstanceBeginEditable name="PageTitle" --><?php echo T_('Multiblog demo') ?><!-- InstanceEndEditable --></h1> 118 </div> 119 </div> 120 121 <div class="pageHeaderEnd"></div> 122 123 </div> 124 </div> 125 126 127 <div class="pageSubTitle"><!-- InstanceBeginEditable name="SubTitle" --><?php echo T_('This demo template displays 3 blogs at once (1 on the left, 2 on the right)') ?><!-- InstanceEndEditable --></div> 128 129 130 <div class="main"><!-- InstanceBeginEditable name="Main" --> 131 132 <!-- =================================== START OF MAIN AREA =================================== --> 133 134 <div class="bPosts"> 135 <h2>#1: <a href="<?php $Blog->disp( 'blogurl', 'raw' ) ?>"><?php echo $Blog->disp( 'name', 'htmlbody' ) ?></a></h2> 136 137 <?php 138 // ------------------------- TITLE FOR THE CURRENT REQUEST ------------------------- 139 request_title( array( 140 'title_before'=> '<h2>', 141 'title_after' => '</h2>', 142 'title_none' => '', 143 'glue' => ' - ', 144 'title_single_disp' => true, 145 'format' => 'htmlbody', 146 ) ); 147 // ------------------------------ END OF REQUEST TITLE ----------------------------- 148 ?> 149 150 <?php // ------------------------------------ START OF POSTS ---------------------------------------- 151 // Display message if no post: 152 display_if_empty(); 153 154 while( $Item = & mainlist_get_item() ) 155 { // For each blog post, do everything below up to the closing curly brace "}" 156 ?> 157 158 <?php 159 // ------------------------------ DATE SEPARATOR ------------------------------ 160 $MainList->date_if_changed( array( 161 'before' => '<h2>', 162 'after' => '</h2>', 163 'date_format' => '#', 164 ) ); 165 ?> 166 167 <div class="bPost" lang="<?php $Item->lang() ?>"> 168 <?php $Item->anchor(); ?> 169 <div class="bSmallHead"> 170 <?php 171 $Item->permanent_link( array( 172 'text' => '#icon#', 173 ) ); 174 ?> 175 <?php 176 $Item->issue_time(); // Post issue time 177 ?> 178 <?php 179 $Item->categories( array( 180 'before' => ', '.T_('Categories').': ', 181 'after' => ' ', 182 'include_main' => true, 183 'include_other' => true, 184 'include_external'=> true, 185 'link_categories' => true, 186 ) ); 187 ?> 188 </div> 189 <h3 class="bTitle"><?php $Item->title(); ?></h3> 190 191 <?php 192 // ---------------------- POST CONTENT INCLUDED HERE ---------------------- 193 skin_include( '_item_content.inc.php', array( 194 'image_size' => 'fit-400x320', 195 ) ); 196 // Note: You can customize the default item feedback by copying the generic 197 // /skins/_item_feedback.inc.php file into the current skin folder. 198 // -------------------------- END OF POST CONTENT ------------------------- 199 ?> 200 201 <div class="bSmallPrint"> 202 <?php 203 // Link to comments, trackbacks, etc.: 204 $Item->feedback_link( array( 205 'type' => 'comments', 206 'link_before' => '', 207 'link_after' => ' • ', 208 'link_text_zero' => '#', 209 'link_text_one' => '#', 210 'link_text_more' => '#', 211 'link_title' => '#', 212 'use_popup' => false, 213 ) ); 214 ?> 215 <?php 216 // Link to comments, trackbacks, etc.: 217 $Item->feedback_link( array( 218 'type' => 'trackbacks', 219 'link_before' => '', 220 'link_after' => ' • ', 221 'link_text_zero' => '#', 222 'link_text_one' => '#', 223 'link_text_more' => '#', 224 'link_title' => '#', 225 'use_popup' => false, 226 ) ); 227 ?> 228 229 <?php $Item->permanent_link(); ?> 230 </div> 231 232 <?php 233 // ------------------ FEEDBACK (COMMENTS/TRACKBACKS) INCLUDED HERE ------------------ 234 skin_include( '_item_feedback.inc.php', array( 235 'before_section_title' => '<h4>', 236 'after_section_title' => '</h4>', 237 ) ); 238 // Note: You can customize the default item feedback by copying the generic 239 // /skins/_item_feedback.inc.php file into the current skin folder. 240 // ---------------------- END OF FEEDBACK (COMMENTS/TRACKBACKS) --------------------- 241 ?> 242 </div> 243 <?php 244 } // ---------------------------------- END OF POSTS ------------------------------------ 245 ?> 246 247 <?php 248 // -------------------- PREV/NEXT PAGE LINKS (POST LIST MODE) -------------------- 249 mainlist_page_links( array( 250 'block_start' => '<p class="center"><strong>', 251 'block_end' => '</strong></p>', 252 'links_format' => '$prev$ :: $next$', 253 'prev_text' => '<< '.T_('Previous'), 254 'next_text' => T_('Next').' >>', 255 ) ); 256 // ------------------------- END OF PREV/NEXT PAGE LINKS ------------------------- 257 ?> 258 259 <?php 260 // -------------- MAIN CONTENT TEMPLATE INCLUDED HERE (Based on $disp) -------------- 261 skin_include( '$disp$', array( 262 'disp_posts' => '', // We already handled this case above 263 'disp_single' => '', // We already handled this case above 264 'disp_page' => '', // We already handled this case above 265 ) ); 266 // Note: you can customize any of the sub templates included here by 267 // copying the matching php file into your skin directory. 268 // ------------------------- END OF MAIN CONTENT TEMPLATE --------------------------- 269 ?> 270 271 </div> 272 273 <!-- =================================== START OF SIDEBAR =================================== --> 274 275 <div class="bSideBar"> 276 277 <!-- =================================== START OF BLOG B =================================== --> 278 279 <div class="bSideItem"> 280 <?php 281 $BlogCache = & get_Cache( 'BlogCache' ); 282 $Blog_B = & $BlogCache->get_by_ID( 2, false ); 283 if( empty($Blog_B) ) 284 { 285 echo T_('Blog #2 doesn\'t seem to exist.'); 286 } 287 else 288 { 289 ?> 290 291 <h3>#2: <a href="<?php $Blog_B->disp( 'blogurl', 'raw' ) ?>"><?php echo $Blog_B->disp( 'name', 'htmlbody' ) ?></a></h3> 292 <?php 293 $BlogBList = & new ItemList2( $Blog_B, $timestamp_min, $timestamp_max, $posts ); 294 295 $BlogBList->set_filters( array( 296 'authors' => $author, 297 'ymdhms' => $m, 298 'week' => $w, 299 'order' => $order, 300 'orderby' => $orderby, 301 'unit' => $unit, 302 ) ); 303 304 // Run the query: 305 $BlogBList->query(); 306 307 while( $Item = & $BlogBList->get_item() ) 308 { 309 ?> 310 <div class="bPostSide" lang="<?php $Item->lang() ?>"> 311 <?php $Item->anchor(); ?> 312 <h4 class="bTitle"> 313 <?php 314 $Item->permanent_link( array( 315 'text' => '#icon#', 316 ) ); 317 ?> 318 <?php $Item->title(); ?> 319 </h4> 320 <div class="bText"> 321 <?php 322 // Display CONTENT (teaser only): 323 $Item->content_teaser( array( 324 'before' => '', 325 'after' => '', 326 'disppage' => 1, 327 'stripteaser' => false, 328 ) ); 329 ?> 330 </div> 331 </div> 332 <?php 333 } 334 } 335 ?> 336 </div> 337 338 <!-- =================================== START OF BLOG C =================================== --> 339 340 <div class="bSideItem"> 341 <?php 342 $Blog_roll = & $BlogCache->get_by_ID( 3, false ); 343 if( empty($Blog_roll) ) 344 { 345 echo T_('Blog #3 doesn\'t seem to exist.'); 346 } 347 else 348 { 349 ?> 350 <h3>#3: <a href="<?php $Blog_roll->disp( 'blogurl', 'raw' ) ?>"><?php echo $Blog_roll->disp( 'name', 'htmlbody' ) ?></a></h3> 351 <?php 352 $LinkblogList = & new ItemList2( $Blog_roll, $timestamp_min, $timestamp_max, $posts ); 353 354 $LinkblogList->set_filters( array( 355 'authors' => $author, 356 'ymdhms' => $m, 357 'week' => $w, 358 'order' => $order, 359 'orderby' => $orderby, 360 'unit' => $unit, 361 ) ); 362 363 // Run the query: 364 $LinkblogList->query(); 365 366 while( $Item = & $LinkblogList->get_item() ) 367 { 368 ?> 369 <div class="bPostSide" lang="<?php $Item->lang() ?>"> 370 <?php $Item->anchor(); ?> 371 <h4 class="bTitle"> 372 <?php 373 $Item->permanent_link( array( 374 'text' => '#icon#', 375 ) ); 376 ?> 377 <?php $Item->title(); ?> 378 </h4> 379 <div class="bText"> 380 <?php 381 // Display CONTENT (teaser only): 382 $Item->content_teaser( array( 383 'before' => '', 384 'after' => '', 385 'disppage' => 1, 386 'stripteaser' => false, 387 ) ); 388 ?> 389 </div> 390 </div> 391 <?php 392 } 393 } 394 ?> 395 </div> 396 397 <!-- =================================== END OF BLOG C =================================== --> 398 399 <div class="bSideItem"> 400 <h3><?php echo T_('Misc') ?></h3> 401 <ul> 402 <?php 403 // Administrative links: 404 user_login_link( '<li>', '</li>' ); 405 user_register_link( '<li>', '</li>' ); 406 user_admin_link( '<li>', '</li>' ); 407 user_profile_link( '<li>', '</li>' ); 408 user_subs_link( '<li>', '</li>' ); 409 user_logout_link( '<li>', '</li>' ); 410 ?> 411 </ul> 412 </div> 413 414 </div> 415 <!-- InstanceEndEditable --></div> 416 <table cellspacing="3" class="wide"> 417 <tr> 418 <td class="cartouche">Original page design by <a href="http://fplanque.net/">François PLANQUE</a> </td> 419 420 <td class="cartouche" align="right"> <a href="http://b2evolution.net/" title="b2evolution home"><img src="rsc/img/b2evolution_button.png" alt="b2evolution" width="80" height="15" class="middle" /></a></td> 421 </tr> 422 </table> 423 <!-- InstanceBeginEditable name="Baseline" --> 424 </p> 425 <?php 426 $Hit->log(); // log the hit on this page 427 debug_info(); // output debug info if requested 428 ?> 429 <p><!-- Note: don't mess with the template here :/ --><!-- InstanceEndEditable --> 430 </body> 431 <!-- InstanceEnd --></html>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Thu Nov 29 23:58:50 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |