In de page_header staat nu het volgende:
Code: Selecteer alles
//toegevoegd door mij
$LAAT_ZIEN = nieuwe_functie();
$template->assign_vars(array('LAAT_ZIEN', $LAAT_ZIEN));
//einde
$template->pparse('overall_header');
In de overall_header.tpl staat ergens {LAAT_ZIEN}
Toch nog niet het gewenste resultaat .....
De functie is een functie die de topics laat zien waarin de afgelopen twee dagen een bericht bij is gekomen.:
Code: Selecteer alles
function freshlyposted() {
global $db, $board_config, $phpbb_root_path;
$urlPath = "$phpbb_root_path";
$NOWTIME = time();
$TWODAYS = $NOWTIME - 172800;
$sql = "SELECT t.topic_title as title, p.post_id as id, t.forum_id as forum_id, t.topic_id as topic_id, t.topic_replies as replies "
."FROM ${table_prefix}topics t, ${table_prefix}posts p "
."WHERE t.topic_id = p.topic_id AND p.post_time > '$TWODAYS' "
."AND t.topic_last_post_id = p.post_id "
."ORDER BY p.post_time DESC "
."LIMIT 20";
//echo $sql;
$VERS_GEPOST = "<B>Vers gepost</B><BR />";
if($r = mysql_query($sql)) {
while($m = mysql_fetch_array($r)) {
$j = stripslashes($m[title]);
//we willen meteen op de goede pagina zitten
$replies = $m[replies] +1;
if ($replies > 15) {
$st = 0;
while ($st < $replies) {
$st = $st+15; }
$st = $st-15;
$VERS_GEPOST .= "<a STYLE=\"font-size: 12px;\" title=\"$m[title]\" href=\"$urlPath/viewtopic.php?t=$m[topic_id]&postdays=0&postorder=asc&start=$st#$m[id]\">$m[title]</a><br />";
} else {
$VERS_GEPOST .= "<a STYLE=\"font-size: 12px;\" title=\"$m[title]\" href=\"$urlPath/viewtopic.php?t=$m[topic_id]&sid=$m[forum_id]#$m[id]\">$m[title]</a><br />"; }
}
} else {
$VERS_GEPOST .= "ooops";
}
return "$VERS_GEPOST";
}