• » webSPELL.org - Free Content Management System
  • Language switch: English German
  • login



    » lost password?   » register now
  • About webSPELL

    webSPELL is a free Content Management System which was especially developed for the needs of esport related communities. Since a short while we are also offering an optimized and enhanced webSPELL version for the special requirements of non-profit organisations. The purpose of both systems is to offer a professional and free opportunity to create and administrate your own website in an easy and optimized way.

    » Learn more about webSPELL     » Download webSPELL now!
  • Advertisement

    Follow us

  • Sort:     printview
    Author
    Message
    webSPELL newbie
    96 Posts
    21.08.2012, 11:33 email offline quote 


    displays all albums, how to display the last five?

    Code:
    1.
    2.
    3.
    4.
    5.
    6.
    7.
    8.
    9.
    10.
    11.
    12.
    13.
    14.
    15.
    16.
    17.
    18.
    19.
    20.
    21.
    22.
    23.
    24.
    25.
    26.
    27.
    28.
    29.
    30.
    31.
    32.
    33.
    34.
    35.
    36.
    37.
    38.
    39.
    40.
    41.
    42.
    43.
    44.
    45.
    46.
    47.
    <?php
         $galclass = new Gallery;
         $_language->read_module('gallery');

         $ergebnis = safe_query("SELECT * FROM ".PREFIX."gallery_groups");

         while($ds = mysql_fetch_array($ergebnis)) {
              $title = $ds['name'];
              $gallerys = mysql_num_rows(safe_query("SELECT galleryID FROM ".PREFIX."gallery WHERE groupID='".$ds['groupID']."'"));
              $pics = mysql_num_rows(safe_query("SELECT picID FROM ".PREFIX."gallery as gal, ".PREFIX."gallery_pictures as pic WHERE gal.groupID='".$ds['groupID']."' AND gal.galleryID=pic.galleryID"));

        $gallery = mysql_fetch_array(safe_query("SELECT * FROM ".PREFIX."gallery WHERE groupID='".$ds['groupID']."' ORDER BY galleryID DESC LIMIT 0,5"));

              
              
              $gallery['picID'] = $galclass->randompic($gallery['galleryID']);
              
              //Bilder ausgabe thumb
              $dir='images/gallery/';
              $gallery['pic'] = $dir.'large/'.$gallery['picID'].'.jpg';
              //Bilder ausgabe thumb ende
              
                   //most hits
         $ds = mysql_fetch_array(safe_query("SELECT picID FROM ".PREFIX."gallery_pictures ORDER BY views DESC LIMIT 0,1"));
         if(!$ds[picID]) $ds[picID] = $galclass->randompic();
         $most_hits = $galclass->showthumb($ds[picID]);
         
              //views ausgabe     geht leider nur von einem pic,
              $views = safe_query("SELECT * FROM ".PREFIX."gallery_pictures WHERE galleryID='".$gallery['galleryID']."'");           
              if(mysql_num_rows($views)) {
              $view = array();
                   while($ds = mysql_fetch_array($views)) {
                        $view[] = $ds['views'];                    
                   }               
               $views = array_sum($view);           
              }     
              //views ausgabe     ende

              eval ("\$sc_gallery = \"".gettemplate("sc_gallery")."\";");
              echo $sc_gallery;


         $_language->read_module('gallery');


         }
    ?>

    webSPELL newbie
    96 Posts
    21.08.2012, 14:50 email offline quote 

    up
    webSPELL newbie
    51 Posts
    22.08.2012, 14:20 email offline quote 

    Code:
    1.
    $ergebnis = safe_query("SELECT * FROM ".PREFIX."gallery_groups DESC LIMIT 0.5");
    Sort:     printview


    To start or to reply to a topic you have to be registered and logged in!

    register now
    login
  • » Support

    » Topics
    20.06.2013 - 01:59 - 0 Replies
    » [4SALE] EXCLUSIVE WEBSITE
    [4SALE] EXCLUSIVE WEBSITE
    Last post: hornyst
    Board: EN - Offers
    20.06.2013 - 01:59
    20.06.2013 - 01:58 - 5 Replies
    » PHP Code wird als Text au...
    PHP Code wird als Text ausgegeben
    Last post: janfolio
    Board: DE - Allgemeiner Support
    20.06.2013 - 01:58
    19.06.2013 - 19:22 - 5 Replies
    » Bewertungs-CMS gesucht!
    Bewertungs-CMS gesucht!
    Last post: Schalla
    Board: DE - Suche
    19.06.2013 - 19:22
    19.06.2013 - 02:59 - 10 Replies
    » [SELL] Gaming Website - E...
    [SELL] Gaming Website - EXCLUSIVE WEBSITE
    Last post: hornyst
    Board: EN - Offers
    19.06.2013 - 02:59
    18.06.2013 - 23:10 - 1 Replies
    » [S] Aufträge Web- und Pri...
    [S] Aufträge Web- und Printdesign
    Last post: neiD-
    Board: DE - Suche
    18.06.2013 - 23:10
    18.06.2013 - 12:30 - 9 Replies
    » Querry Failed Error no 10...
    Querry Failed Error no 1054
    Last post: LoRd
    Board: EN - Technical support
    18.06.2013 - 12:30
    18.06.2013 - 09:43 - 13 Replies
    » webSPELL Bootstrap (respo...
    webSPELL Bootstrap (responsible)
    Last post: sKy-e.belst
    Board: EN - General
    18.06.2013 - 09:43
    18.06.2013 - 01:11 - 1 Replies
    » how can i transform back ...
    how can i transform back to old my website ?
    Last post: Schalla
    Board: EN - Technical support
    18.06.2013 - 01:11
    17.06.2013 - 20:50 - 3 Replies
    » Suche Coder !
    Suche Coder !
    Last post: naki
    Board: DE - Suche
    17.06.2013 - 20:50
    17.06.2013 - 12:48 - 0 Replies
    » [4SALE] Custom team websi...
    [4SALE] Custom team website
    Last post: element-
    Board: EN - Offers
    17.06.2013 - 12:48
    16.06.2013 - 21:21 - 3 Replies
    » update webspell problem
    update webspell problem
    Last post: RUSSHEL
    Board: EN - General support
    16.06.2013 - 21:21
    16.06.2013 - 20:42 - 0 Replies
    » "Make sure you have cooki...
    "Make sure you have cookies enabled" During Login
    Last post: Sasquatch
    Board: EN - General support
    16.06.2013 - 20:42
    16.06.2013 - 16:22 - 8 Replies
    » Farbe von "Dein Profil wu...
    Farbe von "Dein Profil wurde aktualisiert. Du wirst weitergeleitet" ändern!
    Last post: Cali-go
    Board: DE - Allgemeiner Support
    16.06.2013 - 16:22
    16.06.2013 - 16:19 - 2 Replies
    » Sehr erfahrener Programmi...
    Sehr erfahrener Programmierer gesucht (Community,Clanpage)
    Last post: StufF
    Board: DE - Suche
    16.06.2013 - 16:19
    15.06.2013 - 22:39 - 0 Replies
    » portfolio/agency for sale
    portfolio/agency for sale
    Last post: Thoomii
    Board: DE - Biete
    15.06.2013 - 22:39
    15.06.2013 - 16:39 - 2 Replies
    » [4SALE] eSport Design/Tem...
    [4SALE] eSport Design/Template
    Last post: LeG3nDz
    Board: EN - Offers
    15.06.2013 - 16:39
    15.06.2013 - 10:35 - 12 Replies
    » externe Festplatte spinnt
    externe Festplatte spinnt
    Last post: plenergy
    Board: DE - Internet
    15.06.2013 - 10:35
    14.06.2013 - 20:53 - 11 Replies
    » Webspell ver 1070 EN
    Webspell ver 1070 EN
    Last post: TyRRRax
    Board: EN - General support
    14.06.2013 - 20:53
    14.06.2013 - 19:03 - 4 Replies
    » Kostenlose Clanmappen!
    Kostenlose Clanmappen!
    Last post: unikat
    Board: DE - Biete
    14.06.2013 - 19:03
    14.06.2013 - 15:22 - 6 Replies
    » Userpic & Avatar
    Userpic & Avatar
    Last post: Tuxx
    Board: DE - Technischer Support
    14.06.2013 - 15:22
    » Partners
    Bilderkiste.org Image Hosting
    k3rmit.org
    PascalMh.de


    » Blog
    28.03.2013 - derchris
    » Those damn spammers