The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
||||
|
||||
![]()
Aha, thanks orban. What I want to do is this:
If an user wants to search for all threads/posts related to a specific user, he enters a username then leaves the search field empty. The results will show all threads started by that user, ordered the way you like it in Sphinx. Anyone wants to work with me on this project? I PM'ed kmike, hoping he will join us... since he is the only one who managed to fix this, not to mention other little extras. ![]() Quote:
Code:
/*** * Removes duplicate keys and orders thread id's by lastpost * * @param array record id's to be ordered * * @return array */ function sort_thread_ids($keys) { global $vbulletin; $itemids = array(); $items = $vbulletin->db->query_read_slave(" SELECT threadid FROM " . TABLE_PREFIX . "thread AS thread WHERE threadid IN (" . implode(',', array_keys($keys)) . ") ORDER BY lastpost " . $vbulletin->GPC['sortorder'] . " "); while ($item = $vbulletin->db->fetch_array($items)) { $itemids[] = $item['threadid']; } unset($item); $vbulletin->db->free_result($items); return $itemids; } Code:
if (!$vbulletin->GPC['showposts'] AND $vbulletin->GPC['sortby'] == 'lastpost') { $orderedids = sort_thread_ids($orderedids); } The function above has less processing code then the original sort_search_items() function. The PHP BBCode at vb.org is screwed, it breaks the code lines. Switched back to Code, much better. |
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|