Added the function to change the thumbnail URL when clinking on the image.

This commit is contained in:
2018-12-01 15:12:37 -05:00
parent b827a15c67
commit bdcf99e585
7 changed files with 176 additions and 73 deletions

View File

@@ -78,6 +78,24 @@ class ps4 {
return $url;
}
function thumbnailupdateurl($gameid,$gamename,$url) {
$actualurl = $this->thumbnailurl($gameid);
if ($actualurl == "no-thumbnail.png") {
$sql = "INSERT INTO game_thumbnail (game_id, thumbnail_url) VALUES ('".$gameid."', '".$url."');";
} else {
$sql = "UPDATE game_thumbnail SET thumbnail_url = '".$url."' WHERE game_id = '".$gameid."';";
}
$result = $this->mysql_conn($sql);
if ($result == 1) {
echo "<strong>SUCCESS:</strong> Updated image URL for <strong>". $gamename ."</strong> (". $gameid .")";
echo "<br/><br/>";
} else {
echo "<strong>ERROR:</strong> Can't update image URL for <strong>". $gamename ."</strong> (". $gameid .")";
echo "<br/><br/>";
}
}
}
?>