Go Back   Pligg CMS Forum > Pligg Help > General Help

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-21-2007, 07:51 AM
clems365's Avatar
Casual Pligger
Pligg Version: 9.8.2
Pligg Template: CMS Theme
 
Join Date: May 2007
Location: santiago chile
Posts: 60
Thanks: 5
Thanked 9 Times in 6 Posts
How to limit search result

Hi all

My pligg site has more than 40.000 article (and 2.000 users per days), so in a search I can have more than 300 resultat ... This funcion take a lot of resource in my hosting, so I would like to limite the result (to the 50 newest result), I saw in html1.php in related story this line

HTML Code:
$sql.= " GROUP BY ".table_tags.".tag_link_id, ".table_links.".link_title, ".table_links.".link_title_url ORDER BY link_published_date DESC [b]LIMIT 10[/b]
I think it's possible to make the same in libs>search.php, but I don't no where.

If somebody can help me, many thanks

Clément
__________________
my pligg site: http://www.web2.cl
Reply With Quote
  #2 (permalink)  
Old 12-21-2007, 09:01 AM
Pligg Donor
 
Join Date: Sep 2007
Posts: 184
Thanks: 7
Thanked 37 Times in 26 Posts
Try this post.
Reply With Quote
The Following User Says Thank You to blaze For This Useful Post:
  #3 (permalink)  
Old 12-21-2007, 09:55 AM
clems365's Avatar
Casual Pligger
Pligg Version: 9.8.2
Pligg Template: CMS Theme
 
Join Date: May 2007
Location: santiago chile
Posts: 60
Thanks: 5
Thanked 9 Times in 6 Posts
Quote:
Originally Posted by blaze View Post
ty

I find a solution, not the best, because I use "time"
in search under:
Code:
	if ($this->url != '') {
			if($this->filterToStatus != ''){$from_where .= ' AND ';}
			$from_where .= " link_url='$this->url' ";
		}
I put:
Code:
	if ($this->filterToStatus == 'all') {
			$tsdt = date('Ym01000000', strtotime("now"));
			$fsdt = date('Ym'.date('t', strtotime("now")).'235959', strtotime("now"));
			$from_where .= " AND (link_published_date >= $tsdt AND link_published_date <= $fsdt) "; 
		}
So I have the result in a month, but it's not my idea, I prefer 100 result in all time, it will be better for me.

But I will try to see if it's better in my server.

If somebody has a better idea, many thanks

clement
__________________
my pligg site: http://www.web2.cl
Reply With Quote
  #4 (permalink)  
Old 02-26-2008, 04:15 AM
Pligg Donor
Pligg Version: 9.8.2
Pligg Template: custom
 
Join Date: Sep 2007
Location: King of Prussia, PA
Posts: 96
Thanks: 0
Thanked 9 Times in 7 Posts
I found a better way to do this.
In the html1.php page, you can limit how many pages of results are generated.
For example, I wanted to always limit the number of pages to generate on my index page for only 150 items at the most.

So in do_pages function, I added the following code after the global declaration:
Code:
	if ($thepage == 'published') {
	  $total = ($total > 150) ? 150 : $total;
	}
That ensured that I would only generate pages for 150 items at the most.
You can change that number by replacing the '150' in the code with any number.

Hope this helps.
Reply With Quote
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
Customizing search result page based on keywords cruz Customization Assistance 2 06-18-2008 05:44 AM
Search result for URL is a domain result tbones Bug Report 0 03-19-2008 08:28 AM
SEO (Search Engine Optimization) Yankidank Wiki Articles 23 12-02-2007 12:27 PM
Search result limit broken swissbob2 General Help 1 10-25-2007 10:35 PM


Search Engine Friendly URLs by vBSEO 3.2.0