/ Forside/ Teknologi / Udvikling / PHP / Spørgsmål
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
PHP
#NavnPoint
rfh 3959
natmaden 3372
poul_from 3310
funbreak 2700
stone47 2230
Jin2k 1960
Angband 1743
Bjerner 1249
refi 1185
10  Interkril.. 1146
PHP-Fusion dansk mods til nyhedsarkiv
Fra : NoName7620
Vist : 454 gange
120 point
Dato : 28-04-05 19:48

Nogen der kan fortælle hvor jeg finder den danske version af nyhedsarkivet til PHP-Fusion, så ikke halvdelen af informationerne er på engelsk som i eksemplet herunder, hvor månedsnavne og datoer er engelske

http://www.findholger.1go.dk/fusion_infusions/news_archive/news_archive.php?year=2005&month=April

Vi starter på 100 point, kan du henvise til brugbar download forhøjes til 500

 
 
Kommentar
Fra : rfh


Dato : 28-04-05 22:09

Kig lige en file GLOBAL.PHP, den indholder de global variabler for måneder

Kommentar
Fra : NoName7620


Dato : 28-04-05 22:32

Synes at dette i global.php ser helt rigtigt ud, så den må hente andetsteds


<?php
/*
Danish Language Fileset
Produced by Jan Moelgaard (janmol)
Email: jm@mag1.aarhus.dk
Web: http://www.janm.dk
*/
// Unix locale setting
setlocale(LC_ALL, 'danish');
// Windows local setting
//setlocale(LC_TIME, 'dan');
define("FUSION_CHARSET", "iso-8859-1");
define("LAN_MONTHS", "&nbsp;|Januar|Februar|Marts|April|Maj|Juni|Juli|August|September|Oktober|November|December");
define("LAN_SHORTMONTHS", "&nbsp|Jan|Feb|Mar|Apr|Maj|Jun|Jul|Aug|Sep|Okt|Nov|Dec");

Kommentar
Fra : rfh


Dato : 28-04-05 22:49

vis sourcecode for filen 'news_archive.php'

Kommentar
Fra : NoName7620


Dato : 28-04-05 23:28

Her kommer hele smøren

<?
/*--------------------------------------------+
| PHP-Fusion 5 - Content Management System |
|---------------------------------------------|
| author: Nick Jones (Digitanium) © 2002-2005 |
| web: http://www.php-fusion.co.uk |
| email: nick@php-fusion.co.uk |
|---------------------------------------------|
| Released under the terms and conditions of |
| the GNU General Public License (Version 2) |
+--------------------------------------------*/
@include "../../fusion_config.php";
include "../../fusion_core.php";
include FUSION_BASE."subheader.php";
include FUSION_BASE."side_left.php";

@include FUSION_INFUSIONS."news_archive/lang/".$settings['language'].".php";
@include FUSION_INFUSIONS."news_archive/lang/English.php";

$nas = dbarray(dbquery("SELECT * FROM ".$fusion_prefix."nas"));

$newsorder = $nas[news_order];
$numofnews = $nas[numofnews];
if ($nas[listexp] == 1){
$listexp = "AND (news_end='0'||news_end>=".time().")";
}else{
$listexp = "";
}
function listnews($var){
global $rows, $fusion_prefix, $rowstart, $listexp, $numofnews, $year, $month, $day, $PHP_SELF;

if ($rows !=0){
echo "<br><table align='center' cellspacing='0' cellpadding='0' border='0' width='100%' class='tbl-border'>
<tr>
<td>";
echo "<table align='center' cellpadding='0' cellspacing='1' width='100%' border='0'>";
echo "<tr><td align='center' width='50%' class='tbl2'><b>".NA_011."</b></td><td align='center' class='tbl2'><b>".NA_012."</b></td>
<td align='center' class='tbl2'><b>".NA_013."</b></td><td align='center' class='tbl2'><b>".NA_002."</b></td></tr>";
for ($i=$rowstart;$var[$i];$i++) {
$result2 = dbquery(
         "SELECT tn.*, tu.user_id,user_name
         FROM ".$fusion_prefix."news tn
         LEFT JOIN ".$fusion_prefix."users tu ON tn.news_name=tu.user_id
         WHERE news_id=$var[$i] AND (news_start='0'||news_start<=".time().") $listexp
         GROUP BY news_id ORDER BY news_datestamp ASC"
      );
$data = dbarray($result2);
      echo "<tr><td align='left' width='50%' class='tbl1'><a href='".FUSION_BASE."news.php?readmore=$var[$i]'>".$data['news_subject']."</a></td>
<td align='center' class='tbl2'><a href='".FUSION_BASE."profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a></td>
<td align='center' class='tbl1'>".date('d.m.Y', $data[news_datestamp])."</td>
<td align='center' class='tbl2'>".$data['news_reads']."</td></tr>";
if ($i == $rowstart + ($numofnews - 1)){
break;
}
   }
echo "</table></td></tr></table>";

}else{
echo "<center><br>".NA_014."<br><br></center>\n";
}

}


