Announcement

#16 2011-09-15 20:41:44

flop25
Piwigo Team
2006-07-06
7037

Re: How to skip albums, going straight to pics

ho! your galery is really great !

with your way of coding, inside an album are not accessible
but nicksclick was asking for just skipping that page not forbidding it
So my strategy was to change the link on the main page/in "album block"

Now I've just understood that you don't want to get the representative picture but just the first one
So your method is good, but you have some album private : http://www.geertvandeneede.com/index.php?/categories
only 2 are displayed
now knowing more precisely what you want I will give you a better way without mysql request


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#17 2011-09-15 21:04:13

flop25
Piwigo Team
2006-07-06
7037

Re: How to skip albums, going straight to pics

Code:

add_event_handler('loc_end_index_thumbnails', 'skip_cat');
function skip_cat($tpl_thumbnails_var)
{
  global $page;
  if (isset($page['category']))
  {
        redirect($tpl_thumbnails_var[0]['URL']);
  }
}

it's simpler no ? ^^
let me explain :
-it uses the event when the display of thumbnails is called
-then it checks if it's a album page
-then it redirects to the first pictures, using the link in the the first thumbnails
see http://piwigo.org/doc/doku.php?id=dev:plugin_tutorial1 for spme help


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#18 2011-09-15 22:06:31

blowdoof
Member
1970-01-01
4

Re: How to skip albums, going straight to pics

Wow! that's a lot easier indeed, one hell of a great solution you gave me here. Feel kind of stupid now, but i guess that's part of the learning process.
Feel like i discovered a very powerfull framework with piwigo, keeps astonishing me over and over !
Must say your support is great too. What else should someone wish for? Excellent, thanx again !

Offline

 

#19 2011-09-15 22:08:56

flop25
Piwigo Team
2006-07-06
7037

Re: How to skip albums, going straight to pics

owa ^^ thx ! you're too kind
enjoy


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact