|
From: mdw c. <myd...@li...> - 2001-08-28 13:39:27
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/include
Modified Files:
mydynaweb.libs.php templates.inc.php
Log Message:
Trying to fix the problem with undefined $DYNA_SESSION.
In fact this problem is due to the fact that vars ('$') are
not global in PHP, we must use constant (with the 'define' function)
to have global values.
* I've updated mydynaweb.libs.php to set DYNA_SESSION with the value of $DYNA_SESSION
if this var is set.
* Then I've updated templates.inc.php to call get_login_box with DYNA_SESION instead
of $DYNA_SESSION
Hope it will work... ;)
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/mydynaweb.libs.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- mydynaweb.libs.php 2001/07/27 15:49:17 1.18
+++ mydynaweb.libs.php 2001/08/28 13:39:24 1.19
@@ -41,6 +41,9 @@
define ("USER_LANG", $UserLang);
define ("DVISIT", $DYNAVISIT);
+if (isset($DYNA_SESSION)) {
+ define("DYNA_SESSION", $DYNA_SESSION);
+}
// defining the theme
switch(THEMES_BEHAVIOR)
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/templates.inc.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- templates.inc.php 2001/08/26 18:52:52 1.19
+++ templates.inc.php 2001/08/28 13:39:24 1.20
@@ -83,7 +83,7 @@
$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['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);
|
|
From: mdw c. <myd...@li...> - 2001-08-29 16:20:11
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/include Added Files: meminit.php Log Message: This script is dedicated to load shared stuff located in data structure such as DB or files. |
|
From: mdw c. <myd...@li...> - 2001-09-03 12:54:45
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/tools/events
Modified Files:
stats.php
Log Message:
Added the synopsys of two new functions that returns boxes.
This is done to provide much more stuff for building the website.
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/tools/events/stats.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- stats.php 2001/06/08 21:28:48 1.5
+++ stats.php 2001/09/03 12:54:44 1.6
@@ -141,4 +141,34 @@
}
}
+function get_whatsup_box($DBH)
+/*
+This function returns the "What's Up Box".
+That box would contains
+- last news posted
+- last comment posted
+- last page posted
+*/
+{
+ $BOX = '';
+
+ return ($BOX);
+}
+
+function get_global_stats_box($DBH)
+/*
+This function returns a box with number of
+elements in the site :
+- nr of piece of news recorded
+- nr of comments recorded
+- nr of pages recorded
+- nr of users
+- nr of pages viewed
+*/
+{
+ $BOX = '';
+
+ return ($BOX);
+}
+
?>
|
|
From: mdw c. <myd...@li...> - 2001-09-03 13:31:22
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/tools/events
Modified Files:
stats.php
Log Message:
Much more stuff...
not finished yet..
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/tools/events/stats.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- stats.php 2001/09/03 12:54:44 1.6
+++ stats.php 2001/09/03 13:31:21 1.7
@@ -159,7 +159,7 @@
/*
This function returns a box with number of
elements in the site :
-- nr of piece of news recorded
+- nr of news recorded
- nr of comments recorded
- nr of pages recorded
- nr of users
@@ -167,6 +167,43 @@
*/
{
$BOX = '';
+
+ // nr of news
+ $sql = "select count(*)
+ from news
+ where lang = '".USER_LANG."'";
+ $rqt = new query($DBH);
+ $rqt->query($DBH, $sql);
+ $row = $rqt->get_row();
+ $STATS["NEWS"] = $row[0];
+
+ // comments recorded
+ $sql = "select count(*)
+ from comments, news
+ where news.num_news = comments._num_news
+ and news.lang = '".USER_LANG."'";
+ $rqt = new query($DBH);
+ $rqt->query($DBH, $sql);
+ $row = $rqt->get_row();
+ $STATS["COMMENTS"] = $row[0];
+
+ // pages recorded
+ $sql = "select count(*)
+ from page
+ where lang = '".USER_LANG."'";
+ $rqt = new query($DBH);
+ $rqt->query($DBH, $sql);
+ $row = $rqt->get_row();
+ $STATS["PAGES"] = $row[0];
+
+ // pages viewed
+ $sql = "select count(*)
+ from page
+ where lang = '".USER_LANG."'";
+ $rqt = new query($DBH);
+ $rqt->query($DBH, $sql);
+ $row = $rqt->get_row();
+ $STATS["PAGES"] = $row[0];
return ($BOX);
}
|
|
From: mdw c. <myd...@li...> - 2001-09-04 21:30:45
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/templates/default
Modified Files:
main.html
Removed Files:
area_f.html area_h.html area_l.html box_f.html box_h.html
box_l.html controlpanel.html cp_f.html cp_h.html cp_l.html
item_f.html item_h.html item_l.html login.html search.html
Log Message:
*** MAJOR KERNEL MODIFICATIONS ***
The behavior of the templates engine has been enhanced.
Before, we needed to open and read template file each time
we wanted to send HTML output.
Now, with the new function, we are able to read a template file
once, and then access it through memory (thanks to the use of hash tables).
This makes pages to be sent really faster.
Precisely, I've added three functions in the library called
'templates.inc.php' :
* hashtable read_template (string $template_path)
=================================================
this function is to be called whenever you want to
put the content of a template file in a hash.
This the only place where the file is opened !
It returns a hashtable with the content of the file, splitted
according to the blocks defined in the templates.
For example a file like this :
<!-- BLOCK:FOO -->
my text here ~TEXT~
would make a hash like this :
$hash["FOO"] = "my text here ~TEXT~";
* string get_hash_template (string $hash_entry, hashtable $tokens)
==================================================================
returns the content of the string located in a particular
template hash entry with substituing its content with the tokens given.
In fact this function do the same as the old 'get_template' function but
it uses hash instead of opening the template file.
This saves IO time ;)
* void print_template_hash (...)
================================
Do the same as print_template but uses a hashtable instead of opening the file.
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/templates/default/main.html,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- main.html 2001/08/02 19:27:11 1.22
+++ main.html 2001/09/04 21:30:44 1.23
@@ -1,3 +1,4 @@
+<!-- BLOCK:ALL -->
<BASE HREF="~SITE_ROOT~">
<html>
@@ -19,7 +20,7 @@
A:hover {
text-decoration:underline;
- color:#6A749D;
+ color:#0000AA;
}
td,p,li {
@@ -33,7 +34,7 @@
<body bgcolor="#65596D" marginwidth="0" marginheight="0" leftmargin="0" rightmargin="0" topmargin="0"
- alink="#D5DBEF" vlink="#72527A" link="#A68EAC">
+ alink="#DDDDDD" vlink="#000000" link="#0000AA">
<center>~TOPBAR~</center>
|
|
From: mdw c. <myd...@li...> - 2001-09-04 21:31:15
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs
Modified Files:
about.php3
Log Message:
*** MAJOR KERNEL MODIFICATIONS ***
The behavior of the templates engine has been enhanced.
Before, we needed to open and read template file each time
we wanted to send HTML output.
Now, with the new function, we are able to read a template file
once, and then access it through memory (thanks to the use of hash tables).
This makes pages to be sent really faster.
Precisely, I've added three functions in the library called
'templates.inc.php' :
* hashtable read_template (string $template_path)
=================================================
this function is to be called whenever you want to
put the content of a template file in a hash.
This the only place where the file is opened !
It returns a hashtable with the content of the file, splitted
according to the blocks defined in the templates.
For example a file like this :
<!-- BLOCK:FOO -->
my text here ~TEXT~
would make a hash like this :
$hash["FOO"] = "my text here ~TEXT~";
* string get_hash_template (string $hash_entry, hashtable $tokens)
==================================================================
returns the content of the string located in a particular
template hash entry with substituing its content with the tokens given.
In fact this function do the same as the old 'get_template' function but
it uses hash instead of opening the template file.
This saves IO time ;)
* void print_template_hash (...)
================================
Do the same as print_template but uses a hashtable instead of opening the file.
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/about.php3,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- about.php3 2001/07/31 20:05:30 1.10
+++ about.php3 2001/09/04 21:30:44 1.11
@@ -18,6 +18,7 @@
$CONTENT = get_page(translate("ABOUT_THIS_WEBSITE", $DBH), ("<b><font size=\"+3\">".SITE_TITLE."</font></b>"), $TEXTE, $DBH);
-print_template(THEMES_PATH."/main.html", $CONTENT, translate("ABOUT_THIS_WEBSITE", $DBH), $DBH,"ABOUT");
+$h_template = read_template(THEMES_PATH."/main.html");
+print_template_hash($h_template["ALL"], $CONTENT, translate("ABOUT_THIS_WEBSITE", $DBH), $DBH,"ABOUT");
?>
|
|
From: mdw c. <myd...@li...> - 2001-09-04 21:31:15
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/include
Modified Files:
gui.inc.php mydynaweb.libs.php templates.inc.php
Log Message:
*** MAJOR KERNEL MODIFICATIONS ***
The behavior of the templates engine has been enhanced.
Before, we needed to open and read template file each time
we wanted to send HTML output.
Now, with the new function, we are able to read a template file
once, and then access it through memory (thanks to the use of hash tables).
This makes pages to be sent really faster.
Precisely, I've added three functions in the library called
'templates.inc.php' :
* hashtable read_template (string $template_path)
=================================================
this function is to be called whenever you want to
put the content of a template file in a hash.
This the only place where the file is opened !
It returns a hashtable with the content of the file, splitted
according to the blocks defined in the templates.
For example a file like this :
<!-- BLOCK:FOO -->
my text here ~TEXT~
would make a hash like this :
$hash["FOO"] = "my text here ~TEXT~";
* string get_hash_template (string $hash_entry, hashtable $tokens)
==================================================================
returns the content of the string located in a particular
template hash entry with substituing its content with the tokens given.
In fact this function do the same as the old 'get_template' function but
it uses hash instead of opening the template file.
This saves IO time ;)
* void print_template_hash (...)
================================
Do the same as print_template but uses a hashtable instead of opening the file.
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/gui.inc.php,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -3 -r1.26 -r1.27
--- gui.inc.php 2001/08/26 18:52:52 1.26
+++ gui.inc.php 2001/09/04 21:30:44 1.27
@@ -7,11 +7,8 @@
//
///////////////////////////////////////////////////////
-///////////////////////////////////////////////////////
-//
-// The Top Bar
-//
-///////////////////////////////////////////////////////
+
+///////////////////////// functions /////////////////////////
function top_bar_query($DBH,$query,$field_top_bar)
{
@@ -138,17 +135,14 @@
-function get_piece_of_news($title, $text, $image, $image_alt, $link, $nbhit, $num_news, $num_cmt, $num_byte, $DBH)
+function get_piece_of_news($title, $text, $image, $image_alt, $link,
+ $nbhit, $num_news, $num_cmt, $num_byte, $DBH)
{
-
- if (! file_exists(THEMES_PATH)) {
- $ERR = new beeper();
- $ERR->send_file_error(THEMES_PATH, "check that your tempaltes directory is defined in mydynaweb.init.php");
- return(0);
- }
+ // set the hash templates
- $news_template = THEMES_PATH . "/news.html";
+$NEWS_HASH_TEMPLATE = read_template(THEMES_PATH . "/news.html");
+
$VALUES['PAGE_BOX_LINES'] = PAGE_BOX_LINES;
$VALUES['PAGE_TEXTE_BACK'] = PAGE_TEXTE_BACK;
$VALUES['PAGE_TITRE_BACK'] = PAGE_TITRE_BACK;
@@ -163,10 +157,10 @@
$VALUES['COMMENTS'] = translate("COMMENTS",$DBH);
$VALUES['NBCOMMENT'] = $num_cmt;
$VALUES['READ_MORE'] = "+" . $num_byte . " bytes";
-
$VALUES['COMMENT'] = translate("COMMENT",$DBH);
$VALUES['EMAIL_FRIEND'] = translate("EMAIL_FRIEND",$DBH);
- return(get_template($news_template, $VALUES));
+
+ return(get_hash_template($NEWS_HASH_TEMPLATE["ALL"], $VALUES));
}
@@ -224,20 +218,18 @@
function get_newsletter_form($DBH)
{
-
-
- $head = THEMES_PATH . "/area_h.html";
- $line = THEMES_PATH . "/area_l.html";
- $foot = THEMES_PATH . "/area_f.html";
- $VALUES['S_TITLE'] = translate("NEWS_LETTER",$DBH);
- $form = get_template($head, $VALUES);
+ $BOX_HASH_TEMPLATE = read_template(THEMES_PATH . "/box.html");
- $VALUES['TEXT'] = translate("ENTER_EMAIL", $DBH);
- $VALUES['VALUE'] = "<form name='emails' action='save_email.php'><input type='text' name='email' size='13'></form>";
- $form .= get_template($line, $VALUES);
- $form .= get_template($foot, $VALUES);
-
+ $VALUES['TITLE'] = translate("NEWS_LETTER",$DBH);
+ $form = get_hash_template($BOX_HASH_TEMPLATE["HEAD"], $VALUES);
+ $VALUES['CONTENT'] = translate("ENTER_EMAIL", $DBH);
+ $VALUES['CONTENT'] .= "<P>
+ <form name='emails' action='save_email.php'>
+ <input type='text' name='email' size='13'>
+ </form>";
+ $form .= get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES);
+ $form .= get_hash_template($BOX_HASH_TEMPLATE["FOOT"], $VALUES);
return($form);
}
@@ -245,46 +237,69 @@
function get_searchengine($seek, $DBH)
{
+ $BOX_HASH_TEMPLATE = read_template(THEMES_PATH . "/box.html");
+
if ($seek) {
-
- $search_tmpl = THEMES_PATH . "/search.html";
- $VALUES['NAME'] = translate('SEARCH', $DBH);
- $VALUES['VALUE'] = "<FORM name=\"seek\" action=\"seek.php3\"><font size='-1'><input type=\"text\" size=\"13\" name=\"kw\"></font></FORM>";
- $pannel = get_template($search_tmpl, $VALUES);
+ $VALUES['TITLE'] = translate('SEARCH', $DBH);
+ $VALUES['CONTENT'] = "<FORM name=\"seek\" action=\"seek.php3\">
+ <font size='-1'>
+ <input type=\"text\" size=\"13\" name=\"kw\">
+ </font>
+ </FORM>";
+ $pannel = get_hash_template($BOX_HASH_TEMPLATE["HEAD"], $VALUES) .
+ get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES) .
+ get_hash_template($BOX_HASH_TEMPLATE["FOOT"], $VALUES);
- }
+ }
return $pannel;
+
+ die();
}
function get_login_box($session, $show_login, $DBH)
{
+ $BOX_HASH_TEMPLATE = read_template(THEMES_PATH . "/box.html");
+
$login_box = "";
if ($show_login) {
-
- $login_tmpl = THEMES_PATH . "/login.html";
- $VALUES['NAME'] = translate('MEMBERS', $DBH);
+
+ $VALUES['TITLE'] = translate('MEMBERS', $DBH);
$login = get_login_from_session ($session, $DBH);
if (! $login) {
- $VALUES['VALUE'] = "<form name='login_form' action='set_session.php3' METHOD='POST'>
- <table align='center'>
- <tr><td valign=\"top\" align='center'><font size='-1'><input type=\"text\" name=\"user\" size=\"13\" value=\"".translate("USERNAME",$DBH)."\"></font></td></tr>
- <tr><td valign=\"top\" align='center'><font size='-1'><input type=\"password\" name=\"pass\" size=\"13\" value=\"password\"></font></td></tr>
- <tr><td valign='top' align=\"center\"><font size='-1'><input type=\"submit\" value=\"".translate("LOGIN",$DBH)."\"></font></td></tr>
- </table>
- </form>";
+ $VALUES['CONTENT'] = "<form name='login_form' action='set_session.php3' METHOD='POST'>
+ <table align='center'>
+ <tr><td valign=\"top\" align='center'>
+ <font size='-1'>
+ <input type=\"text\" name=\"user\" size=\"13\" value=\"".
+ translate("USERNAME",$DBH).
+ "\"></font></td></tr>
+ <tr><td valign=\"top\" align='center'>
+ <font size='-1'>
+ <input type=\"password\" name=\"pass\" size=\"13\" value=\"password\">
+ </font>
+ </td></tr>
+ <tr><td valign='top' align=\"center\"><font size='-1'>
+ <input type=\"submit\" value=\"".translate("LOGIN",$DBH)."\"></font>
+ </td></tr>
+ </table>
+ </form>";
} else {
- $VALUES['VALUE'] = translate('LOGGED_IN_AS', $DBH) . " $login<br><a href=\"logout\">[" . translate('LOGOUT', $DBH) . "]</a>";
+ $VALUES['CONTENT'] = translate('LOGGED_IN_AS', $DBH) .
+ " $login<br><a href=\"logout.php\">[" .
+ translate('LOGOUT', $DBH) . "]</a>";
}
- $login_box = get_template($login_tmpl, $VALUES);
+ $login_box = get_hash_template($BOX_HASH_TEMPLATE["HEAD"], $VALUES) .
+ get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES) .
+ get_hash_template($BOX_HASH_TEMPLATE["FOOT"], $VALUES);
}
return $login_box;
@@ -292,38 +307,36 @@
function get_control_panel($date, $flag, $time, $DBH)
{
-
-
- $head = THEMES_PATH . "/cp_h.html";
- $line = THEMES_PATH . "/cp_l.html";
- $foot = THEMES_PATH . "/cp_f.html";
+ $BOX_HASH_TEMPLATE = read_template(THEMES_PATH . "/box.html");
+
- $VALUES['S_TITLE'] = translate("CONTROL_PANEL",$DBH);
- $pannel = get_template($head, $VALUES);
+ $VALUES['TITLE'] = translate("CONTROL_PANEL",$DBH);
+ $pannel = get_hash_template($BOX_HASH_TEMPLATE["HEAD"], $VALUES);
if ($date) {
$today = date("Y/m/d");
- $VALUES['NAME'] = translate("TODAY",$DBH);
- $VALUES['VALUE'] = $today;
- $pannel .= get_template($line, $VALUES);
+ $VALUES['CONTENT'] = translate("TODAY",$DBH);
+ $VALUES['CONTENT'] .= " : " . $today . "<br>";
+ $pannel .= get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES);
}
if ($time) {
$date = date("H:i:s");
- $VALUES['NAME'] = translate("TIME",$DBH);
- $VALUES['VALUE'] = $date;
- $pannel .= get_template($line, $VALUES);
+ $VALUES['CONTENT'] = translate("TIME",$DBH);
+ $VALUES['CONTENT'] .= " : " . $date . "<br>";
+ $pannel .= get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES);
}
if ($flag) {
- $sql = "select name, flag from languages where id_lang='".USER_LANG."'";
- $rqt = new query($DBH);
- $rqt->query($DBH,$sql);
- $user_lang = $rqt->getrow();
- $flag = "<img border=\"0\" src=\"$user_lang[1]\" alt=\"$user_lang[0]\">";
- $VALUES['NAME'] = translate('LANGUAGE', $DBH);
- $VALUES['VALUE'] = "<a href=\"choose_da_language.php3\">$user_lang[0]</a>";
- $pannel .= get_template($line, $VALUES);
+ $sql = "select name, flag from languages where id_lang='".USER_LANG."'";
+ $rqt = new query($DBH);
+ $rqt->query($DBH,$sql);
+ $user_lang = $rqt->getrow();
+ $flag = "<img border=\"0\" src=\"$user_lang[1]\" alt=\"$user_lang[0]\">";
+ $VALUES['CONTENT'] = translate('LANGUAGE', $DBH);
+ $VALUES['CONTENT'] .= " : <a
+ href=\"choose_da_language.php3\">$user_lang[0]</a><br>";
+ $pannel .= get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES);
}
@@ -331,30 +344,39 @@
$the_theme = ACTIVE_THEME;
if (!strlen($the_theme)) { $the_theme = 'default'; }
$the_theme = "<a href='themes.php'>$the_theme</a>";
- $VALUES['NAME'] = '';
- $VALUES['VALUE'] = translate("THEME",$DBH) . " : " . $the_theme;
- $pannel .= get_template($line, $VALUES);
+ $VALUES['CONTENT'] = translate("THEME",$DBH) . " : " . $the_theme .
+ "<br>";
+ $pannel .= get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES);
}
if ($seek) {
- $VALUES['NAME'] = translate('SEARCH', $DBH);
- $VALUES['VALUE'] = "<FORM name=\"seek\" action=\"seek.php3\"><input type=\"text\" size=\"10\" name=\"kw\"></FORM>";
- $pannel .= get_template($line, $VALUES);
+ $VALUES['CONTENT'] = translate('SEARCH', $DBH);
+ $VALUES['CONTENT'] .= "<p>
+ <FORM name=\"seek\" action=\"seek.php3\"><input type=\"text\" size=\"10\" name=\"kw\"></FORM>";
+ $pannel .= get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES);
}
if ($login) {
- $VALUES['NAME'] = translate('MEMBERS', $DBH);
- $VALUES['VALUE'] = "<table><form name='foo' action='set_session.php3'>
- <tr><td valign=\"top\"><input type=\"text\" name=\"user\" size=\"8\" value=\"".translate("USERNAME",$DBH)."\"></td></tr>
- <tr><td valign=\"top\"><input type=\"password\" name=\"pass\" size=\"8\" value=\"password\"></td></tr>
- <tr><td align=\"center\"><input type=\"submit\" value=\"".translate("LOGIN",$DBH).":\"></td></tr>
- </form></table>";
- $pannel .= get_template($line, $VALUES);
+ $VALUES['CONTENT'] = translate('MEMBERS', $DBH);
+ $VALUES['CONTENT'] .= "<table><form name='foo' action='set_session.php3'>
+ <tr><td valign=\"top\">
+ <input type=\"text\" name=\"user\" size=\"8\" value=\"".
+ translate("USERNAME",$DBH).
+ "\"></td></tr>
+ <tr><td valign=\"top\">
+ <input type=\"password\" name=\"pass\" size=\"8\" value=\"password\">
+ </td></tr>
+ <tr><td align=\"center\">
+ <input type=\"submit\" value=\"".
+ translate("LOGIN",$DBH).
+ ":\"></td></tr>
+ </form></table>";
+ $pannel .= get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES);
}
- $pannel .= get_template($foot, $VALUES);
+ $pannel .= get_hash_template($BOX_HASH_TEMPLATE["FOOT"], $VALUES);
return($pannel);
}
@@ -370,35 +392,26 @@
function get_headlines($DBH, $site) {
- if (! file_exists(THEMES_PATH)) {
- $ERR = new beeper();
- $ERR->send_file_error(THEMES_PATH, "check that your tempaltes directory is defined in mydynaweb.init.php");
- return(0);
- }
-
+ $BOX_HASH_TEMPLATE = read_template(THEMES_PATH . "/box.html");
+
if (HEADLINES != "")
{
$headlines = new grabber($DBH);
$links = $headlines->getLinks($site);
- $head = THEMES_PATH . "/box_h.html";
- $line = THEMES_PATH . "/box_l.html";
- $foot = THEMES_PATH . "/box_f.html";
-
-
// getting the head of the box
- $VALUES['S_TITLE'] = $headlines->sites[$site][0];
- $VALUES['S_URL'] = $headlines->sites[$site][1];
- $PAGE = get_template($head, $VALUES);
+ $VALUES['TITLE'] = "<A HREF='" . $headlines->sites[$site][1] . "'>" .
+ $headlines->sites[$site][0] .
+ "</A>";
+ $PAGE = get_hash_template($BOX_HASH_TEMPLATE["HEAD"], $VALUES);
// putting the lines
while (list($title,$link) = each($links)) {
- $VALUES['LINK'] = $link;
- $VALUES['TITLE'] = $title;
- $PAGE .= get_template($line, $VALUES);
+ $VALUES['CONTENT'] = "<A HREF='$link'>$title</A>";
+ $PAGE .= get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES) . "<br>";
}
- $PAGE .= get_template($foot, $VALUES);
+ $PAGE .= get_hash_template($BOX_HASH_TEMPLATE["FOOT"], $VALUES);
}
else
{
@@ -445,11 +458,8 @@
function get_item_box ($num_item_box, $DBH)
{
-
- $head = THEMES_PATH . "/item_h.html";
- $line = THEMES_PATH . "/item_l.html";
- $foot = THEMES_PATH . "/item_f.html";
-
+ $BOX_HASH_TEMPLATE = read_template(THEMES_PATH . "/box.html");
+
$sql = "select titre, icon
from item_box_titles
where num_titre = $num_item_box";
@@ -476,9 +486,16 @@
else {
$VALUES['ICON'] = "images/pixel.gif";
}
+
- $VALUES['S_TITLE'] = $titre[0];
- $BOX = get_template ($head, $VALUES);
+ $TABLE_TITRE = "<table width='100%' border='0' cellpadding='2' cellspacing='0'><tr>
+ <td align='center' valign='middle' width='20'><img src='".$VALUES['ICON']."' width='16' height='16'></td>
+ <td align='center' width='100'>
+ <font size='-1'><b>$titre[0]</b></font></td></tr>
+ </table>";
+
+ $VALUES['TITLE'] = $TABLE_TITRE;
+ $BOX = get_hash_template ($BOX_HASH_TEMPLATE["HEAD"], $VALUES);
$sql = "select item_libelle, item_url, target
from item_box_content
@@ -490,15 +507,11 @@
while ($infos = $q->getrow()) {
- $VALUES['LINK'] = $infos[1];
- $VALUES['TITLE'] = $infos[0];
- $VALUES['TARGET'] = $infos[2];
-
- $BOX .= get_template($line, $VALUES);
+ $VALUES['CONTENT'] = "<A HREF='$infos[1]' TARGET='$infos[2]'>$infos[0]</A>";
+ $BOX .= get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES) . "<br>";
}
-
- $BOX .= get_template($foot, $VALUES);
+ $BOX .= get_hash_template($BOX_HASH_TEMPLATE["FOOT"], $VALUES);
return ($BOX);
}
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/mydynaweb.libs.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- mydynaweb.libs.php 2001/08/28 13:39:24 1.19
+++ mydynaweb.libs.php 2001/09/04 21:30:44 1.20
@@ -1,33 +1,5 @@
<?PHP
-/******************************************
-
- LIBRARIES TO USE
-
- *****************************************/
-
-include DYNA_ROOT . "/$db_file";
-include DYNA_ROOT . "/include/templates.inc.php";
-include DYNA_ROOT . "/include/datatypes.php";
-include DYNA_ROOT . "/include/gui.inc.php";
-include DYNA_ROOT . "/tools/content/graphic.php";
-include DYNA_ROOT . "/tools/content/mailer.php";
-include DYNA_ROOT . "/include/utils.inc.php";
-include DYNA_ROOT . "/tools/events/stats.php";
-include DYNA_ROOT . "/tools/events/session.php";
-include DYNA_ROOT . "/include/translate.inc.php";
-include DYNA_ROOT . "/include/objects.inc.php";
-include DYNA_ROOT . "/tools/events/alert.php";
-include DYNA_ROOT . "/tools/events/cache.php";
-include DYNA_ROOT . "/tools/admin/script_creator.php";
-include DYNA_ROOT . "/tools/content/rdf_grabber.php";
-include DYNA_ROOT . "/tools/content/url_grabber.php";
-include DYNA_ROOT . "/tools/content/rdf_maker.php";
-include DYNA_ROOT . "/tools/content/quoter.php";
-
-
-
-
/*****************************************
ENVIRONEMENT SETTINGS
@@ -80,5 +52,34 @@
}
+
+
+/******************************************
+
+ LIBRARIES TO USE
+
+ *****************************************/
+
+include DYNA_ROOT . "/$db_file";
+include DYNA_ROOT . "/include/templates.inc.php";
+include DYNA_ROOT . "/include/datatypes.php";
+include DYNA_ROOT . "/include/gui.inc.php";
+include DYNA_ROOT . "/tools/content/graphic.php";
+include DYNA_ROOT . "/tools/content/mailer.php";
+include DYNA_ROOT . "/include/utils.inc.php";
+include DYNA_ROOT . "/tools/events/stats.php";
+include DYNA_ROOT . "/tools/events/session.php";
+include DYNA_ROOT . "/include/translate.inc.php";
+include DYNA_ROOT . "/include/objects.inc.php";
+include DYNA_ROOT . "/tools/events/alert.php";
+include DYNA_ROOT . "/tools/events/cache.php";
+include DYNA_ROOT . "/tools/admin/script_creator.php";
+include DYNA_ROOT . "/tools/content/rdf_grabber.php";
+include DYNA_ROOT . "/tools/content/url_grabber.php";
+include DYNA_ROOT . "/tools/content/rdf_maker.php";
+include DYNA_ROOT . "/tools/content/quoter.php";
+
+
+
?>
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/templates.inc.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- templates.inc.php 2001/08/28 13:39:24 1.20
+++ templates.inc.php 2001/09/04 21:30:44 1.21
@@ -10,6 +10,117 @@
*******************************************/
+function init_main_values($template_path, $content, $titre, $DBH,$c, $IP='', $REFER='', $MSG='', $ZONE=99, $PAGE=99)
+///////////////////////////////////////////////////////////////
+// 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);
+
+ $VALUES["NEWS_LETTER"] = get_newsletter_form($DBH);
+ $VALUES["SITE_TITLE"] = SITE_TITLE;
+ $VALUES["PAGE_TITLE"] = $titre;
+ $VALUES["WEBMASTER_EMAIL"] = WEBMASTER_EMAIL;
+ $VALUES["SITE_ROOT"] = SITE_ROOT;
+ $VALUES["LINKBAR"] = get_troving_bar($DBH);
+ $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);
+}
+
+
+function read_template($template_path)
+//////////////////////////////////////////////////////////////
+// sukria - 04/09/2001 - creation
+// read a template file and put its content in an hashtable.
+// keys are the block defined in the file by BLOCK:XXX
+// statement where XXX is the name of the block
+// then returns the hashtable
+//////////////////////////////////////////////////////////////
+{
+
+ if (! file_exists($template_path)) {
+ print "$template_path does not exists !";
+ die();
+ }
+
+ $file = file($template_path);
+ $hash_file = array();
+ $key = 'ALL';
+
+ for ($i=0;$i<sizeof($file);$i++) {
+ if (ereg("<!-- BLOCK:(.*) -->", $file[$i], $regs)) {
+ $key = $regs[1];
+ }
+ else {
+ $hash_file[$key] .= $file[$i];
+ }
+ }
+
+ return ($hash_file);
+}
+
+function get_hash_template($template_hash_entry, $tokens)
+///////////////////////////////////////////////////////////////
+// sukria - 04/09/2001
+// this fun return the substituted content of the
+// hash $template_hash_entry with the entries of
+// the hash $tokens :
+// ~KEY~ in the file $template is replaced with $tokens["KEY"]
+///////////////////////////////////////////////////////////////
+{
+
+
+ $OUT = "";
+
+
+ $words = explode("~", $template_hash_entry);
+
+ if (sizeof($words) > 1) {
+ $line = $template_hash_entry;
+ for ($j=0; $j<sizeof($words); $j++) {
+ if ($j % 2 != 0) {
+ $line = str_replace("~$words[$j]~", $tokens[$words[$j]], $line);
+ }
+ }
+ $OUT .= $line;
+ }
+ else {
+ $OUT .= ($template_hash_entry);
+ }
+
+
+ return($OUT);
+
+}
+
+
+
function get_template($template_path, $tokens)
///////////////////////////////////////////////////////////////
// sukria - 28/03/2001
@@ -46,73 +157,92 @@
}
-
-// open the template_path file and print it out
+function print_template_hash( $template_hash_entry, $content, $titre,
+ $DBH,$c, $IP='', $REFER='', $MSG='',
+ $ZONE=99, $PAGE=99)
+////////////////////////////////////////////////////////
+// open the t and print it out $template_hash_entry
// after replacing each keyword by its correct value
-
-function print_template($template_path, $content, $titre, $DBH,$c, $IP='', $REFER='', $MSG='', $ZONE=99, $PAGE=99)
+////////////////////////////////////////////////////////
{
+
+ $VALUES = init_main_values($template_hash_entry, $content, $titre,
+ $DBH,$c, $IP='', $REFER='', $MSG='',
+ $ZONE=99, $PAGE=99);
- // get the page name
- count_one_more($DBH, $IP, $REFER);
+ // get the page name
+ count_one_more($DBH, $IP, $REFER);
- $output = "";
+ $output = "";
- $news_sites = explode(",", HEADLINES);
- for($i=0;$i<sizeof($news_sites);$i++) {
- $VALUES["HEADLINES"] .= get_headlines($DBH, $news_sites[$i]);
- }
-
+ $file = explode("\n", $template_hash_entry);
+
+ for ($i=0; $i<sizeof($file); $i++) {
+
+ $words = explode("~", $file[$i]);
+
+ if (sizeof($words) > 1) {
+ $line = $file[$i];
+ for ($j=0; $j<sizeof($words); $j++) {
+ if ($j % 2 != 0) {
+ $line = str_replace("~$words[$j]~", $VALUES[$words[$j]], $line);
+ }
+ }
+ print $line;
+ $output .= $line;
+ }
+ else {
+ print ($file[$i]);
+ $output .= $file[$i];
+ }
+ }
- $VALUES["TOPBAR"] = top_bar($DBH,$c);
+ $ca = new cache($DBH);
+ $ca->write_file("$c.".USER_LANG.".".ACTIVE_THEME.".html",$output);
- $VALUES["NEWS_LETTER"] = get_newsletter_form($DBH);
- $VALUES["SITE_TITLE"] = SITE_TITLE;
- $VALUES["PAGE_TITLE"] = $titre;
- $VALUES["WEBMASTER_EMAIL"] = WEBMASTER_EMAIL;
- $VALUES["SITE_ROOT"] = SITE_ROOT;
- $VALUES["LINKBAR"] = get_troving_bar($DBH);
- $VALUES["PAGE_TITLE"]=$titre;
- $VALUES["QUOTATION"]=get_quote();
- $VALUES["MESSAGE"] = $MSG;
+ return;
+}
- $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);
- $file = file($template_path);
-
- $VALUES["ZONE"] = $ZONE;
- $VALUES["PAGE"] = $PAGE;
+
+function print_template($template_path, $content, $titre,
+ $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
+////////////////////////////////////////////////////////
+{
+
+ $VALUES = init_main_values($template_path, $content, $titre, $DBH,$c, $IP='', $REFER='', $MSG='', $ZONE=99, $PAGE=99);
+
+ // get the page name
+ count_one_more($DBH, $IP, $REFER);
+
+ $output = "";
- for ($i=0; $i<sizeof($file); $i++) {
+ $file = file($template_path);
+ for ($i=0; $i<sizeof($file); $i++) {
- $words = explode("~", $file[$i]);
+ $words = explode("~", $file[$i]);
if (sizeof($words) > 1) {
- $line = $file[$i];
- for ($j=0; $j<sizeof($words); $j++) {
- if ($j % 2 != 0) {
- $line = str_replace("~$words[$j]~", $VALUES[$words[$j]], $line);
- }
- }
- print $line;
- $output .= $line;
- }
- else {
- print ($file[$i]);
- $output .= $file[$i];
- }
- }
- $ca = new cache($DBH);
+ $line = $file[$i];
+ for ($j=0; $j<sizeof($words); $j++) {
+ if ($j % 2 != 0) {
+ $line = str_replace("~$words[$j]~", $VALUES[$words[$j]], $line);
+ }
+ }
+ print $line;
+ $output .= $line;
+ }
+ else {
+ print ($file[$i]);
+ $output .= $file[$i];
+ }
+ }
+
+ $ca = new cache($DBH);
$ca->write_file("$c.".USER_LANG.".".ACTIVE_THEME.".html",$output);
return;
|
|
From: mdw c. <myd...@li...> - 2001-09-05 08:19:17
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/templates/dynadot Added Files: box.html Log Message: The new template for each box item |
|
From: mdw c. <myd...@li...> - 2001-09-06 14:42:45
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/templates/default
Modified Files:
main.html news.html
Added Files:
box.html
Log Message:
Adding some template stuff...
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/templates/default/main.html,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- main.html 2001/09/04 21:30:44 1.23
+++ main.html 2001/09/06 14:42:44 1.24
@@ -25,8 +25,37 @@
td,p,li {
font-family: tahoma,arial,helvetica;
+ padding-left: 0;
}
+ .ombre { border-bottom : thick solid #333333;
+ border-left : thick solid #333333;
+ border-width : 1 ; }
+
+ .interne { background-color : #CCCCDD;
+
+
+ font-family : tahoma,arial,helvetica;
+ font-size : 8pt ;
+ color: #FFFFFF;
+ border-top : thick solid #666699;
+ border-bottom : thick solid #CCCCFF;
+ border-left : thick solid #CCCCFF;
+ border-right : thick solid #666699;
+ border-width : 1 ;
+ padding-left: 3;
+ padding-right: 4;
+ }
+
+ .iconame { padding-left : 2 ;
+ padding-right : 2 ;
+ font-family : tahoma,arial,helvetica;
+ font-size : 8pt ;
+ color : #ffffff ;
+ letter-spacing : 1 ;
+ text-align : center ;}
+
+
</style>
</head>
@@ -34,7 +63,7 @@
<body bgcolor="#65596D" marginwidth="0" marginheight="0" leftmargin="0" rightmargin="0" topmargin="0"
- alink="#DDDDDD" vlink="#000000" link="#0000AA">
+ alink="#000000" vlink="#000000" link="#0000AA">
<center>~TOPBAR~</center>
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/templates/default/news.html,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- news.html 2001/06/28 15:25:48 1.9
+++ news.html 2001/09/06 14:42:44 1.10
@@ -28,7 +28,7 @@
</td>
<td align="right" width="280">
- <font size="-2" face="tahoma,arial,helvetica" color="#6A749D">[<a href="comment.php?news=~NUMNEWS~" color="#6A749D">~READ_MORE~</a>]</font>
+ <font size="-2" face="tahoma,arial,helvetica" color="#6A749D">[<a href="comment.php?news=~NUMNEWS~" color="#6A749D">Détails (~READ_MORE~)</a>]</font>
<font size="-2" face="tahoma,arial,helvetica" color="#6A749D">[<a href="add_comment.php?num_news=~NUMNEWS~">~COMMENT~</a>]</font>
|
|
From: mdw c. <myd...@li...> - 2001-09-06 22:07:55
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/templates/default
Modified Files:
box.html main.html
Log Message:
Nice boxes !
Just use CSS to make 3D faked boxes... looks good ;)
NOTE : it doesn't looks good under netscape <= 4.7 (best viwed with Mozilla 0.9.x)
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/templates/default/box.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- box.html 2001/09/06 14:42:44 1.1
+++ box.html 2001/09/06 22:07:52 1.2
@@ -1,5 +1,5 @@
<!-- BLOCK:HEAD -->
-<TABLE CELLSPACING="2" CLASS="ombre" WIDTH="100%" BGCOLOR="#9999CC"
+<TABLE CELLSPACING="0" CLASS="ombre" WIDTH="100%" BGCOLOR="#9999CC"
ALIGN="center" NOWRAP>
<TR>
<TD CLASS="iconame"> ~TITLE~ </TD>
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/templates/default/main.html,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -3 -r1.24 -r1.25
--- main.html 2001/09/06 14:42:44 1.24
+++ main.html 2001/09/06 22:07:54 1.25
@@ -28,20 +28,25 @@
padding-left: 0;
}
- .ombre { border-bottom : thick solid #333333;
+ .ombre {
+ border-bottom : thick solid #333333;
border-left : thick solid #333333;
+ border-right : thick solid #AAAADD;
+ border-top : thick solid #AAAADD;
border-width : 1 ; }
- .interne { background-color : #CCCCDD;
-
-
+ .interne {
+
+ background-color : #CCCCDD;
font-family : tahoma,arial,helvetica;
- font-size : 8pt ;
- color: #FFFFFF;
- border-top : thick solid #666699;
- border-bottom : thick solid #CCCCFF;
- border-left : thick solid #CCCCFF;
- border-right : thick solid #666699;
+ font-size : 9pt ;
+ color: #000000;
+
+ border-bottom : thick solid #666699;
+ border-left : thick solid #666699;
+ border-top : thick solid #CCCCFF;
+ border-right : thick solid #CCCCFF;
+
border-width : 1 ;
padding-left: 3;
padding-right: 4;
@@ -50,10 +55,11 @@
.iconame { padding-left : 2 ;
padding-right : 2 ;
font-family : tahoma,arial,helvetica;
- font-size : 8pt ;
- color : #ffffff ;
+ font-size : 9pt ;
+ color : #000000 ;
letter-spacing : 1 ;
- text-align : center ;}
+ text-align : center ;
+ }
</style>
|
|
From: mdw c. <myd...@li...> - 2001-09-06 22:56:19
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/templates/default
Modified Files:
box.html main.html news.html topbar.html
Log Message:
The new default theme is Ready !
It is really smart now :)
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/templates/default/box.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- box.html 2001/09/06 22:07:52 1.2
+++ box.html 2001/09/06 22:56:18 1.3
@@ -1,5 +1,5 @@
<!-- BLOCK:HEAD -->
-<TABLE CELLSPACING="0" CLASS="ombre" WIDTH="100%" BGCOLOR="#9999CC"
+<TABLE CELLSPACING="0" CLASS="ombre" WIDTH="100%" BGCOLOR="#6A749D"
ALIGN="center" NOWRAP>
<TR>
<TD CLASS="iconame"> ~TITLE~ </TD>
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/templates/default/main.html,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -3 -r1.25 -r1.26
--- main.html 2001/09/06 22:07:54 1.25
+++ main.html 2001/09/06 22:56:18 1.26
@@ -27,14 +27,56 @@
font-family: tahoma,arial,helvetica;
padding-left: 0;
}
+ .foot {
+ border-left : thick solid #333333;
+ border-right : thick solid #AAAADD;
+ border-top : thick solid #FFFFFF;
+ border-bottom : thick solid #333333;
+ border-width : 1 ; }
+
+ .corps {
+ border-left : thick solid #333333;
+ border-right : thick solid #AAAADD;
+ border-top : thick solid #FFFFFF;
+ border-bottom : thick solid #FFFFFF;
+ border-width : 1 ; }
+
+ .bandeau {
+ border-left : thick solid #333333;
+ border-right : thick solid #AAAADD;
+ border-top : thick solid #FFFFFF;
+ border-bottom : thick solid #FFFFFF;
+ border-width : 1 ; }
+ .topbar {
+ border-left : thick solid #333333;
+ border-top : thick solid #AAAADD;
+ border-width : 1 ; }
+
+
.ombre {
- border-bottom : thick solid #333333;
+ border-bottom : thick solid #555555;
border-left : thick solid #333333;
border-right : thick solid #AAAADD;
border-top : thick solid #AAAADD;
border-width : 1 ; }
+ .baguette {
+
+ background-color : #CCCCDD;
+ font-family : tahoma,arial,helvetica;
+ font-size : 8pt ;
+ color: #000000;
+
+ border-bottom : thick solid #666699;
+ border-left : thick solid #666699;
+ border-top : thick solid #CCCCFF;
+ border-right : thick solid #CCCCFF;
+
+ border-width : 1 ;
+ }
+
+
.interne {
background-color : #CCCCDD;
@@ -56,7 +98,7 @@
padding-right : 2 ;
font-family : tahoma,arial,helvetica;
font-size : 9pt ;
- color : #000000 ;
+ color : #EEEEEE ;
letter-spacing : 1 ;
text-align : center ;
}
@@ -74,7 +116,7 @@
<center>~TOPBAR~</center>
-<table width="800" cellpadding="0" border="0" cellspacing="0" bgcolor="#ffffff" align="center">
+<table class="bandeau" width="800" cellpadding="0" border="0" cellspacing="0" bgcolor="#ffffff" align="center">
<tr>
<td align="left" valign="top">
<br>
@@ -91,7 +133,7 @@
</table>
-<table width="800" align="center" cellpadding="0" border="0" cellspacing="0" bgcolor="#ffffff">
+<table class="corps" width="800" align="center" cellpadding="0" border="0" cellspacing="0" bgcolor="#ffffff">
<tr>
@@ -103,10 +145,6 @@
~LINK_BOXES~
</td>
-
-<td bgcolor="#ffffff" width="20"><img src="images/pixel.gif" width="20" height="1"></td>
-
-
<td valign="top" bgcolor="#ffffff" align="center" width="400">
<font color="#AA0000"><b>~MESSAGE~</b></font>
@@ -115,7 +153,6 @@
</td>
-<td bgcolor="#ffffff" width="20"><img src="images/pixel.gif" width="20" height="1"></td>
<td valign="top" align="center" width="120">
@@ -136,27 +173,21 @@
</tr>
</table>
-<p>
+<table class="foot" border=0 cellpadding="1" cellspacing="0" width="800" align="center" bgcolor="#FFFFFF">
+<tr><td colspan="4"><br><br><br></td></tr>
-<table border=0 cellpadding="1" cellspacing="0" width="800" align="center">
-<tr><td bgcolor="#D5DBEF">
-<table border="0" cellpadding="0" cellspacing="0" width="800" align="center">
-<tr><td bgcolor="#ffffff" colspan="0" width="100%" >
-<table cellspacing="5" width="100%" cellpadding="0">
<tr><td align="left">
-
-<center><a href="http://mydynaweb.sourceforge.net/"><img src="images/poweredbymydynaweb.gif" alt="MyDynaWeb Powered" border="0"></a></center>
-
-</td>
-
+<center><a href="http://mydynaweb.sourceforge.net/"><img src="images/poweredbymydynaweb.gif" alt="MyDynaWeb Powered" border="0"></a></center></td>
<td> </td>
-
-<td align="left">
+<td align="right">
<font size='-2' face='tahoma,arial,helvetica'>~QUOTATION~</font>
-</td></tr></table>
-</td></tr></table>
-</td></tr></table>
-
-
+</td>
+<td> </td>
+</tr>
+<tr><td colspan="4"> </td></tr>
+</table>
+<p>
+
+</P>
</body>
</html>
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/templates/default/news.html,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- news.html 2001/09/06 14:42:44 1.10
+++ news.html 2001/09/06 22:56:18 1.11
@@ -18,28 +18,26 @@
</td></tr>
</table>
- <table with="480" border="0" cellspacing="0" cellpadding="1" bgcolor="#B1BAD7"><tr><td>
- <table with="480" border="0" cellspacing="0" cellpadding="0" bgcolor="#EEEEEE"><tr><td align="right">
- <table with="480" border="0" cellspacing="1" cellpadding="0" bgcolor="#EEEEEE"><tr>
-
- <td align="left" width="200">
-
- <font size="-2" face="tahoma,arial,helvetica" color="#6A749D"><b>~NBHIT~ ~HITS~- ~NBCOMMENT~ ~COMMENTS~</b></font>
+ <table class="baguette" width="478" border="0" cellpadding=0 cellspacing="0" bgcolor="#6A749D">
+ <tr valign="top">
+
+ <td valign="top" align="left" width="200">
+
+ <font size="-2" face="tahoma,arial,helvetica" color="#6A749D"><b>~NBHIT~ ~HITS~- ~NBCOMMENT~ ~COMMENTS~</b></font>
</td>
-
- <td align="right" width="280">
- <font size="-2" face="tahoma,arial,helvetica" color="#6A749D">[<a href="comment.php?news=~NUMNEWS~" color="#6A749D">Détails (~READ_MORE~)</a>]</font>
-
- <font size="-2" face="tahoma,arial,helvetica" color="#6A749D">[<a href="add_comment.php?num_news=~NUMNEWS~">~COMMENT~</a>]</font>
-
- <font size="-2" face="tahoma,arial,helvetica" color="#6A749D">[<a href="forward.php?news=~NUMNEWS~">~EMAIL_FRIEND~</a>]</font>
- </td>
+ <td valign="top" align="right" width="280">
+ <B>
+ <a href="comment.php?news=~NUMNEWS~" color="#6A749D"><font
+ size="-2" face="tahoma,arial,helvetica" color="#6A749D">[Détails : ~READ_MORE~]</font></a>
+
+ <a href="add_comment.php?num_news=~NUMNEWS~"><font size="-2"
+ face="tahoma,arial,helvetica" color="#6A749D">[~COMMENT~]</font></a>
+
+ <a href="forward.php?news=~NUMNEWS~"><font size="-2"
+ face="tahoma,arial,helvetica" color="#6A749D">[~EMAIL_FRIEND~]</font></a>
+ </B>
+ </td>
</tr>
-
- <tr>
- <td width="480" colspan="2"><img src="images/pixel.gif" width="480" height="1"></td>
- </tr>
-
+ <tr height="1"><td colspan="2"><img src="images/pixel.gif" height="3"></td></tr>
</table>
- </td></tr></table>
- </td></tr></table>
+
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/templates/default/topbar.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- topbar.html 2001/05/15 22:25:36 1.3
+++ topbar.html 2001/09/06 22:56:18 1.4
@@ -2,7 +2,7 @@
<br>
-<table cellspacing="0" cellpadding="1" width="800" border="0" bgcolor="#6A749D">
+<table class="topbar" cellspacing="0" cellpadding="1" width="800" border="0" bgcolor="#6A749D">
<tr valign="middle">
<td>
|
|
From: mdw c. <myd...@li...> - 2001-09-10 14:47:25
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/tools/events
Modified Files:
stats.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/tools/events/stats.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- stats.php 2001/09/03 13:31:21 1.7
+++ stats.php 2001/09/10 14:47:24 1.8
@@ -155,7 +155,7 @@
return ($BOX);
}
-function get_global_stats_box($DBH)
+function get_global_stats_box($DBH, $hash_box)
/*
This function returns a box with number of
elements in the site :
@@ -174,7 +174,7 @@
where lang = '".USER_LANG."'";
$rqt = new query($DBH);
$rqt->query($DBH, $sql);
- $row = $rqt->get_row();
+ $row = $rqt->getrow();
$STATS["NEWS"] = $row[0];
// comments recorded
@@ -184,7 +184,7 @@
and news.lang = '".USER_LANG."'";
$rqt = new query($DBH);
$rqt->query($DBH, $sql);
- $row = $rqt->get_row();
+ $row = $rqt->getrow();
$STATS["COMMENTS"] = $row[0];
// pages recorded
@@ -193,17 +193,23 @@
where lang = '".USER_LANG."'";
$rqt = new query($DBH);
$rqt->query($DBH, $sql);
- $row = $rqt->get_row();
+ $row = $rqt->getrow();
$STATS["PAGES"] = $row[0];
- // pages viewed
- $sql = "select count(*)
- from page
- where lang = '".USER_LANG."'";
- $rqt = new query($DBH);
- $rqt->query($DBH, $sql);
- $row = $rqt->get_row();
- $STATS["PAGES"] = $row[0];
+
+ $tokens['TITLE'] = translate('STATS', $DBH);
+ $BOX = get_hash_template($hash_box['HEAD'], $tokens);
+
+ $tokens['CONTENT'] = $STATS['NEWS'] . ' ' . translate('NEWS', $DBH);
+ $BOX .= get_hash_template($hash_box['LINE'], $tokens);
+
+ $tokens['CONTENT'] = $STATS['COMMENTS'] . ' ' . translate('COMMENTS', $DBH);
+ $BOX .= get_hash_template($hash_box['LINE'], $tokens);
+
+ $tokens['CONTENT'] = $STATS['PAGES'] . ' ' . translate('PAGES', $DBH);
+ $BOX .= get_hash_template($hash_box['LINE'], $tokens);
+
+ $BOX .= get_hash_template($hash_box['FOOT'], $tokens);
return ($BOX);
}
|
|
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
|
|
From: mdw c. <myd...@li...> - 2001-09-10 15:00:11
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/templates/default Modified Files: box.html main.html Log Message: Adding the template entry for the stat box. =================================================================== RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/templates/default/box.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- box.html 2001/09/06 22:56:18 1.3 +++ box.html 2001/09/10 15:00:11 1.4 @@ -10,4 +10,5 @@ </TR> <!-- BLOCK:FOOT --> </TABLE> +<P> =================================================================== RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/templates/default/main.html,v retrieving revision 1.26 retrieving revision 1.27 diff -u -3 -r1.26 -r1.27 --- main.html 2001/09/06 22:56:18 1.26 +++ main.html 2001/09/10 15:00:11 1.27 @@ -157,6 +157,8 @@ <td valign="top" align="center" width="120"> <br> +~STATBOX~ +<br> ~CONTROL_PANNEL~ <br> ~SEARCH~ |
|
From: mdw c. <myd...@li...> - 2001-09-20 21:23:48
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/templates/gnome Modified Files: comment.html Log Message: Adding a new little feature whiwh is asking guest for name and email when posting a comment on a news. MDW then store the values (name & email) into a cookie and use them for next submission. When displaying the comment, guest's name is displayed whith a link on his email. BE CARREFUL : There is a DB upgrade to do, on the comments table : we must add the field user_mail. Launch sql/db_upgrade/from-0.3.5__to-0.3.6/alter-comments.sql on your db after cvs updating... enjoy:) Alexis. =================================================================== RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/templates/gnome/comment.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- comment.html 2001/07/24 22:07:52 1.1 +++ comment.html 2001/09/20 21:23:47 1.2 @@ -4,7 +4,7 @@ <td align="left" > - <font color="#770000"><b>~title~</b> (posted by ~user~ @ ~date_ins~)</font><br><br> + <font color="#770000"><b>~title~</b> (posted by <a href="mailto:~user_mail~">~user_name~</a>, ~date_ins~)</font><br><br> ~content~ |
|
From: mdw c. <myd...@li...> - 2001-09-20 21:24:17
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/templates/default Modified Files: comment.html Log Message: Adding a new little feature whiwh is asking guest for name and email when posting a comment on a news. MDW then store the values (name & email) into a cookie and use them for next submission. When displaying the comment, guest's name is displayed whith a link on his email. BE CARREFUL : There is a DB upgrade to do, on the comments table : we must add the field user_mail. Launch sql/db_upgrade/from-0.3.5__to-0.3.6/alter-comments.sql on your db after cvs updating... enjoy:) Alexis. =================================================================== RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/templates/default/comment.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- comment.html 2001/06/08 21:28:48 1.1 +++ comment.html 2001/09/20 21:23:47 1.2 @@ -5,7 +5,7 @@ <td align="left" bgcolor="#EEEEEE"> - <font color="#6A749D"><b>~title~</b> (posted by ~user~ @ ~date_ins~)</font><br><br> + <font color="#6A749D"><b>~title~</b> (posted by <a href="mailto:~user_mail~">~user_name~</a>, ~date_ins~)</font><br><br> ~content~ |
|
From: mdw c. <myd...@li...> - 2001-09-20 21:24:17
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs
Modified Files:
add_comment.php comment.php save_coment.php
Log Message:
Adding a new little feature whiwh is asking guest for name and email when posting a comment on a news.
MDW then store the values (name & email) into a cookie and use them for next submission.
When displaying the comment, guest's name is displayed whith a link on his email.
BE CARREFUL :
There is a DB upgrade to do, on the comments table : we must add the field user_mail.
Launch sql/db_upgrade/from-0.3.5__to-0.3.6/alter-comments.sql on your db after cvs updating...
enjoy:)
Alexis.
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/add_comment.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- add_comment.php 2001/06/08 23:45:20 1.2
+++ add_comment.php 2001/09/20 21:23:47 1.3
@@ -17,6 +17,12 @@
$UserID = 'anonymous';
}
+if (isset($DYNA_USER)) {
+ $frags = explode("__", $DYNA_USER);
+ $username = $frags[0];
+ $usermail = $frags[1];
+}
+
// we get every comment posted for that news (for creating the reply listbox)
$sql = "SELECT title
FROM comments
@@ -52,14 +58,23 @@
<input type='hidden' name='num_news' value='$num_news'>
-<table align=\"center\" width=\"480\" cellpadding=0 cellspacing=0 border=0>
+<table align=\"center\" width=\"480\" cellpadding=0 cellspacing=5 border=0>
+<tr>
+ <td align=\"left\"> ".translate("TITLE",$DBH)." : <input name=\"titre\" type=\"text\" size=\"30\">
+ </td>
+</tr>
<tr>
- <td align=\"left\"> <b>".translate("TITLE",$DBH)."</b> : <input name=\"titre\" type=\"text\" size=\"30\">
+ <td align=\"left\"> ".translate("YOUR_NAME",$DBH)." : <input name=\"username\" type=\"text\" value='$username' size=\"30\">
</td>
</tr>
<tr>
+ <td align=\"left\"> ".translate("YOUR_EMAIL",$DBH)." : <input name=\"usermail\" type=\"text\" value='$usermail' size=\"30\">
+ </td>
+</tr>
+
+<tr>
<td align=\"left\">
- <b>".translate('CHOOSE_REPLY', $DBH)."$REPLY_LIST
+ ".translate('CHOOSE_REPLY', $DBH)."$REPLY_LIST
</td>
</tr>
@@ -67,7 +82,7 @@
<tr>
<td>
- <b>".translate('COMMENT_HEAD', $DBH)."</b><br>
+ ".translate('COMMENT_HEAD', $DBH)."<br>
<textarea name=\"content\" wrap=\"virtual\" cols=\"50\" rows=\"20\"></textarea>
<br>
</td>
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/comment.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- comment.php 2001/08/13 14:21:31 1.7
+++ comment.php 2001/09/20 21:23:47 1.8
@@ -37,7 +37,10 @@
// we get the comments
-$sql = "select title, content, user_name, date_ins from comments where _num_news = $news order by num_cmt desc";
+$sql = "select title, content, user_name, user_mail, date_ins
+ from comments
+ where _num_news = $news
+ order by num_cmt desc";
$rqt = new query($DBH);
$rqt->query($DBH, $sql);
@@ -50,8 +53,6 @@
$row['user_name'] = 'anonymous';
}
- $row["user"] = $row['user_name'];
-
$PAGE .= get_template(THEMES_PATH."/comment.html", $row);
}
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/save_coment.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- save_coment.php 2001/08/13 14:24:55 1.6
+++ save_coment.php 2001/09/20 21:23:47 1.7
@@ -13,10 +13,17 @@
die();
}
- $aujourdhui = date( "Y-m-d", time() );
+
+// we store the name and the email of the surfer into a cookie
+if (!isset($DYNA_USER)) {
+ setcookie('DYNA_USER', ($username . "__" . $usermail), (time() + 60*60*24*365), '/');
+}
+
+
+$aujourdhui = date( "Y-m-d", time() );
- // we block HTML attacks (like </table> or such a HTML tag that could be bad)
+// we block HTML attacks (like </table> or such a HTML tag that could be bad)
$titre = ereg_replace("<", "<",$titre);
$titre = ereg_replace(">", ">",$titre);
@@ -43,8 +50,8 @@
// we insert the comment in the database
- $sql = "insert into comments (title, _num_news, date_ins, content, user_name)
- values ('$titre', $num_news, '$aujourdhui', '$content', '$UserID')";
+ $sql = "insert into comments (title, _num_news, date_ins, content, user_name, user_mail)
+ values ('$titre', $num_news, '$aujourdhui', '$content', '$username', '$usermail')";
$rqt = new query($DBH);
$rqt->query($DBH, $sql) or die($sql . $rqt->error());
|
|
From: mdw c. <myd...@li...> - 2001-09-26 22:18:45
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/templates/enlightened Log Message: Directory /cvsroot/mydynaweb/mydynaweb/htdocs/templates/enlightened added to the repository |
|
From: mdw c. <myd...@li...> - 2001-09-26 22:19:10
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/templates/enlightened/img Log Message: Directory /cvsroot/mydynaweb/mydynaweb/htdocs/templates/enlightened/img added to the repository |
|
From: mdw c. <myd...@li...> - 2001-09-26 22:25:01
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/templates/enlightened Added Files: INSTALL README bar.html box.html comment.html main.html news.html page.html stylesheet.css topbar.html Log Message: Well, I spent all my night to code for mydynaweb ! It was great. The main topic of this coding party was to release a new theme based on the enlightenment site, which is to my mind, really cute... Go there to see it if you don't know that beautiful HTML : http://www.enlightenment.org. The mydynaweb theme is now OK and I've released a tarball for previous user to get it (see files on sourceforge) I've stopped the access to the show_stats.php because of two reasons : 1 : the stats engine will be redo from scratch to enable each page count 2 : i didn't find why but hits weren't counted anymore... so that makes the show_stats srcipt bombs out... I've also bursted a lot of tiny bugs but I didn't remind what it was exactly. That's all for tonight :) |
|
From: mdw c. <myd...@li...> - 2001-09-26 22:25:32
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/include Modified Files: gui.inc.php templates.inc.php Log Message: Well, I spent all my night to code for mydynaweb ! It was great. The main topic of this coding party was to release a new theme based on the enlightenment site, which is to my mind, really cute... Go there to see it if you don't know that beautiful HTML : http://www.enlightenment.org. The mydynaweb theme is now OK and I've released a tarball for previous user to get it (see files on sourceforge) I've stopped the access to the show_stats.php because of two reasons : 1 : the stats engine will be redo from scratch to enable each page count 2 : i didn't find why but hits weren't counted anymore... so that makes the show_stats srcipt bombs out... I've also bursted a lot of tiny bugs but I didn't remind what it was exactly. That's all for tonight :) =================================================================== RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/gui.inc.php,v retrieving revision 1.30 retrieving revision 1.31 diff -u -3 -r1.30 -r1.31 --- gui.inc.php 2001/09/11 20:46:56 1.30 +++ gui.inc.php 2001/09/26 22:25:00 1.31 @@ -462,7 +462,7 @@ { $BOX_HASH_TEMPLATE = read_template(THEMES_PATH . "/box.html"); - $sql = "select titre, icon + $sql = "select titre from item_box_titles where num_titre = $num_item_box"; $rqt = new query($DBH); @@ -482,17 +482,9 @@ $titre[0] = $titre_frags[1]; } - if (strlen($titre[1])) { - $VALUES['ICON'] = $titre[1]; - } - else { - $VALUES['ICON'] = "images/pixel.gif"; - } - $TABLE_TITRE = "<table width='100%' border='0' cellpadding='2' cellspacing='0'><tr> - <td align='center' valign='middle' width='20'><img src='".$VALUES['ICON']."' width='16' height='16'></td> - <td align='center' width='100'> + <td align='center'> <font size='-1'><b>$titre[0]</b></font></td></tr> </table>"; =================================================================== RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/templates.inc.php,v retrieving revision 1.24 retrieving revision 1.25 diff -u -3 -r1.24 -r1.25 --- templates.inc.php 2001/09/11 20:46:56 1.24 +++ templates.inc.php 2001/09/26 22:25:00 1.25 @@ -169,9 +169,6 @@ $DBH,$c, $IP='', $REFER='', $MSG='', $ZONE=99, $PAGE=99); - // get the page name - count_one_more($DBH, $IP, $REFER); - $output = ""; $file = explode("\n", $template_hash_entry); @@ -214,9 +211,6 @@ { $VALUES = init_main_values($template_path, $content, $titre, $DBH,$c, $IP='', $REFER='', $MSG='', $ZONE=99, $PAGE=99); - - // get the page name - count_one_more($DBH, $IP, $REFER); $output = ""; |
|
From: mdw c. <myd...@li...> - 2001-09-26 22:25:32
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs Modified Files: add_comment.php news.php3 seek.php3 show_stats.php Log Message: Well, I spent all my night to code for mydynaweb ! It was great. The main topic of this coding party was to release a new theme based on the enlightenment site, which is to my mind, really cute... Go there to see it if you don't know that beautiful HTML : http://www.enlightenment.org. The mydynaweb theme is now OK and I've released a tarball for previous user to get it (see files on sourceforge) I've stopped the access to the show_stats.php because of two reasons : 1 : the stats engine will be redo from scratch to enable each page count 2 : i didn't find why but hits weren't counted anymore... so that makes the show_stats srcipt bombs out... I've also bursted a lot of tiny bugs but I didn't remind what it was exactly. That's all for tonight :) =================================================================== RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/add_comment.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- add_comment.php 2001/09/20 21:23:47 1.3 +++ add_comment.php 2001/09/26 22:25:00 1.4 @@ -58,38 +58,41 @@ <input type='hidden' name='num_news' value='$num_news'> -<table align=\"center\" width=\"480\" cellpadding=0 cellspacing=5 border=0> +<table align=\"center\" cellpadding=0 cellspacing=5 border=0> + <tr> - <td align=\"left\"> ".translate("TITLE",$DBH)." : <input name=\"titre\" type=\"text\" size=\"30\"> - </td> + <td align=\"left\"> ".translate("TITLE",$DBH)." </td> + <td align='right'> <input name=\"titre\" type=\"text\" size=\"30\"> </td> </tr> + <tr> - <td align=\"left\"> ".translate("YOUR_NAME",$DBH)." : <input name=\"username\" type=\"text\" value='$username' size=\"30\"> - </td> + <td align=\"left\"> ".translate("YOUR_NAME",$DBH)." </td> + <td align='right'> <input name=\"username\" type=\"text\" value='$username' size=\"30\"> </td> </tr> + <tr> - <td align=\"left\"> ".translate("YOUR_EMAIL",$DBH)." : <input name=\"usermail\" type=\"text\" value='$usermail' size=\"30\"> - </td> + <td align=\"left\"> ".translate("YOUR_EMAIL",$DBH)." </td> + <td align='right'><input name=\"usermail\" type=\"text\" value='$usermail' size=\"30\"> </td> </tr> <tr> - <td align=\"left\"> - ".translate('CHOOSE_REPLY', $DBH)."$REPLY_LIST - </td> + <td align=\"left\"> ".translate('CHOOSE_REPLY', $DBH)."</td> + <td align='right'>$REPLY_LIST</td> </tr> <tr> - + <td colspan='2' align='center'> + ".translate('COMMENT_HEAD', $DBH)." + </td> +</tr> <tr> - <td> - ".translate('COMMENT_HEAD', $DBH)."<br> + <td colspan='2' align='center'> <textarea name=\"content\" wrap=\"virtual\" cols=\"50\" rows=\"20\"></textarea> -<br> </td> </tr> <tr align=\"center\"> - <td align=\"center\"> + <td align=\"center\" colspan='2'> <input type=\"submit\" value=\"".translate("SUBMIT",$DBH)."\"> </td> </tr> =================================================================== RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/news.php3,v retrieving revision 1.37 retrieving revision 1.38 diff -u -3 -r1.37 -r1.38 --- news.php3 2001/08/02 22:22:55 1.37 +++ news.php3 2001/09/26 22:25:00 1.38 @@ -147,7 +147,8 @@ $row2 = $rqt2->getrow(); $HTML = get_piece_of_news($full_title, '<i>' . $full_header . '</i><br><br>' . $full_page, $row[4], $row[5], "news.php3?q=$row[6]", $row[nbhit], $row[0], $row2[0], strlen($full_page) * 8, $DBH); - print_template(THEMES_PATH."/main.html", $HTML, translate("NEWS",$DBH), $DBH,"NEWS.$q.$old.$num.$fam",$REMOTE_ADDR, $MSG); + print_template(THEMES_PATH."/main.html", $HTML, translate("NEWS",$DBH), + $DBH,"NEWS.$q.$old.$num.$fam",$REMOTE_ADDR, $MSG, 0, 0); die(); } else { @@ -208,11 +209,13 @@ } $HTML = get_page(translate($page_title, $DBH), translate($page_header, $DBH), $PAGE, $DBH); - print_template(THEMES_PATH."/main.html", $HTML, translate("NEWS",$DBH), $DBH,"NEWS.$q.$old.$num.$fam",$REMOTE_ADDR, $HTTP_REFERER, $MSG); + print_template(THEMES_PATH."/main.html", $HTML, translate("NEWS",$DBH), + $DBH,"NEWS.$q.$old.$num.$fam",$REMOTE_ADDR, $HTTP_REFERER, $MSG, 0, 0); } else { - print_template(THEMES_PATH."/main.html", $PAGE, translate("NEWS",$DBH), $DBH,"NEWS.$q.$old.$num.$fam",$REMOTE_ADDR, $HTTP_REFERER, $MSG); + print_template(THEMES_PATH."/main.html", $PAGE, translate("NEWS",$DBH), + $DBH,"NEWS.$q.$old.$num.$fam",$REMOTE_ADDR, $HTTP_REFERER, $MSG, 0, 0); } } =================================================================== RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/seek.php3,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- seek.php3 2001/07/30 10:38:47 1.9 +++ seek.php3 2001/09/26 22:25:00 1.10 @@ -135,15 +135,13 @@ $FORM = " <FORM NAME='search' ACTION='$PHP_SELF' METHOD='POST'> - <table cellspacing='0' cellpadding='1' border='0' bgcolor='#EEEEEE' align='center'><tr><td> - <table cellspacing='0' cellpadding='0' border='0' bgcolor='#FFFFFF'><tr><td> - <table cellspacing='10' cellpadding='0' border='0' bgcolor='#FFFFFF' width='400'> + <table align='center' cellspacing='10' cellpadding='0' border='0' width='400'> <tr> <td colspan='2' align='center'><H2>".translate('ADVANCED_SEARCH', $DBH)."</H2></td> </tr> - <tr bgcolor='#EEEEEE'> + <tr> <td colspan='2' align='left'>".translate('ALL_THOSE_OPTIONS_ARE_OPTIONAL', $DBH)."</td> </tr> @@ -185,8 +183,6 @@ </tr> </table> - </td></tr></table> - </td></tr></table> </FORM> "; =================================================================== RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/show_stats.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- show_stats.php 2001/08/02 19:27:11 1.7 +++ show_stats.php 2001/09/26 22:25:00 1.8 @@ -100,9 +100,7 @@ </table> </form> - <div align='center'><a href='show_stats.php?mode=REFERER'>".translate('SHOW_REFERERS', $DBH)."</a></center> - - "; + <div align='center'><a href='show_stats.php?mode=REFERER'>".translate('SHOW_REFERERS', $DBH)."</a></center>"; // 2 - We send the HTML output in the appropriate format (language, theme) @@ -155,8 +153,11 @@ if (!$hits) { - header("Location: show_stats.php"); - die(); + $CONTENT = get_page('Stats Unavailable !', + "The following problem occured :", + 'Sorry stats are no longer supported in this release.', $DBH); + print_template(THEMES_PATH."/main.html", $CONTENT, 'No Stats', $DBH,"URL=$url", $REMOTE_ADDR, $HTTP_REFERER); + die(); } if (! strlen($max)) { @@ -167,19 +168,18 @@ $vis_percentile = ($visits * 100 / $max); $sur_percentile = ($surfers * 100 / $max); - $hit_bar = draw_bar($hit_percentile, $hits); - $vis_bar = draw_bar($vis_percentile, $visits); - $sur_bar = draw_bar($sur_percentile, $surfers); - if ($day < 10) { $day = "0" . $day; } $PAGE = " <table> <tr> <td rowspan='3' valign='middle' align='center'><b>$day</b></td> - <td>".translate("PAGE_VIEW", $DBH). " : </td> <td>$hit_bar</td><td align='right'>$hits</td></tr> - <tr><td>".translate("VISIT",$DBH)." : </td> <td>$vis_bar</td><td align='right'>$visits</td></tr> - <tr><td>".translate("USER", $DBH)." : </td> <td>$sur_bar</td><td align='right'>$surfers</td></tr> + <td>".translate("PAGE_VIEW", $DBH). " : </td> + <td>$hit_percentile</td><td align='right'>$hits</td></tr> + <tr><td>".translate("VISIT",$DBH)." : </td> <td>$vis_percentile</td> + <td align='right'>$visits</td></tr> + <tr><td>".translate("USER", $DBH)." : </td> <td>$sur_percentile</td> + <td align='right'>$surfers</td></tr> </table>"; $date = date("d - m - Y"); |
|
From: mdw c. <myd...@li...> - 2001-09-26 22:27:58
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/templates/enlightened/img Added Files: border_b.gif border_bl.gif border_br.gif border_l.gif border_r.gif border_t.gif border_tl.gif border_tr.gif e-line.gif enlightenment.gif logo.gif ruler.gif Log Message: img for the enlightened theme |
|
From: mdw c. <myd...@li...> - 2001-09-27 21:54:55
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/admin
Modified Files:
menu.php3
Added Files:
update_comment.php
Log Message:
I've done a new tool in the admin section.
It is dedicated to update the comment that are recorded by users on the news.
It was really necessary as people can type whatever they want in the form, and the the content is published.
So now, DynaMasters have the facility of updating (or moderating) the comments recorded.
A little note will then appear at the bottom right of the comment and would like this :
"Moderated the 2001-09-23"
To use this new tool, look at the link in the bottom of your admin section panel.
Enjoy !
sukria, Thu Sep 27 21:55:04 GMT 2001
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/admin/menu.php3,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- menu.php3 2001/08/01 18:25:40 1.11
+++ menu.php3 2001/09/27 21:54:53 1.12
@@ -46,8 +46,8 @@
<tr>
<td valign="top"><img src="images/puce.jpg"> <b><? echo translate("CACHE",$DBH) ?></b><br>
- <a href="../vide_cache.php" target="page"><? echo translate("DROP_CACHE_FILES",$DBH) ?></a>
-<br>
+ <a href="../vide_cache.php" target="page"><? echo translate("DROP_CACHE_FILES",$DBH) ?></a><br>
+
</td>
</tr>
@@ -96,6 +96,7 @@
<a href="submit_news.php3" target="page"><? echo translate("CREATE",$DBH) ?></a><br>
<a href="show_news.php3?act=mod" target="page"><? echo translate("UPDATE",$DBH) ?></a><br>
+ <a href="update_comment.php" target="page"><? echo translate("UPDATE_COMMENT",$DBH) ?></a><br>
<a href="show_news.php3?act=del" target="page"><? echo translate("DELETE",$DBH) ?></a><br><br>
</td>
|
|
From: mdw c. <myd...@li...> - 2001-09-28 09:12:57
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs
Modified Files:
news.php3
Log Message:
Some themes updates, text justify on left
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/news.php3,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -3 -r1.38 -r1.39
--- news.php3 2001/09/26 22:25:00 1.38
+++ news.php3 2001/09/28 09:12:57 1.39
@@ -136,7 +136,7 @@
$PAGE .= "<a href=\"$PHP_SELF?num=$row[0]\"><li><b>$row[1]</b></a>, $da_formated_date - $row[7] (<i><a href='$PHP_SELF?q=$row[6]'>".translate($row[5],$DBH)."</a></i>)</li>";
}
else if (strlen($readmore)) {
- $full_title = "<b>$row[1]</b> <font size='-1'>".translate("POSTED_BY",$DBH)." $row[7] ".translate("ON",$DBH)." $da_formated_date</font>".translate('FROM_THE_CATEGORY', $DBH)." ". translate($family,$DBH);
+ $full_title = "<b>$row[1]</b> <font size='-1'><i>".translate("POSTED_BY",$DBH)." $row[7] ".translate("ON",$DBH)." $da_formated_date</font>".translate('FROM_THE_CATEGORY', $DBH)." ". translate($family,$DBH) . "</i><br>";
$full_page = $row[long_text];
$full_header = $row[texte];
@@ -146,7 +146,7 @@
$rqt2->query($DBH, $sql);
$row2 = $rqt2->getrow();
- $HTML = get_piece_of_news($full_title, '<i>' . $full_header . '</i><br><br>' . $full_page, $row[4], $row[5], "news.php3?q=$row[6]", $row[nbhit], $row[0], $row2[0], strlen($full_page) * 8, $DBH);
+ $HTML = get_piece_of_news($full_title, ($full_header . '<br>' . $full_page), $row[4], $row[5], "news.php3?q=$row[6]", $row[nbhit], $row[0], $row2[0], strlen($full_page), $DBH);
print_template(THEMES_PATH."/main.html", $HTML, translate("NEWS",$DBH),
$DBH,"NEWS.$q.$old.$num.$fam",$REMOTE_ADDR, $MSG, 0, 0);
die();
@@ -185,14 +185,14 @@
// creation of the title
$news_tt = "<b><font size='+1' color='#FFFFFF'>$row[1]</font></b>";
- $intro = "<font size='-1'> ".translate("POSTED_BY", $DBH).
+ $intro = "<font size='-1'><i>".translate("POSTED_BY", $DBH).
" $row[7], $da_formated_date<br>" .
translate('FROM_THE_CATEGORY', $DBH) .
- " ".translate($family,$DBH)."</font> <P>" . $row[2];
+ " ".translate($family,$DBH)."</font></i> <br><br>" . $row[2];
$news_title = $news_tt;
- $PAGE .= get_piece_of_news($news_title, $intro, $row[4], $row[5], "news.php3?q=$row[6]", $new_nbhit, $row[0], $nbcmt, strlen($row['long_text']) * 8, $DBH);
+ $PAGE .= get_piece_of_news($news_title, $intro, $row[4], $row[5], "news.php3?q=$row[6]", $new_nbhit, $row[0], $nbcmt, strlen($row['long_text']), $DBH);
$PAGE .= "<table><tr><td> </td></tr></table>\n";
}
|