| cupoftea wrote:
|
Hey guys,
It took me a while, but I've found a lyrics module (on an Italian site, couldn't understand a word of it but I have it anyway). The problem is, after the installation and activation of the module I always get an error 500 if I try to access the module
this is the module's index.php file
| Code:
|
<?php
if (!stristr($_SERVER['SCRIPT_NAME'], "modules.php")) {
die ("You can't access this file directly...");
}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
$pagetitle = "- "._LYRICS."";
include("header.php");
require_once("modules/$module_name/includes/functions.php");
// Grab config values.
$config = get_lyrics_config();
OpenTable();
echo "<table align='center' width='100%' border='0' cellspacing='1'>";
echo "<tr>";
echo "<td align='center' style='border=1px solid #000000; background-color:$bgcolor2;'><font class='title'><b>"._LYRICS."</b></font></td>";
echo "</tr>";
echo "</table>";
origAnchors();
echo "<table width='100%' border='0' cellspacing='2'>";
if ($sort && $sort == "num") {
echo "<tr><td colspan='4' style='background: $bgcolor2'><font class='title'><b>#</b></font></td></tr>";
$numsql = $db->sql_query("SELECT DISTINCT(artist) AS d_artist, img_artist, thumb_artist, id FROM ".$prefix."_lyrics WHERE left(artist, 1) < 'a' AND check_submit = 0 GROUP BY artist ORDER BY artist");
if (!$row = $db->sql_numrows($sql)) {
echo "<tr><td><font class='title'><b>"._NOARTISTS."</b></font></td></tr>";
} else {
while($row = $db->sql_fetchrow($numsql)) {
extract($row);
$artist = stripslashes($d_artist);
// Only Admins can edit the artist.
if (is_admin($admin)) {
$se_artist = "[<a href='modules.php?name=$module_name&file=artist_edit&c_id=$id'>"._EDIT."</a>]";
}
$res = $db->sql_query("SELECT COUNT(DISTINCT(song)) AS count FROM ".$prefix."_lyrics WHERE artist = \"$artist\"");
$rowcount = $db->sql_fetchrow($res);
extract($rowcount);
$res2 = $db->sql_query("SELECT song,viewed,id AS popid FROM ".$prefix."_lyrics WHERE artist = \"$artist\" ORDER BY viewed DESC");
$popres = $db->sql_fetchrow($res2);
extract($popres);
// Show artist image if its turned on.
if($config['show_artist_image'] == '1') {
if ($thumb_artist <> "none") {
$imgcode = "<a href='$img_artist'><img src='$thumb_artist'></a>";
} else {
$imgcode = "<a href=\"modules.php?name=$module_name&file=artist&c_id=$id\"><img src='$img_artist' border='0' align='middle'></a>";
}
echo "<tr><td width='25%'>$imgcode</td>";
echo "<td><a href=\"modules.php?name=$module_name&file=artist&c_id=$id\">$artist</a><br>
"._SONGS.": $count<br>
"._MOSTVIEWED.": <a href='modules.php?name=$module_name&file=song&c_id=$popid'>$song</a> ($viewed)";
echo "</td><td align='right'> $se_artist</td></tr>";
} else {
echo "<tr><td><a href=\"modules.php?name=$module_name&file=artist&c_id=$id\">$artist</a><br>
"._SONGS.": $count<br>
"._MOSTVIEWED.": <a href='modules.php?name=$module_name&file=song&c_id=$popid'>$song</a> ($viewed)";
echo "</td><td align='right'> $se_artist</td></tr>";
}
}
}
}
if ($sort && $sort != "num") {
echo "<tr><td colspan='4' style='background: $bgcolor2'><font class='title'><b>".$sort."</b></font></td></tr>";
$sql = $db->sql_query("SELECT DISTINCT(artist) as d_artist, img_artist, thumb_artist, id FROM ".$prefix."_lyrics WHERE ucase(left(artist, 1)) = '$sort' AND check_submit = 0 GROUP BY artist ORDER BY artist");
if (!$row = $db->sql_numrows($sql)) {
echo "<tr><td><font class='title'><b>"._NOARTISTS."</b></font></td></tr>";
} else {
while($row = $db->sql_fetchrow($sql)) {
extract($row);
$artist = stripslashes($d_artist);
if(is_admin($admin)) {
$se_artist = "[<a href='modules.php?name=$module_name&file=artist_edit&c_id=$id'>Edit</a>]";
}
$res = $db->sql_query("SELECT COUNT(DISTINCT(song)) AS count FROM ".$prefix."_lyrics WHERE artist = \"$artist\"");
$rowcount = $db->sql_fetchrow($res);
extract($rowcount);
$res2 = $db->sql_query("SELECT song,viewed,id AS popid FROM ".$prefix."_lyrics WHERE artist = \"$artist\" ORDER BY viewed DESC");
$popres = $db->sql_fetchrow($res2);
extract($popres);
if($config['show_artist_image'] == '1') {
if ($thumb_artist <> "none") {
$imgcode = "<a href='$img_artist'><img src='$thumb_artist'></a>";
} else {
$imgcode = "<a href=\"modules.php?name=$module_name&file=artist&c_id=$id\"><img src='$img_artist' border='0' align='middle'></a>";
}
echo "<tr><td width='25%'>$imgcode</td>";
echo "<td><a href=\"modules.php?name=$module_name&file=artist&c_id=$id\">$artist</a><br>
"._SONGS.": $count<br>
"._MOSTVIEWED.": <a href='modules.php?name=$module_name&file=song&c_id=$popid'>$song</a> ($viewed)";
echo "</td><td align='right'> $se_artist</td></tr>";
} else {
echo "<tr><td><a href=\"modules.php?name=$module_name&file=artist&c_id=$id\">$artist</a><br>
"._SONGS.": $count<br>
"._MOSTVIEWED.": <a href='modules.php?name=$module_name&file=song&c_id=$popid'>$song</a> ($viewed)";
echo "</td><td align='right'> $se_artist</td></tr>";
}
}
}
}
if(!$sort || $sort == "") {
echo"<tr><td colspan='2' align='center'><font class='title'><b>"._SELECTLETTER."</b></font></td></tr>";
}
echo "</td></tr></table>";
CloseTable();
MainMenu();
CloseTable();
if ($act && $act == "admin_settings") {
OpenTable();
if (!is_admin($admin)) {
echo "<p align='center'><font class='title'>"._ADMINONLY."</font></p>";
} else {
include("admin_settings.php");
}
CloseTable();
}
include("footer.php");
?>
|
You can check it out here: http://cup-of-tea.leadhoster.com/modules.php?name=Lyrics
I wanted to add the module in attachment, but I get an error page:
| Quote:
|
Access Denied
94.110.38.163 (cust-163-38-110-94.dyn.versateladsl.be)
Forbidden Script Code Detected
For security reason, your last request has been blocked.
However, the requested action already logged for further analysis.
[ Back to Previous Page ]
Protected by Admin Secure
|
[edit]
Seems to work fine in another post... Odd
[/edit]
|