FMC Download - wspólna jedna kategoria plików.
|
Sony |
Dodany dnia 12.05.2008 15:55:02
|
Początkujący
Postów: 253 Pomógł: 19 Ostrzeżeń: 1
v7.02.06 Data rejestracji: 19.04.2008 16:21
|
Witam, mam nadzieję, że w dobrym miejscu piszę? ;->
Potrzebuję pomocy w edycji wtyczki FMC Download 1.08
Chciałby, aby w tej wtyczce utworzona została kategoria o przykładowej nazwie "Wszystko", w której automatycznie dodawane byłyby pliki z innch kategorii.
Heh, trochę namieszałem, ale chyba mniej więcej jest jasne o co mi chodzi?
PW od moderatora:
- Przeniesienie tematu - Pieka 12.05 - 17:53
|
|
|
|
Wścibski Gość |
Dodany dnia 23.12.2024 11:13:45
|
Pan Kontekstualny
Postów: n^x
Data rejestracji: Zawsze
|
|
IP: localhost |
|
|
piotrek199214 |
Dodany dnia 12.05.2008 16:07:04
|
Bywalec
Postów: 977 Pomógł: 168
v7.01.05 Data rejestracji: 17.12.2007 21:05
|
Przecież tam nie musisz tworzyć wielu kategorii. stwórz sobie tą o nazwie "Wszystko" i tam dodawaj, a jak chcesz żeby w download wyświetlała się od razu ta kategoria to zmień sobie link na downloads.php?cat_id=1&sort=1 . Chyba że ja Cie nie za bardzo zrozumiałem. |
|
|
|
kefirek |
Dodany dnia 12.05.2008 16:10:50
|
Zaawansowany
Postów: 1191 Pomógł: 418 Ostrzeżeń: 1
v6.00.xxx Data rejestracji: 06.04.2008 21:59
|
Chcesz mieć ileś tam kategorii na stronie + kategorie w której będą wszystkie dodane pliki tak myślę że takie coś się da zrobić |
|
|
|
Sony |
Dodany dnia 12.05.2008 16:21:33
|
Początkujący
Postów: 253 Pomógł: 19 Ostrzeżeń: 1
v7.02.06 Data rejestracji: 19.04.2008 16:21
|
piotrek199214 napisał/a:
Chyba że ja Cie nie za bardzo zrozumiałem.
Może dam taki przykład:
Mam już stworzonch 20 róznych kategori i w nich kilkanście dodanych plików...
I teraz chciałbym żeby te wszytskie pliki z tych 20 kategori zostały automatycznie wpisane/dodane do tej jednej kategori "Wszystkie".
Oraz również przy swtorzeniu nowych kategori, lub dodaniu pliku/plików do już istniejącej kategrii.. Chciałbym żeby one automatcznie zostały dodawane do tej 'stałej' kategori "Wszystko".
kefirek napisał/a:
Chcesz mieć ileś tam kategorii na stronie + kategorie w której będą wszystkie dodane pliki tak
Dokładnie. Wiesz jak to zrobić? Pomożesz?
Edytowane przez Sony dnia 12.05.2008 16:27:29
|
|
|
|
bartek124 |
Dodany dnia 12.05.2008 17:36:07
|
Weteran
Postów: 3264 Pomógł: 236
v7.02.06 Data rejestracji: 26.05.2007 12:25
|
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";
include LOCALE.LOCALESET."downloads.php";
if (isset($download_id) && !isNum($download_id)) fallback("index.php");
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 WHERE download_id='$download_id'");
redirect($data['download_url']);
}
}
if ($res == 0) redirect(BASEDIR."downloads.php");
}
if ($cat = "all") {
$res = 0;
if (!isNum($cat_id)) fallback(FUSION_SELF);
$result = dbquery("SELECT * FROM ".$db_prefix."download_cats");
if (dbrows($result) != 0) {
$cdata = dbarray($result);
if (checkgroup($cdata['download_cat_access'])) {
$res = 1;
opentable($locale['400']." - ".$cdata['download_cat_name']);
echo "<br>";
echo "<table width='70%' align='center' cellspacing='1' cellpadding='1' class='tbl-border'>";
echo "<tr>";
echo "<td align='center' width='33%' class='".(FUSION_QUERY == "cat_id=$cat_id" || $sort == 1 ? "tbl1" : "tbl2")."'><span class='small'>\n";
echo (FUSION_QUERY == "cat_id=$cat_id" || $sort == 1 ? "<b>".$locale['D014']."</b>" : "<a href='".FUSION_SELF."?cat_id=$cat_id&sort=1'>".$locale['D014']."</a>")."</span></td>\n";
echo "<td align='center' width='33%' class='".($sort == 3 ? "tbl1" : "tbl2")."'><span class='small'>\n";
echo ($sort == 3 ? "<b>".$locale['D015']."</b>" : "<a href='".FUSION_SELF."?cat_id=$cat_id&sort=3'>".$locale['D015']."</a>")."</span></td>\n";
echo "<td align='center' width='33%' class='".($sort == 2 ? "tbl1" : "tbl2")."'><span class='small'>\n";
echo ($sort == 2 ? "<b>".$locale['D016']."</b>" : "<a href='".FUSION_SELF."?cat_id=$cat_id&sort=2'>".$locale['D016']."</a>")."</span></td>\n";
echo "</tr></table><br>";
$rows = dbcount("(*)", "downloads", "download_cat='$cat_id'");
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if (!isset($sort) || !isNum($sort)) $sort = 0;
$sorting = $cdata['download_cat_sorting'];
if ($sort == 1) $sorting = "download_title ASC";
if ($sort == 2) $sorting = "download_count DESC";
if ($sort == 3) $sorting = "download_datestamp DESC, download_title ASC";
if ($rows != 0) {
$result = dbquery("SELECT * FROM ".$db_prefix."downloads WHERE download_cat='$cat_id' ORDER BY $sorting LIMIT $rowstart,20");
$numrows = dbrows($result); $i = 1;
while ($data = dbarray($result)) {
if ($data['download_datestamp']+604800 > time()+($settings['timeoffset']*3600)) {
$new = " <span style='font-size:8px;'>".$locale['410']."</span>";
} else {
$new = "";
}
echo "<table border='0' width='95%' align='center' cellspacing='1' cellpadding='0' class='tbl-border'>
<tr>
<td class='forum-caption' colspan='4'>".$data['download_title']." $new</td>
</tr>";
if ($data['download_description']) {
echo "<tr>
<td class='tbl1' colspan='4' calign='top' style='padding:5px;'>";
echo "<small>".nl2br(stripslashes($data['download_description']))."</small>";
echo "</td>
</tr>";
}
echo "<tr>
<td class='tbl2' colspan='2' align='center'><small>".showdate("%d.%m.%Y %H:%M:%S", $data['download_datestamp'])."</small></td>
<td class='tbl2' colspan='1' align='center'><small>".$locale['D017'].$data['download_count']."</small></td>
<td class='tbl2' colspan='1' align='center'><a href='".FUSION_SELF."?cat_id=$cat_id&info_id=".$data['download_id']."'><small>".$locale['D018']."</small></a></td>
</tr>
<tr>
<td class='tbl2' align='center' width='25%'><small>".$data['download_filesize']."</small></td>
<td class='tbl2' align='center' width='25%'><small>".$data['download_license']."</small></td>";
$wynik = dbquery("SELECT SUM(rating_vote) FROM ".$db_prefix."ratings WHERE rating_type='D' AND rating_item_id='".$data['download_id']."'");
$info = dbresult($wynik,0);
$num_rating = dbcount("(rating_vote)", "ratings", "rating_type='D' AND rating_item_id='".$data['download_id']."'");
$wyn_rating = ($num_rating ? $info / $num_rating : 0);
echo "<td class='tbl2' align='center' width='25%'><small>".$locale['D019']."<img src='".IMAGES."rate/".ceil($wyn_rating).".gif' alt='' style='vertical-align:middle;' title='".$locale['D019'].ceil($wyn_rating)."'></small></td>
<td class='tbl2' align='center' width='25%'><a href='".FUSION_SELF."?cat_id=$cat_id&info_id=".$data['download_id']."&act=comment'><small>".$locale['D020']."</small></a></td>
</tr>
</table>";
echo ($i != $numrows ? "<br>" : "\n"); $i++;
}
echo "<br>";
closetable();
if ($rows > 20) echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,20,$rows,3,FUSION_SELF."?cat_id=$cat_id&sort=$sort&")."\n</div>\n";
} else {
echo $locale['431']."\n";
closetable();
}
}
}
if ($res == 0) redirect(FUSION_SELF);
} elseif (!isset($cat_id)) {
opentable($locale['400']);
echo "<br>";
$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 = 1;
while ($data = dbarray($result)) {
if ($counter != 0 && ($counter % $columns == 0)) echo "<br>";
$num = dbcount("(download_cat)", "downloads", "download_cat='".$data['download_cat_id']."'");
echo "<table border='0' width='95%' align='center' cellspacing='1' cellpadding='0' class='tbl-border'>
<tr>
<td class='forum-caption' colspan='2'>".$data['download_cat_name']."</td>
</tr>";
if ($data['download_cat_description']) {
echo "<tr>
<td class='tbl1' colspan='2' calign='top' style='padding:5px;'>";
echo "<small>".nl2br(stripinput($data['download_cat_description']))."</small>";
echo "</td>
</tr>";
}
echo "<tr>
<td class='tbl2' align='center' width='50%'><small>".$locale['D001'].$num."</small></td>
<td class='tbl2' align='center' width='50%'><a href='".FUSION_SELF."?cat_id=".$data['download_cat_id']."&sort=1'><small>".$locale['D002']."</small></a></td>
</tr>
</table>";
$counter++;
}
$num2 = dbcount("(download_cat)", "downloads");
echo "<br>";
echo "<table border='0' width='95%' align='center' cellspacing='1' cellpadding='0' class='tbl-border'>
<tr>
<td class='forum-caption' colspan='2'>Wszystkie Pliki</td>
</tr>";
echo "<tr>
<td class='tbl1' colspan='2' calign='top' style='padding:5px;'>";
echo "<small>Wszystkie pliki</small>";
echo "</td>
</tr>";
echo "<tr>
<td class='tbl2' align='center' width='50%'><small>".$locale['D001'].$num2."</small></td>
<td class='tbl2' align='center' width='50%'><a href='".FUSION_SELF."?cat=all&sort=1'><small>".$locale['D002']."</small></a></td>
</tr>
</table>";
} else {
echo "<center><br>\n".$locale['430']."<br><br>\n</center>\n";
}
closetable();
} else {
include INCLUDES."comments_include.php";
include INCLUDES."ratings_include.php";
$result = dbquery("SELECT * FROM ".$db_prefix."downloads WHERE download_id='$info_id'");
if ($info_id) {
while ($data = dbarray($result)) {
opentable($locale['400']." » ".$data['download_title']);
echo "<br><br><table border='0' width='95%' align='center' cellspacing='1' cellpadding='0' class='tbl-border'><tr>
<td colspan='3' class='forum-caption'>".$locale['D003']."</td>
</tr><tr>
<td class='tbl1' width='200' align='center' valign='middle' rowspan='8'>";
if ($data['download_screen']) {
echo "<img src='".$data['download_screen']."' alt='' width='160px' height='120px'>";
echo "<br><br><small>[ <a href='".$data['download_screen']."' target='_blank'>".$locale['D004']."</a> ]</small></td>";
} else {
echo "<img src='images/nonscreen.gif' alt='' width='160px' height='120px'>";
echo "<br><br><small>[ ".$locale['D004']." ]</small></td>";
}
echo "<td class='tbl2' width='1%' nowrap><b>".$locale['D005']."</b></td>
<td class='tbl1'>".$data['download_title']."</td>
</tr>
<tr>
<td class='tbl2'width='1%' nowrap><b>".$locale['D006']."</b></td>
<td class='tbl1'>".$data['download_author']."</td>
</tr>
<tr>
<td class='tbl2'width='1%' nowrap><b>".$locale['D007']."</b></td>
<td class='tbl1'>".$data['download_filesize']."</td>
</tr>
<tr>
<td class='tbl2'width='1%' nowrap><b>".$locale['D008']."</b></td>
<td class='tbl1'>".$data['download_license']."</td>
</tr>
<tr>
<td class='tbl2'width='1%' nowrap><b>".$locale['D009']."</b></td>
<td class='tbl1'>".showdate("%d.%m.%Y %H:%M:%S", $data['download_datestamp'])."</td>
</tr>
<tr>
<td class='tbl2'width='1%' nowrap><b>".$locale['D010']."</b></td>
<td class='tbl1'>".$data['download_count']."</td>
</tr><tr>
<td class='tbl2'width='1%' nowrap><b>".$locale['D011']."</b></td>
<td class='tbl1'>".$data['download_os']."</td>
</tr><tr>
<td class='tbl2' align='center' height='30px' colspan='2'><small>";
if ($data['download_copyright']) {
echo $data['download_copyright'];
} else {
echo " ";
}
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'><a href='".FUSION_SELF."?cat_id=$cat_id&download_id=".$data['download_id']."' target='_blank'>Pobierz Plik</a></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;
opentable($locale['400']." - ".$cdata['download_cat_name']);
echo "<br>";
echo "<table width='70%' align='center' cellspacing='1' cellpadding='1' class='tbl-border'>";
echo "<tr>";
echo "<td align='center' width='33%' class='".(FUSION_QUERY == "cat_id=$cat_id" || $sort == 1 ? "tbl1" : "tbl2")."'><span class='small'>\n";
echo (FUSION_QUERY == "cat_id=$cat_id" || $sort == 1 ? "<b>".$locale['D014']."</b>" : "<a href='".FUSION_SELF."?cat_id=$cat_id&sort=1'>".$locale['D014']."</a>")."</span></td>\n";
echo "<td align='center' width='33%' class='".($sort == 3 ? "tbl1" : "tbl2")."'><span class='small'>\n";
echo ($sort == 3 ? "<b>".$locale['D015']."</b>" : "<a href='".FUSION_SELF."?cat_id=$cat_id&sort=3'>".$locale['D015']."</a>")."</span></td>\n";
echo "<td align='center' width='33%' class='".($sort == 2 ? "tbl1" : "tbl2")."'><span class='small'>\n";
echo ($sort == 2 ? "<b>".$locale['D016']."</b>" : "<a href='".FUSION_SELF."?cat_id=$cat_id&sort=2'>".$locale['D016']."</a>")."</span></td>\n";
echo "</tr></table><br>";
$rows = dbcount("(*)", "downloads", "download_cat='$cat_id'");
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if (!isset($sort) || !isNum($sort)) $sort = 0;
$sorting = $cdata['download_cat_sorting'];
if ($sort == 1) $sorting = "download_title ASC";
if ($sort == 2) $sorting = "download_count DESC";
if ($sort == 3) $sorting = "download_datestamp DESC, download_title ASC";
if ($rows != 0) {
$result = dbquery("SELECT * FROM ".$db_prefix."downloads WHERE download_cat='$cat_id' ORDER BY $sorting LIMIT $rowstart,20");
$numrows = dbrows($result); $i = 1;
while ($data = dbarray($result)) {
if ($data['download_datestamp']+604800 > time()+($settings['timeoffset']*3600)) {
$new = " <span style='font-size:8px;'>".$locale['410']."</span>";
} else {
$new = "";
}
echo "<table border='0' width='95%' align='center' cellspacing='1' cellpadding='0' class='tbl-border'>
<tr>
<td class='forum-caption' colspan='4'>".$data['download_title']." $new</td>
</tr>";
if ($data['download_description']) {
echo "<tr>
<td class='tbl1' colspan='4' calign='top' style='padding:5px;'>";
echo "<small>".nl2br(stripslashes($data['download_description']))."</small>";
echo "</td>
</tr>";
}
echo "<tr>
<td class='tbl2' colspan='2' align='center'><small>".showdate("%d.%m.%Y %H:%M:%S", $data['download_datestamp'])."</small></td>
<td class='tbl2' colspan='1' align='center'><small>".$locale['D017'].$data['download_count']."</small></td>
<td class='tbl2' colspan='1' align='center'><a href='".FUSION_SELF."?cat_id=$cat_id&info_id=".$data['download_id']."'><small>".$locale['D018']."</small></a></td>
</tr>
<tr>
<td class='tbl2' align='center' width='25%'><small>".$data['download_filesize']."</small></td>
<td class='tbl2' align='center' width='25%'><small>".$data['download_license']."</small></td>";
$wynik = dbquery("SELECT SUM(rating_vote) FROM ".$db_prefix."ratings WHERE rating_type='D' AND rating_item_id='".$data['download_id']."'");
$info = dbresult($wynik,0);
$num_rating = dbcount("(rating_vote)", "ratings", "rating_type='D' AND rating_item_id='".$data['download_id']."'");
$wyn_rating = ($num_rating ? $info / $num_rating : 0);
echo "<td class='tbl2' align='center' width='25%'><small>".$locale['D019']."<img src='".IMAGES."rate/".ceil($wyn_rating).".gif' alt='' style='vertical-align:middle;' title='".$locale['D019'].ceil($wyn_rating)."'></small></td>
<td class='tbl2' align='center' width='25%'><a href='".FUSION_SELF."?cat_id=$cat_id&info_id=".$data['download_id']."&act=comment'><small>".$locale['D020']."</small></a></td>
</tr>
</table>";
echo ($i != $numrows ? "<br>" : "\n"); $i++;
}
echo "<br>";
closetable();
if ($rows > 20) echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,20,$rows,3,FUSION_SELF."?cat_id=$cat_id&sort=$sort&")."\n</div>\n";
} else {
echo $locale['431']."\n";
closetable();
}
}
}
if ($res == 0) redirect(FUSION_SELF);
}
}
require_once "side_right.php";
require_once "footer.php";
?>
Spróbuj tak, nie sprawdzałem czy działa.
Nie pomagam na komunikatorach oraz PW!
|
|
|
|
Sony |
Dodany dnia 13.05.2008 09:53:28
|
Początkujący
Postów: 253 Pomógł: 19 Ostrzeżeń: 1
v7.02.06 Data rejestracji: 19.04.2008 16:21
|
No niestety nie działa.:( Pod IE strona się ciągle się łąduej i ładuje... A pod FF wywala kumunikat:
Nieprawidłowe przekierowanie
Firefox wykrył, że serwer przekierowuje żądanie tego zasobu w sposób uniemożliwiający jego ukończenie.
Edit:
Dopiero, gdy zmienię linie 32 z:
if ($cat = "all") {
na:
if ($cat = "[b]$all[/b]") {
To strona się ładuje..
Jest widoczna kategoria "Wszystkie Pliki", ale nie można na nią wejść.. Tzn. strona się tylko odświeża. :(
Edytowane przez Sony dnia 13.05.2008 17:06:46
|
|
|
|
kefirek |
Dodany dnia 13.05.2008 17:18:50
|
Zaawansowany
Postów: 1191 Pomógł: 418 Ostrzeżeń: 1
v6.00.xxx Data rejestracji: 06.04.2008 21:59
|
Dokładnie. Wiesz jak to zrobić? Pomożesz?
Proszę ja zrobiłem tak i działa :D
downloads.php
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright Š 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";
include LOCALE.LOCALESET."downloads.php";
[color=red]if($_GET['wszystkie']) {
opentable('Wszystkie pliki');
$wynik = dbquery("SELECT * FROM ".$db_prefix."downloads");
if(dbrows($wynik) > 0) {
while($r = dbarray($wynik)) {
echo "<table border='0' width='95%' align='center' cellspacing='1' cellpadding='0' class='tbl-border'>
<tr>
<td class='forum-caption' colspan='4'>".$r['download_title']."</td>
</tr>";
echo "<tr>
<td class='tbl1' colspan='4' calign='top' style='padding:5px;'>";
echo "<small>".nl2br(stripinput($r['download_cat_description']))."</small>";
echo "</td>
</tr>";
echo "<tr>
<td class='tbl2' align='center'><small>".showdate("%d.%m.%Y %H:%M:%S", $r['download_datestamp'])."</small></td>
<td class='tbl2' align='center'><small>Pobrano: ".$r['download_coun']."</small></td>
</tr>
<tr>";
echo "<td class='tbl2' colspan='2' align='center' width='25%'><a href='".FUSION_SELF."?cat_id=$cat_id&download_id=".$data['download_id']."' target='_blank'>Pobierz Plik</a></td>
</tr>
</table>";
}
}
closetable();
} else
{[/color]
if (isset($download_id) && !isNum($download_id)) fallback("index.php");
if (iMEMBER) {
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 WHERE download_id='$download_id'");
redirect($data['download_url']);
}
}
if ($res == 0) redirect(BASEDIR."downloads.php");
}
}
if (!isset($cat_id)) {
opentable($locale['400']);
tablebreak();
$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 = 1;
while ($data = dbarray($result)) {
if ($counter != 0 && ($counter % $columns == 0)) echo tablebreak();
$num = dbcount("(download_cat)", "downloads", "download_cat='".$data['download_cat_id']."'");
echo "<table border='0' width='95%' align='center' cellspacing='1' cellpadding='0' class='tbl-border'>
<tr>
<td class='forum-caption' colspan='2'>".$data['download_cat_name']."</td>
</tr>";
if ($data['download_cat_description']) {
echo "<tr>
<td class='tbl1' colspan='2' calign='top' style='padding:5px;'>";
echo "<small>".nl2br(stripinput($data['download_cat_description']))."</small>";
echo "</td>
</tr>";
}
echo "<tr>
<td class='tbl2' align='center' width='50%'><small>".$locale['D001'].$num."</small></td>
<td class='tbl2' align='center' width='50%'><a href='".FUSION_SELF."?cat_id=".$data['download_cat_id']."&sort=1'><small>".$locale['D002']."</small></a></td>
</tr>
</table>";
$counter++;
}
[color=red]$ilosc = dbquery("SELECT count(download_id) FROM ".$db_prefix."downloads");
echo "<table border='0' width='95%' align='center' cellspacing='1' cellpadding='0' class='tbl-border'>";
echo "<tr>
<td class='forum-caption' colspan='2'>Wszystkie pliki:</td>
</tr><tr>
<td class='tbl1' colspan='2' calign='top' style='padding:5px;'>";
echo "<small>AAAAAAAAA</small>";
echo "</td>
</tr>";
echo "<tr>
<td class='tbl2' align='center' width='50%'><small>Plików: ".dbresult($ilosc, 0)."</small></td>
<td class='tbl2' align='center' width='50%'><small><a href='".FUSION_SELF."?start=1&wszystkie=1'>Wejdź:</a></small></td>
</tr>
</table>";[/color]
tablebreak();
} else {
echo "<center><br>\n".$locale['430']."<br><br>\n</center>\n";
}
closetable();
} else {
include INCLUDES."comments_include.php";
include INCLUDES."ratings_include.php";
$result = dbquery("SELECT * FROM ".$db_prefix."downloads WHERE download_id='$info_id'");
if ($info_id) {
while ($data = dbarray($result)) {
opentable($locale['400']." » ".$data['download_title']);
echo "<br><br><table border='0' width='95%' align='center' cellspacing='1' cellpadding='0' class='tbl-border'><tr>
<td colspan='3' class='forum-caption'>".$locale['D003']."</td>
</tr><tr>
<td class='tbl1' width='200' align='center' valign='middle' rowspan='8'>";
if ($data['download_screen']) {
echo "<img src='".$data['download_screen']."' alt='' width='160px' height='120px'>";
echo "<br><br><small>[ <a href='".$data['download_screen']."' target='_blank'>".$locale['D004']."</a> ]</small></td>";
} else {
echo "<img src='images/nonscreen.gif' alt='' width='160px' height='120px'>";
echo "<br><br><small>[ ".$locale['D004']." ]</small></td>";
}
echo "<td class='tbl2' width='1%' nowrap><b>".$locale['D005']."</b></td>
<td class='tbl1'>".$data['download_title']."</td>
</tr>
<tr>
<td class='tbl2'width='1%' nowrap><b>".$locale['D006']."</b></td>
<td class='tbl1'>".$data['download_author']."</td>
</tr>
<tr>
<td class='tbl2'width='1%' nowrap><b>".$locale['D007']."</b></td>
<td class='tbl1'>".$data['download_filesize']."</td>
</tr>
<tr>
<td class='tbl2'width='1%' nowrap><b>".$locale['D008']."</b></td>
<td class='tbl1'>".$data['download_license']."</td>
</tr>
<tr>
<td class='tbl2'width='1%' nowrap><b>".$locale['D009']."</b></td>
<td class='tbl1'>".showdate("%d.%m.%Y %H:%M:%S", $data['download_datestamp'])."</td>
</tr>
<tr>
<td class='tbl2'width='1%' nowrap><b>".$locale['D010']."</b></td>
<td class='tbl1'>".$data['download_count']."</td>
</tr><tr>
<td class='tbl2'width='1%' nowrap><b>".$locale['D011']."</b></td>
<td class='tbl1'>".$data['download_os']."</td>
</tr><tr>
<td class='tbl2' align='center' height='30px' colspan='2'><small>";
if ($data['download_copyright']) {
echo $data['download_copyright'];
} else {
echo " ";
}
echo "</small></td>";
echo "</tr></table>";
tablebreak();
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(stripinput($data['download_description']))."</td>
</tr>
</table>";
tablebreak();
}
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'>".(iMEMBER ? "<a href='".FUSION_SELF."?cat_id=$cat_id&download_id=".$data['download_id']."' target='_blank'>Pobierz Plik</a>" : "<a href='".BASEDIR."register.php' target='_blank'>Załóż Konto</a>")."
</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;
opentable($locale['400']." - ".$cdata['download_cat_name']);
tablebreak();
echo "<table width='70%' align='center' cellspacing='1' cellpadding='1' class='tbl-border'>";
echo "<tr>";
echo "<td align='center' width='33%' class='".(FUSION_QUERY == "cat_id=$cat_id" || $sort == 1 ? "tbl1" : "tbl2")."'><span class='small'>\n";
echo (FUSION_QUERY == "cat_id=$cat_id" || $sort == 1 ? "<b>".$locale['D014']."</b>" : "<a href='".FUSION_SELF."?cat_id=$cat_id&sort=1'>".$locale['D014']."</a>")."</span></td>\n";
echo "<td align='center' width='33%' class='".($sort == 3 ? "tbl1" : "tbl2")."'><span class='small'>\n";
echo ($sort == 3 ? "<b>".$locale['D015']."</b>" : "<a href='".FUSION_SELF."?cat_id=$cat_id&sort=3'>".$locale['D015']."</a>")."</span></td>\n";
echo "<td align='center' width='33%' class='".($sort == 2 ? "tbl1" : "tbl2")."'><span class='small'>\n";
echo ($sort == 2 ? "<b>".$locale['D016']."</b>" : "<a href='".FUSION_SELF."?cat_id=$cat_id&sort=2'>".$locale['D016']."</a>")."</span></td>\n";
echo "</tr></table><br>";
$rows = dbcount("(*)", "downloads", "download_cat='$cat_id'");
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if (!isset($sort) || !isNum($sort)) $sort = 1;
if ($sort == 1) $sorting = "download_title ASC";
if ($sort == 2) $sorting = "download_count DESC";
if ($sort == 3) $sorting = "download_datestamp DESC, download_title ASC";
if ($rows != 0) {
$result = dbquery("SELECT * FROM ".$db_prefix."downloads WHERE download_cat='$cat_id' ORDER BY $sorting LIMIT $rowstart,20");
$numrows = dbrows($result); $i = 1;
while ($data = dbarray($result)) {
if ($data['download_datestamp']+604800 > time()+($settings['timeoffset']*3600)) {
$new = " <span style='font-size:8px;'>".$locale['410']."</span>";
} else {
$new = "";
}
echo "<table border='0' width='95%' align='center' cellspacing='1' cellpadding='0' class='tbl-border'>
<tr>
<td class='forum-caption' colspan='4'>".$data['download_title']." $new</td>
</tr>";
if ($data['download_description']) {
echo "<tr>
<td class='tbl1' colspan='4' calign='top' style='padding:5px;'>";
echo "<small>".nl2br(stripinput($data['download_description']))."</small>";
echo "</td>
</tr>";
}
echo "<tr>
<td class='tbl2' colspan='2' align='center'><small>".showdate("%d.%m.%Y %H:%M:%S", $data['download_datestamp'])."</small></td>
<td class='tbl2' colspan='1' align='center'><small>".$locale['D017'].$data['download_count']."</small></td>
<td class='tbl2' colspan='1' align='center'><a href='".FUSION_SELF."?cat_id=$cat_id&info_id=".$data['download_id']."'><small>".$locale['D018']."</small></a></td>
</tr>
<tr>
<td class='tbl2' align='center' width='25%'><small>".$data['download_filesize']."</small></td>
<td class='tbl2' align='center' width='25%'><small>".$data['download_license']."</small></td>";
$wynik = dbquery("SELECT SUM(rating_vote) FROM ".$db_prefix."ratings WHERE rating_type='D' AND rating_item_id='".$data['download_id']."'");
$info = dbresult($wynik,0);
$num_rating = dbcount("(rating_vote)", "ratings", "rating_type='D' AND rating_item_id='".$data['download_id']."'");
$wyn_rating = ($num_rating ? $info / $num_rating : 0);
echo "<td class='tbl2' align='center' width='25%'><small>".$locale['D019']."<img src='".IMAGES."rate/".ceil($wyn_rating).".gif' alt='' style='vertical-align:middle;' title='".$locale['D019'].ceil($wyn_rating)."'></small></td>
<td class='tbl2' align='center' width='25%'><a href='".FUSION_SELF."?cat_id=$cat_id&info_id=".$data['download_id']."&act=comment'><small>".$locale['D020']."</small></a></td>
</tr>
</table>";
echo ($i != $numrows ? tablebreak() : "\n"); $i++;
}
tablebreak();
closetable();
if ($rows > 20) echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,20,$rows,3,FUSION_SELF."?cat_id=$cat_id&sort=$sort&")."\n</div>\n";
} else {
echo $locale['431']."\n";
closetable();
}
}
}
if ($res == 0) redirect(FUSION_SELF);
}
}
[color=red]}[/color]
require_once "side_right.php";
require_once "footer.php";
?>
Edytowane przez kefirek dnia 13.05.2008 17:51:16
|
|
|
|
Sony |
Dodany dnia 13.05.2008 22:50:02
|
Początkujący
Postów: 253 Pomógł: 19 Ostrzeżeń: 1
v7.02.06 Data rejestracji: 19.04.2008 16:21
|
Wielkie dzięki za pomoc kefirek.
Temat można zamknąć. |
|
|