Some more improved queries
This commit is contained in:
parent
fd2d8cc180
commit
501c45def5
9 changed files with 50 additions and 17 deletions
|
@ -788,6 +788,9 @@ function item_post(&$a) {
|
|||
} else
|
||||
$post_id = 0;
|
||||
|
||||
q("COMMIT;");
|
||||
q("START TRANSACTION;");
|
||||
|
||||
$r = q("INSERT INTO `item` (`guid`, `extid`, `uid`,`type`,`wall`,`gravity`, `network`, `contact-id`,
|
||||
`owner-name`,`owner-link`,`owner-avatar`, `owner-id`,
|
||||
`author-name`, `author-link`, `author-avatar`, `author-id`,
|
||||
|
@ -864,6 +867,7 @@ function item_post(&$a) {
|
|||
$r = q("SELECT `id` FROM `item` WHERE `uri` = '%s' LIMIT 1",
|
||||
dbesc($datarray['uri']));
|
||||
if(!count($r)) {
|
||||
q("COMMIT");
|
||||
logger('mod_item: unable to retrieve post that was just stored.');
|
||||
notice( t('System error. Post not saved.') . EOL);
|
||||
goaway($a->get_baseurl() . "/" . $return_path );
|
||||
|
@ -986,6 +990,8 @@ function item_post(&$a) {
|
|||
create_tags_from_item($post_id);
|
||||
create_files_from_item($post_id);
|
||||
|
||||
q("COMMIT");
|
||||
|
||||
if ($post_id == $parent)
|
||||
add_thread($post_id);
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue