obey-robots.txt
  

pHpFusion-Nederlands


 Nederlands-, Vlaamstalige pHp-Fusion support site voor België en Nederland.


 PHP-Fusion is een open-source "Content Magagement System" (CMS) geschreven in PHP en MySQL.
 Het beheren van uw site gaat met een eenvoudig en begrijpbaar administratie systeem.
 PHP-Fusion bevat o.a. een forum, shoutbox, enquêtes, profielpagina's, nieuws, fotogalerij, weblinks enz.
 Uiteraard is de standaardinstallatie nog uit te breiden met infusies (modules) en andere thema's (skins).

Inloggen
Geef gebruikersnaam

Wachtwoord



Nog geen lid?

» Registreer «
Als geregistreerd lid kunt u reageren en alle extra functies gebruiken.

Wachtwoord vergeten?
Verzoek nieuw wachtwoord.
Gebruikers Online
» Gasten online: 5

» Leden online: 0
» Nieuwste lid: BlackHawk
Recent Online
» muscapaul01:43:55
Onderwerp bekijken
Vragen/Problemen in verband met mods
 Onderwerp afdrukken
Downloads sorteren in standaard downloads.php
Thijs
Ik zou graag in de standaard downloads.php een knop hebben waarmee de downloads op naam, datum en hits te sorteren zijn. Ik heb hier een begin in gemaakt maar ben vast gelopen. Ik heb op www.phpfusion-mods.com hulp gevraagd en op phpfusion-mods.net, hier ben ik alleen niets mee op geschoten doordat er gewoon niemand reageert. Ik hoop dat ik hier wel geholpen wordt.

De code is als volgt:




/*-------------------------------------------------------+

| PHP-Fusion Content Management System

| Copyright (C) 2002 - 2008 Nick Jones

| http://www.php-fusion.co.uk/

+--------------------------------------------------------+

| Filename: downloads.php

| Author: Nick Jones (Digitanium)

+--------------------------------------------------------+

| This program is released as free software under the

| Affero GPL license. You can redistribute it and/or

| modify it under the terms of this license which you

| can read by viewing the included agpl.txt or online

| at www.gnu.org/licenses/agpl.html. Removal of this

| copyright header is strictly prohibited without

| written permission from the original author(s).

+--------------------------------------------------------*/

require_once "maincore.php";

require_once THEMES."templates/header.php";

include LOCALE.LOCALESET."downloads.php";



add_to_title($locale['global_200'].$locale['400']);



$type_id= $_GET['type_id'];

$cat_id= $_GET['cat_id'];



if (isset($_GET['download_id']) && isnum($_GET['download_id'])) {

        $res = 0;

        if ($data = dbarray(dbquery("SELECT download_url,download_cat FROM ".DB_DOWNLOADS." WHERE download_id='".$_GET['download_id']."'"))) {

                $cdata = dbarray(dbquery("SELECT * FROM ".DB_DOWNLOAD_CATS." WHERE download_cat_id='".$data['download_cat']."'"));

                if (checkgroup($cdata['download_cat_access'])) {

                        $res = 1;

                        $result = dbquery("UPDATE ".DB_DOWNLOADS." SET download_count=download_count+1 WHERE download_id='".$_GET['download_id']."'");

                        redirect($data['download_url']);

                }

        }

        if ($res == 0) { redirect("downloads.php"); }

}



