Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

entry.admin.php

Go to the documentation of this file.
00001 <?php 00002 if(!isset($_GET['action'])) 00003 { 00004 if(isset($_GET['id']) && !empty($_GET['id'])) 00005 { 00006 ?> 00007 <p>Choose an action :</p> 00008 <ul> 00009 <li><a href="/admin.php?page=feed&user=<?php echo $_GET['user'];?>&amp;action=edit&amp;<?php echo $_GET['id'];?>">edit</a></li> 00010 <li><a href="/admin.php?page=feed&user=<?php echo $_GET['user'];?>&amp;action=del&amp;<?php echo $_GET['id'];?>">delete</a></li> 00011 </ul> 00012 <?php 00013 } 00014 else 00015 { 00016 ?> 00017 <p><strong>Error</strong>, go <a href="/admin.php?page=feed&user=<?php echo $_GET['user'];?>">back to the feed</a>.</p> 00018 <?php 00019 } 00020 } 00021 elseif($_GET['id'] && $_GET['action'] == 'edit') 00022 { 00023 $data = ($atom->getEntryData($_GET['user'],$_GET['id'])); 00024 00025 //$data['content'] = str_replace("[:space:]*",' ',$data['content']); 00026 $data['content'] = str_replace("\t",' ',$data['content']); 00027 00028 ?> 00029 <form method="post" action="?page=entry&amp;user=<?php echo $_GET['user'];?>&amp;action=update&amp;id=<?php echo $_GET['id'];?>"> 00030 <fieldset> 00031 <legend>Edit entry</legend> 00032 <input type="hidden" name="id" value="<?php echo $_GET['id'];?>"/> 00033 <label> 00034 title : <input type="text" name="title" value="<?php echo $data['title'];?>" /> 00035 </label> 00036 <label> 00037 issued: <span class="label"><?php echo $data['issued'];?></span> 00038 </label> 00039 <label> 00040 modified : <span class="label"><?php echo $data['modified'];?></span> 00041 </label> 00042 <label> 00043 summary : <textarea rows="5" cols="20" name="summary"><?php echo $data['summary'];?></textarea> 00044 </label> 00045 <label> 00046 content : <textarea rows="15" cols="20" name="content"><?php echo htmlentities($data['content'],ENT_NOQUOTES,"UTF-8");?></textarea> 00047 </label> 00048 <p>The content <strong>must</strong> be xml valid !</p> 00049 <input type="submit" class="submit" value="update entry" /> 00050 </fieldset> 00051 </form> 00052 <?php 00053 00054 } 00055 // protection d'usage. 00056 elseif($_GET['id'] && $_GET['id'] == $_POST['id'] && $_GET['action'] == 'update') 00057 { 00058 if (get_magic_quotes_gpc ()) 00059 { 00060 while (list($key) = each($_POST)) 00061 { 00062 $_POST[$key] = stripslashes($_POST[$key]); 00063 } 00064 } 00065 00066 $_POST['content'] = str_replace(' ',"\t",$_POST['content']); 00067 00068 $_POST['title'] = htmlent($_POST['title']); 00069 $_POST['summary'] = htmlent($_POST['summary']); 00070 00071 if($atom->setEntryData($_GET['user'],$_GET['id'],$_POST)) 00072 { 00073 ?> 00074 <p>updated</p> 00075 <?php 00076 } 00077 else 00078 { 00079 ?> 00080 <p>failed</p> 00081 <?php 00082 } 00083 } 00084 elseif($_GET['action'] == 'new') 00085 { 00086 ?> 00087 <form method="post" action="?page=entry&amp;user=<?php echo $_GET['user'];?>&amp;action=add"> 00088 <fieldset> 00089 <legend>New entry</legend> 00090 <label> 00091 title : <input type="text" name="title" /> 00092 </label> 00093 <label> 00094 summary : <textarea rows="5" cols="20" name="summary"></textarea> 00095 </label> 00096 <label> 00097 content : <textarea rows="15" cols="20" name="content"> 00098 &lt;div xmlns="http://www.w3.org/1999/xhtml"&gt; 00099 &lt;p&gt;your code here&lt;/p&gt; 00100 &lt;/div&gt; 00101 </textarea> 00102 </label> 00103 <p>The content <strong>must</strong> be xml valid !</p> 00104 <input type="submit" class="submit" value="add entry" /> 00105 </fieldset> 00106 </form> 00107 <?php 00108 } 00109 elseif($_GET['action'] == 'add') 00110 { 00111 if (get_magic_quotes_gpc ()) 00112 { 00113 while (list($key) = each($_POST)) 00114 { 00115 $_POST[$key] = stripslashes($_POST[$key]); 00116 } 00117 } 00118 $_POST['title'] = htmlent($_POST['title']); 00119 $_POST['summary'] = htmlent($_POST['summary']); 00120 00121 if($atom->addEntryData($_GET['user'], $_POST)) 00122 { 00123 ?> 00124 <p>created</p> 00125 <?php 00126 } 00127 else 00128 { 00129 ?> 00130 <p>failed</p> 00131 <?php 00132 } 00133 } 00134 elseif($_GET['action'] == 'del' && isset($_GET['id']) && !empty($_GET['id'])) 00135 { 00136 if($atom->delEntry($_GET['user'], $_GET['id'])) 00137 { 00138 ?> 00139 <p>deleted</p> 00140 <?php 00141 } 00142 else 00143 { 00144 ?> 00145 <p>failed</p> 00146 <?php 00147 } 00148 } 00149 ?>

Generated on Fri Jun 25 00:00:22 2004 for a(tom)Blog by doxygen 1.3.7