|
From: mdw c. <myd...@li...> - 2001-09-10 14:47:25
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/include
Modified Files:
gui.inc.php templates.inc.php
Log Message:
Adding a new box :
the stat box.
It displays
- number of recorded news in the current lang
- number of recorded comments in the current lang
- number of recorded pages in the current lang
To see this box, just ad the keyword ~STATBOX~ in your main.html file
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/gui.inc.php,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -3 -r1.27 -r1.28
--- gui.inc.php 2001/09/04 21:30:44 1.27
+++ gui.inc.php 2001/09/10 14:47:24 1.28
@@ -408,7 +408,7 @@
// putting the lines
while (list($title,$link) = each($links)) {
$VALUES['CONTENT'] = "<A HREF='$link'>$title</A>";
- $PAGE .= get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES) . "<br>";
+ $PAGE .= get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES) ;
}
$PAGE .= get_hash_template($BOX_HASH_TEMPLATE["FOOT"], $VALUES);
@@ -436,7 +436,6 @@
{
- $boxes = "<table width=\"90\" cellpadding=0 cellspacing=0 border=0>";
$sql = "select num_titre
from item_box_titles
@@ -446,10 +445,9 @@
$rqt = new query($DBH);
$rqt->query($DBH,$sql);
while ($num_box = $rqt->getrow()) {
- $boxes .= ("<tr><td>" . get_item_box ($num_box[0], $DBH) . "</td></tr><tr><td> </td></tr>\n");
+ $boxes .= get_item_box ($num_box[0], $DBH);
}
- $boxes .= "</table>";
return($boxes);
}
@@ -495,7 +493,7 @@
</table>";
$VALUES['TITLE'] = $TABLE_TITRE;
- $BOX = get_hash_template ($BOX_HASH_TEMPLATE["HEAD"], $VALUES);
+$BOX = get_hash_template ($BOX_HASH_TEMPLATE["HEAD"], $VALUES);
$sql = "select item_libelle, item_url, target
from item_box_content
@@ -508,11 +506,12 @@
while ($infos = $q->getrow()) {
$VALUES['CONTENT'] = "<A HREF='$infos[1]' TARGET='$infos[2]'>$infos[0]</A>";
- $BOX .= get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES) . "<br>";
+ $BOX .= get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES) ;
}
$BOX .= get_hash_template($BOX_HASH_TEMPLATE["FOOT"], $VALUES);
-
+
+
return ($BOX);
}
}
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/templates.inc.php,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- templates.inc.php 2001/09/04 21:30:44 1.21
+++ templates.inc.php 2001/09/10 14:47:24 1.22
@@ -15,14 +15,16 @@
// We define here each of main values used to print HTML output
///////////////////////////////////////////////////////////////
{
- $news_sites = explode(",", HEADLINES);
- for($i=0;$i<sizeof($news_sites);$i++) {
- $VALUES["HEADLINES"] .= get_headlines($DBH, $news_sites[$i]);
- }
-
-
- $VALUES["TOPBAR"] = top_bar($DBH,$c);
+ $hash_box = read_template(THEMES_PATH . '/box.html');
+
+ $news_sites = explode(",", HEADLINES);
+ for($i=0;$i<sizeof($news_sites);$i++) {
+ $VALUES["HEADLINES"] .= get_headlines($DBH, $news_sites[$i]);
+ }
+
+ $VALUES['STATBOX'] = get_global_stats_box($DBH, $hash_box);
+ $VALUES["TOPBAR"] = top_bar($DBH,$c);
$VALUES["NEWS_LETTER"] = get_newsletter_form($DBH);
$VALUES["SITE_TITLE"] = SITE_TITLE;
$VALUES["PAGE_TITLE"] = $titre;
@@ -32,25 +34,19 @@
$VALUES["PAGE_TITLE"]=$titre;
$VALUES["QUOTATION"]=get_quote();
$VALUES["MESSAGE"] = $MSG;
-
$VALUES["LEFT_CORNER"] = $titre;
$VALUES["CONTENT"] = $content;
$VALUES["TITLE"] = "<img src=\"".DOCUMENT_TITRE_IMAGE."\">";
$VALUES["RIGHT_CORNER"] = new_LastTopics($DBH);
-
$VALUES['SEARCH'] = get_searchengine(CP_SEARCH, $DBH);
- //FIXME: doesnt work (DYNA_SESSION is undefined, surely because we are not in the main script)
$VALUES['LOGIN'] = get_login_box(DYNA_SESSION , CP_LOGIN, $DBH);
$VALUES["LINK_BOXES"] = get_link_boxes($DBH);
$VALUES["CONTROL_PANNEL"] = get_control_panel(CP_DATE,CP_LANG,CP_TIME,$DBH);
-
$VALUES["MYDYNAWEB_POWERED"] = translate("POWERED_BY",$DBH);
-
$VALUES["ZONE"] = $ZONE;
$VALUES["PAGE"] = $PAGE;
-
- return ($VALUES);
+ return ($VALUES);
}
@@ -206,8 +202,8 @@
function print_template($template_path, $content, $titre,
- $DBH,$c, $IP='', $REFER='', $MSG='',
- $ZONE=99, $PAGE=99)
+ $DBH,$c, $IP='', $REFER='', $MSG='',
+ $ZONE=99, $PAGE=99)
////////////////////////////////////////////////////////
// open the template_path file and print it out
// after replacing each keyword by its correct value
|