Skip to content
Permalink
Browse files

Merge branch 'bugfix'

  • Loading branch information...
RocketMan committed May 10, 2019
2 parents 5b47cf4 + c33d980 commit 41752f4e46d5737c735a73fd1d7d09e0b8946f95
Showing with 17 additions and 16 deletions.
  1. +10 −12 ui/Reviews.php
  2. +7 −4 ui/Search.php
@@ -43,8 +43,9 @@ public function processLocal($action, $subaction) {
return $this->dispatchAction($action, self::$actions);
}
public function emitReviewHook() {
$tag = $_REQUEST["n"];
public function emitReviewHook($tag=0) {
if(!$tag)
$tag = $_REQUEST["n"];
if($this->session->isAuth("u"))
echo "<A HREF=\"?session=".$this->session->getSessionID()."&amp;action=searchReviewEdit&amp;tag=$tag\" CLASS=\"nav\"><B>Write a review of this album</B></A>";
}
@@ -107,12 +108,12 @@ public function viewRecentReviews() {
}
public function viewReview() {
$_REQUEST["n"] = $_REQUEST["tag"];
$this->newEntity(Search::class)->searchByAlbumKey();
$this->newEntity(Search::class)->searchByAlbumKey($_REQUEST["tag"]);
}
public function viewReview2() {
$tag = $_REQUEST["n"];
public function viewReview2($tag=0) {
if(!$tag)
$tag = $_REQUEST["n"];
$records = Engine::api(IReview::class)->getReviews($tag, 1, "", $this->session->isAuth("u"));
if($count = sizeof($records)) {
@@ -285,8 +286,7 @@ public function editReview() {
if($_REQUEST["noise"])
$this->eMailReview($_REQUEST["tag"], $airname, $review);
echo "<B><FONT COLOR=\"#ffcc33\">Your review has been posted!</FONT></B>\n";
$_REQUEST["n"] = $_REQUEST["tag"];
$this->newEntity(Search::class)->searchByAlbumKey();
$this->newEntity(Search::class)->searchByAlbumKey($_REQUEST["tag"]);
return;
}
echo "<B><FONT COLOR=\"#cc0000\">Review not posted. Try again later.</FONT></B>\n";
@@ -298,8 +298,7 @@ public function editReview() {
if($_REQUEST["noise"])
$this->eMailReview($_REQUEST["tag"], $airname, $review);
echo "<B><FONT COLOR=\"#ffcc33\">Your review has been updated.</FONT></B>\n";
$_REQUEST["n"] = $_REQUEST["tag"];
$this->newEntity(Search::class)->searchByAlbumKey();
$this->newEntity(Search::class)->searchByAlbumKey($_REQUEST["tag"]);
return;
}
echo "<B><FONT COLOR=\"#cc0000\">Review not updated. Try again later.</FONT></B>\n";
@@ -308,8 +307,7 @@ public function editReview() {
$success = Engine::api(IReview::class)->deleteReview($_REQUEST["tag"], $this->session->getUser());
if($success >= 1) {
echo "<B><FONT COLOR=\"#ffcc33\">Your review has been deleted.</FONT></B>\n";
$_REQUEST["n"] = $_REQUEST["tag"];
$this->newEntity(Search::class)->searchByAlbumKey();
$this->newEntity(Search::class)->searchByAlbumKey($_REQUEST["tag"]);
return;
}
echo "<B><FONT COLOR=\"#cc0000\">Delete failed. Try again later.</FONT></B>\n";
@@ -190,11 +190,14 @@ private function HTMLify($arg, $size) {
return UI::HTMLify($arg, $size, $this->noTables);
}
public function searchByAlbumKey() {
public function searchByAlbumKey($key=0) {
$opened = 0;
if($key)
$this->searchText = $key;
$albums = Engine::api(ILibrary::class)->search(ILibrary::ALBUM_KEY, 0, 1, $this->searchText);
$artist = strcmp(substr($albums[0]["artist"], 0, 8), "[coll]: ")?
$albums[0]["artist"]:"Various Artists";
echo "<TABLE WIDTH=\"100%\">\n <TR><TH ALIGN=LEFT COLSPAN=5 CLASS=\"secdiv\">" .
@@ -286,7 +289,7 @@ public function searchByAlbumKey() {
} else
echo "(Unknown)";
echo "</B></TD><TD COLSPAN=2>&nbsp;</TD><TD>";
$this->newEntity(Reviews::class)->emitReviewHook();
$this->newEntity(Reviews::class)->emitReviewHook($this->searchText);
echo "</TD></TR>\n";
echo "</TABLE>\n<BR>\n";
@@ -298,7 +301,7 @@ public function searchByAlbumKey() {
$this->newEntity(Playlists::class)->viewLastPlays($this->searchText, 6);
// Emit Review
$this->newEntity(Reviews::class)->viewReview2();
$this->newEntity(Reviews::class)->viewReview2($this->searchText);
// Emit Tracks
echo "<TABLE WIDTH=\"100%\">\n <TR><TH COLSPAN=5 ALIGN=LEFT CLASS=\"secdiv\">Track Listing</TH></TR></TABLE>\n";

0 comments on commit 41752f4

Please sign in to comment.
You can’t perform that action at this time.