Recent Photos

Forum rules
Support ended: 31.12.2011

Recent Photos

Postby Onny » Wed Jul 20, 2011 12:35 pm

Hello,

I do not know if this is the right section. If not, sorry.

I would like to know how on the index to put only recent photos without random photos and comments.

I tried many things without results ...

Thank you for your help,

Good day

Onny
Onny
Posts < 10
Posts < 10
 
Posts: 4
Topics: 1
Joined: Thu Jun 30, 2011 12:52 pm

Re: Recent Photos

Postby nickvergessen » Wed Jul 20, 2011 2:29 pm

You can change that in the ACP, or did you not mean the gallery/index
cheers nickvergessen :geek:

Member of phpBB Development-Team
No Support via PM
User avatar
nickvergessen
Administrator
Administrator
 
Posts: 5753
Topics: 218
Images: 139
Joined: Mon Oct 15, 2007 4:15 pm
phpBB.de: nickvergessen
phpBB.com: nickvergessen

Re: Recent Photos

Postby Onny » Thu Jul 21, 2011 10:23 am

Good morning.

I thought, but after days I have not found how ^ ^

Maybe I'm stupid or have I not seen, but if you could say exactly the corresponding part, because there I have no idea!

Thank you!

Good day.

Onny.
Onny
Posts < 10
Posts < 10
 
Posts: 4
Topics: 1
Joined: Thu Jun 30, 2011 12:52 pm

Re: Recent Photos

Postby Onny » Sat Aug 06, 2011 11:42 am

Up ?

My stupidity is becoming stronger, I still have not found! ^ ^
Onny
Posts < 10
Posts < 10
 
Posts: 4
Topics: 1
Joined: Thu Jun 30, 2011 12:52 pm

Re: Recent Photos

Postby nickvergessen » Sat Aug 06, 2011 2:09 pm

if you talk about the index.php of the forum, please have a look at the code you added in your index.php
cheers nickvergessen :geek:

Member of phpBB Development-Team
No Support via PM
User avatar
nickvergessen
Administrator
Administrator
 
Posts: 5753
Topics: 218
Images: 139
Joined: Mon Oct 15, 2007 4:15 pm
phpBB.de: nickvergessen
phpBB.com: nickvergessen

Re: Recent Photos

Postby Onny » Sun Aug 07, 2011 4:39 pm

index.php :

Code: Select all
include($phpbb_root_path . $gallery_root_path . 'includes/functions_recent.' . $phpEx);


So, in gallery/includes/functions_recent.php, I delete :

Code: Select all
      //if ($mode & RRC_MODE_RANDOM)
      {
         switch ($db->sql_layer)
         {
            case 'postgres':
               $random_sql = 'RANDOM()';
            break;
            case 'mssql':
            case 'mssql_odbc':
               $random_sql = 'NEWID()';
            break;
            default:
               $random_sql = 'RAND()';
            break;
         }

         $sql = 'SELECT image_id
            FROM ' . GALLERY_IMAGES_TABLE . "
            WHERE $sql_permission_where
            ORDER BY " . $random_sql;
         $result = $db->sql_query_limit($sql, $limit_sql);

         while ($row = $db->sql_fetchrow($result))
         {
            $images[] = $row['image_id'];
            $random_images[] = $row['image_id'];
         }
         $db->sql_freeresult($result);
      }
      if ($ints['contests'])
      {
         $sql_array = array(
            'SELECT'      => 'c.*, a.album_name',
            'FROM'         => array(GALLERY_CONTESTS_TABLE => 'c'),

            'LEFT_JOIN'      => array(
               array(
                  'FROM'      => array(GALLERY_ALBUMS_TABLE => 'a'),
                  'ON'      => 'a.album_id = c.contest_album_id',
               ),
            ),

            'WHERE'         => $db->sql_in_set('c.contest_album_id', array_unique(array_merge($view_albums, $moderate_albums))) . ' AND c.contest_marked = ' . IMAGE_NO_CONTEST,
            'ORDER_BY'      => 'c.contest_start + c.contest_end DESC',
         );
         $sql = $db->sql_build_query('SELECT', $sql_array);
         $result = $db->sql_query_limit($sql, $ints['contests']);

         while ($row = $db->sql_fetchrow($result))
         {
            $images[] = $row['contest_first'];
            $images[] = $row['contest_second'];
            $images[] = $row['contest_third'];
            $contest_images[$row['contest_id']] = array(
               'album_id'      => $row['contest_album_id'],
               'album_name'   => $row['album_name'],
               'images'      => array($row['contest_first'], $row['contest_second'], $row['contest_third'])
            );
         }
         $db->sql_freeresult($result);
      }


And it works!

Thanks !
Onny
Posts < 10
Posts < 10
 
Posts: 4
Topics: 1
Joined: Thu Jun 30, 2011 12:52 pm


Return to Supported Addons

Who is online

Users browsing this forum: No registered users and 0 guests