Commit 063d994f authored by Thomas's avatar Thomas
Browse files

Fixes for cache

parent f5bb8cd3
......@@ -158,10 +158,14 @@ class Mastodon_comments_Public {
)
);
} else{ //Update cache
$wpdb->query(
"UPDATE ".$wpdb->prefix . "mastodon_comment_cache
SET cache='".json_encode( $searchResult )."', date = '".$dateInsert->format( 'Y-m-d H:i:s' )."'
WHERE URL='".urlencode($search)."'");
$wpdb->update(
$wpdb->prefix . "mastodon_comment_cache",
array(
'date' => $dateInsert->format( 'Y-m-d H:i:s' ),
'cache' => json_encode( $result )
),
array( 'URL' => urlencode( $search ))
);
}
}else{
......@@ -264,10 +268,15 @@ class Mastodon_comments_Public {
)
);
} else{ //Update cache
$wpdb->query(
"UPDATE ".$wpdb->prefix . "mastodon_comment_cache
SET cache='".json_encode( $result )."', date = '".$dateInsert->format( 'Y-m-d H:i:s' )."'
WHERE URL='".urlencode($search)."'");
$wpdb->update(
$wpdb->prefix . "mastodon_comment_cache",
array(
'date' => $dateInsert->format( 'Y-m-d H:i:s' ),
'cache' => json_encode( $result )
),
array( 'URL' => urlencode( $search ))
);
}
}else{
......
......@@ -36,7 +36,7 @@
{
'action': 'mastodon_comments_getcomment',
'post_id': params.post_id,
'search': window.location.href,
'search': "https://mastalab.app/2018/09/02/how-to-login/",
'mastodon_comments_nonce': params.mastodon_comments_nonce
},
function(data){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment