It is currently Wed Aug 22, 2018 9:51 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Nov 06, 2013 8:09 pm 
Offline

Joined: Wed Nov 06, 2013 8:04 pm
Posts: 1
Hi and thanks for this great component,

I am trying to give the option to users to select number of images showing per page using dropdown menu.
I modified the function writePagination(). Here my code:

Code:
 function writePagination() {
        // Paggination Support
        $html = "";

   
         $number_per_page = $_REQUEST['npp'];
         $page = $_REQUEST['page'];
   
         
         if (isset($number_per_page)) {
         $limit = $number_per_page;
         }else{
         $limit = $this->paginImgTotal; // How many items to show per page by default if visitor hasn't used dropdown.
         }
   
   $html= "
            <form action='' method=POST >
            <input type=hidden name=page value=\"$page\">
            Items Per Page: <select name=\"npp\">
            <option selected>$limit</option>
            <option value=10>10</option>
            <option value=25>25</option>
            <option value=50>50</option>
            </select>
            <input type=submit value=\"Go\">
            </form>
            
      ";
        if ($this->params['paginUse']) {
            if ($this->params['paginUse']) {
                if (!empty($limit) && ceil($limit/ $this->params['paginImagesPerGallery']) > 1) {
                    $html.= '<div class="AG_pagin_wrap">';
                    $paginPrev = ($this->paginInitPages[$this->index] - 1);
                    if ($paginPrev >= 1) {
                        $html.= '<a href="" onClick="AG_form_submit_' . $this->articleID . '(' . $this->index . ',' . $paginPrev . ',\'' . $this->imagesFolderName . '\'); return false;" class="AG_pagin_prev">' . JText::_("PREV") . '</a>';
                    }
                    for ($i = 1; $i <= ceil($limit/ $this->params['paginImagesPerGallery']); $i++) {
                        if ($i == $this->paginInitPages[$this->index]) {
                            $html.= '<span class="AG_pagin_current">' . $i . '</span>';
                        } else {
                            $html.= '<a href="" onClick="AG_form_submit_' . $this->articleID . '(' . $this->index . ',' . $i . ',\'' . $this->imagesFolderName . '\',this);return false;" class="AG_pagin_link">' . $i . '</a>';
                        }
                    }
                    $paginNext = ($this->paginInitPages[$this->index] + 1);
                    if ($paginNext <= ceil($limit/ $this->params['paginImagesPerGallery'])) {
                        $html.= '<a href="" onClick="AG_form_submit_' . $this->articleID . '(' . $this->index . ',' . $paginNext . ',\'' . $this->imagesFolderName . '\'); return false;" class="AG_pagin_next">' . JText::_("NEXT") . '</a>';
                    }
                    $html.= '<br style="clear:both"></div>';
                }
            }
        }
        return $html;
    }



But no luck so far!

Thanks in advance!


Top
 Profile  
 
 Post subject: Pagination and number of images showing per picture (option)
PostPosted: Wed Nov 06, 2013 8:09 pm 
Top  
PostPosted: Mon Nov 11, 2013 2:30 pm 
Offline
Developer
Developer
User avatar

Joined: Sat Aug 14, 2010 9:31 pm
Posts: 1241
Location: Novi Sad, Serbia
Well that part is OK, but writePagination() is only responsible for displaying page buttons (Prev,1,2,3) under the gallery.
So changing this function is OK, but real modification are needed in loadImageFiles. Here the template actually provides images to the template.

If I find the time I will give you some more info, maybe some code example how to develop what you need.

But I would recommend you to try to make a new template and try to develop all the functionality inside the template.

_________________
Help Admiror Gallery become even better,
give us a review on JED


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

 


All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

This is the official Admiror Joomla! Community Forum. You are welcome to join the Admiror Joomla! Community. All Admiror Joomla! Extensions Users, Joomla! Developers, PHP or mySQL Developers are welcome to support & contribute to Admiror Joomla! Projects.

Joomla! is a free and open source content management system (CMS) for publishing content on the World Wide Web and intranets. With a vibrant volunteer community, user-friendly features and plenty of power, Joomla is perfect for your website!

Joomla! is written in PHP, uses object-oriented programming (OOP) techniques and software patterns, stores data in a MySQL database, and includes features such as page caching, RSS feeds, printable versions of pages, news flashes, blogs, polls, search, and support for language internationalization.

Joomla! is the property of Open Source Matters, Inc. All rights reserved. Read more about Joomla! at http://www.joomla.org/.


Protected by Anti-Spam ACP Powered by phpBB® Forum Software © phpBB Group