opentable(NA_001);
$splityears = array();
$result = dbquery("SELECT * FROM ".$fusion_prefix."news ORDER BY news_datestamp ASC");
if (dbrows($result)!=0) {
while ($date = dbarray($result)){
$allyears = date('Y', $date[news_datestamp]);
array_push($splityears, $allyears);
}
$yearsnum = array_count_values($splityears);
$years = array_unique($splityears);
$years = array_merge($years);
echo ". <a href='news_archive.php?listtype=last&pre=3'>".NA_005."</a><br>";
echo ". <a href='news_archive.php?listtype=last&pre=7'>".NA_006."</a><br>";
echo ". <a href='news_archive.php?listtype=last&pre=30'>".NA_008."</a><br>";
echo "<hr>";
for ($i=0;$years[$i];$i++) {
      echo ". <a href='news_archive.php?year=$years[$i]'>$years[$i]</a> (".$yearsnum[$years[$i]].")<br>";
   }
closetable();

if ($listtype == "last"){
tablebreak();
opentable(NA_010);
$newslastweek = array();
$result = dbquery("SELECT * FROM ".$fusion_prefix."news ORDER BY news_datestamp $newsorder");
if (!$rowstart) $rowstart = 0;
if (!$pre) $pre = 7;
$weektime = mktime(0, 0, 0, date("m") , date("d")-$pre, date("Y"));
while ($date = dbarray($result)){
$newstime = $date[news_datestamp];
if ($newstime >= $weektime){
$newsid = $date[news_id];
array_push($newslastweek, $newsid);
}
}
$rows = count($newslastweek);
listnews($newslastweek);
echo "<br /><div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,$numofnews,$rows,3,"$PHP_SELF?listtype=last&pre=$pre&")."\n</div>\n";
closetable();
}elseif (isset($year)){
tablebreak();
opentable($year);
$splitmonths = array();
$result = dbquery("SELECT * FROM ".$fusion_prefix."news ORDER BY news_datestamp ASC");
while ($date = dbarray($result)){
$allyears = date('Y', $date[news_datestamp]);
if ($allyears == $year){
$allmonths = date('F', $date[news_datestamp]);
array_push($splitmonths, $allmonths);
}
}
$monthsnum = array_count_values($splitmonths);
$months = array_unique($splitmonths);
$months = array_merge($months);
$rows = count($months);
if ($rows !=0){
for ($i=0;$months[$i];$i++) {
      echo ". <a href='news_archive.php?year=$year&month=$months[$i]'>$months[$i]</a> (".$monthsnum[$months[$i]].") - (<a href='news_archive.php?listtype=bymonth&year=$year&month=$months[$i]'>".NA_004."</a>)<br>";
   }
   }else{
echo "<center><br>".NA_015."<br><br></center>\n";
}
closetable();
if ($listtype == "bymonth"){
tablebreak();
opentable($month);
$newsbymonth = array();
$result = dbquery("SELECT * FROM ".$fusion_prefix."news ORDER BY news_datestamp $newsorder");
if (!$rowstart) $rowstart = 0;
while ($date = dbarray($result)){
$allyears = date('Y', $date[news_datestamp]);
$allmonths = date('F', $date[news_datestamp]);
if ($allmonths == $month && $allyears == $year){
$newsid = $date[news_id];
array_push($newsbymonth, $newsid);
}
}
$rows = count($newsbymonth);
listnews($newsbymonth);
echo "<br /><div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,$numofnews,$rows,3,"$PHP_SELF?listtype=bymonth&year=$year&month=$month&")."\n</div>\n";
closetable();
}elseif (isset($month)){
tablebreak();
opentable($month);
$splitdays = array();
$result = dbquery("SELECT * FROM ".$fusion_prefix."news ORDER BY news_datestamp ASC");
while ($date = dbarray($result)){
$allyears = date('Y', $date[news_datestamp]);
$allmonths = date('F', $date[news_datestamp]);
if ($allmonths == $month && $allyears == $year){
$alldays = date('d', $date[news_datestamp]);
array_push($splitdays, $alldays);
}
}
$daysnum = array_count_values($splitdays);
$days = array_unique($splitdays);
$days = array_merge($days);
$rows = count($days);
if ($rows !=0){
for ($i=0;$days[$i];$i++) {
if ( $days[$i] == 1 or $days[$i] == 21 or $days[$i] == 31){
$sub = "st";
}elseif ( $days[$i] == 2 or $days[$i] == 22){
$sub = "nd";
}elseif ( $days[$i] == 3 or $days[$i] == 23){
$sub = "rd";
}else{
$sub = "th";
}
      echo ". <a href='news_archive.php?year=$year&month=$month&day=$days[$i]'>$days[$i]$sub</a> (".$daysnum[$days[$i]].")<br>";
   }
}else{
echo "<center><br>".NA_009."<br><br></center>\n";
}
closetable();
}
if (isset($day)){
tablebreak();
opentable($day);
$news = array();
$result = dbquery("SELECT * FROM ".$fusion_prefix."news ORDER BY news_datestamp $newsorder");
if (!$rowstart) $rowstart = 0;
while ($date = dbarray($result)){
$allyears = date('Y', $date[news_datestamp]);
$allmonths = date('F', $date[news_datestamp]);
$alldays = date('d', $date[news_datestamp]);
if ($alldays == $day && $allmonths == $month && $allyears == $year){
$newsid = $date[news_id];
array_push($news, $newsid);
}
}
$rows = count($news);
listnews($news);
echo "<br /><div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,$numofnews,$rows,3,"$PHP_SELF?listtype=bymonth&year=$year&month=$month&day=$day&")."\n</div>\n";
closetable();
}
}
}
else
{
echo "<center><br>".NA_003."<br><br></center>\n";
      closetable();
      }

