|
|
@ -12,6 +12,17 @@ |
|
|
header('location: ../index.php'); |
|
|
header('location: ../index.php'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$content = file_get_contents($url); |
|
|
|
|
|
$arr = explode('t-->', $content); |
|
|
|
|
|
if(isset($arr[1])) { |
|
|
|
|
|
$oldtitle = ltrim(rtrim(str_replace('<!--t','',$arr[0]), ' ')); |
|
|
|
|
|
$oldcontent = ltrim($arr[1]); |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
$oldtitle = 'Untitled'; |
|
|
|
|
|
$oldcontent = ltrim($arr[0]); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
$dir = substr($url, 0, strrpos($url, '/')); |
|
|
$dir = substr($url, 0, strrpos($url, '/')); |
|
|
|
|
|
|
|
|
$oldurl = explode('_', $url); |
|
|
$oldurl = explode('_', $url); |
|
|
@ -21,13 +32,14 @@ |
|
|
$oldmd = str_replace('.md','',$oldurl[2]); |
|
|
$oldmd = str_replace('.md','',$oldurl[2]); |
|
|
|
|
|
|
|
|
if(isset($_POST['submit'])) { |
|
|
if(isset($_POST['submit'])) { |
|
|
|
|
|
$post_title = $_POST['title']; |
|
|
$post_tag = preg_replace('/[^A-Za-z0-9,.-]/u', '', $_POST['tag']); |
|
|
$post_tag = preg_replace('/[^A-Za-z0-9,.-]/u', '', $_POST['tag']); |
|
|
$post_tag = rtrim($post_tag, ',\.\-'); |
|
|
$post_tag = rtrim($post_tag, ',\.\-'); |
|
|
$post_url = preg_replace('/[^A-Za-z0-9,.-]/u', '', $_POST['url']); |
|
|
$post_url = preg_replace('/[^A-Za-z0-9,.-]/u', '', $_POST['url']); |
|
|
$post_url = rtrim($post_url, ',\.\-'); |
|
|
$post_url = rtrim($post_url, ',\.\-'); |
|
|
$post_content = $_POST['content']; |
|
|
|
|
|
|
|
|
$post_content = '<!--t ' . $post_title . ' t-->' . "\n\n" . $_POST['content']; |
|
|
} |
|
|
} |
|
|
if(!empty($post_tag) && !empty($post_url) && !empty($post_content)) { |
|
|
|
|
|
|
|
|
if(!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) { |
|
|
if(get_magic_quotes_gpc()) { |
|
|
if(get_magic_quotes_gpc()) { |
|
|
$post_content = stripslashes($post_content); |
|
|
$post_content = stripslashes($post_content); |
|
|
} |
|
|
} |
|
|
@ -71,10 +83,11 @@ |
|
|
</div> |
|
|
</div> |
|
|
<div class="wmd-panel"> |
|
|
<div class="wmd-panel"> |
|
|
<form method="POST"> |
|
|
<form method="POST"> |
|
|
|
|
|
Title: <br><input type="text" name="title" size="60" maxlength="60" value="<?php echo $oldtitle?>"/><br><br> |
|
|
Tag: <br><input type="text" name="tag" size="60" maxlength="60" value="<?php echo $oldtag?>"/><br><br> |
|
|
Tag: <br><input type="text" name="tag" size="60" maxlength="60" value="<?php echo $oldtag?>"/><br><br> |
|
|
Url: <br><input type="text" name="url" size="60" maxlength="60" value="<?php echo $oldmd ?>"/><br><br> |
|
|
Url: <br><input type="text" name="url" size="60" maxlength="60" value="<?php echo $oldmd ?>"/><br><br> |
|
|
<div id="wmd-button-bar" class="wmd-button-bar"></div> |
|
|
<div id="wmd-button-bar" class="wmd-button-bar"></div> |
|
|
<textarea id="wmd-input" class="wmd-input" name="content" cols="20" rows="10"><?php echo file_get_contents($url)?></textarea><br>
|
|
|
|
|
|
|
|
|
<textarea id="wmd-input" class="wmd-input" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea><br>
|
|
|
<input type="submit" name="submit" value="Submit"/> |
|
|
<input type="submit" name="submit" value="Submit"/> |
|
|
</form> |
|
|
</form> |
|
|
</div> |
|
|
</div> |
|
|
|