Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
Giraffaman committed Mar 21, 2024
1 parent 78e7629 commit 2a5df20
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions ext/auto_tagger/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void

public function onTagSet(TagSetEvent $event): void
{
make_logentry("auto-tagger: tag set!");
$this->make_logentry("auto-tagger: tag set!");
$results = $this->apply_auto_tags($event->new_tags);
if (!empty($results)) {
$event->new_tags = $results;
make_logentry("auto-tagger: new tags: ".$results."");
$this->make_logentry("auto-tagger: new tags: ".$results."");
}
}

Expand Down
6 changes: 3 additions & 3 deletions ext/post_tags/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,13 @@ public function make_logentry($data) {
public function onTagSet(TagSetEvent $event): void
{
global $user;
make_logentry("post_tag: new tag set!");
$this->make_logentry("post_tag: new tag set!");
if ($user->can(Permissions::EDIT_IMAGE_TAG) && (!$event->image->is_locked() || $user->can(Permissions::EDIT_IMAGE_LOCK))) {
make_logentry("post_tag: ".$event->new_tags." is normal tag.");
$this->make_logentry("post_tag: ".$event->new_tags." is normal tag.");
$event->image->set_tags($event->new_tags);
}
foreach ($event->metatags as $tag) {
make_logentry("post_tag: ".$tag." is meta tag!");
$this->make_logentry("post_tag: ".$tag." is meta tag!");
send_event(new TagTermParseEvent($tag, $event->image->id));
}
}
Expand Down
10 changes: 5 additions & 5 deletions ext/rating/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,10 @@ public function onSearchTermParse(SearchTermParseEvent $event): void

public function onTagTermCheck(TagTermCheckEvent $event): void
{
make_logentry("ratings: tagTermCheck...");
$this->make_logentry("ratings: tagTermCheck...");
if (preg_match($this->search_regexp, $event->term)) {
$event->metatag = true;
make_logentry("ratings: ...".$event." is meta tag!");
$this->make_logentry("ratings: ...".$event." is meta tag!");
}
}

Expand All @@ -314,18 +314,18 @@ public function onTagTermParse(TagTermParseEvent $event): void
global $user;
$matches = [];

make_logentry("ratings: parsing tag term ".$event->term."...");
$this->make_logentry("ratings: parsing tag term ".$event->term."...");
if (preg_match($this->search_regexp, strtolower($event->term), $matches)) {
$ratings = $matches[1] ? $matches[1] : $matches[2][0];

if (count($matches) > 2 && in_array($matches[2], self::UNRATED_KEYWORDS)) {
$ratings = "?";
make_logentry("ratings: ...unknown rating!");
$this->make_logentry("ratings: ...unknown rating!");
}

$ratings = array_intersect(str_split($ratings), Ratings::get_user_class_privs($user));
$rating = $ratings[0];
make_logentry("ratings: rating is ".$rating);
$this->make_logentry("ratings: rating is ".$rating);
$image = Image::by_id_ex($event->image_id);
send_event(new RatingSetEvent($image, $rating));
}
Expand Down

0 comments on commit 2a5df20

Please sign in to comment.