if (!isset($_GET['cat_id']) || !isnum($_GET['cat_id'])) {

        opentable($locale['400']);

        $result = dbquery("SELECT * FROM ".DB_DOWNLOAD_CATS." WHERE ".groupaccess('download_cat_access')." ORDER BY download_cat_name");

        $rows = dbrows($result);

        if ($rows) {

                $counter = 0; $columns = 2;

                echo "".$locale['401']."
".$locale['402']."
\n\n";

                echo "
\n\n";

                while ($data = dbarray($result)) {

                        if ($counter != 0 && ($counter % $columns == 0)) { echo "\n\n"; }

                        $num = dbcount("(download_cat)", DB_DOWNLOADS, "download_cat='".$data['download_cat_id']."'");

                        echo "\n" ;

                        $counter++;

                }

                echo "\n
RSS ''
".$data['download_cat_name']." ($num)";

                        if ($data['download_cat_description'] != "") { echo "
\n".$data['download_cat_description'].""; }

                        echo "
\n";

        } else {

                echo "

\n".$locale['430']."

\n
\n";

        }

        closetable();

} else {

        $res = 0;

        $result = dbquery("SELECT * FROM ".DB_DOWNLOAD_CATS." WHERE download_cat_id='".$_GET['cat_id']."'");

        if (dbrows($result) != 0) {

                $cdata = dbarray($result);

                if (checkgroup($cdata['download_cat_access'])) {

                        $res = 1;

                        add_to_title($locale['global_201'].$cdata['download_cat_name']);



                echo "\n";

                echo "\n";

                echo "\n";

                echo "
\n";

                echo "  \n";

                echo " Popularity  \n";

                echo " Date  \n";

                echo " Name\n";

            echo "
\n";

                if ($cat_id > 0) { $where = " WHERE download_cat='".$cat_id."'";} else { $where = "";}

                if ($type_id == 2) { $order = " download_count DESC";}

                elseif ($type_id == 3) { $order = " download_datestamp DESC";}

                else { $order = " download_title ASC";}

               

                        opentable($locale['400'].": ".$cdata['download_cat_name']);

                        echo"
''
";

                        $rows = dbcount("(*)", DB_DOWNLOADS, "download_cat='".$_GET['cat_id']."'");

                        if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }

                        if ($rows != 0) {



                                if ($cat_id > 0) { $where2 = " AND download_cat ='".$cat_id."'";} else { $where2 = "";}

                                $myquery =" SELECT tu.*, tn.*, download_cat_id, download_cat_name FROM ".$db_prefix."download_cats tn

                                        LEFT JOIN ".$db_prefix."downloads tu ON tn.download_cat_id=tu.download_cat

                                        WHERE download_id!=''".$where2." ORDER BY download_title ASC,".$order." LIMIT ".$_GET['rowstart'].",15";

                                $result = dbquery($myquery);




                                //$result = dbquery("SELECT * FROM ".DB_DOWNLOADS." WHERE download_cat='".$_GET['cat_id']."' ORDER BY ".$order." LIMIT ".$_GET['rowstart'].",15");

                                $numrows = dbrows($result); $i = 1;

                                while ($data = dbarray($result)) {

                                        if ($data['download_datestamp'] + 604800 > time() + ($settings['timeoffset'] * 3600)) {

                                                $new = " ".$locale['410']."";

                                        } else {

                                                $new = "";

                                        }

                                        echo "\n";

                                        echo "\n\n\n";

                                        if ($data['download_description']) { echo "\n\n\n"; }

                                        echo "\n\n\n";

                                        echo "\n\n\n\n";

                                        echo "\n\n\n";

                                        echo "
".$data['download_title']." $new
".nl2br(stripslashes($data['download_description']))."
".$locale['411']." ".$data['download_license']."".$locale['412']." ".$data['download_os']." ".$locale['413']." ".$data['download_version']."
".$locale['414']." ".showdate("shortdate", $data['download_datestamp'])." ".$locale['415']." ".$data['download_count']."";



if (iMEMBER){

echo "".$locale['416']." (".$data['download_filesize'].")";



}else{



echo "".$locale['417']."";



}







echo"
\n";

                                        if ($i != $numrows) { echo "
''
\n"; $i++; }

                                }

echo"
''
";

                                closetable();

                                if ($rows > 15) { echo "
\n".makepagenav($_GET['rowstart'], 15, $rows, 3, FUSION_SELF."?cat_id=".$_GET['cat_id']."&")."\n
\n"; }

                        } else {

                                echo $locale['431']."\n";

                                closetable();

                        }

                }

        }

        if ($res == 0) { redirect(FUSION_SELF); }

}



require_once THEMES."templates/footer.php";

?>


De code in rood gekleurd is wat toegevoegd of aangepast is. Kan iemand hier de fout uit halen of mij vertellen hoe het moet??
 
Thijs
Als bijlage zit nog even een screenshot van hoe het eruit ziet. Om het plaatje af te maken Wink
Thijs voegde bij, afbeelding: (Klik het plaatje voor vergroting!)
downloadssectie.jpg
 
Thijs
heb het zelf al voor elkaar gekregen.. lukte in het begin van geen kant maar ben maar gewoon doorgegaan met van alles en nog wat proberen en zo ben ik toch verder gekomen. Duurde wel erg lang, beetje support van jullie was fijn geweest.
Gewijzigd door Thijs op 01 juli 2009, 16:57
 
Spring naar forum:
Nieuw onderwerp Antwoorden
Gebruik BBcode of HTML om naar; 'Downloads sorteren in standaard downloads.php', te verwijzen!
BBcode:
HTML:
Vergelijkbare onderwerpen
Onderwerp Forum         Laatste bericht
Nieuwe vraag: standaard url in balk ? Algemene v7 support : 3 12 jul 2011, 20:47
[Opgelost] downloads enkel voor leden? Algemene v7 support : 4 21 mrt 2011, 22:10
[Opgelost] Aantal Downloads weergeven in Panel? Algemene v7 support : 2 08 mrt 2011, 13:24
[Opgelost] Resetten Downloads Teller? Algemene v7 support : 8 07 mrt 2011, 12:34
downloads Modificaties : 3 24 apr 2010, 16:45