Parašė Deiviuxsz· 2012 Sau. 7 15:01:03
#1
Sveiki,turiu prašyma kas galėtumėte padaryti pertaisyti dainos perklausa na kad veiktu nes kažko neveikia :)
Štai downloads.php failas:
<?php
/*---------------------------------------------------+
+----------------------------------------------------*/
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";
include LOCALE.LOCALESET."muzika.php";
if(!iBANNED) {
echo "<center>Atsiprašome, tačiau muzika yra prieinama tik registruotiems portalo vartotojams<br><br><a href='".BASEDIR."register.php'><b>Registracija</b></a> <a href='".BASEDIR."login.php'><b>Prisijungimas</b></a></center>";
}
else {
if (isset($download_id) && !isNum($download_id)) fallback("index.php");
echo "<table width='100%'><tr> <td valign='top'>";
if (isset($download_id)) {
$res = 0;
if ($data = dbarray(dbquery("SELECT download_url,download_cat FROM ".$db_prefix."downloads WHERE download_id='$download_id'"))) {
$cdata = dbarray(dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_cat_id='".$data['download_cat']."'"));
if (checkgroup($cdata['download_cat_access'])) {
$res = 1;
$result = dbquery("UPDATE ".$db_prefix."downloads SET download_count=download_count+1, download_count_s=download_count_s+1, download_count_m=download_count_m+1 WHERE download_id='$download_id'");
$result = dbquery("UPDATE ".$db_prefix."users SET user_downloads=user_downloads+1 WHERE user_id='".$userdata['user_id']."'");
redirect($data['download_url']);
}
}
if ($res == 0) redirect("muzika.php");
}
if (isset($d_id) && !isNum($d_id)) fallback("index.php");
$result = dbquery("SELECT * FROM ".$db_prefix."downloads WHERE download_id='$d_id'");
if (dbrows($result) != 0) {
$data = dbarray($result);
$catdata = dbarray(dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_cat_id='".$data['download_cat']."'"));
opentable2("");
include INCLUDES."ratings_include.php";
include INCLUDES."comments_include.php";echo "<a class='small' href='downloads.php'>Visos kategorijos</a> -> <a class='small' href='downloads.php?cat_id=".$data['download_cat']."' title='".$catdata['download_cat_name']."'>".$catdata['download_cat_name']."</a><br><br><br>";
echo "<table class='tbl-border' width='100%'>
<tr>
<td colspan='6' class='tbl1' align='center'><b>".$data['download_title']."</b> $new";
if (checkrights("D")){ echo "<a href='".ADMIN."downloads.php".$aidlink."&step=edit&download_cat_id=".$data['download_cat']."&download_id=".$data['download_id']."'><img src='".IMAGES."edit.gif' border='0'></a>";}
echo "</td></tr>
<tr>
<td class='tbl1' rowspan='2' width='32' align='center'><a class='small' href='".FUSION_SELF."?cat_id=".$data['download_cat']."&download_id=".$data['download_id']."' title='' target='new' onMouseover=\"ddrivetip('Atsisiųsti mp3','#eaefef', 100)\"; onMouseout=\"hideddrivetip()\"><img src='".IMAGES."d.png' border='0'></a></td>
<td class='tbl2'>Dainos perklausa ";
echo "</td>
<td class='tbl1'>Įdėjo</td>
<td class='tbl2'>Pridėtas</td>
<td class='tbl1'>Siųsta</td>
<td class='tbl2'>TOP<font color='red'><b>*</b></font></td>
</tr>";
$id = $data['download_cat'];
if ($data['download_datestamp']+604800 > time()+($settings['timeoffset']*3600)) {
$new = " <img src='".IMAGES."new2.gif'>";
} else {
$new = "";
}
$time = $data['download_datestamp'];
$laikas = showdate( "%Y-%m-%d", $time);
$kat = dbresult(dbquery("SELECT download_cat_name FROM ".$db_prefix."download_cats WHERE download_cat_id='$id'"), 0);
$result = dbquery("SELECT user_id FROM ".$db_prefix."users WHERE user_name='".$data['download_license']."'");
$data2 = dbarray($result);
echo "
<tr>
<td class='tbl2'>";
if(preg_match('/zippyshare/i' , $data['download_url'])){
echo zip($data['download_url']);
} else {
echo "<b>Nera perklausos</b>"; }
echo "</td> <td class='tbl1'><a href='".BASEDIR."~".$data2['user_id']."'>".$data['download_license']."</a></td>
<td class='tbl2'>$laikas
</td>
<td class='tbl1'>".$data['download_count']."</td>
<td class='tbl2' align='center'>";
if(!iMEMBER) {
echo "<img src='".IMAGES."naryste/nesutikti.png' height='15' width='15' border='0' title='Registruokis'>";
} else {
echo "<a href='".FUSION_SELF."?veiksmas=prideti&d_id=".$data['download_id']."&cat_id=".$data['download_cat']."' onMouseover=\"ddrivetip('Pridėti dainą į savo muzikos topa','#eaefef', 200)\"; onMouseout=\"hideddrivetip()\"><img src='".IMAGES."naryste/sutikti.png' border='0' height='15' width='15'></a>"; }
echo "</td>
</tr>
";
echo "</table><br/>
<table width='100%' class='tbl-border' align='center' cellspacing='2' cellpadding='2'><tr>
<td rowspan='2' class='tbl1'><a href='kaip.php'>Kaip parsisiųsti muziką??</a></td>
<td width='120' align='left' class='tbl1'>Trukmė:</td><td class='tbl1'>";
if ($data['download_filesize']!=''){ echo "".$data['download_filesize'].""; } else {
echo "Nenurodyta"; }
echo "</td>
</tr>
<tr>
<td class='tbl1'>Dainos tekstas:</td>
<td class='tbl1'>";
if ($data['download_text']!=''){ echo "<a href='".$data['download_text']."'><img src='".IMAGES."naryste/sutikti.png' border='0' height='10' width='10' alt='Žiūrėti' title='Žiūrėti'></a>"; } else {
echo "<img src='".IMAGES."naryste/nesutikti.png' border='0' height='10' width='10' alt='Nėra' title='Nėra'>"; }
echo "</td>
</tr>
</table><br/><br/>\n";
showratings("D",$d_id,FUSION_SELF."?d_id=$d_id");
echo "<font color='red'><b>*</b></font> Tai nuosavas tavo music topas, į kurį gali įtraukti 10-imt savo mėgiamų dainų. Tas dainas kiti vartotojai matys <a href='".BASEDIR."~".$userdata['user_id']."'>tavo profilyje</a>.";
echo "<br/><br/>";
echo "<table class='tbl-border' cellpadding='0' cellspacing='1' width='100%'><tbody><tr>
<td class='tbl2' style='width: 80px;' width='80'>Nuoroda</td>
<td class='tbl1'><center><input value='http://www.mp3laisve.us.lt/".BASEDIR.seoname($data['download_title'])."-".$data['download_id'].".php' class='textbox' style='font-size: 11px; width: 480px;' onclick='javascript:this.select();' type='text'></center></td>
</tr>
<tr>
<td class='tbl2' style='width: 80px;' width='80'>BB Kodas</td>
<td class='tbl1'><center><input value=')."-".$data['download_id'].".php]".$data['download_title']."' class='textbox' style='font-size: 11px; width: 480px;' onclick='javascript:this.select();' type='text'></center></td>
</tr>
<tr>
<td class='tbl2' style='width: 80px;' width='80'>HTML Kodas</td>
<td class='tbl1'><center><input value='<a href=http://www.mp3laisve.us.lt/".BASEDIR.seoname($data['download_title'])."-".$data['download_id'].".php>".$data['download_title']."</a>' class='textbox' style='font-size: 11px; width: 480px;' onclick='javascript:this.select();' type='text'></center></td>
</tr></tbody></table>
";
showcomments("D","downloads","download_id",$d_id,FUSION_SELF."?d_id=$d_id");
echo "</td></tr></table>\n";
closetable2();
} else {
if (!isset($cat_id)) {
opentable('Dainų kategorijos');
$result = dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE ".groupaccess('download_cat_access')." ORDER BY download_cat_name");
$rows = dbrows($result);
if ($rows != 0) {
$counter = 0; $columns = 2;
echo "<table width='100%' align='center' border='0'><tr><td width='100%'>";
echo "<table cellspacing='2' cellpanding='2' width='100%' align='center'>";
echo "<tr><td align='center'><img src='".IMAGES."music.jpg'></td></tr>";
echo "<tr>
<td align='center' class='cell'>
<form name='searchform' method='post' action='paieska.php' style='display: inline;'>
<b>Ieškoti MP3:</b> <input name='stext' class='textbox' style='width: 200px;' type='text'>
<input name='stype' value='d' type='hidden'><input name='search' value='Ieškoti!' class='button' type='submit'>
</form>
</td>
</tr>";
while ($data = dbarray($result)) {
$num = dbcount("(download_cat)", "downloads", "download_cat='".$data['download_cat_id']."'");
echo "<tr>
<td class='cell'><a class='small' href='".seoname($data['download_cat_name'])."=".$data['download_cat_id'].".php' style='font-weight: bold;'><a href='".seoname($data['download_cat_name'])."=".$data['download_cat_id'].".php' border='1'>".$data['download_cat_name']."</a> ".$data['download_cat_description']." (dainų: ".dbresult(dbquery("SELECT count(download_id) FROM ".$db_prefix."downloads WHERE download_cat='".$data['download_cat_id']."'"), 0).")</td>
</tr>";
$counter++;
}
echo "</table>";
echo "</td><td valign='top'><a href='http://www.' target='_blank'></td></tr></table>";
while ($data = dbarray($result)) {
$num = dbcount("(download_cat)", "downloads", "download_cat='".$data['download_cat_id']."'");
echo "<tr>
<td class='cell'><a class='small' href='".seoname($data['download_cat_name'])."=".$data['download_cat_id'].".php' style='font-weight: bold;'><a href='".seoname($data['download_cat_name'])."=".$data['download_cat_id'].".php' border='1'>".$data['download_cat_name']."</a> ".$data['download_cat_description']." (dainų: ".dbresult(dbquery("SELECT count(download_id) FROM ".$db_prefix."downloads WHERE download_cat='".$data['download_cat_id']."'"), 0).")</td>
</tr>";
$counter++;
}
echo "</table>";
} else {
echo "<center><br>\n".$locale['430']."<br><br>\n</center>\n";
}
closetable();
tablebreak();
opentable("Statistika");
$naujausias = dbarray(dbquery("SELECT * FROM ".$db_prefix."downloads ORDER BY download_datestamp DESC LIMIT 0,1"));
echo "<table cellspacing='2' cellpanding='2' width='100%' align='center'>";
echo "<tr><td align='center' valign='top' class='cell'><img src='".IMAGES."stats.jpg'></td>";
echo "<td valign='top' class='cell'><strong>Naujausia daina:</strong> <a href='".BASEDIR.seoname($naujausias['download_title'])."-".$naujausias['download_id'].".php' title='".$naujausias['download_title']."' class='side'>".$naujausias['download_title']."</a> (siuntėsi: ".$naujausias['download_count'].")<br>";
$pop = dbarray(dbquery("SELECT * FROM ".$db_prefix."downloads ORDER BY download_count DESC LIMIT 0,1"));
echo "<strong>Populiariausia daina:</strong> <a href='".BASEDIR.seoname($pop['download_title'])."-".$pop['download_id'].".php' title='".$pop['download_title']."' class='side'>".$pop['download_title']."</a> (siuntėsi: ".$pop['download_count'].")<br>";
$s = dbcount("(download_id)", "downloads");
echo "<strong>Dainų:</strong> $s<br>";
$sk = dbcount("(download_cat_id)", "download_cats");
echo "<strong>Kategorijų:</strong> $sk<br>";
echo "</td></tr></table>";
closetable();
tablebreak();
opentable("Top50");
$top = dbquery("SELECT * FROM ".$db_prefix."downloads ORDER BY download_count DESC LIMIT 0,50");
echo "<a name='top' id='top'></a>";
echo "<table cellspacing='2' cellpanding='2' width='100%' align='center'><tr><td class='cell'><strong>Nr.</strong></td><td class='cell'><strong>Pavadinimas</strong></td><td class='cell'><strong>Įdėta</strong></td><td class='cell'><strong>Siuntėsi</strong></td><td class='cell' width='60'><strong>Įdėjo</strong></td></tr>";
$a = 1;
while($data = dbarray($top)){
$result = dbquery("SELECT user_id FROM ".$db_prefix."users WHERE user_name='".$data['download_license']."'");
$data2 = dbarray($result);
echo "<tr><td valign='top' class='cell'>$a.</td><td valign='top' class='cell'><a href='".BASEDIR.seoname($data['download_title'])."-".$data['download_id'].".php' title='".$data['download_title']."' class='side'>".$data['download_title']."</a></td><td class='cell'>".showdate("%Y.%m.%d", $data['download_datestamp'])."</td><td class='cell' align='center'>".$data['download_count']."</td><td class='cell' align='center'><a href='".BASEDIR."~".$data2['user_id']."'>".$data['download_license']."</a></td></tr>";
$a++;
}
echo "</table>";
closetable();
} else {
if (isset($pranesimas) && $_GET['pranesimas'] == "pasalintas") {
echo "<script language='JavaScript'>alert(\"Ši daina pašalinta iš jūsų topo\");</script>"; }
if (isset($pranesimas) && $_GET['pranesimas'] == "pridetas") {
echo "<script language='JavaScript'>alert(\"Jūs sėkmingai pridėjote šią dainą į savo topų sąrašą\");</script>"; }
if (isset($pranesimas) && $_GET['pranesimas'] == "pilnas") {
echo "<script language='JavaScript'>alert(\"Jūsų sąrašas jau pilnas\");</script>"; }
opentable('Geriausia muzika');
$res = 0;
if (!isNum($cat_id)) fallback(FUSION_SELF);
$result = dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_cat_id='$cat_id' ");
if (dbrows($result) != 0) {
$cdata = dbarray($result);
if (checkgroup($cdata['download_cat_access'])) {
$res = 1;
$rows = dbcount("(*)", "downloads", "download_cat='$cat_id'");
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if ($rows != 0) {
$result = dbquery("SELECT * FROM ".$db_prefix."downloads WHERE download_cat='$cat_id' ORDER BY download_datestamp DESC LIMIT $rowstart,30");
//s
$catdata = dbarray(dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_cat_id='$cat_id'"));
$count = dbresult(dbquery("SELECT count(download_id) FROM ".$db_prefix."downloads WHERE download_cat='$cat_id'"), 0);
echo "
<table valign='top' align='center' cellpadding='0' cellspacing='1' width='100%'>
<tr><td align='center' valign='top'><a class='small' href='downloads.php'>Visos kategorijos</a> -> <a class='small' href='downloads.php?cat_id=$cat_id' title='".$catdata['download_cat_name']."'>".$catdata['download_cat_name']."</a><br/><br/>Dainų kategorijoje: <span class='small2'>$count</span><br><br><form name='searchform' method='post' action='paieska.php' style='display: inline;'>
<b>Ieškoti MP3:</b> <input name='stext' class='textbox' style='width: 200px;' type='text'>
<input name='stype' value='d' type='hidden'><input name='search' value='Ieškoti!' class='button' type='submit'>
</form></td>
</tr>
</table>
";
$numrows = dbrows($result); $i = 1;
$abc = 0;
echo "<table width='100%' align='center'>
<tr>
<td class='tbl1' width='1%'></td>
<td class='tbl2' >Dainos pavadinimas</td>
<td class='tbl1' align='center' width='1%'>Pridėtas</td>
<td class='tbl2' align='center' width='1%'>Siųsta</td>
<td class='tbl2' align='center' width='1%'>Top<font color='red'><b>*</b></font></td>
</tr>";
while ($data = dbarray($result)) {
$abc = $abc+1;
$id = $data['download_id'];
if ($data['download_datestamp']+604800 > time()+($settings['timeoffset']*3600)) {
$new = " <span class='small'><img src='".IMAGES."new2.gif'></span>";
} else {
$new = "";
}
$time = $data['download_datestamp'];
$laikas = showdate( "%d.%m.%y", $time);
echo "
<tr>
<td class='tbl2' width='1%'>$abc</td>
<td class='tbl1'><a class='small' href='".BASEDIR.seoname($data['download_title'])."-".$data['download_id'].".php' title='Daina'><b>".$data['download_title']."</b></a> $new</td>
<td class='tbl2' align='center' width='1%'>$laikas</td>
<td class='tbl1' align='center' width='1%'>".$data['download_count']."</td>
<td class='tbl1' align='center' width='1%'>";
if(!iMEMBER) {
echo "<img src='".IMAGES."naryste/nesutikti.png' height='15' width='15' border='0' title='Registruokis'>";
}
else {
echo "<a href='".FUSION_SELF."?veiksmas=prideti&d_id=".$data['download_id']."&cat_id=".$data['download_cat']."'><img src='".IMAGES."naryste/sutikti.png' border='0' height='15' width='15'></a>"; } echo "</td>
</tr>
";
if ($i != $numrows) { echo "<div align='center'><img src='".THEME."images/blank.gif' alt='' width='1'></div>\n"; $i++; }
}
echo "</table>";
if ($rows > 30) echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,30,$rows,3,FUSION_SELF."?cat_id=$cat_id&")."\n</div>\n";
} else {
echo $locale['431']."\n";
}
}
}
if ($res == 0) redirect(FUSION_SELF);
echo "</td></tr><tr><td colspan='5' ><font color='red'><b>*</b></font> Tai nuosavas tavo music topas, į kurį gali įtraukti 10-imt savo mėgiamų dainų. Tas dainas kiti vartotojai matys <a href='".BASEDIR."~".$userdata['user_id']."'>tavo profilyje</a>.</td></tr></table>";
closetable();
}
}
if (isset($_GET['veiksmas']) && $_GET['veiksmas'] == "pasalinti") {
$resultas = dbquery("DELETE FROM ".$db_prefix."nario_topas WHERE music_id='$d_id' AND user_id='".$userdata['user_id']."'");
redirect(FUSION_SELF."?cat_id=$cat_id&pranesimas=pasalintas");
}
if (isset($_GET['veiksmas']) && $_GET['veiksmas'] == "prideti" && dbcount("(music_id)", "nario_topas", "user_id='".$userdata['user_id']."'") < 10) {
$result = dbquery("SELECT * FROM ".$db_prefix."nario_topas WHERE user_id='".$userdata['user_id']."' ORDER BY top_order DESC LIMIT 1");
if (dbrows($result) != 0) { $data = dbarray($result); $neworder = $data['top_order'] + 1; } else { $neworder = 1; }
$result = dbquery("INSERT INTO ".$db_prefix."nario_topas (top_order, music_id, user_id, nuo_kada) VALUES ('', '$d_id', '".$userdata['user_id']."', '".time()."')");
redirect(FUSION_SELF."?cat_id=$cat_id&pranesimas=pridetas");
}
if (isset($_GET['veiksmas']) && $_GET['veiksmas'] == "prideti" && dbcount("(music_id)", "nario_topas", "user_id='".$userdata['user_id']."'") > 9) { redirect(FUSION_SELF."?cat_id=$cat_id&pranesimas=pilnas"); }
}
require_once "side_right.php";
require_once "footer.php";
?>
Redagavo Deiviuxsz· 2012 Sau. 7 15:01:36