diff options
author | Starla Insigna <hatkirby@fourisland.com> | 2008-12-13 10:01:56 -0500 |
---|---|---|
committer | Starla Insigna <hatkirby@fourisland.com> | 2008-12-13 10:01:56 -0500 |
commit | 7eb055141bae63b85cef93e5d6f67e3016219d7b (patch) | |
tree | a688d1cb452ea8a2bcf6f278326b2a36e8e03fd3 /includes/functions.php | |
parent | 391f6825d7b5bc986d6529b2a2a4c043555d9f07 (diff) | |
download | fourisland-7eb055141bae63b85cef93e5d6f67e3016219d7b.tar.gz fourisland-7eb055141bae63b85cef93e5d6f67e3016219d7b.tar.bz2 fourisland-7eb055141bae63b85cef93e5d6f67e3016219d7b.zip |
Optimized posting
Previously, Four Island posted a blog, and then searched through the table looking for it so it could retrieve its ID. Now, the "mysql_insert_id()" function is used instead.
Diffstat (limited to 'includes/functions.php')
-rwxr-xr-x | includes/functions.php | 9 |
1 files changed, 4 insertions, 5 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) |