|
1 <?php |
|
2 /* |
|
3 Template Name: Links |
|
4 */ |
|
5 ?> |
|
6 |
|
7 <?php |
|
8 get_header(); |
|
9 $linkcats = $wpdb->get_results("SELECT T1.name AS name FROM $wpdb->terms T1, $wpdb->term_taxonomy T2 WHERE T1.term_id = T2.term_id AND T2.taxonomy = 'link_category'"); |
|
10 ?> |
|
11 |
|
12 <?php if (have_posts()) : the_post(); update_post_caches($posts); ?> |
|
13 |
|
14 <div class="post" id="post-<?php the_ID(); ?>"> |
|
15 <h2> |
|
16 <?php if ( $user_ID ) : ?> |
|
17 <div class="act"> |
|
18 <span class="addlink"><a href="<?php echo get_settings('siteurl'); ?>/wp-admin/link-add.php"><?php _e('Add link', 'inove'); ?></a></span> |
|
19 <span class="editlinks"><a href="<?php echo get_settings('siteurl'); ?>/wp-admin/link-manager.php"><?php _e('Edit links', 'inove'); ?></a></span> |
|
20 </div> |
|
21 <?php endif; ?> |
|
22 <?php the_title(); ?> |
|
23 </h2> |
|
24 <div class="info"> |
|
25 <span class="date"><?php the_modified_time(__('F jS, Y', 'inove')); ?></span> |
|
26 <?php edit_post_link(__('Edit', 'inove'), '<span class="editpost">', '</span>'); ?> |
|
27 <?php if ($comments || comments_open()) : ?> |
|
28 <span class="addcomment"><a href="#respond"><?php _e('Leave a comment', 'inove'); ?></a></span> |
|
29 <span class="comments"><a href="#comments"><?php _e('Go to comments', 'inove'); ?></a></span> |
|
30 <?php endif; ?> |
|
31 <div class="fixed"></div> |
|
32 </div> |
|
33 <div class="content"> |
|
34 |
|
35 <?php if($linkcats) : foreach($linkcats as $linkcat) : ?> |
|
36 <div class="boxcaption"><h3><?php echo $linkcat->name; ?></h3></div> |
|
37 <div class="box linkcat"> |
|
38 <ul> |
|
39 <?php |
|
40 $bookmarks = get_bookmarks('orderby=rand&category_name=' . $linkcat->name); |
|
41 if ( !empty($bookmarks) ) { |
|
42 foreach ($bookmarks as $bookmark) { |
|
43 echo '<li><a href="' . $bookmark->link_url . '" title="' . $bookmark->link_description . '">' . $bookmark->link_name . '</a></li>'; |
|
44 } |
|
45 } |
|
46 ?> |
|
47 </ul> |
|
48 <div class="fixed"></div> |
|
49 </div> |
|
50 <?php endforeach; endif; the_content(); ?> |
|
51 <div class="fixed"></div> |
|
52 </div> |
|
53 </div> |
|
54 |
|
55 <?php include('templates/comments.php'); ?> |
|
56 |
|
57 <?php else : ?> |
|
58 <div class="errorbox"> |
|
59 <?php _e('Sorry, no posts matched your criteria.', 'inove'); ?> |
|
60 </div> |
|
61 <?php endif; ?> |
|
62 |
|
63 <?php get_footer(); ?> |