• Welcome to PHPVIBE Forums. Please log in.

[ Video Sharing CMS v4 ] Display search results by uploaded date

Started by x5000x,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

x5000xTopic starter

Is there a way to display search results by upload date? Recent upload first?
  •  

PHPVibe A.

You need to edit the order by in the query at com/com_search.php
right now it's

ORDER BY CASE WHEN ".DB_PREFIX."videos.title like '" .$key. "%' THEN 0
	           WHEN ".DB_PREFIX."videos.title like '%" .$key. "%' THEN 1
	           WHEN ".DB_PREFIX."videos.tags like '" .$key. "%' THEN 2
               WHEN ".DB_PREFIX."videos.tags like '%" .$key. "%' THEN 3		   
               WHEN ".DB_PREFIX."videos.description like '%" .$key. "%' THEN 4
			   WHEN ".DB_PREFIX."videos.tags like '%" .$key. "%' THEN 5
               ELSE 6

x5000xTopic starter

Alex, Tried but no luck  ;D

Could you please post final code how it is supposed to look  ;D
  •  

PHPVibe A.

You can replace all that with:

ORDER BY ".DB_PREFIX."videos.id desc


or

ORDER BY ".DB_PREFIX."videos.date desc


Same effect. But the results are pretty bad as match in this case.

x5000xTopic starter

This option:
ORDER BY ".DB_PREFIX."videos.id desc

gives me error:
Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END, title LIMIT 0,50' at line 4 in /home/xxxxx/public_html/lib/class.ezsql.php on line 249



This option:
ORDER BY ".DB_PREFIX."videos.date desc

Gives me same error.
  •  

PHPVibe A.


x5000xTopic starter

  •  

Similar topics (7)