how to control the list number ......

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
yaatop
Posts: 7
Joined: Wed Dec 30, 2009 2:15 pm

how to control the list number ......

Post by yaatop »

I'm a new user of phpmyfaq,i really like it. But i have a problem:

all of the numbers of "Records in this category" ,"Tags" ,"Sticky FAQs" are listed on artikel page. this makes the page much too long. How can i control the list number.

sorry for my poor english
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: how to control the list number ......

Post by Thorsten »

Hi,

do you mean the number of entries?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
yaatop
Posts: 7
Joined: Wed Dec 30, 2009 2:15 pm

Re: how to control the list number ......

Post by yaatop »

I mean do not to display all records in "Records in this category"
yaatop
Posts: 7
Joined: Wed Dec 30, 2009 2:15 pm

Re: how to control the list number ......

Post by yaatop »

May be here

function showAllRecordsWoPaging($category) {

global $sids, $PMF_CONF, $tree;

$now = date('YmdHis');
$query = '
SELECT
fd.id AS id,
fd.lang AS lang,
fd.thema AS thema,
fcr.category_id AS category_id,
fv.visits AS visits
FROM
'.SQLPREFIX.'faqdata fd
LEFT JOIN
'.SQLPREFIX.'faqcategoryrelations fcr
ON
fd.id = fcr.record_id
AND
fd.lang = fcr.record_lang
LEFT JOIN
'.SQLPREFIX.'faqvisits fv
ON
fd.id = fv.id
AND
fv.lang = fd.lang
LEFT JOIN
'.SQLPREFIX.'faqdata_group fdg
ON
fd.id = fdg.record_id
LEFT JOIN
'.SQLPREFIX.'faqdata_user fdu
ON
fd.id = fdu.record_id
WHERE
fd.date_start <= \''.$now.'\'
AND
fd.date_end >= \''.$now.'\'
AND
fd.active = \'yes\'
AND
fcr.category_id = '.$category.'
AND
fd.lang = \''.$this->language.'\'
ORDER BY
fd.id';

$result = $this->db->query($query);

$output = '<ul class="phpmyfaq_ul">';

while (($row = $this->db->fetch_object($result))) {
$title = $row->thema;
$url = sprintf('%saction=artikel&cat=%d&id=%d&artlang=%s',
$sids,
$row->category_id,
$row->id,
$row->lang);
$oLink = new PMF_Link(PMF_Link::getSystemRelativeUri().'?'.$url);
$oLink->itemTitle = $row->thema;
$oLink->text = $title;
$oLink->tooltip = $title;

$listItem = sprintf('<li>%s</li>', $oLink->toHtmlAnchor(), $this->pmf_lang['msgViews']);
$listItem = '<li>'.$oLink->toHtmlAnchor().'</li>';

$output .= $listItem;
}
$output .= '</ul>';

return $output;
}

how can i add a Parameter to control how many records list. For example i only want it to display 10 records.
yaatop
Posts: 7
Joined: Wed Dec 30, 2009 2:15 pm

Re: how to control the list number ......

Post by yaatop »

问题已经解决了,感谢你们提供那么好的程序.:)

I've solved the problem.Thank you for providing such good program
Post Reply