1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 21:27:25 +02:00

Increase speed of forum-attachment processing.

This commit is contained in:
Cameron
2013-03-31 04:23:11 -07:00
parent 52d57adef5
commit 6becda09d4
3 changed files with 8 additions and 4 deletions

View File

@@ -1311,8 +1311,9 @@ function getperms($arg, $ap = ADMINPERMS)
} }
/** /**
* @DEPRECATED
* Get the user data from user and user_extended tables * Get the user data from user and user_extended tables
* SO MUCH DEPRECATED! * SO MUCH DEPRECATED! Use e107::user($uid);
* *
* *
* @return array * @return array

View File

@@ -786,7 +786,7 @@ class e107forum
} }
else else
{ {
$tmp = get_user_data($uid); $tmp = e107::user($uid);
$viewed = $tmp['user_plugin_forum_viewed']; $viewed = $tmp['user_plugin_forum_viewed'];
unset($tmp); unset($tmp);
} }

View File

@@ -1140,6 +1140,9 @@ function step10()
} }
/**
* Attachments
*/
function step10_ajax()//TODO function step10_ajax()//TODO
{ {
$sql = e107::getDb(); $sql = e107::getDb();
@@ -1150,7 +1153,7 @@ function step10_ajax()//TODO
$qry = " $qry = "
SELECT post_id, post_thread, post_entry, post_user FROM `#forum_post` SELECT post_id, post_thread, post_entry, post_user FROM `#forum_post`
WHERE post_entry REGEXP '_[[:digit:]]+_FT' WHERE post_entry REGEXP '_[[:digit:]]+_FT'
AND post_id > {$lastPost} LIMIT 1 AND post_id > {$lastPost} LIMIT 200
"; ";
if ($sql->gen($qry)) if ($sql->gen($qry))
@@ -1314,7 +1317,7 @@ function step10_ajax()//TODO
{ {
$info['WHERE'] = 'post_id = ' . $post['post_id']; $info['WHERE'] = 'post_id = ' . $post['post_id'];
$info['post_attachments'] = e107::getArrayStorage()->write($newValues); $info['post_attachments'] = e107::getArrayStorage()->write($newValues);
// $sql->update('forum_post', $info); // XXX screwed up due to Fields-defs. // $sql->update('forum_post', $info); // XXX FIXME TODO screwed up due to _FIELD_DEFS
$sql->update('forum_post',"post_entry = \"".$info['post_entry']."\", post_attachments=\"".$info['post_attachments']."\" WHERE post_id = ".$post['post_id']." LIMIT 1"); $sql->update('forum_post',"post_entry = \"".$info['post_entry']."\", post_attachments=\"".$info['post_attachments']."\" WHERE post_id = ".$post['post_id']." LIMIT 1");
} }