RosCMS update:
* website status page: add day counter and "date colors"
Modified:
trunk/web/reactos.org/htdocs/roscms/colors.php
Added:
trunk/web/reactos.org/htdocs/roscms/inc/tools.php
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/website_status.php
_____
Modified:
trunk/web/reactos.org/htdocs/roscms/colors.php
---
trunk/web/reactos.org/htdocs/roscms/colors.php 2005-12-14
19:49:09 UTC (rev 20173)
+++
trunk/web/reactos.org/htdocs/roscms/colors.php 2005-12-14
19:51:53 UTC (rev 20174)
@@ -23,5 +23,7 @@
$roscms_intern_color0="#5984C3"; // table head line
$roscms_intern_color1="#E2E2E2"; // table color1
$roscms_intern_color2="#EEEEEE"; // table color2
+ $roscms_intern_color_new="#339900"; // new content
+ $roscms_intern_color_old="#FF3300"; // new content
?>
\ No newline at end of file
_____
Added:
trunk/web/reactos.org/htdocs/roscms/inc/tools.php
---
trunk/web/reactos.org/htdocs/roscms/inc/tools.php 2005-12-14
19:49:09 UTC (rev 20173)
+++
trunk/web/reactos.org/htdocs/roscms/inc/tools.php 2005-12-14
19:51:53 UTC (rev 20174)
@@ -0,0 +1,45 @@
+<?php
+ /*
+ RosCMS - ReactOS Content Management System
+ Copyright (C) 2005 Klemens Friedl <frik85(a)reactos.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, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+ function compareDate ($i_sFirstDate, $i_sSecondDate)
+ {
+ // Break the Date strings into seperate components
+ $arrFirstDate = explode ("-", $i_sFirstDate);
+ $arrSecondDate = explode ("-", $i_sSecondDate);
+
+ $intFirstYear = $arrFirstDate[0];
+ $intFirstMonth = $arrFirstDate[1];
+ $intFirstDay = $arrFirstDate[2];
+
+ $intSecondYear = $arrSecondDate[0];
+ $intSecondMonth = $arrSecondDate[1];
+ $intSecondDay = $arrSecondDate[2];
+
+
+ // Calculate the diference of the two dates and return
the number of days
+ $intDate1Jul = gregoriantojd($intFirstMonth,
$intFirstDay, $intFirstYear);
+ $intDate2Jul = gregoriantojd($intSecondMonth,
$intSecondDay, $intSecondYear);
+// echo "|".$intDate1Jul."|".$intDate2Jul."|";
+ return $intDate1Jul - $intDate2Jul;
+
+ } // end Compare Date
+
+?>
\ No newline at end of file
Property changes on:
trunk/web/reactos.org/htdocs/roscms/inc/tools.php
___________________________________________________________________
Name: svn:eol-style
+ native
_____
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/website_status.php
---
trunk/web/reactos.org/htdocs/roscms/inc/website_status.php
2005-12-14 19:49:09 UTC (rev 20173)
+++
trunk/web/reactos.org/htdocs/roscms/inc/website_status.php
2005-12-14 19:51:53 UTC (rev 20174)
@@ -31,15 +31,22 @@
include('securitylog.php'); // open security log
die("Hacking attempt");
}
+
+include("inc/tools.php");
+
?>
<h1><a
href="http://www.reactos.org/?page=dev">ReactOS
Development</a>
> Website Status</h1>
<h2>Website Status</h2>
+<ul>
+ <li><a href="#sec1">Website Content Updates</a></li>
+ <li><a href="#sec2">Website Translation
Status</a></li>
+</ul>
+<a name="sec1"></a>
<h3>Website Content Updates</h3>
<table cellpadding="1" cellspacing="1">
<tr bgcolor="#5984C3">
<td width="200">
<div align="center"><font color="#FFFFFF"
face="Arial, Helvetica,
sans-serif"><strong>Title</strong></font></div></td>
- <td width="250"><div align="center"><font
color="#FFFFFF"
face="Arial, Helvetica,
sans-serif"><strong>Description</strong></font></div></td>
<td width="200"><div align="center"><font
color="#FFFFFF"
face="Arial, Helvetica,
sans-serif"><strong>Name</strong></font></div></td>
<td width="150">
<div align="center"><font color="#FFFFFF"
face="Arial, Helvetica,
sans-serif"><strong>Language</strong></font></div></td>
@@ -53,7 +60,7 @@
AND `content_visible` = 1
AND `content_type` = 'default'
ORDER BY `content_id` DESC
-
LIMIT 0 , 15 ;") ;
+
LIMIT 0 , 20 ;") ;
$color="";
$color1=$roscms_intern_color1;
$color2=$roscms_intern_color2;
@@ -107,17 +114,6 @@
}
?>
</font></td>
- <td valign="middle" bgcolor="<?php echo $color;
?>"><font
face="Arial, Helvetica, sans-serif" size="2">
- <?php
-
- if ($result_count_title[0] == "0" ||
$result_count_title[0] == "") {
- // temp
- }
- else {
- echo
substr($result_lang_page_name_update['page_description'], 0, 40);
- }
- ?>
- </font></td>
<td valign="middle" bgcolor="<?php echo $color;
?>"><font
face="Arial, Helvetica, sans-serif" size="2"><b>
<?php
@@ -139,8 +135,13 @@
echo $result_lang_name_update['lang_name'];
?>
</font></div></td>
- <td valign="middle" bgcolor="<?php echo $color;
?>"><div
align="center"><font face="Arial, Helvetica, sans-serif"
size="2">
- <?php
+ <td valign="middle" bgcolor="<?php echo $color; ?>"
title="<?php
+
+ $accountinfo_query = @mysql_query("SELECT user_name,
user_id FROM users WHERE user_id =
'".$result_updates['content_usrname_id']."'") or
die('DB error (website
status page)!');
+ $accountinfo_result =
@mysql_fetch_array($accountinfo_query);
+ echo $accountinfo_result['user_name']."
(".$result_updates['content_usrname_id'].")";
+
+ ?>"><div align="center"><font face="Arial,
Helvetica,
sans-serif" size="2"><?php
echo "<b>".$result_updates['content_date'].'
'.$result_updates['content_time']."</b>";
?>
@@ -150,6 +151,7 @@
} // end while
?>
</table>
+<a name="sec2"></a>
<h3>Website Translation Status</h3>
<p>This page show the current website translation status.</p>
<table cellpadding="1" cellspacing="1">
@@ -236,14 +238,35 @@
$link_current_line = true;
}
?></font></td>
- <td valign="middle" bgcolor="<?php echo $color;
?>"><div
align="center"><font face="Arial, Helvetica, sans-serif"
size="2"><?php
+ <td valign="middle" bgcolor="<?php
+
+ echo $color;
+
+ ?>"><div align="center"><font face="Arial,
Helvetica,
sans-serif" size="2"><?php
+
if ($link_current_line == "true") {
echo '<a
href="../?page='.$result_page['content_name'].'&lang=en">'.
$result_page['content_date'] .'</a>';
}
else {
echo $result_page['content_date'];
}
- ?></font></div></td>
+
+ if
(compareDate((date('Y')."-".date('m')."-".date('d')),$result_page['conte
nt_date']) == 0) {
+ echo '<table width="100%" border="0"
cellpadding="0" cellspacing="0"><tr><td
bgcolor="'.$roscms_intern_color_new.'"><div
align="center"><strong><font
color="#FFFFFF" size="2">';
+ echo 'today';
+ echo
'</font></strong></div></td></tr></table>';
+ }
+ elseif
(compareDate((date('Y')."-".date('m')."-".date('d')),$result_page['conte
nt_date']) <= 7) {
+ //echo '<br /><font
color="'.$roscms_intern_color_new.'"><b>'.compareDate((date('Y')."-".dat
e('m')."-".date('d')),$result_page['content_date']).'
days</font>';
+ echo '<table width="100%" border="0"
cellpadding="0" cellspacing="0"><tr><td
bgcolor="'.$roscms_intern_color_new.'"><div
align="center"><strong><font
color="#FFFFFF" size="2">';
+ echo
compareDate((date('Y')."-".date('m')."-".date('d')),$result_page['conten
t_date']).' days';
+ echo
'</font></strong></div></td></tr></table>';
+ }
+ else {
+ echo "<br
/>".compareDate((date('Y')."-".date('m')."-".date('d')),$result_page['co
ntent_date'])." days";
+ }
+ ?>
+ </font></div></td>
<?php
$query_lang_name = mysql_query("SELECT *
FROM `languages`
@@ -277,6 +300,19 @@
else {
echo
$result_lang_item2['content_date'];
}
+
+ if
(compareDate($result_page['content_date'],$result_lang_item2['content_da
te']) <= 0) {
+ echo '<br /><font
color="'.$roscms_intern_color_new.'">+
'.compareDate($result_lang_item2['content_date'],$result_page['content_d
ate']).' days</font>';
+ /*echo '<table width="100%"
border="0" cellpadding="0"
cellspacing="0"><tr><td
bgcolor="'.$roscms_intern_color_new.'"><div
align="center"><strong><font
color="#FFFFFF" size="2">';
+ echo
compareDate($result_lang_item2['content_date'],$result_page['content_dat
e']).' days';
+ echo
'</font></strong></div></td></tr></table>';*/
+ }
+ else {
+ echo '<br /><font
color="'.$roscms_intern_color_old.'">-
'.compareDate($result_page['content_date'],$result_lang_item2['content_d
ate']).' days</font>';
+ /*echo '<table width="100%"
border="0" cellpadding="0"
cellspacing="0"><tr><td
bgcolor="'.$roscms_intern_color_old.'"><div
align="center"><strong><font
color="#FFFFFF" size="2">';
+ echo
compareDate($result_page['content_date'],$result_lang_item2['content_dat
e']).' days';
+ echo
'</font></strong></div></td></tr></table>';*/
+ }
}
?></font></div></td>
<?php
@@ -288,4 +324,4 @@
} // end while
?>
</table>
-<p>All entries that are marked with "done" are NOT by all
means completely translated!</p>
+<p> </p>