PHP Nuke Nederland
 
•   Home  •  Downloads  •  Your Account  •  Forums  •
PHP-Nuke Nederland: Forums

PHP-Nuke Nederland :: View topic - Datum boven nieuwsbericht
 Forum FAQ  •   Search   •  Memberlist  •  Usergroups   •  Register   •    •  Profile  •  Log in to check your private messages  •  Log in

 
Post new topicReply to topic
View previous topic Log in to check your private messages View next topic
Author Message
bjornju
Beginner
Beginner


Joined: Apr 01, 2008
Posts: 11

PostPosted: Wed 09 Apr 2008 7:46 Reply with quoteBack to top

Ik zit nu al een tijdje te zoeken op het forum, verschillende dingen gevonden maar nog niet wat ik precies zoek.

Ik wil graag de datum van vandaag boven het nieuwste nieuwsbericht.

Als voorbeeld;

datum vandaag

bericht
bericht
bericht

datum gistern

bericht
bericht
bericht


Dit mag uiteraard met een aantal dagen langer.

Hoe en waar is dit in te vullen en aan te passen?

Alvast bedankt.
View user's profileSend private message
nedkelly
Elite Support
Elite Support


Joined: Aug 23, 2004
Posts: 518

PostPosted: Sat 12 Apr 2008 3:21 Reply with quoteBack to top

Je wilt dus de datum voor de titel van het bericht?
Dus: Datum----Titel en hieronder het bericht?
View user's profileSend private message
bjornju
Beginner
Beginner


Joined: Apr 01, 2008
Posts: 11

PostPosted: Sat 12 Apr 2008 5:18 Reply with quoteBack to top

Het liefst de datum erboven.
Dan alle berichten van die dag.

En dit herhalen bij een nieuwe dag.

Dus als er vandaag 5 berichten zijn, zie je de datum van vandaag met daar onder de vijf berichten.
Gisteren waren er 3 berichten, dus dan de datum van gisteren en de 3 berichten.

Het aantal dagen mag aanpasbaar zijn.
View user's profileSend private message
bjornju
Beginner
Beginner


Joined: Apr 01, 2008
Posts: 11

PostPosted: Sat 21 Jun 2008 5:32 Reply with quoteBack to top

Ik ben inmiddels al iets verder.
Ik heb nu deze code in mijn last_5_articles-block geplaatst op mijn phpnuke 7.6.3.1 site.

Code:
<?php

/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/*         Additional security & Abstraction layer conversion           */
/*                           2003 chatserv                              */
/*      http://www.nukefixes.com -- http://www.nukeresources.com        */
/************************************************************************/

/* Block to fit perfectly in the center of the site, remember that not all
   blocks looks good on Center, just try and see yourself what fits your needs */

if ( !defined('BLOCK_FILE') ) {
    Header("Location: ../index.php");
    die();
}

global $prefix, $multilingual, $currentlang, $db;

if ($multilingual == 1) {
    $querylang = "WHERE (alanguage='$currentlang' OR alanguage='')";
} else {
    $querylang = "";
}

$sql = "SELECT sid, title, time FROM ".$prefix."_stories $querylang ORDER BY time DESC LIMIT 0,50";
$result = $db->sql_query($sql);
$res = array();

while (list($sid, $title, $date) = $db->sql_fetchrow($result)) {

   if (preg_match('/^([0-9]{4})\-([0-9]{2})\-([0-9]{2}).*$/', $date, $matches)) {
   
      $date = $matches[3] . '-' . $matches[2] . '-' . $matches[1];

      if (!array_key_exists($date, $res)) $res[$date] = array();   
      
      $res[$date][] = array('id' => $sid, 'title' => $title);
   }
}

$content = "<dl id=\"headlines\">";

foreach ($res as $date => $arr) {
   
   $content .= "<br>";
   $content .= "<dd><strong>" . $date . "</strong></dd>";
   
   foreach ($arr as $item) {
      
      $content .= "<dd><strong><big>·</big></strong> <a href=\"news.html&amp;file=article&amp;sid=".$item['id']."\">" . htmlspecialchars($item['title']) . "</a></dd>";
      
         }   
$content .= "<dd><hr></dd>";
}

$content .= "</dl>";
?>


Het aantal berichten staat op 50.
Ik wil nog steeds dat het aantal zichtbare dagen te bepalen is.
Want wanneer er nu een nieuw bericht bijkomt, valt er een bericht weg bij de laatste zichtbare dag, dus eigenlijk is dat bericht 51.
Dan hou je dus een incomplete dag met nieuwsberichten over. En dat wil ik dus niet.

Iemand hier een oplossing voor?
View user's profileSend private message
Display posts from previous:      
 Donaties   Adverteren 
Wilt u het forum steunen, dan kunt u nu eenvoudig doneren met PayPal.
Post new topicReply to topic
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Web site powered by PHP-Nuke

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © 2004-2008 by BlueLion.
SEO enhanced with the Sitemapper script
You can syndicate our news using the file backend.php or ultramode.txt
Powered by PHP Powered by MySQL Apache Webserver Valid robots.txt
PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Pagina rendering: 0.09 seconden


[Valid News RSS]

RSS Feeds:
[RSS 2.0 News Feed]
[RSS 2.0 Download Feed]
[RSS 2.0 Forum Feed]
[RSS 2.0 Link Feed]
:: fisubsilver shadow phpbb2 style by Daz :: PHP-Nuke theme by BlueLion ::