2018-09-03 16:47:08 +00:00
|
|
|
<?php
|
|
|
|
namespace likes;
|
|
|
|
|
2018-09-04 02:10:36 +00:00
|
|
|
function create_like( $actor_id, $object_id ) {
|
|
|
|
global $wpdb;
|
|
|
|
return $wpdb->insert(
|
|
|
|
'activitypub_likes', array( 'actor_id' => $actor_id, 'object_url' => $object_id )
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2018-09-03 16:47:08 +00:00
|
|
|
function create_likes_table() {
|
|
|
|
global $wpdb;
|
|
|
|
$wpdb->query(
|
|
|
|
"
|
|
|
|
CREATE TABLE IF NOT EXISTS activitypub_likes (
|
|
|
|
actor_id INT NOT NULL,
|
|
|
|
object_url TEXT NOT NULL,
|
2018-09-04 02:10:36 +00:00
|
|
|
FOREIGN KEY actor_fk(actor_id)
|
|
|
|
REFERENCES activitypub_actors(id)
|
2018-09-03 16:47:08 +00:00
|
|
|
);
|
|
|
|
"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
?>
|