Kokosadun hat geschrieben:
Das war aber alles ein bisschen kompliziert und ich weiss den Ablauf nicht mehr genau, weil er nirgends dokumentiert ist. Wenn ich dazu komme, mach ich es.
Naja gut, was heisst nicht dokumentiert.
Ich hatte dazu sogar einen eigenen Mod geschrieben.
So sieht das aus hier:
Code:
##############################################################
## MOD Title: Search24h for CH 2.1.6
## MOD Author: 'kokos'adun () with help from mgutt (Marc Gutt) www.phpbb-de.com
## MOD Description: This mod adds a function to search for all posts of the last 24 hours.
##
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: 3 Minutes
##
## Files To Edit: 4
## includes/class_search.php
## search.php
## templates/ptifo/overall_header.tpl
## templates/subSilver/overall_header.tpl
##
## Included Files:
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## Author Notes:
## - Please watch the DIY - section at the end of the mod!
##
##############################################################
## MOD History:
##
## 2008-01-02 - Version 1.0.0
## - first release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
includes/class_search.php
#
#-----[ FIND ]------------------------------------------
#
class topics_search_authors extends topics_search
#
#-----[ BEFORE, ADD ]------------------------------------------
#
class topics_search_today extends topics_search
{
function read()
{
global $db, $user;
$this->forum_id = 0;
$this->total_topics = 0;
$this->data_ext = array();
// get topics without replies
$sql = 'SELECT t.*
FROM ' . TOPICS_TABLE . ' t
WHERE t.topic_moved_id = 0
AND t.topic_id IN(' . $db->sql_subquery('topic_id', '
SELECT DISTINCT topic_id
FROM ' . POSTS_TABLE . '
WHERE forum_id IN(' . implode(', ', $this->authed_forums(intval($this->parms['search_forum']), intval($this->parms['no_subs']))) . ')
AND post_time >= ' . (time() - 86400) .'
', __LINE__, __FILE__) . ')
ORDER BY t.topic_last_post_id DESC';
$result = $db->sql_query($sql, false, __LINE__, __FILE__);
// read results
if ( ($this->total_topics = $db->sql_numrows($result)) && ($this->total_topics > intval($this->parms['start'])) )
{
$db->sql_rowseek(intval($this->parms['start']), $result);
$this->do_read($result, intval($this->parms['ppage']));
}
$db->sql_freeresult($result);
$this->total_items = $this->total_topics;
}
}
#
#-----[ FIND ]------------------------------------------
#
$this->mode = _read('search_id', TYPE_NO_HTML, '', array_flip(array('', 'newposts', 'egosearch', 'unanswered')));
#
#-----[ REPLACE WITH ]------------------------------------------
#
$this->mode = _read('search_id', TYPE_NO_HTML, '', array_flip(array('', 'newposts', 'egosearch', 'unanswered', 'today')));
#
#-----[ FIND ]------------------------------------------
#
case 'egosearch':
$topics = new topics_search_egosearch($this->requester, $this->nav_parms);
break;
#
#-----[ AFTER, ADD ]------------------------------------------
#
case 'today':
$topics = new topics_search_today($this->requester, $this->nav_parms);
break;
#
#-----[ OPEN ]------------------------------------------
#
search.php
#
#-----[ FIND ]------------------------------------------
#
// process
$search->read_parms();
switch ( $search->mode )
{
case 'newposts':
case 'egosearch':
case 'unanswered':
#
#-----[ REPLACE WITH ]------------------------------------------
#
// process
$search->read_parms();
switch ( $search->mode )
{
case 'newposts':
case 'egosearch':
case 'today':
case 'unanswered':
#
#-----[ DIY ]-------------------------------------------------
#
Insert a link into your /templates/template/overall_header.tpl to yourdomain.tld/search.php?search_id=today.
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Muss man nur noch erweitern..