diff options
| -rwxr-xr-x | includes/functions.php | 9 | ||||
| -rwxr-xr-x | pages/admin.php | 21 |
2 files changed, 13 insertions, 17 deletions
| diff --git a/includes/functions.php b/includes/functions.php index d8d1bc4..7f85f96 100755 --- a/includes/functions.php +++ b/includes/functions.php | |||
| @@ -118,11 +118,8 @@ function postBlogPost($title,$author,$tags,$content) | |||
| 118 | $inspost = "INSERT INTO updates (title,slug,author,text) VALUES (\"" . $title . "\",\"" . $slug . "\",\"" . $author . "\",\"" . addslashes($content) . "\")"; | 118 | $inspost = "INSERT INTO updates (title,slug,author,text) VALUES (\"" . $title . "\",\"" . $slug . "\",\"" . $author . "\",\"" . addslashes($content) . "\")"; |
| 119 | $inspost2 = mysql_query($inspost); | 119 | $inspost2 = mysql_query($inspost); |
| 120 | 120 | ||
| 121 | $getpost = "SELECT * FROM updates WHERE slug = \"" . $slug . "\""; | 121 | $id = mysql_insert_id(); |
| 122 | $getpost2 = mysql_query($getpost); | 122 | addTags($id, $tags); |
| 123 | $getpost3 = mysql_fetch_array($getpost2); | ||
| 124 | |||
| 125 | addTags($getpost3['id'], $tags); | ||
| 126 | 123 | ||
| 127 | $upconf = "UPDATE config SET value = \"" . date('md') . "\" WHERE name = \"lastUpdate\""; | 124 | $upconf = "UPDATE config SET value = \"" . date('md') . "\" WHERE name = \"lastUpdate\""; |
| 128 | $upconf2 = mysql_query($upconf); | 125 | $upconf2 = mysql_query($upconf); |
| @@ -161,6 +158,8 @@ function postBlogPost($title,$author,$tags,$content) | |||
| 161 | $msg = new xmlrpcmsg("weblogUpdates.ping", array( new xmlrpcval('Four Island', 'string'), | 158 | $msg = new xmlrpcmsg("weblogUpdates.ping", array( new xmlrpcval('Four Island', 'string'), |
| 162 | new xmlrpcval('http://fourisland.com/', 'string'))); | 159 | new xmlrpcval('http://fourisland.com/', 'string'))); |
| 163 | $client->send($msg); | 160 | $client->send($msg); |
| 161 | |||
| 162 | return $id; | ||
| 164 | } | 163 | } |
| 165 | 164 | ||
| 166 | function recalcPop($id) | 165 | function recalcPop($id) |
| diff --git a/pages/admin.php b/pages/admin.php index b21948c..aff21cf 100755 --- a/pages/admin.php +++ b/pages/admin.php | |||
| @@ -44,24 +44,21 @@ if (isLoggedIn()) | |||
| 44 | $insdraft = "INSERT INTO drafts (title,author,text,slug) VALUES (\"" . addslashes($_POST['title']) . "\",\"" . sess_get('uname') . "\",\"" . addslashes($_POST['text']) . "\",\"" . generateSlug($_POST['title'],'updates') . "\")"; | 44 | $insdraft = "INSERT INTO drafts (title,author,text,slug) VALUES (\"" . addslashes($_POST['title']) . "\",\"" . sess_get('uname') . "\",\"" . addslashes($_POST['text']) . "\",\"" . generateSlug($_POST['title'],'updates') . "\")"; |
| 45 | $insdraft2 = mysql_query($insdraft); | 45 | $insdraft2 = mysql_query($insdraft); |
| 46 | 46 | ||
| 47 | $getdraft = "SELECT * FROM drafts ORDER BY id DESC LIMIT 0,1"; | 47 | $id = mysql_insert_id(); |
| 48 | $getdraft2 = mysql_query($getdraft); | 48 | addTags($id, $tags, 'draft'); |
| 49 | $getdraft3 = mysql_fetch_array($getdraft2); | ||
| 50 | |||
| 51 | addTags($getdraft3['id'], $tags, 'draft'); | ||
| 52 | 49 | ||
| 53 | $template = new FITemplate('admin/draftSuccess'); | 50 | $template = new FITemplate('admin/draftSuccess'); |
| 54 | $template->add('ID', $getdraft3['id']); | 51 | $template->add('ID', $id); |
| 55 | } else if ($_POST['type'] == 'instant') | 52 | } else if ($_POST['type'] == 'instant') |
| 56 | { | 53 | { |
| 57 | postBlogPost($_POST['title'], sess_get('uname'), $tags, $_POST['text']); | 54 | $id = postBlogPost($_POST['title'], sess_get('uname'), $tags, $_POST['text']); |
| 58 | 55 | ||
| 59 | $getpost = "SELECT * FROM updates ORDER BY id DESC LIMIT 0,1"; | 56 | $getpost = "SELECT * FROM updates WHERE id = " . $id; |
| 60 | $getpost2 = mysql_query($getpost); | 57 | $getpost2 = mysql_query($getpost); |
| 61 | $getpost3 = mysql_fetch_array($getpost2); | 58 | $getpost3 = mysql_fetch_array($getpost2); |
| 62 | 59 | ||
| 63 | $template = new FITemplate('admin/postSuccess'); | 60 | $template = new FITemplate('admin/postSuccess'); |
| 64 | $template->add('ID', $getpost3['id']); | 61 | $template->add('ID', $id); |
| 65 | $template->add('CODED', $getpost3['slug']); | 62 | $template->add('CODED', $getpost3['slug']); |
| 66 | } else { | 63 | } else { |
| 67 | if ($_POST['type'] == 'normal') | 64 | if ($_POST['type'] == 'normal') |
| @@ -143,17 +140,17 @@ if (isLoggedIn()) | |||
| 143 | $template->add('ID', $_GET['id']); | 140 | $template->add('ID', $_GET['id']); |
| 144 | } else if ($_POST['type'] == 'instant') | 141 | } else if ($_POST['type'] == 'instant') |
| 145 | { | 142 | { |
| 146 | postBlogPost($_POST['title'], sess_get('uname'), $tags, $_POST['text']); | 143 | $id = postBlogPost($_POST['title'], sess_get('uname'), $tags, $_POST['text']); |
| 147 | 144 | ||
| 148 | $deldraft = "DELETE FROM drafts WHERE id = " . $_GET['id']; | 145 | $deldraft = "DELETE FROM drafts WHERE id = " . $_GET['id']; |
| 149 | $deldraft2 = mysql_query($deldraft); | 146 | $deldraft2 = mysql_query($deldraft); |
| 150 | 147 | ||
| 151 | $getpost = "SELECT * FROM updates ORDER BY id DESC LIMIT 0,1"; | 148 | $getpost = "SELECT * FROM updates WHERE id = " . $id; |
| 152 | $getpost2 = mysql_query($getpost); | 149 | $getpost2 = mysql_query($getpost); |
| 153 | $getpost3 = mysql_fetch_array($getpost2); | 150 | $getpost3 = mysql_fetch_array($getpost2); |
| 154 | 151 | ||
| 155 | $template = new FITemplate('admin/postSuccess'); | 152 | $template = new FITemplate('admin/postSuccess'); |
| 156 | $template->add('ID', $getpost3['id']); | 153 | $template->add('ID', $id); |
| 157 | $template->add('CODED', $getpost3['slug']); | 154 | $template->add('CODED', $getpost3['slug']); |
| 158 | } else { | 155 | } else { |
| 159 | if ($_POST['type'] == 'normal') | 156 | if ($_POST['type'] == 'normal') |
