|
From: mdw c. <myd...@li...> - 2003-02-27 16:24:11
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/admin Added Files: approve.php Log Message: permet de valider une nouvelle postée par un membre |
|
From: mdw c. <myd...@li...> - 2003-02-27 16:24:41
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/tools/content
Modified Files:
mailer.php
Log Message:
permet de valider une nouvelle postée par un membre
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/tools/content/mailer.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- mailer.php 14 Feb 2003 13:30:02 -0000 1.6
+++ mailer.php 27 Feb 2003 16:24:10 -0000 1.7
@@ -24,10 +24,15 @@
$nouvelle = str_replace ("<p>", "\n\n", $nouvelle);
$nouvelle = str_replace ("<br>", "\n", $nouvelle);
+ $nouvelle = str_replace ("<li>", "- ", $nouvelle);
+ $nouvelle = str_replace ("</li>", "", $nouvelle);
$nouvelle = str_replace ("<i>", "", $nouvelle);
$nouvelle = str_replace ("</i>", "", $nouvelle);
- $nouvelle = preg_replace("/<a href=\"(\S+)\">.+<\/a>/", "$1",$nouvelle);
- $nouvelle = preg_replace("/<a href='(\S+)'>.+<\/a>/", "$1",$nouvelle);
+
+ $nouvelle = preg_replace("/<a href=\"(.+)\">.+<\/a>/", "$1",$nouvelle);
+ $nouvelle = preg_replace("/<a href='(.+)'>.+<\/a>/", "$1",$nouvelle);
+ $nouvelle = preg_replace("/<h.>(.+)<\/h.>/", strtoupper("$1"),$nouvelle);
+ $nouvelle = preg_replace("/<H.>(.+)<\/H.>/", strtoupper("$1"),$nouvelle);
// recup des infos du posteur
/* if (! strlen($USER)) {*/
@@ -78,6 +83,10 @@
$rqt = new query($DBH);
$rqt->query ($DBH, $sql);
+ $sql = "REPLACE into mail (email, is_forward, num_news) VALUES ('$TO', 1, $num_news)";
+ $rqt = new query($DBH);
+ $rqt->query ($DBH, $sql);
+
}
|
|
From: mdw c. <myd...@li...> - 2003-03-04 10:59:46
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs Added Files: setup.php Log Message: fichier d'installation autoamtique de mytinyweb |
|
From: mdw c. <myd...@li...> - 2003-03-04 10:59:46
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/tools/content
Modified Files:
mailer.php
Log Message:
fichier d'installation autoamtique de mytinyweb
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/tools/content/mailer.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- mailer.php 27 Feb 2003 16:24:10 -0000 1.7
+++ mailer.php 4 Mar 2003 10:59:45 -0000 1.8
@@ -33,6 +33,8 @@
$nouvelle = preg_replace("/<a href='(.+)'>.+<\/a>/", "$1",$nouvelle);
$nouvelle = preg_replace("/<h.>(.+)<\/h.>/", strtoupper("$1"),$nouvelle);
$nouvelle = preg_replace("/<H.>(.+)<\/H.>/", strtoupper("$1"),$nouvelle);
+
+ $nouvelle = preg_replace("/<\S+>(.+)<\/.+>/", "$1",$nouvelle);
// recup des infos du posteur
/* if (! strlen($USER)) {*/
@@ -83,10 +85,11 @@
$rqt = new query($DBH);
$rqt->query ($DBH, $sql);
- $sql = "REPLACE into mail (email, is_forward, num_news) VALUES ('$TO', 1, $num_news)";
+ $date = date ("Y-m-d");
+ $sql = "INSERT into email_forward (mail, num_news, date) VALUES ('$TO', $num_news, '$date')";
$rqt = new query($DBH);
- $rqt->query ($DBH, $sql);
-
+ $rqt->query ($DBH, $sql) or send_sql_error($PHP_SELF, $sql, $rqt->error());
+ print $sql;
}
|
|
From: mdw c. <myd...@li...> - 2003-03-05 16:54:37
|
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:
premiere version des sondages
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/gui.inc.php,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -3 -r1.58 -r1.59
--- gui.inc.php 14 Feb 2003 08:31:13 -0000 1.58
+++ gui.inc.php 5 Mar 2003 16:54:00 -0000 1.59
@@ -354,6 +354,90 @@
}
+/*
+ print a box with the current poll.
+ if user IP is not found in the poll_users print the questions ;
+ if not (the user as already vote for that poll, just display
+ the results)
+*/
+
+function get_poll_box($DBH)
+{
+ $BOX_HASH_TEMPLATE = read_template(THEMES_PATH . "/box.html");
+
+ $sql = "SELECT pol_title, pol_id,
+ pol_question_1_str, pol_question_1_num,
+ pol_question_2_str, pol_question_2_num,
+ pol_question_3_str, pol_question_3_num,
+ pol_question_4_str, pol_question_4_num,
+ pol_question_5_str, pol_question_5_num,
+ pol_question_6_str, pol_question_6_num,
+ pol_question_7_str, pol_question_7_num,
+ pol_date_creation
+ FROM poll
+ WHERE pol_is_open=1
+ ORDER BY pol_date_creation DESC
+ LIMIT 1";
+ $rqt = new query($DBH);
+ $rqt->query($DBH, $sql) or send_sql_error($PHP_SELF, $sql, $rqt->error());
+ $row = $rqt->getrow();
+
+ // first look if that user (IP ADDR) can vote for that poll
+ $sql = "SELECT pol_id FROM poll_users WHERE user_ip_addr = '".REMOTE_ADDR."'";
+ $rqt = new query($DBH);
+ $rqt->query($DBH, $sql) or send_sql_error($PHP_SELF, $sql, $rqt->error());
+ $row2 = $rqt->getrow();
+
+ if ($row2['pol_id'] == $row['pol_id'] and $row["pol_id"] != "") {
+ // already vote for that poll
+ return ("results");
+ }
+
+
+ $VALUES['TITLE'] = translate("POLL",$DBH);
+ $VALUES['TITLE'] .= "<br><b>" . $row["pol_title"] . "</b>";
+ $form = get_hash_template($BOX_HASH_TEMPLATE["HEAD"], $VALUES);
+
+ $questions[0] = $row["pol_question_1_str"];
+ $questions[1] = $row["pol_question_2_str"];
+ $questions[2] = $row["pol_question_3_str"];
+ $questions[3] = $row["pol_question_4_str"];
+ $questions[4] = $row["pol_question_5_str"];
+ $questions[5] = $row["pol_question_6_str"];
+ $questions[6] = $row["pol_question_7_str"];
+
+ $votes[0] = $row["pol_question_1_num"];
+ $votes[1] = $row["pol_question_2_num"];
+ $votes[2] = $row["pol_question_3_num"];
+ $votes[3] = $row["pol_question_4_num"];
+ $votes[4] = $row["pol_question_5_num"];
+ $votes[5] = $row["pol_question_6_num"];
+ $votes[6] = $row["pol_question_7_num"];
+
+ $form .= "<FORM name='poll' action='poll.php' method='GET'>\n";
+ $form .= "<INPUT type='hidden' name='pol_id' value='".$row["pol_id"]."'>\n";
+
+ for ($i=0; $i<7; $i++) {
+ if (strlen($questions[$i])) {
+ $VALUES["CONTENT"] = "<input type='radio' name='poll' value='$i'>" . $questions[$i] . "<br>\n";
+ $form .= get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES);
+ }
+ else {
+ break;
+ }
+ }
+
+ if ($i == 0) {
+ return "";
+ }
+
+ $VALUES["CONTENT"] = "<INPUT type='submit' value='".translate ("CONFIRM", $DBH)."'>\n</form>";
+ $form .= get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES);
+
+
+ $form .= get_hash_template($BOX_HASH_TEMPLATE["FOOT"], $VALUES);
+ return($form);
+}
function get_searchengine($seek, $DBH)
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/mydynaweb.libs.php,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -3 -r1.42 -r1.43
--- mydynaweb.libs.php 27 Dec 2002 11:52:56 -0000 1.42
+++ mydynaweb.libs.php 5 Mar 2003 16:54:01 -0000 1.43
@@ -50,6 +50,8 @@
*****************************************/
+define ("REMOTE_ADDR", $REMOTE_ADDR);
+
define("USER_FAM", $fam);
if (! isset($UserLang)) {
$UserLang = DEFAULT_LANG;
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/templates.inc.php,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -3 -r1.37 -r1.38
--- templates.inc.php 14 Feb 2003 08:31:14 -0000 1.37
+++ templates.inc.php 5 Mar 2003 16:54:02 -0000 1.38
@@ -28,6 +28,7 @@
}
$VALUES["TOPICS_BOX"] = get_topics_htmlbox($DBH);
+ $VALUES["POLL"] = get_poll_box($DBH);
$VALUES['LAYER'] = get_layer($DBH, $hash_layer);
$VALUES['SPONSORS'] = get_sponsors($DBH, $hash_box);
$VALUES['STATBOX'] = get_global_stats_box($DBH, $hash_box);
|
|
From: mdw c. <myd...@li...> - 2003-03-05 16:54:37
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/templates/gris Modified Files: main.html Log Message: premiere version des sondages =================================================================== RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/templates/gris/main.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- main.html 12 Feb 2003 09:26:39 -0000 1.2 +++ main.html 5 Mar 2003 16:54:03 -0000 1.3 @@ -152,12 +152,11 @@ </p> - - ~WHATSUP_BOX~ - ~LOGIN~ - ~CONTROL_PANNEL~ + ~POLL~ + + ~WHATSUP_BOX~ ~HEADLINES~ |
|
From: mdw c. <myd...@li...> - 2003-03-05 18:41:27
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs Added Files: poll.php Log Message: enregistre les votes (un seul par IP) |
|
From: mdw c. <myd...@li...> - 2003-03-05 18:41:27
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/include
Modified Files:
gui.inc.php
Log Message:
enregistre les votes (un seul par IP)
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/gui.inc.php,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -3 -r1.59 -r1.60
--- gui.inc.php 5 Mar 2003 16:54:00 -0000 1.59
+++ gui.inc.php 5 Mar 2003 18:41:25 -0000 1.60
@@ -388,13 +388,7 @@
$rqt->query($DBH, $sql) or send_sql_error($PHP_SELF, $sql, $rqt->error());
$row2 = $rqt->getrow();
- if ($row2['pol_id'] == $row['pol_id'] and $row["pol_id"] != "") {
- // already vote for that poll
- return ("results");
- }
-
- $VALUES['TITLE'] = translate("POLL",$DBH);
$VALUES['TITLE'] .= "<br><b>" . $row["pol_title"] . "</b>";
$form = get_hash_template($BOX_HASH_TEMPLATE["HEAD"], $VALUES);
@@ -413,6 +407,32 @@
$votes[4] = $row["pol_question_5_num"];
$votes[5] = $row["pol_question_6_num"];
$votes[6] = $row["pol_question_7_num"];
+
+
+ // already vote for that poll
+ if ($row2['pol_id'] == $row['pol_id'] and $row["pol_id"] != "") {
+
+ $VALUES['TITLE'] = "<b>" . $row["pol_title"] . "</b>";
+ $form = get_hash_template($BOX_HASH_TEMPLATE["HEAD"], $VALUES);
+
+ for ($i=0; $i<7; $i++) {
+ if (strlen($questions[$i])) {
+ $size = $votes[$i] * 2 + 5;
+
+ $VALUES["CONTENT"] = $questions[$i] . " : ";
+ $VALUES["CONTENT"] .= "<table cellspacing='0' border='0' cellpadding='0' height='10' width='$size' bgcolor='#000000'>
+ <tr><td background='images/bar.png' height='10' width='$size'></td></tr></table> (".$votes[$i].")<br>\n";
+ $form .= get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES);
+ }
+ else {
+ break;
+ }
+ }
+
+ $form .= get_hash_template($BOX_HASH_TEMPLATE["FOOT"], $VALUES);
+ return ($form);
+ }
+
$form .= "<FORM name='poll' action='poll.php' method='GET'>\n";
$form .= "<INPUT type='hidden' name='pol_id' value='".$row["pol_id"]."'>\n";
|
|
From: mdw c. <myd...@li...> - 2003-03-06 09:41:37
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/admin
Modified Files:
menu.php
Log Message:
Hello :)
Bon, les sondages fonctionnent nickel !
On accepte un seul vote par adresse IP, les sondages peuvent être ouverts ou fermés
...
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/admin/menu.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- menu.php 24 Jan 2002 01:49:41 -0000 1.6
+++ menu.php 6 Mar 2003 09:41:05 -0000 1.7
@@ -194,7 +194,12 @@
]
+<br>
+<b><? echo translate("POLL", $DBH); ?></b> :
+[
+ <a href="db_interface.php?table=poll&KEY=pol_id" target="page">Manage</a>
+]
</td>
|
|
From: mdw c. <myd...@li...> - 2003-03-06 09:41:37
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/include
Modified Files:
gui.inc.php utils.inc.php
Log Message:
Hello :)
Bon, les sondages fonctionnent nickel !
On accepte un seul vote par adresse IP, les sondages peuvent être ouverts ou fermés
...
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/gui.inc.php,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -3 -r1.60 -r1.61
--- gui.inc.php 5 Mar 2003 18:41:25 -0000 1.60
+++ gui.inc.php 6 Mar 2003 09:41:06 -0000 1.61
@@ -376,87 +376,112 @@
pol_date_creation
FROM poll
WHERE pol_is_open=1
- ORDER BY pol_date_creation DESC
- LIMIT 1";
+ ORDER BY pol_date_creation DESC";
$rqt = new query($DBH);
$rqt->query($DBH, $sql) or send_sql_error($PHP_SELF, $sql, $rqt->error());
- $row = $rqt->getrow();
- // first look if that user (IP ADDR) can vote for that poll
- $sql = "SELECT pol_id FROM poll_users WHERE user_ip_addr = '".REMOTE_ADDR."'";
- $rqt = new query($DBH);
- $rqt->query($DBH, $sql) or send_sql_error($PHP_SELF, $sql, $rqt->error());
- $row2 = $rqt->getrow();
-
-
- $VALUES['TITLE'] .= "<br><b>" . $row["pol_title"] . "</b>";
- $form = get_hash_template($BOX_HASH_TEMPLATE["HEAD"], $VALUES);
-
- $questions[0] = $row["pol_question_1_str"];
- $questions[1] = $row["pol_question_2_str"];
- $questions[2] = $row["pol_question_3_str"];
- $questions[3] = $row["pol_question_4_str"];
- $questions[4] = $row["pol_question_5_str"];
- $questions[5] = $row["pol_question_6_str"];
- $questions[6] = $row["pol_question_7_str"];
-
- $votes[0] = $row["pol_question_1_num"];
- $votes[1] = $row["pol_question_2_num"];
- $votes[2] = $row["pol_question_3_num"];
- $votes[3] = $row["pol_question_4_num"];
- $votes[4] = $row["pol_question_5_num"];
- $votes[5] = $row["pol_question_6_num"];
- $votes[6] = $row["pol_question_7_num"];
+ $poll_boxes = '';
-
- // already vote for that poll
- if ($row2['pol_id'] == $row['pol_id'] and $row["pol_id"] != "") {
+ // we'll fetch every open polls
+ while ($row = $rqt->getrow()) {
- $VALUES['TITLE'] = "<b>" . $row["pol_title"] . "</b>";
+ // first look if that user (IP ADDR) can vote for that poll
+ $sql = "SELECT pol_id FROM poll_users
+ WHERE user_ip_addr = '".REMOTE_ADDR."'
+ AND pol_id = ".$row['pol_id'];
+ $rqt2 = new query($DBH);
+ $rqt2->query($DBH, $sql) or send_sql_error($PHP_SELF, $sql, $rqt2->error());
+ $row2 = $rqt2->getrow();
+
+ // set the title
+ $VALUES['TITLE'] .= "<br><b>" . $row["pol_title"] . "</b>";
$form = get_hash_template($BOX_HASH_TEMPLATE["HEAD"], $VALUES);
-
- for ($i=0; $i<7; $i++) {
- if (strlen($questions[$i])) {
- $size = $votes[$i] * 2 + 5;
+
+ $questions[0] = $row["pol_question_1_str"];
+ $questions[1] = $row["pol_question_2_str"];
+ $questions[2] = $row["pol_question_3_str"];
+ $questions[3] = $row["pol_question_4_str"];
+ $questions[4] = $row["pol_question_5_str"];
+ $questions[5] = $row["pol_question_6_str"];
+ $questions[6] = $row["pol_question_7_str"];
+
+ $votes[0] = $row["pol_question_1_num"];
+ $votes[1] = $row["pol_question_2_num"];
+ $votes[2] = $row["pol_question_3_num"];
+ $votes[3] = $row["pol_question_4_num"];
+ $votes[4] = $row["pol_question_5_num"];
+ $votes[5] = $row["pol_question_6_num"];
+ $votes[6] = $row["pol_question_7_num"];
+
+ $max = get_max ($votes);
+ $total = 0;
+ $exp = explode ("-", $row['pol_date_creation']);
+ $date = ($exp[2] . "/" . $exp[1] . "/" . $exp[0]);
+
+ // already vote for that poll
+ if ($row2['pol_id'] == $row['pol_id'] and $row["pol_id"] != "") {
+
+ $VALUES['TITLE'] = "<b>" . $row["pol_title"] . "</b>";
+ $form = get_hash_template($BOX_HASH_TEMPLATE["HEAD"], $VALUES);
- $VALUES["CONTENT"] = $questions[$i] . " : ";
- $VALUES["CONTENT"] .= "<table cellspacing='0' border='0' cellpadding='0' height='10' width='$size' bgcolor='#000000'>
- <tr><td background='images/bar.png' height='10' width='$size'></td></tr></table> (".$votes[$i].")<br>\n";
- $form .= get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES);
+ $VALUES['CONTENT'] = "Sondage ouvert depuis le $date";
+ $form .= get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES);
+
+ for ($i=0; $i<7; $i++) {
+ if (strlen($questions[$i])) {
+ $size = ($votes[$i] * 200) / $max;
+ if ($size == 0) $size = 5;
+ $total += $votes[$i];
+
+ $VALUES["CONTENT"] = $questions[$i] . " : ";
+ $VALUES["CONTENT"] .= "
+ <table cellspacing='0' border='0' cellpadding='0' height='10'>
+ <tr><td height='10'><img src='/images/copper.jpg' height='10' width='$size'>
+ <font size='-1'>
+ ".$votes[$i]."</font></td></tr></table>\n";
+ $form .= get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES);
+ }
+ else {
+ break;
+ }
}
- else {
- break;
- }
- }
+
+ $VALUES['CONTENT'] = "Total : $total votes - <i>Vous avez déjà répondu à ce sondage</i>";
+ $form .= get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES);
+ $form .= get_hash_template($BOX_HASH_TEMPLATE["FOOT"], $VALUES);
- $form .= get_hash_template($BOX_HASH_TEMPLATE["FOOT"], $VALUES);
- return ($form);
- }
-
-
- $form .= "<FORM name='poll' action='poll.php' method='GET'>\n";
- $form .= "<INPUT type='hidden' name='pol_id' value='".$row["pol_id"]."'>\n";
-
- for ($i=0; $i<7; $i++) {
- if (strlen($questions[$i])) {
- $VALUES["CONTENT"] = "<input type='radio' name='poll' value='$i'>" . $questions[$i] . "<br>\n";
- $form .= get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES);
+ $poll_boxes .= $form;
}
else {
- break;
+
+ $form .= "<FORM name='poll' action='poll.php' method='GET'>\n";
+ $form .= "<INPUT type='hidden' name='pol_id' value='".$row["pol_id"]."'>\n";
+
+ for ($i=0; $i<7; $i++) {
+ if (strlen($questions[$i])) {
+ $VALUES["CONTENT"] = "<input type='radio' name='poll' value='$i'>" . $questions[$i] . "<br>\n";
+ $form .= get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES);
+ }
+ else {
+ break;
+ }
+ }
+
+ if ($i == 0) {
+ $poll_boxes .= "";
+ }
+ else {
+ $VALUES["CONTENT"] = "<INPUT type='submit' value='".translate ("CONFIRM", $DBH)."'>\n</form>";
+ $form .= get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES);
+
+ $form .= get_hash_template($BOX_HASH_TEMPLATE["FOOT"], $VALUES);
+
+ $poll_boxes .= $form;
+ $poll_boxes .= "<br>";
+ }
}
}
-
- if ($i == 0) {
- return "";
- }
-
- $VALUES["CONTENT"] = "<INPUT type='submit' value='".translate ("CONFIRM", $DBH)."'>\n</form>";
- $form .= get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES);
-
-
- $form .= get_hash_template($BOX_HASH_TEMPLATE["FOOT"], $VALUES);
- return($form);
+ return ($poll_boxes);
}
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/utils.inc.php,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- utils.inc.php 26 Dec 2002 13:46:57 -0000 1.23
+++ utils.inc.php 6 Mar 2003 09:41:06 -0000 1.24
@@ -1,5 +1,24 @@
<?
+// returns the biggest value of the given array
+function get_max ($array) {
+
+ if (!is_array ($array)) {
+ return 0;
+ }
+
+ $max = $array[0];
+
+ for ($i=0; $i<sizeof($array); $i++) {
+ if ($max < $array[$i]) {
+ $max = $array[$i];
+ }
+ }
+
+ return ($max);
+
+}
+
function get_newsleter_form()
{
return 1;
|
|
From: mdw c. <myd...@li...> - 2003-03-06 09:41:37
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/templates/gris Modified Files: main.html Log Message: Hello :) Bon, les sondages fonctionnent nickel ! On accepte un seul vote par adresse IP, les sondages peuvent être ouverts ou fermés ... =================================================================== RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/templates/gris/main.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- main.html 5 Mar 2003 16:54:03 -0000 1.3 +++ main.html 6 Mar 2003 09:41:06 -0000 1.4 @@ -58,7 +58,7 @@ </head> - <body background="/templates/gris/fond.png"> + <body> <!--<body bgcolor="#878585">--> <center> @@ -103,7 +103,7 @@ <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#244ca0"> <tr> <td background="templates/gris/bandeau-fond.png" align="center"> - <img src="/templates/gris/bandeau.png"> + <img src="/images/titre.png"> </td> </tr> |
|
From: mdw c. <myd...@li...> - 2003-03-06 09:52:16
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/templates/gris Modified Files: main.html Log Message: correction des betises du themes gris =================================================================== RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/templates/gris/main.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- main.html 6 Mar 2003 09:41:06 -0000 1.4 +++ main.html 6 Mar 2003 09:52:14 -0000 1.5 @@ -1,8 +1,8 @@ <html> <head> -<meta name="keyword" content="php, mysql, mydynaweb, portal, engine, news grabber, sukria, abit, linux, enlightenment, e17, enlightenment screenshots, linux desktop screenshots, desktop screenshots, desktop, amd kt7, amd, kt7, via, tuning amd, tuning, nerd, geek, nerd vs geek, debian linux, debian, wallpapers, linux wallpapers, wallpaper, linux wallpaper, pics, amd athlon thunderbird, athlon, t-bird, athlon T-bird, vim, perl camel, perl camel code, perl, camel, code, perl caml, caml, perl caml code, imagei, perl, CGI, perl CGI, développeur Perl"> -<meta name="description" content="Homepage de sukria (Alexis Sukrieh). Site vitrine de MyDynaWeb car utilisant la dernière version de mydynaweb (logiciel de generation de portail en php mysql). Les sujets du sites sont basés sur l'informatique : linux (enlightenment, debian, vim, articles divers sur l'utilisation de linux) ; mydynaweb"> +<meta name="keyword" content="php, mysql, mydynaweb, portal, engine, news grabber, sukria, abit, linux, enlightenment, e17, enlightenment screenshots, linux desktop screenshots, desktop screenshots, desktop, amd kt7, amd, kt7, via, tuning amd, tuning, nerd, geek, nerd vs geek, debian linux, debian, wallpapers, linux wallpapers, wallpaper, linux wallpaper, pics, amd athlon thunderbird, athlon, t-bird, athlon T-bird, vim, perl camel, perl camel code, perl, camel, code, perl caml, caml, perl caml code, imagei, perl, CGI, perl CGI, développeur Perl"> +<meta name="description" content="Homepage de sukria (Alexis Sukrieh). Site vitrine de MyDynaWeb car utilisant la dernière version de mydynaweb (logiciel de generation de portail en php mysql). Les sujets du sites sont basés sur l'informatique : linux (enlightenment, debian, vim, articles divers sur l'utilisation de linux) ; mydynaweb"> <link REL="icon" HREF="sukria.png" TYPE="image/png"> @@ -58,7 +58,7 @@ </head> - <body> + <body background="/templates/gris/fond.png"> <!--<body bgcolor="#878585">--> <center> @@ -103,7 +103,7 @@ <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#244ca0"> <tr> <td background="templates/gris/bandeau-fond.png" align="center"> - <img src="/images/titre.png"> + <img src="/templates/gris/bandeau.png"> </td> </tr> @@ -152,11 +152,12 @@ </p> - ~LOGIN~ - ~POLL~ - ~WHATSUP_BOX~ + + ~LOGIN~ + + ~CONTROL_PANNEL~ ~HEADLINES~ |
|
From: mdw c. <myd...@li...> - 2003-03-13 16:56:52
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/include
Modified Files:
mydynaweb.libs.php gui.inc.php
Log Message:
un cookie est posé lorsque l'on répond à un sondage ainsi on se base egalement dessus pour savoir si on a deja repondu, utile en cas d'adresse IP dynamique'
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/mydynaweb.libs.php,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -3 -r1.43 -r1.44
--- mydynaweb.libs.php 5 Mar 2003 16:54:01 -0000 1.43
+++ mydynaweb.libs.php 13 Mar 2003 16:33:05 -0000 1.44
@@ -51,6 +51,7 @@
*****************************************/
define ("REMOTE_ADDR", $REMOTE_ADDR);
+define ("VOTES", $VOTES);
define("USER_FAM", $fam);
if (! isset($UserLang)) {
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/gui.inc.php,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -3 -r1.61 -r1.62
--- gui.inc.php 6 Mar 2003 09:41:06 -0000 1.61
+++ gui.inc.php 13 Mar 2003 16:33:07 -0000 1.62
@@ -359,10 +359,13 @@
if user IP is not found in the poll_users print the questions ;
if not (the user as already vote for that poll, just display
the results)
+
+ if the optionalm argument $view is set to TRUE, display the results
*/
-function get_poll_box($DBH)
+function get_poll_box($DBH, $view = 0)
{
+ $votes = explode ("-", VOTES);
$BOX_HASH_TEMPLATE = read_template(THEMES_PATH . "/box.html");
$sql = "SELECT pol_title, pol_id,
@@ -385,6 +388,15 @@
// we'll fetch every open polls
while ($row = $rqt->getrow()) {
+ // if the user has a cookie for that poll, don't show the form
+ // only display the results
+ for ($i=0; $i<sizeof($votes); $i++) {
+ if ($votes[$i] == $row['pol_id']) {
+ $view = 1;
+ }
+ }
+
+
// first look if that user (IP ADDR) can vote for that poll
$sql = "SELECT pol_id FROM poll_users
WHERE user_ip_addr = '".REMOTE_ADDR."'
@@ -419,7 +431,7 @@
$date = ($exp[2] . "/" . $exp[1] . "/" . $exp[0]);
// already vote for that poll
- if ($row2['pol_id'] == $row['pol_id'] and $row["pol_id"] != "") {
+ if ($view or ($row2['pol_id'] == $row['pol_id'] and $row["pol_id"] != "")) {
$VALUES['TITLE'] = "<b>" . $row["pol_title"] . "</b>";
$form = get_hash_template($BOX_HASH_TEMPLATE["HEAD"], $VALUES);
@@ -429,7 +441,7 @@
for ($i=0; $i<7; $i++) {
if (strlen($questions[$i])) {
- $size = ($votes[$i] * 200) / $max;
+ $size = ($votes[$i] * 100) / $max;
if ($size == 0) $size = 5;
$total += $votes[$i];
@@ -451,6 +463,8 @@
$form .= get_hash_template($BOX_HASH_TEMPLATE["FOOT"], $VALUES);
$poll_boxes .= $form;
+ $view = 0;
+ $VALUES = Array();
}
else {
@@ -478,6 +492,8 @@
$poll_boxes .= $form;
$poll_boxes .= "<br>";
+ $view = 0;
+ $VALUES = Array();
}
}
}
|
|
From: mdw c. <myd...@li...> - 2003-03-13 17:01:07
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs
Modified Files:
poll.php
Log Message:
un cookie est posé lorsque l'on répond à un sondage ainsi on se base egalement dessus pour savoir si on a deja repondu, utile en cas d'adresse IP dynamique'
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/poll.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- poll.php 5 Mar 2003 18:41:25 -0000 1.1
+++ poll.php 13 Mar 2003 16:33:02 -0000 1.2
@@ -16,6 +16,7 @@
$rqt->query($DBH, $sql) or send_sql_error($PHP_SELF, $sql, $rqt->error());
// get the number of votes
+ $poll++;
$sql = "SELECT pol_question_".$poll."_num
FROM poll
WHERE pol_id = $pol_id";
@@ -29,6 +30,9 @@
$rqt = new query($DBH);
$rqt->query($DBH, $sql) or send_sql_error($PHP_SELF, $sql, $rqt->error());
+
+
+ setcookie ("VOTES", ($VOTES . "-".$pol_id), time() + 365 * 3600 * 24, "/");
// go back to the news page
header ("Location: news.php");
|
|
From: mdw c. <myd...@li...> - 2003-03-14 15:10:23
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/include Modified Files: templates.inc.php Log Message: quelques mise à jour avant le premier taggage en mytinyweb_0.1 =================================================================== RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/templates.inc.php,v retrieving revision 1.38 retrieving revision 1.39 diff -u -3 -r1.38 -r1.39 --- templates.inc.php 5 Mar 2003 16:54:02 -0000 1.38 +++ templates.inc.php 14 Mar 2003 15:09:51 -0000 1.39 @@ -13,7 +13,7 @@ *******************************************/ -function init_main_values($template_path, $content, $titre, $DBH,$c, $IP='', $REFER='', $MSG='', $ZONE=99, $PAGE=99) +function init_main_values($template_path, $content, $titre, $DBH,$c, $IP='', $REFER='', $MSG='', $ZONE=99, $PAGE=99, $view=0) /////////////////////////////////////////////////////////////// // We define here each of main values used to print HTML output /////////////////////////////////////////////////////////////// @@ -28,7 +28,7 @@ } $VALUES["TOPICS_BOX"] = get_topics_htmlbox($DBH); - $VALUES["POLL"] = get_poll_box($DBH); + $VALUES["POLL"] = get_poll_box($DBH, $view); $VALUES['LAYER'] = get_layer($DBH, $hash_layer); $VALUES['SPONSORS'] = get_sponsors($DBH, $hash_box); $VALUES['STATBOX'] = get_global_stats_box($DBH, $hash_box); |
|
From: mdw c. <myd...@li...> - 2003-03-14 15:10:24
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/templates/gris Modified Files: main.html Log Message: quelques mise à jour avant le premier taggage en mytinyweb_0.1 =================================================================== RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/templates/gris/main.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- main.html 6 Mar 2003 09:52:14 -0000 1.5 +++ main.html 14 Mar 2003 15:09:52 -0000 1.6 @@ -118,8 +118,17 @@ <table border="0" cellspacing="3" cellpadding="0" width="100%"><tr><td> - <p> </p> - + <table align="center"> + <tr> + <td> + <img src="/images/gnome-warning.png" > + </td> + <td> + <b>Attention !</b> Vous êtes sur un site de <a href="http://www.copinedegeek.com" target="out">g</><a href="http://www.thinkgeek.com" target="out">e</a><a href="http://slashdot.org" target="out">e</a><a href="http://www.geekcode.com" target="out">k</a> ! + </td> + </tr> + </table> + ~CONTENT~ </td></tr></table> @@ -152,7 +161,8 @@ </p> - + ~POLL~ + ~WHATSUP_BOX~ ~LOGIN~ |
|
From: mdw c. <myd...@li...> - 2003-03-21 09:15:00
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs
Modified Files:
poll.php
Log Message:
Correction d'un vilain bug dans la lecture du cookie des voffectués.
Maintenant ce bug est correigé et quand on a l'id du sondage dans le cookie "VOTES"
le sondage est affiché.
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/poll.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- poll.php 13 Mar 2003 16:33:02 -0000 1.2
+++ poll.php 21 Mar 2003 09:14:29 -0000 1.3
@@ -10,8 +10,39 @@
header ("Location: news.php");
}
+ $site_root = SITE_ROOT;
+
+/* FIXME : nedd to check that the refere is from the site
+ to prevent some abuse
+
+ if (! preg_match ("/^$site_root.*$/", $HTTP_REFERER)) {
+ print "You bastard !<br>Don't try to abuse my poll !";
+ exit();
+ }
+*/
+ // some check up before processing
+
+/* print "$HTTP_REFERER - <br>";
+ print "$HTTP_USER_AGENT - <br>";
+ print "$REMOTE_ADDR - <br>";
+ exit;
+*/
+
+
+ // look if the same user_agent has yet answered for that poll
+ /*$sql = "SELECT count(user_agent)
+ FROM poll_users
+ WHERE pol_id = $pol_id
+ AND user_agent = '$HTTP_USER_AGENT'";
+ $rqt = new query($DBH);
+ $rqt->query($DBH, $sql) or send_sql_error($PHP_SELF, $sql, $rqt->error());
+ $row = $rqt->getrow ();
+*/
+
+
// log the IP that vote for that poll
- $sql = "INSERT into poll_users (pol_id, user_ip_addr) values ($pol_id, '".$REMOTE_ADDR."');";
+ $sql = "INSERT into poll_users (pol_id, user_ip_addr, user_agent)
+ values ($pol_id, '".$REMOTE_ADDR."', '$HTTP_USER_AGENT');";
$rqt = new query($DBH);
$rqt->query($DBH, $sql) or send_sql_error($PHP_SELF, $sql, $rqt->error());
|
|
From: mdw c. <myd...@li...> - 2003-03-21 09:15:01
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/include
Modified Files:
gui.inc.php templates.inc.php
Log Message:
Correction d'un vilain bug dans la lecture du cookie des voffectués.
Maintenant ce bug est correigé et quand on a l'id du sondage dans le cookie "VOTES"
le sondage est affiché.
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/gui.inc.php,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -3 -r1.62 -r1.63
--- gui.inc.php 13 Mar 2003 16:33:07 -0000 1.62
+++ gui.inc.php 21 Mar 2003 09:14:29 -0000 1.63
@@ -365,7 +365,7 @@
function get_poll_box($DBH, $view = 0)
{
- $votes = explode ("-", VOTES);
+ $cookie_votes = explode ("-", VOTES);
$BOX_HASH_TEMPLATE = read_template(THEMES_PATH . "/box.html");
$sql = "SELECT pol_title, pol_id,
@@ -390,12 +390,12 @@
// if the user has a cookie for that poll, don't show the form
// only display the results
- for ($i=0; $i<sizeof($votes); $i++) {
- if ($votes[$i] == $row['pol_id']) {
+ for ($i=0; $i<sizeof($cookie_votes); $i++) {
+ if ($cookie_votes[$i] == $row['pol_id']) {
$view = 1;
}
}
-
+
// first look if that user (IP ADDR) can vote for that poll
$sql = "SELECT pol_id FROM poll_users
@@ -406,7 +406,7 @@
$row2 = $rqt2->getrow();
// set the title
- $VALUES['TITLE'] .= "<br><b>" . $row["pol_title"] . "</b>";
+ $VALUES['TITLE'] .= "<b>" . $row["pol_title"] . "</b>";
$form = get_hash_template($BOX_HASH_TEMPLATE["HEAD"], $VALUES);
$questions[0] = $row["pol_question_1_str"];
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/templates.inc.php,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -3 -r1.39 -r1.40
--- templates.inc.php 14 Mar 2003 15:09:51 -0000 1.39
+++ templates.inc.php 21 Mar 2003 09:14:30 -0000 1.40
@@ -264,10 +264,10 @@
list($usec, $sec) = explode(" ",microtime());
$now = (float)$usec + (float)$sec;
$time_used = sprintf("%01.3f", $now - $TIME_START);
- print "<center><font face='sans-serif' size=\"-2\">
+ print "<div id='signature'>
Ce site tourne sous MyTinyWeb 0.1<br>
Page générée en $time_used secondes.
- </font></center>\n";
+ </div>\n";
}
$output .= $line;
@@ -279,10 +279,10 @@
list($usec, $sec) = explode(" ",microtime());
$now = (float)$usec + (float)$sec;
$time_used = sprintf("%01.3f", $now - $TIME_START);
- print "<center><font face='sans-serif' size=-2>
+ print "<div id='signature'>
Ce site tourne sous MyTinyWeb 0.1<br>
Page générée en $time_used secondes.
- </font></center>\n";
+ </div>\n";
}
print ($file[$i]);
$output .= $file[$i];
@@ -344,10 +344,10 @@
list($usec, $sec) = explode(" ",microtime());
$now = (float)$usec + (float)$sec;
$time_used = sprintf("%01.3f", $now - $TIME_START);
- print "<center><font face='sans-serif' size=-2>
+ print "<div id='signature'>
Ce site tourne sous MyTinyWeb 0.1<br>
Page générée en $time_used secondes.
- </font></center>";
+ </div>";
}
|
|
From: mdw c. <myd...@li...> - 2003-03-21 09:15:01
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/tools/events
Modified Files:
cache.php
Log Message:
Correction d'un vilain bug dans la lecture du cookie des voffectués.
Maintenant ce bug est correigé et quand on a l'id du sondage dans le cookie "VOTES"
le sondage est affiché.
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/tools/events/cache.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- cache.php 14 Feb 2003 08:31:14 -0000 1.20
+++ cache.php 21 Mar 2003 09:14:30 -0000 1.21
@@ -1,7 +1,7 @@
<?PHP
//!! Cache System
//! Global cache system for MDW.Q
-// $Id: cache.php,v 1.20 2003/02/14 08:31:14 sukria Exp $
+// $Id: cache.php,v 1.21 2003/03/21 09:14:30 sukria Exp $
/*!
This class implement a global cache system for MDW.
@@ -184,10 +184,10 @@
$now = (float)$usec + (float)$sec;
$time_used = sprintf("%01.3f", $now - $TIME_START);
- print "<center><font face='sans-serif' size=-2>
+ print "<div id='signature'>
Ce site tourne sous MyTinyWeb 0.1<br>
Page cachée, générée en $time_used secondes.
- </font></center>\n";
+ </div>\n";
}
}
|
|
From: mdw c. <myd...@li...> - 2003-04-02 13:50:39
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs
Modified Files:
comment.php save_news.php
Log Message:
correction d'un bug lorsque un membre poste un message
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/comment.php,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- comment.php 26 Dec 2002 13:46:56 -0000 1.23
+++ comment.php 2 Apr 2003 13:50:08 -0000 1.24
@@ -1,5 +1,7 @@
<?
+//poisson d'avril
+
/////////////////////////////////////////////////
// TIME INIT FOR PERF BENCH
list($usec, $sec) = explode(" ",microtime());
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/save_news.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- save_news.php 14 Feb 2003 08:31:13 -0000 1.4
+++ save_news.php 2 Apr 2003 13:50:08 -0000 1.5
@@ -95,6 +95,6 @@
$last_news = $DBH->lastid('news_seq');
}
-header("Location: comment.php?news=$last_news");
+header("Location: members.php");
?>
|
|
From: mdw c. <myd...@li...> - 2003-04-02 13:50:39
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/include
Modified Files:
gui.inc.php templates.inc.php
Log Message:
correction d'un bug lorsque un membre poste un message
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/gui.inc.php,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -3 -r1.63 -r1.64
--- gui.inc.php 21 Mar 2003 09:14:29 -0000 1.63
+++ gui.inc.php 2 Apr 2003 13:50:08 -0000 1.64
@@ -363,10 +363,10 @@
if the optionalm argument $view is set to TRUE, display the results
*/
-function get_poll_box($DBH, $view = 0)
+function get_poll_box($DBH, $view = 0, $hash_box)
{
$cookie_votes = explode ("-", VOTES);
- $BOX_HASH_TEMPLATE = read_template(THEMES_PATH . "/box.html");
+ $BOX_HASH_TEMPLATE = $hash_box;
$sql = "SELECT pol_title, pol_id,
pol_question_1_str, pol_question_1_num,
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/templates.inc.php,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -3 -r1.40 -r1.41
--- templates.inc.php 21 Mar 2003 09:14:30 -0000 1.40
+++ templates.inc.php 2 Apr 2003 13:50:08 -0000 1.41
@@ -28,7 +28,7 @@
}
$VALUES["TOPICS_BOX"] = get_topics_htmlbox($DBH);
- $VALUES["POLL"] = get_poll_box($DBH, $view);
+ $VALUES["POLL"] = get_poll_box($DBH, $view, $hash_box);
$VALUES['LAYER'] = get_layer($DBH, $hash_layer);
$VALUES['SPONSORS'] = get_sponsors($DBH, $hash_box);
$VALUES['STATBOX'] = get_global_stats_box($DBH, $hash_box);
|
|
From: mdw c. <myd...@li...> - 2003-04-02 13:50:40
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/templates/dynadot Modified Files: main.html Log Message: correction d'un bug lorsque un membre poste un message =================================================================== RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/templates/dynadot/main.html,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- main.html 19 Feb 2002 11:24:21 -0000 1.13 +++ main.html 2 Apr 2003 13:50:08 -0000 1.14 @@ -129,7 +129,7 @@ </td> <td align="left" valign="middle" bgcolor="#006666"> <!-- TITLE --> -<B><FONT size="+3" color="#FFFFFF">~SITE_TITLE~</FONT></B> +<B><FONT size="+3" color="#FFFFFF">sukria.net</FONT></B> <!-- end TITLE --> </td> |
|
From: mdw c. <myd...@li...> - 2003-04-03 10:15:30
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs
Modified Files:
members.php update_news.php
Log Message:
GROS TRAVAIL SUR L'ESPACE MEMBRE
J'ai beaucoup travaillé sur l'ergonomie de l'esapce membre, on présente désormais les infos sous forme de tableau
tout est traduit et donne envie de poster des news :)
D'ailleurs, lorsque l'on met à jour un article, on a une iframe en bas de page pour avoir un aperçu du rendu.
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/members.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- members.php 14 Feb 2003 08:31:13 -0000 1.4
+++ members.php 3 Apr 2003 10:15:18 -0000 1.5
@@ -1,13 +1,14 @@
<?
+
+/* MyTinyWeb header */
include('./include/mydynaweb.init.php');
include(DYNA_ROOT . '/include/mydynaweb.libs.php');
+$DBH=new db();
+$DBH->open($dbName, $dbServer, $dbUser, $dbPass);
- $DBH=new db();
- $DBH->open($dbName, $dbServer, $dbUser, $dbPass);
-
-
- check_session($DYNA_SESSION, $DBH);
+/* We are in a member area, check that user is allowed to be here */
+check_session($DYNA_SESSION, $DBH);
$login = get_login_from_session (DYNA_SESSION, $DBH);
if (strlen($login)) {
$sql = "SELECT nom, prenom, email
@@ -23,53 +24,78 @@
}
- $titre = translate("WELCOME",$DBH)." $UserID !";
+/* set the title of the page */
+$titre = translate("WELCOME",$DBH)." $UserID !";
- if (strlen($msg)) {
- $chapeau = translate(strtoupper($msg), $DBH);
- }
-
- $texte = "<a class=\"lienpage\" href=\"add_news.php\">".translate("POST_NEWS",$DBH)."</a><br>
- <a class=\"lienpage\" href=\"chpass.php\">".translate("CH_PASSWD",$DBH)."</a>
- <p>
- ".translate('TO_BE_APPROVED', $DBH)." <br> ";
-
- ///////////////////////////////////////////////////////
- // fetch the news posted by member and not yet approved
- ///////////////////////////////////////////////////////
- $sql = "SELECT num_news, titre
- FROM news where user_name = '$login'
- AND approved = 0";
- $rqt = new query($DBH);
- $rqt->query($DBH, $sql);
- while ($row = $rqt->getrow()) {
- $texte .= "<li>$row[1] : [<a href='comment.php?news=$row[0]'>Preview</a>] [<a href='update_news.php?news=$row[0]'>Edit</a>]</li>";
- }
-
+/* put the message if there is one */
+if (strlen($msg)) {
+ $header = translate(strtoupper($msg), $DBH);
+}
+
+/* set the link to post a story*/
+$post_news_link = ("<a class=\"lienpage\" href=\"add_news.php\">".translate("POST_NEWS",$DBH)."</a>");
+
+
+/*set the link to change the password */
+$change_passwd_link = ("<a class=\"lienpage\" href=\"chpass.php\">".translate("CH_PASSWD",$DBH)."</a>");
+
+
+/* fetch the news posted by member and not yet approved */
+$to_be_approved = (translate('TO_BE_APPROVED', $DBH)." <br> ");
+$sql = "SELECT num_news, titre
+ FROM news where user_name = '$login'
+ AND approved = 0";
+$rqt = new query($DBH);
+$rqt->query($DBH, $sql);
+while ($row = $rqt->getrow()) {
+ $to_be_approved .= "<li><a href='update_news.php?news=$row[0]'>$row[1]</a></li>";
+}
- $sql = "SELECT last_login
- FROM members
- WHERE name='$login'";
- $rqt = new query($DBH);
- $rqt->query($DBH, $sql);
- $row = $rqt->getrow();
- $last_visit = $row[0];
+/* fetch the story that are not yet read by that user */
+$sql = "SELECT last_login
+ FROM members
+ WHERE name='$login'";
+$rqt = new query($DBH);
+$rqt->query($DBH, $sql);
+$row = $rqt->getrow();
+$last_visit = $row[0];
- $sql = "SELECT num_news, titre
- FROM news
- WHERE date > '$last_visit'";
- $rqt = new query($DBH);
- $rqt->query($DBH, $sql);
- while ($row = $rqt->getrow()) {
- $news_nonlues .= "<li><a href='comment.php?news=$row[0]'>$row[1]</a></li>";
- }
-
- $texte .= "\n<hr>\nDepuis votre dernière visite le $last_visit,
- <br>les nouvelles suivantes ont été postées :\n<p>\n";
- $texte .= "<ul>$news_nonlues</ul>";
+$sql = "SELECT num_news, titre
+ FROM news
+ WHERE date > '$last_visit'";
+$rqt = new query($DBH);
+$rqt->query($DBH, $sql);
+while ($row = $rqt->getrow()) {
+ $unread_stories .= "<li><a href='comment.php?news=$row[0]'>$row[1]</a></li>";
+}
+
+
+/* draw the table to fit everything in a smart way */
+$text_body = "
+<table class='formcontent'>
+
+ <tr>
+ <td>".translate ("ADMIN", $DBH)."</td>
+ <td>$change_passwd_link</td>
+ </tr>
+
+ <tr>
+ <td>".translate ("MANAGE_STORIES", $DBH)."</td>
+ <td>$post_news_link<p>$to_be_approved</td>
+ </tr>
+
+ <tr>
+ <td>".translate ("SINCE_LAST_VISIT", $DBH)."</td>
+ <td>$unread_stories</td>
+ </tr>
+
+</table>
+";
+
+$header .= translate("MEMBERS_AREA_HEADER", $DBH);
- $CONTENT = get_page($titre, $chapeau, $texte, $DBH);
- print_template(THEMES_PATH."/main.html", $CONTENT, "$UserID Room", $DBH,"MEMBERS");
+$CONTENT = get_page($titre, $header, $text_body, $DBH);
+print_template(THEMES_PATH."/main.html", $CONTENT, "$UserID Room", $DBH,"MEMBERS");
?>
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/update_news.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- update_news.php 27 Dec 2002 15:51:49 -0000 1.1
+++ update_news.php 3 Apr 2003 10:15:21 -0000 1.2
@@ -47,47 +47,57 @@
$list_users = get_users_box($DBH, $member);
$formulaire = "
-<FORM name=\"f\" action=\"save_news.php\" METHOD='POST'>
+<FORM name='f' action='save_news.php' METHOD='POST'>
-<input type=\"hidden\" name=\"num_news\" value=\"$num_news\">
-<input type=\"hidden\" name=\"date_ins\" value=\"$date\">
+<input type='hidden' name='num_news' value='$num_news'>
+<input type='hidden' name='date_ins' value='$date'>
+<input type='hidden' name='user' value='$login'>
-<table align=\"center\">
-<tr><td width=\"100%\">
- <table width=\"100%\">
- <td align=\"left\"> <b><i>Title</i></b><br>
- <input name=\"titre\" type=\"text\" size=\"40\" value=\"$titre\">
- </td>
- <td align=\"left\">
- Category<br>
- $liste_family<br>
- Topic<br>
- $liste_topics<br>
- <input type='hidden' name='user' value='$login'>
- Language<br>
- $list_lang
- </td>
+<table class='formcontent'>
+ <tr>
+ <td>".translate ("TITLE", $DBH)."</td>
+ <td><input name='titre' type='text' size='80' value='$titre'></td>
+ </tr>
+ <tr>
+ <td>".translate ("CATEGORY", $DBH) . "</td>
+ <td>$liste_family</td>
+ </tr>
+
+ <tr>
+ <td>".translate ("TOPIC", $DBH)."</td>
+ <td>$liste_topics</td>
+ </tr>
+
+ <tr>
+ <td>".translate ("LANGUAGE", $DBH)."</td>
+ <td>$list_lang</td>
+ </tr>
+
+ <tr>
+ <td>".translate ("STORY_HEADER", $DBH)."</td>
+ <td><textarea name='nouvelle' wrap='virtual' cols='70' rows='10'>$texte</textarea></td>
+ </tr>
+
+ <tr>
+ <td>".translate ("STORY_BODY", $DBH)."</td>
+ <td><textarea name='long' wrap='virtual' cols='70' rows='20'>$longtext</textarea></td>
+ </tr>
+
+ <tr>
+ <td colspan='2' align='center'>
+ <input type='submit' value='".translate ("CONFIRM", $DBH)."'>
+ </td>
+ </tr>
</table>
-</td>
-</tr>
-<tr>
- <td>
- <textarea name=\"nouvelle\" wrap=\"virtual\" cols=\"70\" rows=\"10\">$texte</textarea>
- </td>
-</tr>
-<tr>
- <td>
- <textarea name=\"long\" wrap=\"virtual\" cols=\"70\" rows=\"20\">$longtext</textarea>
- </td>
-</tr>
-<tr align=\"center\">
- <td align=\"center\">
- <input type=\"submit\" value=\"Yeah\">
- </td>
-</tr>
-</table>
</FORM>
+
+
+<p>
+<h2>Prévisualisation de l'article</h2>
+<p>
+
+<iframe width='100%' height='480' src='comment.php?news=$num_news'></iframe>
";
$titre = translate ('UPDATE_NEWS', $DBH);
|
|
From: mdw c. <myd...@li...> - 2003-04-03 10:17:39
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs
Modified Files:
add_news.php
Log Message:
pour le nouvel espace membre
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/add_news.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- add_news.php 26 Apr 2002 13:56:06 -0000 1.2
+++ add_news.php 3 Apr 2003 10:17:06 -0000 1.3
@@ -14,88 +14,68 @@
$list_families = get_fam_box($DBH, USER_FAM, '');
$liste_topics = get_topics_box($DBH);
-$formulaire = "<FORM name=\"f\" action=\"save_news.php\" method='POST'>
-<table align=\"center\" width=\"480\" cellpadding=0 cellspacing=0 border=0>
-<tr>
- <td align=\"left\"> <b><i>".translate("TITLE",$DBH)."</i></b><br>
- <input name=\"titre\" type=\"text\" size=\"30\">
- </td>
- <td align=\"left\">
- <b><i>".translate("TOPICS",$DBH)."</i></b><br>
- $liste_topics
- </td>
-</tr>
-<tr>
- <td> ".translate("CHOOSE_CATEGORY", $DBH)."</td>
- <td>$list_families</td>
-</tr>
-
-<tr>
-<td align=\"left\">
-<i>".translate("Y_C_SEND_EMAIL",$DBH)."</i><br>
-<input type=\"text\" name=\"TO\" size=\"30\">
-</td>
-<td align=\"left\">
- <b><i>".translate("LANGUAGE",$DBH)."</i></b><br>
- $liste_lang
- </select>
- </td>
-
-</tr>
-
-
-<tr>
- <td colspan=2>
- <b>".translate('NEWS_HEAD', $DBH)."</b><br>
- <textarea name=\"nouvelle\" wrap=\"virtual\" cols=\"50\" rows=\"10\"></textarea>
- </td>
-</tr>
-
-<tr>
- <td colspan=2>
- <b>".translate('NEWS_BODY', $DBH)."</b><br>
- <textarea name=\"longtext\" wrap=\"virtual\" cols=\"50\" rows=\"30\"></textarea>
- </td>
-</tr>
-
-<tr>
-
- <td colspan='2'>
- <br>
-
- <b>".translate('BOUND_LINKS', $DBH)."</b><br>
- <br>
-
- <li>
- url : <input type='text' name='link_url1' size='30'> ".translate('name', $DBH)."
- <input type='text' name='link_name1' size='30'>
- </li>
-<br>
- <li>
- url : <input type='text' name='link_url2' size='30'> ".translate('name', $DBH)."
- <input type='text' name='link_name2' size='30'>
- </li>
-<br>
- <li>
- url : <input type='text' name='link_url3' size='30'> ".translate('name', $DBH)."
- <input type='text' name='link_name3' size='30'>
- </li>
-
- </td>
-</tr>
-
-<tr align=\"center\">
- <td align=\"center\" colspan=2>
-
- <br><br>
-
- <input type=\"submit\" value=\"".translate("SUBMIT",$DBH)."\">
- </td>
-</tr>
-</table>
+$formulaire = "
+<FORM name=\"f\" action=\"save_news.php\" method='POST'>
<input type=\"hidden\" name=\"user\" value=\"$UserID\">
<input type=\"hidden\" name=\"online\" value=\"0\">
+
+<table class='formcontent'>
+ <tr>
+ <td>".translate ("TITLE", $DBH)."</td>
+ <td><input name='titre' type='text' size='80' value='$titre'></td>
+ </tr>
+
+ <tr>
+ <td>".translate ("CATEGORY", $DBH) . "</td>
+ <td>$list_families</td>
+ </tr>
+
+ <tr>
+ <td>".translate ("TOPIC", $DBH)."</td>
+ <td>$liste_topics</td>
+ </tr>
+
+ <tr>
+ <td>".translate ("LANGUAGE", $DBH)."</td>
+ <td>$liste_lang</td>
+ </tr>
+
+ <tr>
+ <td>".translate ("NEWS_HEAD", $DBH)."</td>
+ <td><textarea name='nouvelle' wrap='virtual' cols='70' rows='10'>$texte</textarea></td>
+ </tr>
+
+ <tr>
+ <td>".translate ("NEWS_BODY", $DBH)."</td>
+ <td><textarea name='longtext' wrap='virtual' cols='70' rows='20'>$longtext</textarea></td>
+ </tr>
+
+ <tr>
+ <td>".translate('BOUND_LINKS', $DBH)."</td>
+ <td>
+
+ - url : <input type='text' name='link_url1' size='30'> ".translate('name', $DBH)."
+ <input type='text' name='link_name1' size='30'>
+ <br>
+
+ - url : <input type='text' name='link_url2' size='30'> ".translate('name', $DBH)."
+ <input type='text' name='link_name2' size='30'>
+ <br>
+
+ - url : <input type='text' name='link_url3' size='30'> ".translate('name', $DBH)."
+ <input type='text' name='link_name3' size='30'>
+
+
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan='2' align='center'>
+ <input type='submit' value='".translate ("CONFIRM", $DBH)."'>
+ </td>
+ </tr>
+ </table>
</FORM>";
|
|
From: mdw c. <myd...@li...> - 2003-04-03 12:40:47
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs
Modified Files:
save_news.php update_news.php
Log Message:
possibilité de désactiver la complétion des liens HTTP
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/save_news.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- save_news.php 2 Apr 2003 13:50:08 -0000 1.5
+++ save_news.php 3 Apr 2003 12:26:49 -0000 1.6
@@ -17,13 +17,12 @@
$aujourdhui = date( "Y-m-d", time() );
-$auto_link_checked = 1;
-//if ($auto_link_checked) {
+if ($auto_link_checked) {
$nouvelle = ereg_replace("((ftp://)|(http://))(([[:alnum:]]|[[:punct:]])*)", "<a href=\"\\0\">\\0</a>",$nouvelle);
$longtext = ereg_replace("((ftp://)|(http://))(([[:alnum:]]|[[:punct:]])*)", "<a href=\"\\0\">\\0</a>",$longtext);
$long = ereg_replace("((ftp://)|(http://))(([[:alnum:]]|[[:punct:]])*)", "<a href=\"\\0\">\\0</a>",$long);
-//}
+}
///////////////////////////////////////////////////////
//
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/update_news.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- update_news.php 3 Apr 2003 10:15:21 -0000 1.2
+++ update_news.php 3 Apr 2003 12:26:50 -0000 1.3
@@ -15,6 +15,17 @@
die();
}
+
+/* grab the links bound to that story */
+/*
+$sql = "SELECT url, name from links where _num_news=$num_news";
+$rqt = new query ($DBH);
+$rqt->query($DBH,$sql) or send_sql_error($PHP_SELF, $sql, $rqt->error());
+while ($row = $rqt->getrow()) {
+
+}
+*/
+
$login = get_login_from_session (DYNA_SESSION, $DBH);
$sql = "select num_news, titre, texte, _num_topic, lang, family, long_text, date, user_name
from news
@@ -29,6 +40,8 @@
die();
}
+
+
$row = $rqt->getrow();
$num_news = $row[0];
@@ -83,7 +96,15 @@
<td>".translate ("STORY_BODY", $DBH)."</td>
<td><textarea name='long' wrap='virtual' cols='70' rows='20'>$longtext</textarea></td>
</tr>
-
+
+ <tr>
+ <td>".translate ("AUTO_LINK", $DBH)."</td>
+ <td>
+ <input type='radio' name='auto_link_checked' value='0' checked>".translate ("NO", $DBH)."
+ <input type='radio' name='auto_link_checked' value='1'>".translate ("YES", $DBH)."
+ </td>
+ </tr>
+
<tr>
<td colspan='2' align='center'>
<input type='submit' value='".translate ("CONFIRM", $DBH)."'>
|