Changeset 21
- Timestamp:
- 12/28/2004 09:56:41 PM (21 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
-
bb-includes/functions.php (modified) (2 diffs)
-
bb-includes/template-functions.php (modified) (4 diffs)
-
bb-templates/profile.php (modified) (1 diff)
-
bb-templates/rss2.php (added)
-
bb-templates/search.php (modified) (1 diff)
-
bb-templates/topic.php (modified) (2 diffs)
-
rss.php (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bb-includes/functions.php
r18 r21 19 19 } 20 20 21 function get_thread( $topic, $page = 0 ) {22 global $bbdb , $bb;21 function get_thread( $topic, $page = 0, $reverse = 0 ) { 22 global $bbdb; 23 23 24 24 $limit = bb_get_option('page_topics'); 25 25 if ( $page ) 26 26 $limit = ($limit * $page) . ", $limit"; 27 return $bbdb->get_results("SELECT * FROM $bbdb->posts WHERE topic_id = $topic ORDER BY post_time ASC LIMIT $limit"); 27 $order = ($reverse) ? 'DESC' : 'ASC'; 28 29 return $bbdb->get_results("SELECT * FROM $bbdb->posts WHERE topic_id = $topic ORDER BY post_time $order LIMIT $limit"); 28 30 } 29 31 … … 42 44 $limit = ($limit * $page) . ", $limit"; 43 45 return $bbdb->get_results("SELECT * FROM $bbdb->topics $where ORDER BY topic_time DESC LIMIT $limit"); 46 } 47 48 function get_latest_posts( $num ) { 49 global $bbdb; 50 $num = (int) $num; 51 return $bbdb->get_results("SELECT * FROM $bbdb->posts ORDER BY post_time DESC LIMIT $num"); 44 52 } 45 53 -
trunk/bb-includes/template-functions.php
r19 r21 152 152 } 153 153 154 function topic_rss_link( $id = 0 ) { 155 echo bb_apply_filters('topic_link', get_topic_rss_link($id) ); 156 } 157 158 function get_topic_rss_link( $id = 0 ) { 159 global $topic; 160 161 if ( $id ) 162 $topic = get_topic( $id ); 163 164 if ( bb_get_option('mod_rewrite') ) 165 $link = bb_get_option('uri') . $topic->topic_id . '/rss/'; 166 else 167 $link = bb_get_option('uri') . "rss.php?topic=$topic->topic_id"; 168 169 return bb_apply_filters('get_topic_rss_link', $link); 170 } 171 154 172 function get_topic_link( $id = 0 ) { 155 global $topic , $bb;173 global $topic; 156 174 157 175 if ( $id ) … … 159 177 160 178 if ( bb_get_option('mod_rewrite') ) 161 $link = bb_get_option(' path') . $topic->topic_id;162 else 163 $link = bb_get_option(' path') . "topic.php?id=$topic->topic_id";179 $link = bb_get_option('uri') . $topic->topic_id; 180 else 181 $link = bb_get_option('uri') . "topic.php?id=$topic->topic_id"; 164 182 165 183 return bb_apply_filters('get_topic_link', $link); … … 199 217 200 218 function topic_date( $format = '', $id = 0 ) { 201 echo date( $format, get_topic_timestamp( $id ) );219 echo gmdate( $format, get_topic_timestamp( $id ) ); 202 220 } 203 221 … … 280 298 281 299 function post_date( $format ) { 282 echo date( $format, get_post_timestamp() );300 echo gmdate( $format, get_post_timestamp() ); 283 301 } 284 302 -
trunk/bb-templates/profile.php
r18 r21 5 5 <dl id="userinfo"> 6 6 <dt>Member Since</dt> 7 <dd><?php echo date('F j, Y', $ts); ?> (<?php echo bb_since($ts); ?>)</dd>7 <dd><?php echo gmdate('F j, Y', $ts); ?> (<?php echo bb_since($ts); ?>)</dd> 8 8 <?php 9 9 if ($user->user_website) : -
trunk/bb-templates/search.php
r16 r21 17 17 ?> 18 18 <li><h4><a href="<?php topic_link(); ?>"><?php topic_title(); ?></a></h4> 19 <small><?php echo $count; ?> replies — Last reply <?php echo date('F j, Y', $topic->posttime); ?> </small>19 <small><?php echo $count; ?> replies — Last reply <?php echo gmdate('F j, Y', $topic->posttime); ?> </small> 20 20 </li> 21 21 <?php endforeach; ?> -
trunk/bb-templates/topic.php
r10 r21 3 3 <?php login_form(); ?> 4 4 5 <h 2><a href="<?php option('uri'); ?>"><?php option('name'); ?></a> » <a href="<?php forum_link(); ?>"><?php forum_name(); ?></a></h2>6 <h 3><?php topic_title(); ?></h3>5 <h3><a href="<?php option('uri'); ?>"><?php option('name'); ?></a> » <a href="<?php forum_link(); ?>"><?php forum_name(); ?></a></h3> 6 <h2><?php topic_title(); ?></h2> 7 7 <?php if ($posts) : ?> 8 8 <div class="nav"> … … 28 28 </ol> 29 29 <div class="clearit"><br style=" clear: both;" /></div> 30 <p><a href="<?php topic_rss_link(); ?>">RSS feed for this thread</a></p> 30 31 <div class="nav"> 31 32 <?php topic_pages(); ?>
Note: See TracChangeset
for help on using the changeset viewer.