OrdaSoft forum
Welcome, Guest
Please Login or Register.    Lost Password?
categories in alphabetical order (0 viewing) 

BookLibary Component Support

Go to bottom Favoured: 0

Categories in alphabetical order

saco76 (Visitor)
Posts: 0
graphgraph
User Offline
categories in alphabetical order 10 Years, 10 Months ago
Karma: 0  
Hello,
I wanted to ask if you can order the categories in alphabetical order. From a to z. I I've tried from the admin panel but the categories remain in insertion order. Can you help me?
thanks
Logged Logged
The administrator has disabled public write access.
admin (Admin)
Admin
Posts: 8230
graph
User Offline Click here to see the profile of this user
Re:categories in alphabetical order 10 Years, 10 Months ago
Karma: 101  
Hello,

We special in admin panel have "Reorder" column for categories, in Book Library category manager, with it help you may order every category exactly as you wish.

If you agree kill that features and show categories ordered by title.

You need in file:
{yours site}/components/com_booklibrary/booklibrary.php

find function:
listCategories

and in it
Code:

    $query = "select c.id,c.parent_id, COUNT(bc.bookid) AS books, c.title, c.image, '1' AS display" .
        " FROM  #__booklibrary_main_categories as c
        LEFT JOIN #__booklibrary_categories AS bc ON c.id=bc.catid n
        LEFT JOIN #__booklibrary AS b ON b.id=bc.bookid AND b.published=1 AND b.approved=1
        WHERE  c.section='com_booklibrary'
          AND c.published=1 AND ({$s})
        GROUP BY c.id n
        ORDER BY parent_id DESC, c.ordering ";



replace to

Code:

    $query = "select c.id,c.parent_id, COUNT(bc.bookid) AS books, c.title, c.image, '1' AS display" .
        " FROM  #__booklibrary_main_categories as c
        LEFT JOIN #__booklibrary_categories AS bc ON c.id=bc.catid n
        LEFT JOIN #__booklibrary AS b ON b.id=bc.bookid AND b.published=1 AND b.approved=1
        WHERE  c.section='com_booklibrary'
          AND c.published=1 AND ({$s})
        GROUP BY c.id n
        ORDER BY parent_id DESC, c.title DESC";



Please backup that file firs

Thanks,
Andrew,
OrdaSoft team
Logged Logged
The administrator has disabled public write access.
saco76 (Visitor)
Posts: 0
graphgraph
User Offline
Re:categories in alphabetical order 10 Years, 9 Months ago
Karma: 0  
First of all, thanks for taking my call, sie was really very kind.
As soon as I replace my code that you have given me comes out this code, what should I do?
Thank you very much.



Warning: Invalid argument supplied for foreach() in C:Inetpubvhosts****************ebookcomponentscom_booklibrarybooklibrary.php on line 2007

Warning: Invalid argument supplied for foreach() in C:Inetpubvhosts**************httpdocsebookcomponentscom_booklibrarybooklibrary.php on line 2014
File Attachment:
File Name: booklibrary.zip
File Size: 29758
Logged Logged
The administrator has disabled public write access.
admin (Admin)
Admin
Posts: 8230
graph
User Offline Click here to see the profile of this user
Re:categories in alphabetical order 10 Years, 9 Months ago
Karma: 101  
Hello,

Look like forum soft, remove some letters from code what I sent. Please use code below:

Code:

    $query = "select c.id,c.parent_id, COUNT(bc.bookid) AS books, c.title, c.image, '1' AS display" .
        " FROM  #__booklibrary_main_categories as c
        LEFT JOIN #__booklibrary_categories AS bc ON c.id=bc.catid 
        LEFT JOIN #__booklibrary AS b ON b.id=bc.bookid AND b.published=1 AND b.approved=1
        WHERE  c.section='com_booklibrary'
          AND c.published=1 AND ({$s})
        GROUP BY c.id 
        ORDER BY parent_id DESC, c.title ";



Thanks,
Andrew,
OrdaSoft team
Logged Logged
The administrator has disabled public write access.
saco76 (Visitor)
Posts: 0
graphgraph
User Offline
Re:categories in alphabetical order 10 Years, 9 Months ago
Karma: 0  
Thank you very much, now it works fine. E 'was really kind to help me. I wanted to ask one more information if possible. Can i put 10 categories per page? Currently I have about 20 categories and the page is very long. Can I put them in 2 pages? Thanks again for everything.
Logged Logged
The administrator has disabled public write access.
admin (Admin)
Admin
Posts: 8230
graph
User Offline Click here to see the profile of this user
Re:categories in alphabetical order 10 Years, 9 Months ago
Karma: 101  
hello,

You may vote for us on joomla.org and write excellent review

Currently I have about 20 categories and the page is very long. Can I put them in 2 pages?
In BooklIbrary category manager - you see pagenator with 20 item per page, you may change it to 10

Thanks,
Andrew,
Ordasoft team
Logged Logged
The administrator has disabled public write access.
Go to top
»