Zaawansowany
Postów: 1191 Pomógł: 418 Ostrzeżeń: 1
v6.00.xxx Data rejestracji: 06.04.2008 21:59
|
Nie wiem jaki masz download ale dla MOD-FMC Download wygląda to tak
Najpierw wchodzisz w dodatkowe strony i wklejasz ten kod i klikasz podgląd
<?php
dbquery("ALTER TABLE `".DB_PREFIX."downloads` ADD `grupa` smallint(5) unsigned NOT NULL ;");
?>
Potem edytujesz plik downloads.php i dodajesz to co na czerwono
echo "</small></td>";
echo "</tr></table>";
echo "<br>";
if ($data['download_description']) {
echo "<table border='0' width='95%' align='center' cellspacing='1' cellpadding='0' class='tbl-border'>
<tr>
<td class='forum-caption'>".$locale['D012']."</td>
</tr>
<tr>
<td class='tbl1'>".nl2br(stripslashes($data['download_description']))."</td>
</tr>
</table>";
echo "<br>";
}
echo "<table border='0' width='95%' align='center' cellspacing='1' cellpadding='0' class='tbl-border'><tr>
<td class='forum-caption' colspan='3'>".$locale['D013']."</td>
</tr><tr>
<td class='tbl1' width='33%' align='center'>[b]";
$wynik = dbquery("SELECT * FROM ".$db_prefix."downloads WHERE grupa='".$userdata['user_groups']."'");
if(dbrows($wynik)) {
echo "Nie należysz do grupy";
} else { echo "<a href='".FUSION_SELF."?cat_id=$cat_id&download_id=".$data['download_id']."' target='_blank'>Pobierz Plik</a>"; }
echo "[/b]</td>
<td class='tbl1' width='33%' align='center'><a href='".FUSION_SELF."?cat_id=$cat_id&info_id=".$data['download_id']."&act=rate'>Oceń Plik</a></td>
<td class='tbl1' width='33%' align='center'><a href='".FUSION_SELF."?cat_id=$cat_id&info_id=".$data['download_id']."&act=comment'>Skomentuj Plik</a></td>
</tr></table><br><br>";
closetable();
if ($act == "rate") {
showratings("D",$info_id,FUSION_SELF."?cat_id=$cat_id&info_id=$info_id&act=rate");
}
if ($act == "comment") {
showcomments("D","downloads","download_id",$info_id,FUSION_SELF."?cat_id=$cat_id&info_id=$info_id&act=comment");
}
}
} else {
$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;
Potem edytujesz plik administration/ downloads.php i dodajesz to na czerwono dzięki temu będziesz miał możliwość przy dodawaniu plików określić jaki plik ma być dla danej grupy
$result = dbquery("SELECT * FROM ".$db_prefix."download_cats");
if (dbrows($result) != 0) {
if ($step == "delete") {
$result = dbquery("DELETE FROM ".$db_prefix."downloads WHERE download_id='$download_id'");
redirect(FUSION_SELF.$aidlink."&download_cat_id=$download_cat_id");
}
if (isset($_POST['save_download'])) {
$download_title = stripinput($_POST['download_title']);
$download_description = addslash($_POST['download_description']);
$download_url = stripinput($_POST['download_url']);
$download_license = stripinput($_POST['download_license']);
$download_os = stripinput($_POST['download_os']);
$download_filesize = stripinput($_POST['download_filesize']);
$download_author = stripinput($_POST['download_author']);
$download_screen = stripinput($_POST['download_screen']);
$download_copyright = addslash($_POST['download_copyright']);
[b]$grupa = stripinput($_POST['grupa']);[/b]
if ($step == "edit") {
$download_datestamp = isset($_POST['update_datestamp']) ? ", download_datestamp='".time()."'" : "";
$result = dbquery("UPDATE ".$db_prefix."downloads SET download_title='$download_title', download_description='$download_description', download_url='$download_url', download_cat='$download_cat', download_license='$download_license', download_os='$download_os', download_filesize='$download_filesize'".$download_datestamp.", download_author='$download_author', download_screen='$download_screen', download_copyright='$download_copyright' WHERE download_id='$download_id' [b]grupa='$grupa'");[/b]
redirect(FUSION_SELF.$aidlink."&download_cat_id=$download_cat");
} else {
$result = dbquery("INSERT INTO ".$db_prefix."downloads (download_title, download_description, download_url, download_cat, download_license, download_os, download_filesize, download_datestamp, download_count, download_author, download_screen, download_copyright,[b] grupa[/b]) VALUES ('$download_title', '$download_description', '$download_url', '$download_cat', '$download_license', '$download_os', '$download_filesize', '".time()."', '0', '$download_author', '$download_screen', '$download_copyright',[b] '$grupa'[/b])");
redirect(FUSION_SELF.$aidlink."&download_cat_id=$download_cat");
}
}
if ($step == "edit") {
$result = dbquery("SELECT * FROM ".$db_prefix."downloads WHERE download_id='$download_id'");
$data = dbarray($result);
$download_title = $data['download_title'];
$download_description = stripslashes($data['download_description']);
$download_url = $data['download_url'];
$download_license = $data['download_license'];
$download_os = $data['download_os'];
$download_filesize = $data['download_filesize'];
$download_author = $data['download_author'];
$download_screen = $data['download_screen'];
$download_copyright = $data['download_copyright'];
[b]$grupa = $_POST['grupa'];[/b]
$formaction = FUSION_SELF.$aidlink."&step=edit&download_cat_id=$download_cat_id&download_id=$download_id";
opentable($locale['470']);
} else {
$download_title = "";
$download_description = "";
$download_url = "";
$download_license = "";
$download_os = "";
$download_filesize = "";
$download_author = "";
$download_screen = "";
$download_copyright = "";
$grupa = "";
$formaction = FUSION_SELF.$aidlink;
opentable($locale['471']);
}
$editlist = ""; $sel = "";
$result2 = dbquery("SELECT * FROM ".$db_prefix."download_cats ORDER BY download_cat_name");
if (dbrows($result2) != 0) {
while ($data2 = dbarray($result2)) {
if ($step == "edit") $sel = ($data['download_cat'] == $data2['download_cat_id'] ? " selected" : "");
$editlist .= "<option value='".$data2['download_cat_id']."'$sel>".$data2['download_cat_name']."</option>\n";
}
}
echo "<form name='inputform' method='post' action='$formaction'>
<table align='center' cellpadding='0' cellspacing='0' width='460'>
<tr>
<td width='80' class='tbl'>".$locale['480']."</td>
<td class='tbl'><input type='text' name='download_title' value='$download_title' class='textbox' style='width:380px;'></td>
</tr>
<tr>
<td valign='top' width='80' class='tbl'>".$locale['481']."</td>
<td class='tbl'><textarea name='download_description' rows='5' class='textbox' style='width:380px;'>".$download_description."</textarea></td>
</tr>
<tr>
<td class='tbl'></td><td class='tbl'>
<input type='button' value='b' class='button' style='font-weight:bold;width:25px;' onClick=\"addText('download_description', '<b>', '</b>');\">
<input type='button' value='i' class='button' style='font-style:italic;width:25px;' onClick=\"addText('download_description', '<i>', '</i>');\">
<input type='button' value='u' class='button' style='text-decoration:underline;width:25px;' onClick=\"addText('download_description', '<u>', '</u>');\">
<input type='button' value='link' class='button' style='width:35px' onClick=\"addText('download_description', '<a href=\'', '\' target=\'_blank\'>Link</a>');\">
<input type='button' value='img' class='button' style='width:35px' onClick=\"addText('download_description', '<img src=\'', '\' style=\'margin:5px\' align=\'left\'>');\">
<input type='button' value='center' class='button' style='width:45px' onClick=\"addText('download_description', '<center>', '</center>');\">
<input type='button' value='small' class='button' style='width:40px' onClick=\"addText('download_description', '<span class=\'small\'>', '</span>');\">
<input type='button' value='small2' class='button' style='width:45px' onClick=\"addText('download_description', '<span class=\'small2\'>', '</span>');\">
<input type='button' value='alt' class='button' style='width:25px' onClick=\"addText('download_description', '<span class=\'alt\'>', '</span>');\"><br>
</td>
</tr>
<tr>
<td valign='top' width='80' class='tbl'>".$locale['512']."</td>
<td class='tbl'><textarea name='download_copyright' rows='5' class='textbox' style='width:380px;'>".$download_copyright."</textarea></td>
</tr>
<tr>
<td width='80' class='tbl'>".$locale['482']."</td>
<td class='tbl'><input type='text' name='download_url' value='$download_url' class='textbox' style='width:380px;'></td>
</tr>
<tr>
<td width='80' class='tbl'>".$locale['513']."</td>
<td class='tbl'><input type='text' name='download_screen' value='$download_screen' class='textbox' style='width:380px;'></td>
</tr>
<tr>
<td width='80' class='tbl'>".$locale['483']."</td>
<td class='tbl'><select name='download_cat' class='textbox'>
$editlist</select></td>
</tr>
[b]<tr>
<td width='80' class='tbl'>Wybierz grupę</td>
<td class='tbl'>";
$result = dbquery("SELECT * FROM ".$db_prefix."user_groups");
$link = ""; $sel = "";
while ($data = dbarray($result)) {
if (isset($site_links)) $sel = ($site_links == $data['group_id'] ? " selected" : "");
$link .= "<option value='".$data['group_id']."'$sel>".$data['group_name']."</option>\n";
}
echo "<select name='grupa' class='textbox' style='width:250px;'>
$link</select>";
echo "</td></tr>[/b]
<tr>
<td width='80' class='tbl'>".$locale['484']."</td>
<td class='tbl'><input type='text' name='download_license' value='$download_license' class='textbox' style='width:150px;'></td>
</tr>
|