include FUSION_BASE."side_right.php";
include FUSION_BASE."footer.php";
?>


Kommentar
Fra : rfh


Dato : 28-04-05 23:43

Der skal kun være en linie med @include
Kode
@include FUSION_INFUSIONS."news_archive/lang/".$settings['language'].".php";
@include FUSION_INFUSIONS."news_archive/lang/English.php";


hvis dit system er sat op til dansk, så du kun bruge denne linie
Kode
@include FUSION_INFUSIONS."news_archive/lang/".$settings['language'].".php";

eller
Kode
@include FUSION_INFUSIONS."news_archive/lang/dansk.php";



Kommentar
Fra : NoName7620


Dato : 28-04-05 23:59

Prøvede lige med kun den ene linje

@include FUSION_INFUSIONS."news_archive/lang/dansk.php"; (filen hedder Danish.php ) og kan så se at den henter en del af informationerne i denne fil men ikke måned og datoer se vedh. links til to billeder heraf

http://img123.echo.cx/img123/9655/nyhedsarkiv18tw.gif
http://img123.echo.cx/img123/1742/nyhedsarkiv20no.gif

Kommentar
Fra : rfh


Dato : 29-04-05 00:07

har du checket de her include også og de include der indeni (hvis der er nogle)

Kommentar
Fra : rfh


Dato : 29-04-05 00:08

Glemte lige code !
har du checket de her include også og de include der indeni (hvis der er nogle)
Kode
@include "../../fusion_config.php";
include "../../fusion_core.php";
include FUSION_BASE."subheader.php";
include FUSION_BASE."side_left.php";


