ruạṛ
<?php /** * Write or edit a blog article * @version 0.10.0 * @author Callum Muir <cmuirnz@gmail.com> * @author Robert Urquhart <programmer@activatedesign.co.nz> * @package WEP-CMS */ session_start(); require_once $_SERVER['DOCUMENT_ROOT'].'/admin/scripts-includes/universal.php'; require_once $_SERVER['DOCUMENT_ROOT'].'/admin/scripts-includes/display.php'; $connID = connect_to_db(); if(!$article_id = is_numeric_id($_GET['article_id'])) { getout('Article not found','blog.php'); exit; } $a = new Blog($article_id); if(!$a->article_id) { getout("Article not found", "blog.php"); exit; } $date = explode(" ", $a->date); head("blog", "Edit an article"); echo "<h1>\n"; echo "Edit " . $a->name. "\n"; echo "</h1>\n"; echo "<p></p>\n"; echo "<form action='processes/process-blog-edit.php' method='post' enctype='multipart/form-data' name='blog-edit' id='blog-edit'>\n"; echo "<input name='article_id' id='article_id' type='hidden' value='" . $article_id . "' />\n"; echo "<div class='mock_table'>\n"; echo "<label for='article_title'><span class='right'>Article Title:</span><span class='left'><input name='article_title' id='article_title' type='text' size='60' maxlength='120' value='" . $a->title . "' /></span></label>\n"; echo "<label for='date'><span class='right'>Date (YYYY-MM-DD):</span><span class='left'><input name='date' id='date' class='date' type='text' size='20' maxlength='30' value='" . $date[0] . "'></span></label>\n"; echo "<label for='time'><span class='right'>Time (HH:MM:SS):</span><span class='left'><input name='time' id='time' type='text' size='20' maxlength='30' value='" . $date[1] . "'></span></label>\n"; if(BLOG_POST_SUMMARY) { echo '<label for="summary"><span class="right">Summary:</span><span class="left"><textarea name="summary" id="summary" cols="50" rows="4">'. $a->summary . '</textarea></span></label>'."\n"; } echo "<div style='width: 760px; margin: 0px auto; text-align: center;'>\n"; echo "<textarea name='content' class='editor content' style='width: 760px; height: 600px;'>" . html_entity_decode($a->content,ENT_QUOTES) . "</textarea>\n"; echo "</div>\n"; echo "<p></p>\n"; //print_r($a->images); if(BLOG_POST_IMAGE) { if(!$a->images[0]){ ?> <br class="clear" /> <label for="feature_image"><span class="right">Add Feature Image:</span><span class="left"><input name="feature_image" id="feature_image" type="file" size="30" /></span></label> <?php } else { $s = $a->images[0]; $sid = $s['image_id']; $refresh = '?r='.time(); ?> <br class="clear" /> <label for="feature<?php echo $sid; ?>"><span class="right">Replace Image:</span><span class="left"><input name="feature[feature<?php echo $sid; ?>]" id="feature<?php echo $sid; ?>" type="file" size="30" /></span></label> <p class="center"> <img align="middle" src="<?php echo $s['image_path'].$s['image_filename'].$refresh; ?>" /><br /> <input name="imgdel" type="button" value="Remove image" onclick="if(confirm('Remove image?')){window.location='processes/process-image-remove.php?blog=<?php echo $article_id; ?>&image=<?php echo $sid; ?>';return true;}else{return false;}" /> </p> <br class="clear" /> <?php } //end else } echo "</div>\n"; echo "<p class='center'>\n"; if($a->active) { echo "<input name='publish' id='publish' type='submit' value='Update Article' />\n"; } else { echo "<input name='save' id='save' type='submit' value='Save Article' /> <input name='publish' id='publish' type='submit' value='Save and Publish Article' />\n"; } echo "</p>\n"; echo "</form>\n"; footer(); exit; ?>
cải xoăn