Advertisement
grysom

Untitled

May 1st, 2011
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.09 KB | None | 0 0
  1.  
  2. <div id="sidebar">
  3.  
  4.  
  5.  
  6. <div id="sidebar-top">
  7. <?php /* Widgetized sidebar, if you have the plugin installed. */ if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(1) ) : ?>
  8. <!--<h3><?php _e('Štítky:','arthemia');?></h3>
  9. <?php wp_tag_cloud(''); ?>-->
  10. <?php endif; ?>
  11. </div>
  12.  
  13.  
  14. <div id="sidebar-middle" class="clearfloat">
  15. <div id="sidebar-left">
  16. <?php /* Widgetized sidebar, if you have the plugin installed. */ if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(2) ) : ?>
  17.  
  18. <h3>Poslední příspěvky</h3>
  19. <ul>
  20. <?php wp_get_archives('title_li=&type=postbypost&limit=5'); ?>
  21. </ul>
  22.  
  23. <h3>Komiksy</h3>
  24. <ul>
  25. <?php
  26. $args=array(
  27. 'orderby' => 'name',
  28. 'order' => 'ASC'
  29. );
  30.  
  31. $categories=get_categories($args);
  32.  
  33. foreach($categories as $category) {
  34. if ( $category->term_id == 3 || $category->term_id == 5 || $category->term_id == 1 ) continue;
  35. echo '<li><a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "Ukaž všechno uložené v %" ), $category->name ) . '" ' . '>' . $category->name.'</a></li>';
  36. }
  37.  
  38. ?>
  39. </ul>
  40. <?php endif; ?>
  41.  
  42.  
  43.  
  44.  
  45. </div>
  46.  
  47. <div id="sidebar-right">
  48. <?php /* Widgetized sidebar, if you have the plugin installed. */ if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(3) ) : ?>
  49.  
  50.  
  51. <?php endif; ?>
  52.  
  53. <h3>Poslední komenty</h3>
  54. <ul>
  55. <?php
  56. global $wpdb;
  57. $sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID,
  58. comment_post_ID, comment_author, comment_date_gmt, comment_approved,
  59. comment_type,comment_author_url,
  60. SUBSTRING(comment_content,1,30) AS com_excerpt
  61. FROM $wpdb->comments
  62. LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID =
  63. $wpdb->posts.ID)
  64. WHERE comment_approved = '1' AND comment_type = '' AND
  65. post_password = ''
  66. ORDER BY comment_date_gmt DESC
  67. LIMIT 5";
  68. $comments = $wpdb->get_results($sql);
  69. $output = $pre_HTML;
  70. $output .= "\n<ul>";
  71. foreach ($comments as $comment) {
  72. $output .= "\n<li>".strip_tags($comment->comment_author)
  73. .":" . "<a href=\"" . get_permalink($comment->ID) .
  74. "#comment-" . $comment->comment_ID . "\" title=\"on " .
  75. $comment->post_title . "\">" . strip_tags($comment->com_excerpt)
  76. ."</a></li>";
  77. }
  78. $output .= "\n</ul>";
  79. $output .= $post_HTML;
  80. echo $output;?>
  81. </ul>
  82.  
  83. </div>
  84.  
  85. </div>
  86.  
  87. <div id="sidebar-bottom">
  88. <?php /* Widgetized sidebar, if you have the plugin installed. */ if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(4) ) : ?>
  89.  
  90.  
  91. <?php endif; ?>
  92. </div>
  93.  
  94. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement