Default number of entries shown

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
alinford
Posts: 7
Joined: Sat May 17, 2003 11:30 pm
Location: Sandy

Default number of entries shown

Post by alinford »

How can I change the default number of entries that are shown per page? I believe that the current default is 10.
Austin Linford
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

just look into the inc/functions.php and search for the function printThemes($category). Then chnage the following 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 this

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
alinford
Posts: 7
Joined: Sat May 17, 2003 11:30 pm
Location: Sandy

Thanks!

Post by alinford »

Wow, not only is this a great product, but this support forum is fantastic.
Austin Linford
alinford
Posts: 7
Joined: Sat May 17, 2003 11:30 pm
Location: Sandy

Worked, but...

Post by alinford »

This change put all of the entries on a single page, but it shows that there are multiple pages. If I go to the second page, it shows all of the entries just like the first page. It only shows the multiple pages once I get over 10 entries.
Austin Linford
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

I'll post you the code changes tomorrow!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi Austin,

just remove this part

Code: Select all

    if ($seiten > 1) {
        $output .= "<p align=\"center\"><b>";
        $previous = $seite - 1; 
        $next = $seite + 1;
        if ($previous != 0) {
            $output .= "[ <a href=\"".$_SERVER["PHP_SELF"]."?".$sids."aktion=anzeigen&rubrik=".$category."&seite=".$previous."\">".$msgPrevious."</a> ]";
            }
        $output .= " ";
        if ($next <= $seiten) {
            $output .= "[ <a href=\"".$_SERVER["PHP_SELF"]."?".$sids."aktion=anzeigen&rubrik=".$category."&seite=".$next."\">".$msgNext."</a> ]";
            }
        $output .= "</b></p>";
		}
in the function printThemes().

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply