Project

General

Profile

« Previous | Next » 

Revision 600

Added by thorn almost 17 years ago

module news: added publish_until field to control the visibility of a news-posting by date and time

View differences:

modify.php
82 82
				}
83 83
				?>
84 84
			</td>
85
			<td width="80">
85
			<td width="120">
86 86
				<?php echo $TEXT['COMMENTS'].': ';
87 87
				// Get number of comments
88 88
				$query_title = $database->query("SELECT title FROM ".TABLE_PREFIX."mod_news_comments WHERE post_id = '".$post['post_id']."'");
......
93 93
				<?php echo $TEXT['ACTIVE'].': '; if($post['active'] == 1) { echo $TEXT['YES']; } else { echo $TEXT['NO']; } ?>
94 94
			</td>
95 95
			<td width="20">
96
			<?php
97
			$start = $post['published_when'];
98
			$end = $post['published_until'];
99
			$t = time();
100
			$icon = '';
101
			if($start<=$t && $end==0)
102
				$icon=ADMIN_URL.'/images/noclock_16.png';
103
			elseif(($start<=$t || $start==0) && $end>=$t)
104
				$icon=ADMIN_URL.'/images/clock_16.png';
105
			else
106
				$icon=ADMIN_URL.'/images/clock_red_16.png';
107
			?>
108
			<a href="<?php echo WB_URL; ?>/modules/news/modify_post.php?page_id=<?php echo $page_id; ?>&section_id=<?php echo $section_id; ?>&post_id=<?php echo $post['post_id']; ?>" title="<?php echo $TEXT['MODIFY']; ?>">
109
				<img src="<?php echo $icon; ?>" border="0" alt="" />
110
			</td>
111
			<td width="20">
96 112
			<?php if($post['position'] != $num_posts) { ?>
97 113
				<a href="<?php echo WB_URL; ?>/modules/news/move_down.php?page_id=<?php echo $page_id; ?>&section_id=<?php echo $section_id; ?>&post_id=<?php echo $post['post_id']; ?>" title="<?php echo $TEXT['MOVE_UP']; ?>">
98 114
					<img src="<?php echo ADMIN_URL; ?>/images/up_16.png" border="0" alt="^" />

Also available in: Unified diff