diff options
| author | Savetheinternet <savetheinternet@n0v4.com> | 2010-11-05 20:51:39 +1100 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@n0v4.com> | 2010-11-05 20:51:39 +1100 |
| commit | 43b62acb44893fc62682e09a387ce77f102c06ea (patch) | |
| tree | 859597bb234bde9c09d6cd737874f2f2e125387b /post.php | |
| parent | 247772323ecb035885778c8a6cc8f83f60482c30 (diff) | |
Stopped storing the full path name of the images in the database. Should make it easier/possible to move the imageboard later.
Diffstat (limited to 'post.php')
| -rw-r--r-- | post.php | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -180,6 +180,10 @@ $post['thumbheight'] = $thumb['height'];
}
+ // Remove DIR_* before inserting them into the database.
+ $post['file'] = substr_replace($post['file'], '', 0, strlen(DIR_IMG));
+ $post['thumb'] = substr_replace($post['thumb'], '', 0, strlen(DIR_THUMB));
+
// Todo: Validate some more, remove messy code, allow more specific configuration
// MySQLify
@@ -266,6 +270,10 @@ $dump_post['thumbwidth'] = $thumb['width'];
$dump_post['thumbheight'] = $thumb['height'];
+ // Remove DIR_* before inserting them into the database.
+ $dump_post['file'] = substr_replace($dump_post['file'], '', 0, strlen(DIR_IMG));
+ $dump_post['thumb'] = substr_replace($dump_post['thumb'], '', 0, strlen(DIR_THUMB));
+
// Create the post
post($dump_post, false);
}
@@ -303,7 +311,6 @@ } else {
if(!file_exists(FILE_INDEX)) {
buildIndex();
- sql_close();
}
header('Location: ' . ROOT . FILE_INDEX, true, 302);
|
