[ Index ] |
|
Code source de SPIP Agora 1.4 |
1 <?php 2 /***************************************************** 3 * This file is part of Agora, web based content management system. 4 * 5 * Agora is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; version 2 of the License. 8 * 9 * Agora is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details (file "COPYING"). 13 * 14 * Copyright © Arnaud Martin, Antoine Pitrou et Philippe Rivière. 15 * List of authors detailed in "copyright_fr.html" file. 16 * E-mail : agora@sig.premier-ministre.gouv.fr 17 * Web site : http://www.agora.gouv.fr 18 *****************************************************/ 19 require_once 'include/settings.php'; 20 21 require_once 'design/top.php'; 22 23 echo '<div class="content">'; 24 echo '<h1>' . $db->getOne( 25 "SELECT lst_name FROM " . CM_TABLE_PREFIX . "_lists WHERE lst_id=" . $_GET['lst_id']). '</h1>'; 26 27 // new posts 28 if ($db->getOne( 29 "SELECT COUNT(*) FROM " . CM_TABLE_PREFIX . "_posts WHERE lst_id=" . $_GET['lst_id']. " AND pst_date_sent = 0") 30 > 0) { 31 ?> 32 33 <h2> New posts</h2> 34 35 <p> 36 Below is the list of posts that have been created but not sent:</p> 37 38 <?php 39 $posts = $db->query( 40 "SELECT * FROM " . CM_TABLE_PREFIX . "_posts WHERE lst_id=" . $_GET['lst_id']. " AND pst_date_sent = 0 ORDER BY pst_date_create DESC"); 41 while ($post = $posts->fetchRow()) { 42 ?> 43 44 <div class = "list"> 45 <h3><?php 46 echo $post['pst_subject'] 47 ?></h3> 48 49 <p> 50 Created: 51 52 <?php 53 echo date("m/d/Y H:i", $post['pst_date_create']) 54 ?></p> 55 56 <?php 57 if ($post['pst_date_update'] != 0) { 58 ?> 59 60 <p> 61 Modified: 62 63 <?php 64 echo date("m/d/Y H:i", $post['pst_date_update']) 65 ?></p> 66 67 <?php 68 } 69 ?> 70 71 <p> 72 Actions: 73 <a href = "post.php?pst_id=<?php echo $post['pst_id']?>&mode=text" target = "_blank"> 74 text preview</a>| 75 <a href = "post.php?pst_id=<?php echo $post['pst_id']?>&mode=html" target = "_blank"> 76 html preview</a>|<a href = "post_edit.php?pst_id=<?php echo $post['pst_id']?>">modify</a>| 77 <a href = "post_queue.php?pst_id=<?php echo $post['pst_id']?>">send</a> 78 </p> 79 </div> 80 81 <?php 82 } 83 } 84 85 // queued posts 86 if ($db->getOne( 87 "SELECT COUNT(*) FROM " . CM_TABLE_PREFIX . "_posts p, " . CM_TABLE_PREFIX . "_posts_queued q WHERE p.pst_id = q.pst_id AND p.lst_id=" . $_GET['lst_id']) > 0) 88 { 89 ?> 90 91 <h2> Queued posts</h2> 92 93 <p> 94 Below is the list of posts that have been processed but not fully sent:</p> 95 96 <?php 97 $posts = $db->query( 98 "SELECT DISTINCT p.*, q.pst_id FROM " . CM_TABLE_PREFIX . "_posts p, " . CM_TABLE_PREFIX . "_posts_queued q WHERE p.pst_id = q.pst_id AND p.lst_id=" . $_GET['lst_id']. " ORDER BY p.pst_date_sent DESC"); 99 while ($post = $posts->fetchRow()) { 100 $postInfo = array(); 101 $postInfo['sent'] = $db->getOne( 102 "SELECT COUNT(*) FROM " . CM_TABLE_PREFIX . "_posts_done WHERE pst_id = " . $post['pst_id']); 103 $postInfo['queued'] = $db->getOne( 104 "SELECT COUNT(*) FROM " . CM_TABLE_PREFIX . "_posts_queued WHERE pst_id = " . $post['pst_id']); 105 ?> 106 107 <div class = "list"> 108 <h3><?php 109 echo $post['pst_subject'] 110 ?></h3> 111 112 <p> 113 Created: 114 115 <?php 116 echo date("m/d/Y H:i", $post['pst_date_create']) 117 ?></p> 118 119 <p> 120 Sent: 121 122 <?php 123 echo date("m/d/Y H:i", $post['pst_date_sent']) 124 ?></p> 125 126 <p> 127 <?php 128 echo $postInfo['queued'] 129 ?> 130 131 message<?php 132 echo ($postInfo['queued'] > 1 ? 's' : '') 133 ?> 134 135 queued and 136 137 <?php 138 echo $postInfo['sent'] 139 ?> 140 141 message<?php 142 echo ($postInfo['sent'] > 1 ? 's' : '') 143 ?> 144 145 sent 146 </p> 147 148 <p> 149 Actions:<a href = "post.php?pst_id=<?php echo $post['pst_id']?>&mode=text" target = "_blank"> 150 text preview</a>| 151 <a href = "post.php?pst_id=<?php echo $post['pst_id']?>&mode=html" target = "_blank"> html preview</a> 152 </p> 153 </div> 154 155 <?php 156 } 157 } 158 159 // processed posts 160 $queuedList = implode(',', 161 $db->getCol( 162 "SELECT DISTINCT q.pst_id FROM " . CM_TABLE_PREFIX . "_posts p, " . CM_TABLE_PREFIX . "_posts_queued q WHERE p.pst_id = q.pst_id AND p.lst_id=" . $_GET['lst_id'])); 163 164 if ($db->getOne( 165 "SELECT COUNT(*) FROM " . CM_TABLE_PREFIX . "_posts WHERE pst_date_sent != 0 AND lst_id=" . $_GET['lst_id']. (strlen($queuedList) 166 > 0 167 ? " AND pst_id NOT IN (" . $queuedList . ")" 168 : '')) > 0) 169 { 170 ?> 171 172 <h2> Sent posts</h2> 173 174 <p> 175 Below is the list of posts that have already been fully sent:</p> 176 177 <?php 178 $posts = $db->query( 179 "SELECT * FROM " . CM_TABLE_PREFIX . "_posts WHERE pst_date_sent != 0 AND lst_id=" . $_GET['lst_id']. (strlen($queuedList) 180 > 0 181 ? " AND pst_id NOT IN (" . $queuedList . ")" 182 : ''). " ORDER BY pst_date_sent DESC"); 183 while ($post = $posts->fetchRow()) { 184 ?> 185 186 <div class = "list"> 187 <h3><?php 188 echo $post['pst_subject'] 189 ?></h3> 190 191 <p> 192 Created: 193 194 <?php 195 echo date("m/d/Y H:i", $post['pst_date_create']) 196 ?> 197 198 | Sent: 199 200 <?php 201 echo date("m/d/Y H:i", $post['pst_date_sent']) 202 ?> 203 204 </p> 205 206 <p> 207 Actions:<a href = "post.php?pst_id=<?php echo $post['pst_id']?>&mode=text" target = "_blank"> 208 text preview</a>| 209 <a href = "post.php?pst_id=<?php echo $post['pst_id']?>&mode=html" target = "_blank"> html preview</a> 210 </p> 211 </div> 212 213 <?php 214 } 215 } 216 ?> 217 218 <p> 219 <a href = "post_edit.php?lst_id=<?php echo $_GET['lst_id']?>&pst_id=-1">Create</a> a new post!</p> 220 221 </div> 222 223 <?php 224 require_once 'design/bottom.php'; 225 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sat Feb 24 14:40:03 2007 | par Balluche grâce à PHPXref 0.7 |