Help with output in catagories

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
Guest

Help with output in catagories

Post by Guest »

I would like like to display all entries in each catagory every time it is viewed. 10 at a time does not work for what I want to do. How can I do this? I looked at the code and cannot figure out where exactly those pages are being generated, probably because I cannot read German.
Thorsten
Posts: 15562
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Help with output in catagories

Post by Thorsten »

Hi,
Anonymous wrote:I would like like to display all entries in each catagory every time it is viewed. 10 at a time does not work for what I want to do. How can I do this? I looked at the code and cannot figure out where exactly those pages are being generated, probably because I cannot read German.
just look for the Function printThemes($category) in functions.php. Just change the this line

Code: Select all

$result = $db->query("SELECT DISTINCT ".$sqltblpre."faqdata.id, ".$sqltblpre."faqdata.lang, ".$sqltblpre."faqdata.thema, ".$sqltblpre."faqdata.rubrik, ".$sqltblpre."faqvisits.visits FROM ".$sqltblpre."faqdata LEFT JOIN ".$sqltblpre."faqvisits ON ".$sqltblpre."faqdata.id = ".$sqltblpre."faqvisits.id WHERE ".$sqltblpre."faqdata.active = 'yes' AND ".$sqltblpre."faqdata.rubrik = '".$category."' GROUP BY ".$sqltblpre."faqdata.id ORDER BY ".$sqltblpre."faqdata.id LIMIT ".$first.",".$last);
to

Code: Select all

$result = $db->query("SELECT DISTINCT ".$sqltblpre."faqdata.id, ".$sqltblpre."faqdata.lang, ".$sqltblpre."faqdata.thema, ".$sqltblpre."faqdata.rubrik, ".$sqltblpre."faqvisits.visits FROM ".$sqltblpre."faqdata LEFT JOIN ".$sqltblpre."faqvisits ON ".$sqltblpre."faqdata.id = ".$sqltblpre."faqvisits.id WHERE ".$sqltblpre."faqdata.active = 'yes' AND ".$sqltblpre."faqdata.rubrik = '".$category."' GROUP BY ".$sqltblpre."faqdata.id ORDER BY ".$sqltblpre."faqdata.id");
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Guest

Re: Help with output in catagories

Post by Guest »

Thanks!! That worked great. One more question, how can I sort those results alphabetically?
Guest

Re: Help with output in catagories

Post by Guest »

Anonymous wrote:Thanks!! That worked great. One more question, how can I sort those results alphabetically?
Nevermind that, they are sorting properly now. Thanks again! You have a very nice application here, much better than some that cost $100s of dollars!

Thanks!
Guest

Re: Help with output in catagories

Post by Guest »

Ok it's not sorting alphabetically now that I have more data in the database. Can that be done globally?
Thorsten
Posts: 15562
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Help with output in catagories

Post by Thorsten »

Anonymous wrote:Ok it's not sorting alphabetically now that I have more data in the database. Can that be done globally?
Sure! :)

Code: Select all

$result = $db->query("SELECT DISTINCT ".$sqltblpre."faqdata.id, ".$sqltblpre."faqdata.lang, ".$sqltblpre."faqdata.thema, ".$sqltblpre."faqdata.rubrik, ".$sqltblpre."faqvisits.visits FROM ".$sqltblpre."faqdata LEFT JOIN ".$sqltblpre."faqvisits ON ".$sqltblpre."faqdata.id = ".$sqltblpre."faqvisits.id WHERE ".$sqltblpre."faqdata.active = 'yes' AND ".$sqltblpre."faqdata.rubrik = '".$category."' GROUP BY ".$sqltblpre."faqdata.id ORDER BY ".$sqltblpre."faqdata.id ORDER BY ".$sqltblpre."faqdata.thema");
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Guest

Re: Help with output in catagories

Post by Guest »

Thanks again! I will recommend you!
Post Reply