📄 showgenres.php
字号:
<?
// Musicbox Mods for version 2.1
// TeaM SCRiPTMAFiA 2005
// Musicbox mod created and modified by Shane
print(" <style type='text/css'><!--
.tbl {
width: 100%;
border: 1px solid #FDF1FB;
border-collapse: collapse;
}
.tbl td, .tbl th {
text-align: center;
border: 1px solid #FFFFFF;
}
--></style>
<script type='text/javascript'><!--
var elem = 'TH'; // Object you want to affect
var rClick;
window.onload = function(){
if(document.getElementsByTagName){
var el = document.getElementsByTagName(elem);
for(var i=0; i<el.length; i++){
el[i].onmouseover = function(){
this.style.backgroundColor='FFFFFF';
}
el[i].onmouseout = function(){
this.style.backgroundColor='FDF1FB';
}
el[i].onclick = function(){
if(rClick){
rClick.style.backgroundColor='FDF1FB';
rClick.onmouseout = function(){ this.style.backgroundColor = 'FDF1FB'; }
}
this.style.backgroundColor='FDF1FB';
rClick = this;
this.onmouseout = new Function('return true');
}
}
}
}
//--></script>");
class Music {
/*** Continue configuring here ***/
// MySQL Information
var $mysqlHostname = "localhost";
var $mysqlUsername = "put your db details here";
var $mysqlPassword = "put your db details here";
var $mysqlDbName = "put your db details here";
// Name of this file
// If this is changed to anything other than index.php also change it in common.js
var $thisfile = "index.php";
/**** No need to edit anything below this line ****/
var $mysqlConn;
function Music($action)
{
// Connect to the database
$this->dbConnect();
// Determine Action
switch( $action ) {
case 'genre':
$this->genre();
break;
}
}
/********** Database Functions **********/
function dbConnect()
{
$this->mysqlConn = mysql_connect( $this->mysqlHostname, $this->mysqlUsername, $this->mysqlPassword )
or die("Error: Unable to connect to MySQL server.");
mysql_select_db( $this->mysqlDbName, $this->mysqlConn ) or die("Error: Unable to connect to MySQL database.");
}
/********** Genre Functions **********/
function genre() {
$genre = addslashes($_GET['id']);
if( $genre != '' ) {
$this->displayGenre($genre);
} else {
$this->listGenres();
}
}
function listGenres() {
$query = "SELECT * FROM genre";
$result = mysql_query($query);
print("<div id='content'>");
while( $genre = mysql_fetch_assoc($result) )
{
print("<tr><th class='tbl' align=left> <img src='template/images/arrow.gif' width='9' height='13' border='0'> <a href='".$this->thisfile."?action=genre&id=".$genre['id']."'>".$genre['genre']."</a></th>");
}
print("</div>");
}
}
// Create Class
$mymusic = new Music($_GET['action']);
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -