Image to Post - numeric score

This commit is contained in:
Matthew Barbour 2020-10-26 10:16:58 -05:00
parent 64649133e2
commit bfe95a09e7
3 changed files with 11 additions and 11 deletions

View file

@ -5,10 +5,10 @@ class NumericScoreInfo extends ExtensionInfo
public const KEY = "numeric_score";
public $key = self::KEY;
public $name = "Image Scores (Numeric)";
public $name = "Post Scores (Numeric)";
public $url = self::SHIMMIE_URL;
public $authors = self::SHISH_AUTHOR;
public $license = self::LICENSE_GPLV2;
public $description = "Allow users to score images";
public $documentation ="Each registered user may vote an image +1 or -1, the image's score is the sum of all votes.";
public $documentation ="Each registered user may vote a post +1 or -1, the image's score is the sum of all votes.";
}

View file

@ -162,7 +162,7 @@ class NumericScore extends Extension
public function onNumericScoreSet(NumericScoreSetEvent $event)
{
global $user;
log_debug("numeric_score", "Rated >>{$event->image_id} as {$event->score}", "Rated Image");
log_debug("numeric_score", "Rated >>{$event->image_id} as {$event->score}", "Rated Post");
$this->add_vote($event->image_id, $user->id, $event->score);
}

View file

@ -51,7 +51,7 @@ class NumericScoreTheme extends Themelet
</div>
";
}
$page->add_block(new Block("Image Score", $html, "left", 20));
$page->add_block(new Block("Post Score", $html, "left", 20));
}
public function get_nuller(User $duser)
@ -96,32 +96,32 @@ class NumericScoreTheme extends Themelet
public function get_help_html()
{
return '<p>Search for images that have received numeric scores by the score or by the scorer.</p>
return '<p>Search for posts that have received numeric scores by the score or by the scorer.</p>
<div class="command_example">
<pre>score=1</pre>
<p>Returns images with a score of 1.</p>
<p>Returns posts with a score of 1.</p>
</div>
<div class="command_example">
<pre>score>0</pre>
<p>Returns images with a score of 1 or more.</p>
<p>Returns posts with a score of 1 or more.</p>
</div>
<p>Can use &lt;, &lt;=, &gt;, &gt;=, or =.</p>
<div class="command_example">
<pre>upvoted_by=username</pre>
<p>Returns images upvoted by "username".</p>
<p>Returns posts upvoted by "username".</p>
</div>
<div class="command_example">
<pre>upvoted_by_id=123</pre>
<p>Returns images upvoted by user 123.</p>
<p>Returns posts upvoted by user 123.</p>
</div>
<div class="command_example">
<pre>downvoted_by=username</pre>
<p>Returns images downvoted by "username".</p>
<p>Returns posts downvoted by "username".</p>
</div>
<div class="command_example">
<pre>downvoted_by_id=123</pre>
<p>Returns images downvoted by user 123.</p>
<p>Returns posts downvoted by user 123.</p>
</div>
<div class="command_example">