Kommentar
Fra : NoName7620


Dato : 29-04-05 00:16

Har søgt på month i disse filer intet resultat

Kommentar
Fra : rfh


Dato : 29-04-05 00:17

Hvis du vil ændre tekst bag ved dagens nr, så find flg. code i news_archive.php
Kode
$daysnum = array_count_values($splitdays);
$days = array_unique($splitdays);
$days = array_merge($days);
$rows = count($days);
if ($rows !=0){
for ($i=0;$days[$i];$i++) {
if ( $days[$i] == 1 or $days[$i] == 21 or $days[$i] == 31){
$sub = "st";
}elseif ( $days[$i] == 2 or $days[$i] == 22){
$sub = "nd";
}elseif ( $days[$i] == 3 or $days[$i] == 23){
$sub = "rd";
}else{
$sub = "th";
}

ændre i de her 4 linier
Kode
$sub = "st";
$sub = "nd";
$sub = "rd";
$sub = "th";


Kommentar
Fra : NoName7620


Dato : 29-04-05 00:23

Koderne på dato skriver disse ind efter dato-nummer og dansk må være D. [dato] hvordan gør jeg lige det

Kommentar
Fra : rfh


Dato : 29-04-05 00:53

har fundet fejlen, scriptet kører på engelsk efter

PHP kommando'en : DATE http://dk2.php.net/manual/da/php/function.date.php

I linie 108 (ca.) har du en linie som ser sådan ud
Kode
$allmonths = date('F', $date[news_datestamp]);


Det store F kan du ændre til M, så får du måneder med 3 bogstaver

Go'Nat
mvh
rfh

Kommentar
Fra : NoName7620


Dato : 29-04-05 01:17

Det er desværre ikke en brugbar løsning, når man udskifter med kort format virker link til nyheder under de enkelte måneder ikke...

Accepteret svar
Fra : rfh

Modtaget 120 point
Dato : 29-04-05 10:50

Det her skulle løse problemet.

erstat flg. code ( ca. linie 112)
Kode
$monthsnum = array_count_values($splitmonths);
$months = array_unique($splitmonths);
$months = array_merge($months);
$rows = count($months);
$FIX = array (
'January' => 'Januar',
'February' => 'Februar',
'March' => 'Marts',
'April' => 'April',
'May' => 'Maj',
'June' => 'Juni',
'July' => 'Juli',
'August' => 'August',
'September' => 'September',
'October' => 'Oktober',
'November' => 'November',
'December' => 'December'
);
if ($rows !=0){
for ($i=0;$months[$i];$i++) {
$FIXmonth=$FIX[$months[$i]];
echo ". <a href='news_archive.php?year=$year&month=$months[$i]'>$FIXmonth</a> (".$monthsnum[$months[$i]].") - (<a href='news_archive.php?listtype=bymonth&year=$year&month=$months[$i]'>".NA _004."</a>)<br>";
}
}else{
echo "<center><br>".NA_015."<br><br></center>\n";
}


variablen $FIX bruges til at erstatte den engelsk månede med den dansk.
variablen $FIXmonth indholder den dansk månede.

mvh
rfh


Kommentar
Fra : NoName7620


Dato : 29-04-05 13:00

Har fået fat i revideret news_archive.php og det ser ud til at det kører som det skal, ved ikke om dit forslag også ville virke, men løst lidt anderledes

http://www.findholger.1go.dk/fusion_infusions/news_archive/news_archive.ph p?year=2005&month=April

Vedhæfter lige hele koden der virker

Kode:
<?
/*--------------------------------------------+
| PHP-Fusion 5 - Content Management System |
|---------------------------------------------|
| author: Nick Jones (Digitanium) © 2002-2005 |
| web: http://www.php-fusion.co.uk |
| email: nick@php-fusion.co.uk |
|---------------------------------------------|
| Released under the terms and conditions of |
| the GNU General Public License (Version 2) |
+--------------------------------------------*/
@require_once "../../fusion_config.php";
require_once "../../fusion_core.php";
require_once "../../subheader.php";
require_once "../../side_left.php";

@include FUSION_INFUSIONS."news_archive/lang/".$settings['language'].".php";
@include FUSION_INFUSIONS."news_archive/lang/English.php";

$nas = dbarray(dbquery("SELECT * FROM ".$fusion_prefix."nas"));
$array_month = array(Januar,Februar,Marts,April,Maj,Juni,Juli,August,September,Oktober,November,December);

$newsorder = $nas[news_order];
$numofnews = $nas[numofnews];
if ($nas[listexp] == 1){
$listexp = "AND (news_end='0'||news_end>=".time().")";
}else{
$listexp = "";
}
function listnews($var){
global $rows, $fusion_prefix, $rowstart, $listexp, $numofnews, $year, $month, $day, $PHP_SELF;

if ($rows !=0){
echo "<br><table align='center' cellspacing='0' cellpadding='0' border='0' width='100%' class='tbl-border'>
<tr>
<td>";
echo "<table align='center' cellpadding='0' cellspacing='1' width='100%' border='0'>";
echo "<tr><td align='center' width='50%' class='tbl2'><b>".NA_011."</b></td><td align='center' class='tbl2'><b>".NA_012."</b></td>
<td align='center' class='tbl2'><b>".NA_013."</b></td><td align='center' class='tbl2'><b>".NA_002."</b></td></tr>";
for ($i=$rowstart;$var[$i];$i++) {
$result2 = dbquery(
         "SELECT tn.*, tu.user_id,user_name
         FROM ".$fusion_prefix."news tn
         LEFT JOIN ".$fusion_prefix."users tu ON tn.news_name=tu.user_id
         WHERE news_id=$var[$i] AND (news_start='0'||news_start<=".time().") $listexp
         GROUP BY news_id ORDER BY news_datestamp ASC"
      );
$data = dbarray($result2);
      echo "<tr><td align='left' width='50%' class='tbl1'><a href='".FUSION_BASE."news.php?readmore=$var[$i]'>".$data['news_subject']."</a></td>
<td align='center' class='tbl2'><a href='".FUSION_BASE."profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a></td>
<td align='center' class='tbl1'>".date('d.m.Y', $data[news_datestamp])."</td>
<td align='center' class='tbl2'>".$data['news_reads']."</td></tr>";
if ($i == $rowstart + ($numofnews - 1)){
break;
}
   }
echo "</table></td></tr></table>";

}else{
echo "<center><br>".NA_014."<br><br></center>\n";
}

}


opentable(NA_001);
$splityears = array();
$result = dbquery("SELECT * FROM ".$fusion_prefix."news ORDER BY news_datestamp ASC");
if (dbrows($result)!=0) {
while ($date = dbarray($result)){
$allyears = date('Y', $date[news_datestamp]);
array_push($splityears, $allyears);
}
$yearsnum = array_count_values($splityears);
$years = array_unique($splityears);
$years = array_merge($years);
echo ". <a href='news_archive.php?listtype=last&pre=3'>".NA_005."</a><br>";
echo ". <a href='news_archive.php?listtype=last&pre=7'>".NA_006."</a><br>";
echo ". <a href='news_archive.php?listtype=last&pre=30'>".NA_008."</a><br>";
echo "<hr>";
for ($i=0;$years[$i];$i++) {
      echo ". <a href='news_archive.php?year=$years[$i]'>$years[$i]</a> (".$yearsnum[$years[$i]].")<br>";
   }
closetable();

if ($listtype == "last"){
tablebreak();
opentable(NA_010);
$newslastweek = array();
$result = dbquery("SELECT * FROM ".$fusion_prefix."news ORDER BY news_datestamp $newsorder");
if (!$rowstart) $rowstart = 0;
if (!$pre) $pre = 7;
$weektime = mktime(0, 0, 0, date("m") , date("d")-$pre, date("Y"));
while ($date = dbarray($result)){
$newstime = $date[news_datestamp];
if ($newstime >= $weektime){
$newsid = $date[news_id];
array_push($newslastweek, $newsid);
}
}
$rows = count($newslastweek);
listnews($newslastweek);
echo "<br /><div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,$numofnews,$rows,3,"$PHP_SELF?listtype=last&pre=$pre&")."\n</div>\n";
closetable();
}elseif (isset($year)){
tablebreak();
opentable($year);
$splitmonths = array();
$result = dbquery("SELECT * FROM ".$fusion_prefix."news ORDER BY news_datestamp ASC");
while ($date = dbarray($result)){
$allyears = date('Y', $date[news_datestamp]);
if ($allyears == $year){
$allmonths = date('F', $date[news_datestamp]);
array_push($splitmonths, $allmonths);
array_push($array_month, $allmonts);
}
}
$monthsnum = array_count_values($splitmonths);
$months = array_unique($splitmonths);
$months = array_merge($months);
$rows = count($months);
$FIX = array (
'January' => 'Januar',
'February' => 'Februar',
'March' => 'Marts',
'April' => 'April',
'May' => 'Maj',
'June' => 'Juni',
'July' => 'Juli',
'August' => 'August',
'September' => 'September',
'October' => 'Oktober',
'November' => 'November',
'December' => 'December'
);
if ($rows !=0){
for ($i=0;$months[$i];$i++) {
$FIXmonth=$FIX[$months[$i]];
echo ". <a href='news_archive.php?year=$year&month=$months[$i]'>$FIXmonth</a> (".$monthsnum[$months[$i]].") - (<a href='news_archive.php?listtype=bymonth&year=$year&month=$months[$i]'>".NA _004."</a>)<br>";
}
}else{
echo "<center><br>".NA_015."<br><br></center>\n";
}

closetable();
if ($listtype == "bymonth"){
tablebreak();
if ($month == "January") {
$month_t = "Januar";
}
if ($month == "February") {
$month_t = "Februar";
}
if ($month == "March") {
$month_t = "Marts";
}
if ($month == "April") {
$month_t = "April";
}
if ($month == "May") {
$month_t = "Maj";
}
if ($month == "June") {
$month_t = "Juni";
}
if ($month == "July") {
$month_t = "Juli";
}
if ($month == "August") {
$month_t = "August";
}
if ($month == "September") {
$month_t = "September";
}
if ($month == "October") {
$month_t = "Oktober";
}
if ($month == "November") {
$month_t = "November";
}
if ($month == "December") {
$month_t = "December";
}
opentable($month_t);
$newsbymonth = array();
$result = dbquery("SELECT * FROM ".$fusion_prefix."news ORDER BY news_datestamp $newsorder");
if (!$rowstart) $rowstart = 0;
while ($date = dbarray($result)){
$allyears = date('Y', $date[news_datestamp]);
$allmonths = date('F', $date[news_datestamp]);
if ($allmonths == $month && $allyears == $year){
$newsid = $date[news_id];
array_push($newsbymonth, $newsid);
}
}
$rows = count($newsbymonth);
listnews($newsbymonth);
echo "<br /><div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,$numofnews,$rows,3,"$PHP_SELF?listtype=bymonth&year=$year&month=$month&")."\n</div>\n";
closetable();
}elseif (isset($month)){
tablebreak();
//den nederste månedsrubrik
if ($month == "January") {
$month_t = "Januar";
}
if ($month == "February") {
$month_t = "Februar";
}
if ($month == "March") {
$month_t = "Marts";
}
if ($month == "April") {
$month_t = "April";
}
if ($month == "May") {
$month_t = "Maj";
}
if ($month == "June") {
$month_t = "Juni";
}
if ($month == "July") {
$month_t = "Juli";
}
if ($month == "August") {
$month_t = "August";
}
if ($month == "September") {
$month_t = "September";
}
if ($month == "October") {
$month_t = "Oktober";
}
if ($month == "November") {
$month_t = "November";
}
if ($month == "December") {
$month_t = "December";
}
opentable($month_t);
$splitdays = array();
$result = dbquery("SELECT * FROM ".$fusion_prefix."news ORDER BY news_datestamp ASC");
while ($date = dbarray($result)){
$allyears = date('Y', $date[news_datestamp]);
$allmonths = date('F', $date[news_datestamp]);
if ($allmonths == $month && $allyears == $year){
$alldays = date('d', $date[news_datestamp]);
array_push($splitdays, $alldays);
}
}
$daysnum = array_count_values($splitdays);
$days = array_unique($splitdays);
$days = array_merge($days);
$rows = count($days);
if ($rows !=0){
for ($i=0;$days[$i];$i++) {
if ( $days[$i] == 1 or $days[$i] == 21 or $days[$i] == 31){
$sub = "Nyheder den: ";
}elseif ( $days[$i] == 2 or $days[$i] == 22){
$sub = "Nyheder den: ";
}elseif ( $days[$i] == 3 or $days[$i] == 23){
$sub = "Nyheder den: ";
}else{
$sub = "Nyheder den: ";
}
      echo ". <a href='news_archive.php?year=$year&month=$month&day=$days[$i]'>$sub$days[$i]</a> (".$daysnum[$days[$i]].")<br>";
   }
}else{
echo "<center><br>".NA_009."<br><br></center>\n";
}
closetable();
}
if (isset($day)){
tablebreak();
opentable("Nyheder den: ".$day);
$news = array();
$result = dbquery("SELECT * FROM ".$fusion_prefix."news ORDER BY news_datestamp $newsorder");
if (!$rowstart) $rowstart = 0;
while ($date = dbarray($result)){
$allyears = date('Y', $date[news_datestamp]);
$allmonths = date('F', $date[news_datestamp]);
$alldays = date('d', $date[news_datestamp]);
if ($alldays == $day && $allmonths == $month && $allyears == $year){
$newsid = $date[news_id];
array_push($news, $newsid);
}
}
$rows = count($news);
listnews($news);
echo "<br /><div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,$numofnews,$rows,3,"$PHP_SELF?listtype=bymonth&year=$year&month=$month&day=$day&")."\n</div>\n";
closetable();
}
}
}
else
{
echo "<center><br>".NA_003."<br><br></center>\n";
      closetable();
      }

include FUSION_BASE."side_right.php";
include FUSION_BASE."footer.php";
?>




Godkendelse af svar
Fra : NoName7620


Dato : 29-04-05 13:13

Såvidt jeg lige har kunnet teste virkede dit forslag ikke, men jeg takker mange gange for det arbejde du har lagt i at forsøge at svare, så pointene er på vej til dig... og håber du måske kan få noget ud af mit sidste indlæg og gennemskue løsningen

Vil ligeledes lukke et html-spørgsmål hvor du vist også er den eneste der har forsøgt at hjælpe...

Have a nice day
                        

Kommentar
Fra : rfh


Dato : 29-04-05 14:00

en lille optimering af kode

erstat disse linier
Kode
if ($month == "January") {
$month_t = "Januar";
}
if ($month == "February") {
$month_t = "Februar";
}
if ($month == "March") {
$month_t = "Marts";
}
if ($month == "April") {
$month_t = "April";
}
if ($month == "May") {
$month_t = "Maj";
}
if ($month == "June") {
$month_t = "Juni";
}
if ($month == "July") {
$month_t = "Juli";
}
if ($month == "August") {
$month_t = "August";
}
if ($month == "September") {
$month_t = "September";
}
if ($month == "October") {
$month_t = "Oktober";
}
if ($month == "November") {
$month_t = "November";
}
if ($month == "December") {
$month_t = "December";
}

med denne linie
Kode
$month_t=$FIX[$month];


hvorfor laver 12 forspørgelser, når man kan bare sætte en variable lige med et array ?

mvh
rfh

Kommentar
Fra : NoName7620


Dato : 29-04-05 14:38

Takker ser ud til at virke - sender det videre til ophavsmand til originalfilen

Kommentar
Fra : rfh


Dato : 29-04-05 14:51

Skulle det være en anden.

Tak for alle points.

mvh
rfh

Du har følgende muligheder
Eftersom du ikke er logget ind i systemet, kan du ikke skrive et indlæg til dette spørgsmål.

Hvis du ikke allerede er registreret, kan du gratis blive medlem, ved at trykke på "Bliv medlem" ude i menuen.
Søg
Reklame
Statistik
Spørgsmål : 177558
Tips : 31968
Nyheder : 719565
Indlæg : 6408914
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste