|
From: mdw c. <myd...@li...> - 2002-12-27 11:51:22
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/admin
Modified Files:
page.php show_news.php
Log Message:
Nouvelle fonctionnalité : les nouvelles peuvent être approuvées.
Le travail ici corresponda à la nouvelle capacité de l'administrateur d'approuver les dernieres nouvelles
postées par les utilisateurs.
On a un visu sur la page d'accueil des nouvelles qui attendent une bénédiction et on peut aussi le voir dans
l'affichage des nouvelles 'Nouvelles -> mise a jour'
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/admin/page.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- page.php 24 Jan 2002 01:49:41 -0000 1.2
+++ page.php 27 Dec 2002 11:51:21 -0000 1.3
@@ -24,6 +24,35 @@
<h1>Welcome to your admin section !</h1>
+
+<?
+ $sql = "select num_news, titre, date, user_name, approved
+ from news
+ where approved = 0
+ order by num_news desc";
+ $rqt = new query($DBH);
+ $rqt->query($DBH,$sql) or send_sql_error($PHP_SELF, $sql, $rqt->error());
+
+ $i=0;
+
+ while ($infos_page = $rqt->getrow()) {
+ $lines .= "<tr bgcolor='$bg'>
+ <td>[<a href='approve.php?news=$infos_page[0]'>APPROVE</a>] <a href=\"update_news.php?num_news=$infos_page[0]\">$infos_page[1]</a></td>
+ <td>$infos_page[2] </td>
+ <td>$infos_page[3] </td>
+ </tr>\n";
+ }
+
+if (strlen($lines)) {
+ print "You have to approve some piece of news : <p>
+ ";
+ print "<table>$lines</table>";
+}
+
+?>
+
+
+
</center>
</body>
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/admin/show_news.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- show_news.php 24 Jan 2002 01:49:41 -0000 1.3
+++ show_news.php 27 Dec 2002 11:51:21 -0000 1.4
@@ -49,7 +49,7 @@
<?
-$sql = "select num_news, titre, date, user_name
+$sql = "select num_news, titre, date, user_name, approved
from news
order by num_news desc";
$rqt = new query($DBH);
@@ -67,11 +67,21 @@
}
if ($act == "mod") {
- print "<tr bgcolor='$bg'>
+ if ($infos_page[4]) {
+ print "<tr bgcolor='$bg'>
<td><a href=\"update_news.php?num_news=$infos_page[0]\">$infos_page[1]</a></td>
<td>$infos_page[2] </td>
<td>$infos_page[3] </td>
</tr>\n";
+ }
+ else {
+ print "<tr bgcolor='#DDDDDD'>
+ <td>[<a href='approve.php?news=$row[0]'>APPROVE</a>] <a href=\"update_news.php?num_news=$infos_page[0]\"><font color='#AA0000'>$infos_page[1]</font></a></td>
+ <td><font color='#AA0000'>$infos_page[2]</font></td>
+ <td><font color='#AA0000'>$infos_page[3]</font> </td>
+ </tr>\n";
+
+ }
}
else {
print "<tr bgcolor='$bg'>
|
|
From: mdw c. <myd...@li...> - 2002-12-27 11:52:57
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/tools/events Modified Files: stats.php Log Message: Travail sur l'espace membre. Toute nouvelle postée doit désormais être approuvée par l'administrateur. Il reste du taf dans l'espace membre. Une nouvelle peut également être prévisualisée/éditée par le membre qui l'a postée. =================================================================== RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/tools/events/stats.php,v retrieving revision 1.15 retrieving revision 1.16 diff -u -3 -r1.15 -r1.16 --- stats.php 26 Dec 2002 13:46:57 -0000 1.15 +++ stats.php 27 Dec 2002 11:52:56 -0000 1.16 @@ -168,6 +168,7 @@ $sql = "select titre, num_news from news where lang = '".USER_LANG."' + and approved=1 order by num_news desc"; $rqt = new query($DBH); $rqt->query($DBH, $sql); @@ -206,6 +207,7 @@ from comments, news where news.lang = '".USER_LANG."' and news.num_news = comments._num_news + and news.approved = 1 order by comments.num_cmt desc"; $rqt = new query($DBH); $rqt->query($DBH, $sql); |
|
From: mdw c. <myd...@li...> - 2002-12-27 11:53:27
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/include Modified Files: mydynaweb.libs.php Log Message: Travail sur l'espace membre. Toute nouvelle postée doit désormais être approuvée par l'administrateur. Il reste du taf dans l'espace membre. Une nouvelle peut également être prévisualisée/éditée par le membre qui l'a postée. =================================================================== RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/mydynaweb.libs.php,v retrieving revision 1.41 retrieving revision 1.42 diff -u -3 -r1.41 -r1.42 --- mydynaweb.libs.php 31 Aug 2002 01:26:46 -0000 1.41 +++ mydynaweb.libs.php 27 Dec 2002 11:52:56 -0000 1.42 @@ -95,11 +95,5 @@ break; } - - - - - - ?> |
|
From: mdw c. <myd...@li...> - 2002-12-27 11:53:27
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs
Modified Files:
add_comment.php members.php news.php save_news.php welcome.php
Log Message:
Travail sur l'espace membre.
Toute nouvelle postée doit désormais être approuvée par l'administrateur.
Il reste du taf dans l'espace membre.
Une nouvelle peut également être prévisualisée/éditée par le membre qui l'a postée.
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/add_comment.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- add_comment.php 26 Dec 2002 10:43:29 -0000 1.9
+++ add_comment.php 27 Dec 2002 11:52:56 -0000 1.10
@@ -1,28 +1,58 @@
<?
+///////////////////////////////////////////////////
+// init stuff
+///////////////////////////////////////////////////
include('./include/mydynaweb.init.php');
include(DYNA_ROOT . '/include/mydynaweb.libs.php');
-
$DBH=new db();
$DBH->open($dbName, $dbServer, $dbUser, $dbPass);
-set_theme($DBH);
+///////////////////////////////////////////////////
+// check we have a news bound
+///////////////////////////////////////////////////
if (! strlen($num_news)) {
header("Location: news.php");
die();
}
-if (! strlen($UserID)) {
- $UserID = translate("ANONYMOUS",$DBH);
+
+///////////////////////////////////////////////////
+// look for an existing member
+///////////////////////////////////////////////////
+$login = get_login_from_session (DYNA_SESSION, $DBH);
+if (strlen($login)) {
+ $sql = "SELECT nom, prenom, email
+ FROM members
+ WHERE name='$login'";
+ $rqt = new query($DBH);
+ $rqt->query($DBH, $sql);
+ $row = $rqt->getrow();
+
+ $username = $row[1] . " " . $row[0];
+ $usermail = $row[2];
+ $UserID = $username;
}
-if (isset($DYNA_USER)) {
+///////////////////////////////////////////////////
+// look for an existing comment user
+///////////////////////////////////////////////////
+else if (isset($DYNA_USER)) {
$frags = explode("__", $DYNA_USER);
$username = $frags[0];
$usermail = $frags[1];
+ $UserID = $username;
}
+////////////////////////////////////////////////////
+// If there is not any user, anonymous
+////////////////////////////////////////////////////
+if (! strlen($UserID)) {
+ $UserID = translate("ANONYMOUS",$DBH);
+}
+
+/*
// we get every comment posted for that news (for creating the reply listbox)
$sql = "SELECT title, num_comment
FROM comments
@@ -35,12 +65,11 @@
$REPLY_LIST .= "\t<option value=''>$row[0]</option>\n";
}
$REPLY_LIST .= "</SELECT>\n";
+*/
if (!isset($pere)) $pere = 0;
- $formulaire = "
-
-
+ $formulaire = "
<i><center>".translate('COMMENT_HEADER_TEXT', $DBH)."</center></i>
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/members.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- members.php 19 Feb 2002 11:05:50 -0000 1.2
+++ members.php 27 Dec 2002 11:52:56 -0000 1.3
@@ -8,11 +8,46 @@
check_session($DYNA_SESSION, $DBH);
+$login = get_login_from_session (DYNA_SESSION, $DBH);
+if (strlen($login)) {
+ $sql = "SELECT nom, prenom, email
+ FROM members
+ WHERE name='$login'";
+ $rqt = new query($DBH);
+ $rqt->query($DBH, $sql);
+ $row = $rqt->getrow();
+
+ $username = $row[1] . " " . $row[0];
+ $usermail = $row[2];
+ $UserID = $username;
+}
+
$titre = translate("WELCOME",$DBH)." $UserID !";
- $chapeau = "";
+
+
+ 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>";
+ <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>";
+ }
+
+
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/news.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- news.php 26 Dec 2002 13:46:56 -0000 1.9
+++ news.php 27 Dec 2002 11:52:56 -0000 1.10
@@ -95,6 +95,7 @@
where news._num_topic = topic.num_topic
AND news.lang = '". USER_LANG ."'
AND family.num_fam = news.family
+ AND news.approved = 1
$option
order by num_news desc
$cond";
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/save_news.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- save_news.php 26 Apr 2002 13:56:06 -0000 1.2
+++ save_news.php 27 Dec 2002 11:52:56 -0000 1.3
@@ -15,10 +15,12 @@
///////////////////////////////////////////////////////
$aujourdhui = date( "Y-m-d", time() );
-
+
+
+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);
-
+}
///////////////////////////////////////////////////////
//
@@ -26,7 +28,10 @@
//
///////////////////////////////////////////////////////
if (isset($num_news)) {
- $sql = "update news set titre='$titre', long_text='$longtext', _num_topic=$topic, date='$aujourdhui', texte='$nouvelle', lang='$lang',
+
+ $longtext = $long;
+
+ $sql = "update news set titre='$titre', long_text='$longtext', _num_topic=$topic, date='$date_ins', texte='$nouvelle', lang='$lang',
user_name='$user', family='$family'
where num_news=$num_news";
$rqt = new query($DBH);
@@ -36,8 +41,8 @@
else {
// insertion de la nouvelle
- $sql = "insert into news (titre, _num_topic, date, texte, lang, user_name, long_text, family)
- values ('$titre', $topic, '$aujourdhui', '$nouvelle', '$lang', '$user', '$longtext', $family)";
+ $sql = "insert into news (titre, _num_topic, date, texte, lang, user_name, long_text, family, approved)
+ values ('$titre', $topic, '$aujourdhui', '$nouvelle', '$lang', '$user', '$longtext', $family, 0)";
$rqt = new query($DBH);
$rqt->query($DBH, $sql) or send_error($PHP_SELF, $sql . " : " .$rqt->error());
@@ -79,6 +84,14 @@
$ca = new cache($DBH);
$ca->clear_news($lang);
-header("Location: news.php");
+
+if (isset ($num_news)) {
+ $last_news = $num_news;
+}
+else {
+ $last_news = $DBH->lastid('news_seq');
+}
+
+header("Location: comment.php?news=$last_news");
?>
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/welcome.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- welcome.php 26 Apr 2002 13:56:06 -0000 1.7
+++ welcome.php 27 Dec 2002 11:52:56 -0000 1.8
@@ -30,6 +30,7 @@
from news
where family=$row[1]
and lang='$lang'
+ and approved=1
order by num_news desc";
$rqt2 = new query($DBH);
$rqt2->query($DBH, $sql);
@@ -58,6 +59,7 @@
from news
where family=$row[1]
and lang='$lang'
+ and approved=1
order by num_news desc
limit 5";
$rqt2 = new query($DBH);
|
|
From: mdw c. <myd...@li...> - 2002-12-27 15:51:12
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs
Modified Files:
login_failed.php
Log Message:
creation de membre automatique de la mort qui tue
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/login_failed.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- login_failed.php 26 Apr 2002 13:56:06 -0000 1.3
+++ login_failed.php 27 Dec 2002 15:51:10 -0000 1.4
@@ -8,7 +8,8 @@
$LOGIN_FORM = get_login_box("$DYNA_SESSION", 1, $DBH);
-$CONTENT = get_page(translate("ERROR", $DBH), translate("INVALID_CREDENTIAL", $DBH), $LOGIN_FORM, $DBH);
+//$CONTENT = get_page(translate("ERROR", $DBH), translate("INVALID_CREDENTIAL", $DBH), $LOGIN_FORM, $DBH);
+$CONTENT = get_page(translate("ERROR", $DBH), $msg, $LOGIN_FORM, $DBH);
print_template(THEMES_PATH."/main.html", $CONTENT, $row[1], $DBH,$c, $REMOTE_ADDR, $HTTP_REFERER, '', 80, 10);
|
|
From: mdw c. <myd...@li...> - 2002-12-27 15:51:50
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs Added Files: new_account.php update_news.php Log Message: travail sur les membres |
|
From: mdw c. <myd...@li...> - 2002-12-27 15:56:26
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs
Modified Files:
set_session.php
Added Files:
guest.php
Log Message:
l'ajout automatique de membre fonctionne, reste des choses à clarifier
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/set_session.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- set_session.php 19 Feb 2002 18:37:32 -0000 1.2
+++ set_session.php 27 Dec 2002 15:56:25 -0000 1.3
@@ -14,7 +14,8 @@
$sql = "select name, pass
from members
where name='$user'
- and pass='$pass'";
+ and pass='$pass'
+ and pending_id = ''";
$rqt = new query($DBH);
$rqt->query($DBH, $sql);
|
|
From: mdw c. <myd...@li...> - 2003-02-08 18:23:28
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/templates/gris Log Message: Directory /cvsroot/mydynaweb/mydynaweb/htdocs/templates/gris added to the repository |
|
From: mdw c. <myd...@li...> - 2003-02-08 18:23:41
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/templates/gris/images Log Message: Directory /cvsroot/mydynaweb/mydynaweb/htdocs/templates/gris/images added to the repository |
|
From: mdw c. <myd...@li...> - 2003-02-08 18:23:58
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/templates/gris Added Files: bandeau-fond.png bandeau.png bar.html boite_fond.png box.html calendar.html comment.html fond.old.png fond.png fond2.png gallery.html main.html main.html.new news.html news_as_page.html page.html thread.html topbar.html Log Message: ajout du theme 'gris' de sukria.net |
|
From: mdw c. <myd...@li...> - 2003-02-08 18:24:38
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/templates/deekay Added Files: news_as_page.html Log Message: needed in this release |
|
From: mdw c. <myd...@li...> - 2003-02-08 18:26:42
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/templates/default Added Files: news_as_page.html Log Message: la page de details des nouvelles |
|
From: mdw c. <myd...@li...> - 2003-02-08 18:26:42
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/templates/dynadot Added Files: news_as_page.html Log Message: la page de details des nouvelles |
|
From: mdw c. <myd...@li...> - 2003-02-08 18:26:42
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/templates/petits Added Files: news_as_page.html Log Message: la page de details des nouvelles |
|
From: mdw c. <myd...@li...> - 2003-02-08 18:26:42
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/templates/smarty Added Files: news_as_page.html Log Message: la page de details des nouvelles |
|
From: mdw c. <myd...@li...> - 2003-02-12 09:26:40
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/templates/gris
Modified Files:
box.html main.html news.html
Log Message:
toutes les polices sont remplacées par sans-serif
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/templates/gris/box.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- box.html 8 Feb 2003 18:23:57 -0000 1.1
+++ box.html 12 Feb 2003 09:26:39 -0000 1.2
@@ -1,9 +1,9 @@
<!-- BLOCK:HEAD -->
<TABLE width=100% bgcolor=#000000 cellspacing=0 cellpadding=1 border=0><TR><TD>
<TABLE width=100% bgcolor=#EEEEEE cellspacing=0 cellpadding=2 border=0>
- <TR><TD background="/templates/gris/boite_fond.png" align="center"><FONT COLOR="#ffffff" size="-1" FACE="tahoma,arial,helvetica"><b>~TITLE~</b></font></TD></TR>
+ <TR><TD background="/templates/gris/boite_fond.png" align="center"><FONT COLOR="#ffffff" size="-1" FACE="sans-serif"><b>~TITLE~</b></font></TD></TR>
<!-- BLOCK:LINE -->
-<TR><TD><FONT FACE="tahoma,arial,helvetica" SIZE="-2">~CONTENT~</font></TD></TR>
+<TR><TD><FONT FACE="sans-serif" SIZE="-2">~CONTENT~</font></TD></TR>
<!-- BLOCK:FOOT -->
</TABLE>
</TR></TD></TABLE>
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/templates/gris/main.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- main.html 8 Feb 2003 18:23:57 -0000 1.1
+++ main.html 12 Feb 2003 09:26:39 -0000 1.2
@@ -36,12 +36,12 @@
background: #eeeeee;
color: #333333;
border: solid 1px #333333;
- font: 11px verdana, geneva, helvetica, arial, sans-serif;
+ font: 11px sans-serif;
}
.topbar {
font-size: 10pt;
- font-family: verdana, tahoma, helvetica, sans-serif;
+ font-family: sans-serif;
}
A.topbar:hover {
@@ -167,7 +167,7 @@
<p>
- <font size="-1" face="lucida,verdana,helvetica">~QUOTATION~</font>
+ <font size="-1" face="sans-serif">~QUOTATION~</font>
</center>
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/templates/gris/news.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- news.html 8 Feb 2003 18:23:57 -0000 1.1
+++ news.html 12 Feb 2003 09:26:39 -0000 1.2
@@ -4,7 +4,7 @@
<tr>
<td align="center" background="/templates/gris/boite_fond.png">
- <font size="+1" face="lucida,helvetica,arial,tahoma" color="#eeeeee">~TITLE~</font>
+ <font size="+1" face="sans-serif" color="#eeeeee">~TITLE~</font>
</td>
</tr>
@@ -29,19 +29,24 @@
<br>
<br>
-
- <table width="100%">
+
+ <table width="100%" bgcolor="#444444" cellpadding="1" cellspacing="0" border="0"><tr><td>
+ <table width="100%" bgcolor="#EEEEEE" cellpadding="0" cellspacing="3" border="0"><tr><td>
+ <table width="100%" bgcolor="#EEEEEE">
<tr>
- <td align="left"><font size="-2" color="#777777"><b> ~NBHIT~ hits - ~NBCOMMENT~ ~COMMENTS~ / ~NBTHREADS~ ~THREADS~</b></font></td>
+ <td align="left">
+ <font size="-2" color="#777777"><b> ~NBHIT~ hits - ~NBCOMMENT~ ~COMMENTS~ / ~NBTHREADS~ ~THREADS~</b></font></td>
<td align="right">
- <a href="comment.php?news=~NUMNEWS~"><font size="-2" color="#777777">[à lire : ~READ_MORE~]</font></a>
+ <a href="comment.php?news=~NUMNEWS~"><font face="sans-serif" size="-2">[~READ_MORE~]</font></a>
- <a href="add_comment.php?num_news=~NUMNEWS~"><font size="-2" color="#777777">[commenter]</font></a>
+ <a href="add_comment.php?num_news=~NUMNEWS~"><font size="-2" face="sans-serif">[commenter]</font></a>
- <a href="forward.php?news=~NUMNEWS~"><font size="-2" color="#777777">[envoyer à un ami]</font></a>
+ <a href="forward.php?news=~NUMNEWS~"><font size="-2" face="sans-serif">[envoyer à un ami]</font></a>
</td>
</tr>
</table>
+ </td></tr></table>
+ </td></tr></table>
</td>
</tr>
|
|
From: mdw c. <myd...@li...> - 2003-02-14 08:31:15
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/tools/events
Modified Files:
cache.php stats.php
Log Message:
pas mal d'ajouts concernant les membres
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/tools/events/cache.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- cache.php 26 Dec 2002 13:46:57 -0000 1.19
+++ cache.php 14 Feb 2003 08:31:14 -0000 1.20
@@ -1,7 +1,7 @@
<?PHP
//!! Cache System
//! Global cache system for MDW.Q
-// $Id: cache.php,v 1.19 2002/12/26 13:46:57 sukria Exp $
+// $Id: cache.php,v 1.20 2003/02/14 08:31:14 sukria Exp $
/*!
This class implement a global cache system for MDW.
@@ -183,7 +183,11 @@
list($usec, $sec) = explode(" ",microtime());
$now = (float)$usec + (float)$sec;
$time_used = sprintf("%01.3f", $now - $TIME_START);
- print "<center><font face='lucida-typewriter,courier' size=-2>page en cache servie en $time_used secondes.</font></center>\n";
+
+ print "<center><font face='sans-serif' size=-2>
+ Ce site tourne sous MyTinyWeb 0.1<br>
+ Page cachée, générée en $time_used secondes.
+ </font></center>\n";
}
}
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/tools/events/stats.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- stats.php 27 Dec 2002 11:52:56 -0000 1.16
+++ stats.php 14 Feb 2003 08:31:14 -0000 1.17
@@ -175,15 +175,21 @@
$row = $rqt->getrow();
$ELEMS["LAST_NEWS"] = ("<li>" . translate('DERNIERE_NEWS', $DBH) . " : <a href='comment.php?news=$row[1]'>".$row[0]."</a></li>");
- // best news
+ // best news of the month
+ $month = date ("Y-m");
$sql = "select titre, num_news, nbhit
from news
where lang = '".USER_LANG."'
- order by nbhit desc";
+ and date like '$month%'
+ order by nbhit desc
+ limit 3";
$rqt = new query($DBH);
$rqt->query($DBH, $sql);
- $row = $rqt->getrow();
- $ELEMS["BEST_NEWS"] = ("<li>" . translate('BEST_NEWS', $DBH) . " : <a href='comment.php?news=$row[1]'>".$row[0]."</a> ($row[2] hits)</li>");
+ $ELEMS["BEST_NEWS"] = "<li>" . translate('BEST_NEWS', $DBH);
+ while ($row = $rqt->getrow()) {
+ $ELEMS["BEST_NEWS"] .= ("<br>- <a href='comment.php?news=$row[1]'>".$row[0]."</a> ($row[2])");
+ }
+ $ELEMS["BEST_NEWS"] .= "</li>";
// 3 most famous news
$sql = "select news.titre as news, num_news, count(*) as total
|
|
From: mdw c. <myd...@li...> - 2003-02-14 08:31:45
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs
Modified Files:
add_comment.php logout.php members.php new_account.php
save_coment.php save_news.php set_session.php
test_rdf_maker.php
Log Message:
pas mal d'ajouts concernant les membres
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/add_comment.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- add_comment.php 27 Dec 2002 11:52:56 -0000 1.10
+++ add_comment.php 14 Feb 2003 08:31:13 -0000 1.11
@@ -108,6 +108,7 @@
</td>
</tr>
+
<tr align=\"center\">
<td align=\"center\" colspan='2'>
<input type=\"submit\" value=\"".translate("SUBMIT",$DBH)."\">
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/logout.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- logout.php 28 Jan 2002 20:45:53 -0000 1.4
+++ logout.php 14 Feb 2003 08:31:13 -0000 1.5
@@ -22,7 +22,17 @@
$rqt = new query($DBH);
$rqt->query($DBH,$sql) or send_error($PHP_SELF, $sql . " : " .$rqt->error());
- // Removal of the cookie.
+ // mise à jour du last_login
+ $last = date ("Y-m-d");
+ $sql = "UPDATE members set last_login='$last'
+ WHERE name='".$login."'";
+ $rqt = new query($DBH);
+ $rqt->query($DBH,$sql) or send_error($PHP_SELF, $sql . " : " .$rqt->error());
+
+
+
+
+ // Removal of the cookie.
$path = get_path(SITE_ROOT);
setcookie('DYNA_SESSION', '', time()-65535, "$path");
setcookie('DYNA_SESSION', '', time()-65535, "/");
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/members.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- members.php 27 Dec 2002 11:52:56 -0000 1.3
+++ members.php 14 Feb 2003 08:31:13 -0000 1.4
@@ -48,8 +48,26 @@
}
+ $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>";
$CONTENT = get_page($titre, $chapeau, $texte, $DBH);
print_template(THEMES_PATH."/main.html", $CONTENT, "$UserID Room", $DBH,"MEMBERS");
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/new_account.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- new_account.php 27 Dec 2002 15:51:49 -0000 1.1
+++ new_account.php 14 Feb 2003 08:31:13 -0000 1.2
@@ -5,7 +5,7 @@
goal : create a new account and send an email to the newly registrated user.
when user recieve the mail, he has to answer to it to confirm the registration.
Then MDW waits for the admin to approve the new user.
-cvs id : $Id: new_account.php,v 1.1 2002/12/27 15:51:49 sukria Exp $
+cvs id : $Id: new_account.php,v 1.2 2003/02/14 08:31:13 sukria Exp $
------------------------------------------------------------------------------------*/
/*****************************************************************
@@ -30,7 +30,7 @@
/*****************************************************************
* print the page with mydynaweb engine
*****************************************************************/
- $content = get_page($title, $header, '', $DBH);
+ $content = get_page($title, $header, ' ', $DBH);
print_template( THEMES_PATH."/main.html", $content, "$UserID Room", $DBH, "new_account",
$REMOTE_ADDR, $MSG, 70, 10, $TIME_START);
@@ -93,13 +93,20 @@
$headers .= "X-Sender: <".WEBMASTER_EMAIL.">\n";
$headers .= "X-Mailer: MyDynaWeb 0.5\n";
$headers .= "Return-Path: <".WEBMASTER_EMAIL.">\n";
- $message = ("You just have requested a registration for the site ".SITE_TITLE." located at : ".SITE_ROOT.".
+ $message = ("Bonjour $prenom $nom :-)
-Please reply to this email with keeping its title if you want to confirm the registration.
+Vous avez demandé la création d'un compte pour le site '".SITE_TITLE."' situé ici : ".SITE_ROOT.".
-The title must contains your pending ID in order to validate the process.
+Votre login : $login
+Votre passe : $pass1
+
+Pour confirmer votre inscription, vous devez répondre à ce mail en conservant le titre.
+
+Assurez-vous que le titre du mail comporte bien votre ID.
-You will recieve one more mail when the site admin of ".SITE_TITLE." will approve it.
+Vous recevrez un nouveau mail lorsdque l'administrateur du site aura approuvé votre inscription.
+Vous serez alors à même de poster des nouvelles à l'url suivante : ".SITE_ROOT."login.php
+
________________________________________________________________________
".
translate('NEW_COMMENT_MAIL5', $DBH) . "\n" .
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/save_coment.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- save_coment.php 26 Dec 2002 10:43:29 -0000 1.13
+++ save_coment.php 14 Feb 2003 08:31:13 -0000 1.14
@@ -40,12 +40,19 @@
$content = eregi_replace("<a", "<A",$content);
$content = eregi_replace("</a>", "</A>",$content);
-
- // we detect URL link and link them
+ /*****************************************************************
+ * we detect URL link and link them if user wants to
+ *****************************************************************/
+ $user_wants_auto_url = 1;
+ if ($user_wants_auto_url) {
+ $content = ereg_replace("((ftp://)|(http://))(([[:alnum:]]|[[:punct:]])*)", "<a href=\"\\0\">\\0</a>",$content);
+ }
- $content = ereg_replace("((ftp://)|(http://))(([[:alnum:]]|[[:punct:]])*)", "<a href=\"\\0\">\\0</a>",$content);
+ /*****************************************************************
+ * init of the flag saying if we show the user mail
+ *****************************************************************/
+ if (!isset($show_user_mail)) $show_user_mail = 1;
-
// add nospam to avoid spamming on user emails
if (!ereg("nospam\.", $usermail)) {
@@ -56,8 +63,8 @@
// we insert the comment in the database
if (!isset($pere)) $pere = 0;
- $sql = "insert into comments (title, _num_news, date_ins, content, user_name, user_mail, pere)
- values ('$titre', $num_news, '$aujourdhui', '$content', '$username', '$usermail', $pere)";
+ $sql = "insert into comments (title, _num_news, date_ins, content, user_name, user_mail, pere, show_user_mail)
+ values ('$titre', $num_news, '$aujourdhui', '$content', '$username', '$usermail', $pere, $show_user_mail)";
$rqt = new query($DBH);
$rqt->query($DBH, $sql) or die($sql . $rqt->error());
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/save_news.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- save_news.php 27 Dec 2002 11:52:56 -0000 1.3
+++ save_news.php 14 Feb 2003 08:31:13 -0000 1.4
@@ -14,13 +14,16 @@
//
///////////////////////////////////////////////////////
- $aujourdhui = date( "Y-m-d", time() );
+$aujourdhui = date( "Y-m-d", time() );
-if ($auto_link_checked) {
+$auto_link_checked = 1;
+
+//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/set_session.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- set_session.php 27 Dec 2002 15:56:25 -0000 1.3
+++ set_session.php 14 Feb 2003 08:31:13 -0000 1.4
@@ -23,8 +23,51 @@
if ($login_is_ok) {
+
+ // get the last_login value and look if there is a session younger
+ $sql = "select last_login from members where name='$user'";
+ $rqt = new query($DBH);
+ $rqt->query($DBH,$sql) or send_error($PHP_SELF, $sql . " : " .$rqt->error());
+ $row = $rqt->getrow();
+ $last_login = $row[0];
+
+
+ // cleanup the old session entries and set the good last_login option
+ $sql = "select last_update from session where user_login='$user'";
+ $rqt = new query($DBH);
+ $rqt->query($DBH,$sql) or send_error($PHP_SELF, $sql . " : " .$rqt->error());
+ while ($row = $rqt->getrow()) {
+ $date_of_session = date ("Y-m-d", $row[0]);
+
+ list ($month, $day, $year) = explode ("-", $last_login);
+
+ // if that session is younger than the last_login value, it means
+ // that user has forgotten to logout, update the last login value and
+ // clear that session entry
+ if (mktime (0, 0, 0, $month, $day, $year) < $row["last_update"]) {
+ // the session is more pertinent than the last login,
+ // update the stuff !
+ $sql = "UPDATE members set last_login='$date_of_session' WHERE name = '$user'";
+ $rqt2 = new query($DBH);
+ $rqt2->query($DBH,$sql) or send_error($PHP_SELF, $sql . " : " .$rqt2->error());
+ }
+
+ // anyway, that session entry has to be removed !
+ $sql = "DELETE FROM session WHERE user_login='$user' and last_update='$row[0]'";
+ $rqt2 = new query($DBH);
+ $rqt2->query($DBH,$sql) or send_error($PHP_SELF, $sql . " : " .$rqt2->error());
+
+ }
+
+
+ // the cleanup is done, there is no more session entry for that user and the last_login
+ // value is pertinent ;)
+ // we can now create a new session
create_session($user, $DBH);
+
+ // and just have to go in the member section !
header("Location: members.php");
+
die();
}
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/test_rdf_maker.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- test_rdf_maker.php 2 Jul 2001 22:22:32 -0000 1.2
+++ test_rdf_maker.php 14 Feb 2003 08:31:13 -0000 1.3
@@ -7,8 +7,8 @@
$DBH->open($dbName, $dbServer, $dbUser, $dbPass);
$test= new rdf_maker($DBH);
-$test->get_last_news(DEFAULT_LANG);
-
+$rdf_content = $test->get_last_news(DEFAULT_LANG);
+$test->write_file (DEFAULT_LANG, $rdf_content);
$DBH->close();
|
|
From: mdw c. <myd...@li...> - 2003-02-14 08:31:46
|
MyDynaWeb CVS committal Author : sukria Project : mydynaweb Module : htdocs Dir : mydynaweb/htdocs/templates/gris Modified Files: news.html news_as_page.html Log Message: pas mal d'ajouts concernant les membres =================================================================== RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/templates/gris/news.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- news.html 12 Feb 2003 09:26:39 -0000 1.2 +++ news.html 14 Feb 2003 08:31:14 -0000 1.3 @@ -15,12 +15,10 @@ <tr> <td align="left" width="80%"> + <A HREF="~LINK~"><IMG SRC="~IMAGE~" BORDER="0" TITLE="~ALT~" ALT="~ALT~" + ALIGN="RIGHT" HSPACE="20" VSPACE="10"></A> ~TEXT~ </td> - - <td width="20%" align="right"> - <A HREF="~LINK~"><IMG SRC="~IMAGE~" BORDER="0" TITLE="~ALT~" ALT="~ALT~"></A> - </td> </tr> <tr> @@ -31,7 +29,7 @@ <table width="100%" bgcolor="#444444" cellpadding="1" cellspacing="0" border="0"><tr><td> - <table width="100%" bgcolor="#EEEEEE" cellpadding="0" cellspacing="3" border="0"><tr><td> + <table width="100%" bgcolor="#EEEEEE" cellpadding="0" cellspacing="0" border="0"><tr><td> <table width="100%" bgcolor="#EEEEEE"> <tr> <td align="left"> =================================================================== RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/templates/gris/news_as_page.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- news_as_page.html 8 Feb 2003 18:23:57 -0000 1.1 +++ news_as_page.html 14 Feb 2003 08:31:14 -0000 1.2 @@ -2,7 +2,7 @@ <tr> <!-- title bar --> <td align="left"> - <font size="+3" face="lucida,helvetica,arial,tahoma">~TITLE~</font> + <font size="+3" face="sans-serif"><b>~TITLE~</b></font> </td> </tr> |
|
From: mdw c. <myd...@li...> - 2003-02-14 08:31:46
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/include
Modified Files:
gui.inc.php templates.inc.php
Log Message:
pas mal d'ajouts concernant les membres
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/gui.inc.php,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -3 -r1.57 -r1.58
--- gui.inc.php 26 Dec 2002 16:30:46 -0000 1.57
+++ gui.inc.php 14 Feb 2003 08:31:13 -0000 1.58
@@ -153,11 +153,18 @@
$VALUES['NUMNEWS'] = $num_news;
$VALUES['COMMENTS'] = translate("COMMENTS",$DBH);
$VALUES['NBCOMMENT'] = $num_cmt;
- $VALUES['READ_MORE'] = "+" . $num_byte . " bytes";
$VALUES['COMMENT'] = translate("COMMENT",$DBH);
$VALUES['DETAILS'] = translate("DETAILS",$DBH);
$VALUES['EMAIL_FRIEND'] = translate("EMAIL_FRIEND",$DBH);
-
+
+ if ($num_byte > 0) {
+ $VALUES['READ_MORE'] = translate("READ_THE_FULL_STORY", $DBH) . " ($num_byte)";
+ }
+ else {
+ $VALUES['READ_MORE'] = translate("SEE_THE_COMMENTS", $DBH);
+ }
+
+
// récupération des liens associés
$sql = "select num_link, name, hits, url
from links where _num_news=$num_news";
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/templates.inc.php,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- templates.inc.php 26 Dec 2002 13:46:57 -0000 1.36
+++ templates.inc.php 14 Feb 2003 08:31:14 -0000 1.37
@@ -263,7 +263,10 @@
list($usec, $sec) = explode(" ",microtime());
$now = (float)$usec + (float)$sec;
$time_used = sprintf("%01.3f", $now - $TIME_START);
- print "<center><font face='lucida-typewriter,courier' size=-2>page générée en $time_used secondes.</font></center>\n";
+ print "<center><font face='sans-serif' size=\"-2\">
+ Ce site tourne sous MyTinyWeb 0.1<br>
+ Page générée en $time_used secondes.
+ </font></center>\n";
}
$output .= $line;
@@ -275,7 +278,10 @@
list($usec, $sec) = explode(" ",microtime());
$now = (float)$usec + (float)$sec;
$time_used = sprintf("%01.3f", $now - $TIME_START);
- print "<center><font face='lucida-typewriter,courier' size=-2>page générée en $time_used secondes.</font></center>\n";
+ print "<center><font face='sans-serif' size=-2>
+ Ce site tourne sous MyTinyWeb 0.1<br>
+ Page générée en $time_used secondes.
+ </font></center>\n";
}
print ($file[$i]);
$output .= $file[$i];
@@ -337,7 +343,10 @@
list($usec, $sec) = explode(" ",microtime());
$now = (float)$usec + (float)$sec;
$time_used = sprintf("%01.3f", $now - $TIME_START);
- print "<center><font face='lucida-typewriter,courier' size=-2>page générée en $time_used secondes.</font></center>\n";
+ print "<center><font face='sans-serif' size=-2>
+ Ce site tourne sous MyTinyWeb 0.1<br>
+ Page générée en $time_used secondes.
+ </font></center>";
}
|
|
From: mdw c. <myd...@li...> - 2003-02-14 09:54:16
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/tools/content
Modified Files:
mailer.php
Log Message:
Modification du comportement de forward d'une nouvelle.
Désormais on envoie la nouvelle dans son entièreté avec un lien vers le site et une copie des liens associés.
Les caractère suivants sont supprimés :
<i>
<p>
<br>
ainsi que les liens http
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/tools/content/mailer.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- mailer.php 9 Jul 2001 13:44:51 -0000 1.3
+++ mailer.php 14 Feb 2003 09:54:15 -0000 1.4
@@ -16,39 +16,43 @@
$titre = $row[0];
$nouvelle = $row[2] . "\n\n" . $row[3];
+ $nouvelle = str_replace ("<p>", "\n\n", $nouvelle);
+ $nouvelle = str_replace ("<br>", "\n", $nouvelle);
+ $nouvelle = str_replace ("<i>", "", $nouvelle);
+ $nouvelle = str_replace ("</i>", "", $nouvelle);
+ $nouvelle = ereg_replace("((ftp://)|(http://))(([[:alnum:]]|[[:punct:]])*)", "<a href=\"\\0\">\\0</a>",$nouvelle);
+
// recup des infos du posteur
- if (! strlen($USER)) {
- $sql = "select email, nom, prenom from members where name='$user'";
- $rqt = new query($DBH);
- $rqt->query($DBH, $sql);
- $row = $rqt->getrow();
- $text = ("$row[2] $row[1] has post a piece of news on " .SITE_TITLE. " and wish you to be notified :\n");
- }
+/* if (! strlen($USER)) {*/
+ $text = ("$row[0]\n" . SITE_ROOT . "comment.php?news=$num_news\n");
+/* }
else {
$sql = "select email, nom, prenom from members where name='$USER'";
$rqt = new query($DBH);
$rqt->query($DBH, $sql);
$row = $rqt->getrow();
- $text = ("$row[2] $row[1] has found a piece of news on " .SITE_TITLE. ", and has forwarded it to you :\n");
+ $text = ("$row[2] $row[1] ". translate ("FORWARD") . "" .SITE_TITLE. "\n");
+ $text = ("$row[0]\n" . SITE_ROOT . "comment.php?news=$num_news\n\n");
}
-
+*/
// recup du titre du topic
- $sql = "select titre from topic where num_topic = $topic";
+ $sql = "select url, name from links where _num_news = $num_news";
$rqt = new query($DBH);
$rqt->query($DBH, $sql);
- $top = $rqt->getrow();
+ $nouvelle .= "\nLiens associés à cette nouvelle :\n";
+ while ($link = $rqt->getrow()) {
+ $nouvelle .= "$link[1] : $link[0]\n";
+ }
// envoi du mail
- $sujet = ("[" . SITE_TITLE . " News] > " . $titre);
- $text .= "\nTitle : $titre\n";
- $text .= "Subject : $top[0]\n";
+ $sujet = ($titre);
$text .= "\n$nouvelle";
- $headers .= "From: <$row[0]>\n";
+ $headers .= "From: \"".SITE_TITLE."\" <".WEBMASTER_EMAIL.">\n";
$headers .= "X-Sender: <$row[0]>\n";
- $headers .= "X-Mailer: PHP\n";
+ $headers .= "X-Mailer: MyTinyWeb\n";
$headers .= "X-Priority: 1\n";
$headers .= "Return-Path: <$row[0]>\n";
@@ -56,6 +60,16 @@
mail($TO, stripslashes($sujet), stripslashes($text), $headers);
+ $sql = "SELECT nb_forward FROM news WHERE num_news=$num_news";
+ $rqt = new query($DBH);
+ $rqt->query ($DBH, $sql);
+ $row = $rqt->getrow();
+
+ $nb_forward = $row[0]+1;
+
+ $sql = "UPDATE news set nb_forward = $nb_forward WHERE num_news=$num_news";
+ $rqt = new query($DBH);
+ $rqt->query ($DBH, $sql);
}
|
|
From: mdw c. <myd...@li...> - 2003-02-14 09:54:46
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs
Modified Files:
forward.php
Log Message:
Modification du comportement de forward d'une nouvelle.
Désormais on envoie la nouvelle dans son entièreté avec un lien vers le site et une copie des liens associés.
Les caractère suivants sont supprimés :
<i>
<p>
<br>
ainsi que les liens http
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/forward.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- forward.php 8 Nov 2001 03:11:12 -0000 1.5
+++ forward.php 14 Feb 2003 09:54:15 -0000 1.6
@@ -6,7 +6,10 @@
$DBH=new db();
$DBH->open($dbName, $dbServer, $dbUser, $dbPass);
-
+$sql = "SELECT titre from news where num_news=$news";
+$rqt = new query($DBH);
+$rqt->query($DBH, $sql);
+$row = $rqt->getrow();
if (!strlen($UserID)) {
@@ -26,10 +29,15 @@
<center>
<b>".translate('FORWARD_TITLE', $DBH)."</b>
<p> </p>
+ \"$row[0]\"
+ <p>
<FORM name='mail_form' action='$PHP_SELF' method='POST'>
".translate('Y_C_SEND_EMAIL', $DBH)."<br>
<input type='text' name='TO' size='40'>
<input type='hidden' name='news' value='$news'>
+
+<p>
+ <input type='submit' value='".translate ('CONFIRM', $DBH)."'>
</FORM>
<p> </P>
</center>
|
|
From: mdw c. <myd...@li...> - 2003-02-14 12:56:36
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/tools/content
Modified Files:
mailer.php
Log Message:
Il y a vait un bug sur la suppression des liens <a href=""></a> lors de l'envoi d'une nouvelle.
Désormais les liens sont mis en pur texte (suppression des tags HTML).
Il reste à trouver une façon de bien sécuriser le formulaire. Pour l'instant,
n'importe quel robot peut l'utiliser pour spammer et c pas cool...
Je pense logguer l'ip du client et lui interdire de l'utiliser plus de 3 fois par heure.
Qu'en dites vous ?
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/tools/content/mailer.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- mailer.php 14 Feb 2003 09:54:15 -0000 1.4
+++ mailer.php 14 Feb 2003 12:56:35 -0000 1.5
@@ -20,7 +20,8 @@
$nouvelle = str_replace ("<br>", "\n", $nouvelle);
$nouvelle = str_replace ("<i>", "", $nouvelle);
$nouvelle = str_replace ("</i>", "", $nouvelle);
- $nouvelle = ereg_replace("((ftp://)|(http://))(([[:alnum:]]|[[:punct:]])*)", "<a href=\"\\0\">\\0</a>",$nouvelle);
+ $nouvelle = preg_replace("/<a href=\"(\S+)\">.+<\/a>/", "$1",$nouvelle);
+ $nouvelle = preg_replace("/<a href='(\S+)'>.+<\/a>/", "$1",$nouvelle);
// recup des infos du posteur
/* if (! strlen($USER)) {*/
@@ -41,7 +42,7 @@
$sql = "select url, name from links where _num_news = $num_news";
$rqt = new query($DBH);
$rqt->query($DBH, $sql);
- $nouvelle .= "\nLiens associés à cette nouvelle :\n";
+ $nouvelle .= "\n\nLiens associés à cette nouvelle :\n";
while ($link = $rqt->getrow()) {
$nouvelle .= "$link[1] : $link[0]\n";
}
|
|
From: mdw c. <myd...@li...> - 2003-02-14 13:30:06
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs
Modified Files:
forward.php
Log Message:
on peut ajouter un message lorsque l'on forward une nouvelle
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/forward.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- forward.php 14 Feb 2003 09:54:15 -0000 1.6
+++ forward.php 14 Feb 2003 13:30:01 -0000 1.7
@@ -21,7 +21,7 @@
}
else if (strlen($TO)) {
header("Location: news.php");
- send_piece_of_news($news, $TO, $DBH, $UserID);
+ send_piece_of_news($news, $TO, $DBH, $UserID, $private);
}
else {
$FORM = "
@@ -37,6 +37,10 @@
<input type='hidden' name='news' value='$news'>
<p>
+
+ ".translate ("ADD_PRIVATE_MESSAGE", $DBH)."<br>
+ <textarea name='private' cols='40' rows='10'></textarea>
+<br>
<input type='submit' value='".translate ('CONFIRM', $DBH)."'>
</FORM>
<p> </P>
|
|
From: mdw c. <myd...@li...> - 2003-02-14 13:30:06
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/tools/content
Modified Files:
mailer.php
Log Message:
on peut ajouter un message lorsque l'on forward une nouvelle
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/tools/content/mailer.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- mailer.php 14 Feb 2003 12:56:35 -0000 1.5
+++ mailer.php 14 Feb 2003 13:30:02 -0000 1.6
@@ -1,6 +1,6 @@
<?PHP
-function send_piece_of_news ($num_news, $TO, $DBH, $USER='')
+function send_piece_of_news ($num_news, $TO, $DBH, $USER='', $private='')
{
@@ -14,7 +14,13 @@
$user = $row[6];
$topic = $row[4];
$titre = $row[0];
- $nouvelle = $row[2] . "\n\n" . $row[3];
+
+ if (strlen ($private)) {
+ $nouvelle = "$private\n";
+ $nouvelle .= "--------------------------------------------------------------------------------\n\n";
+ }
+
+ $nouvelle .= $row[2] . "\n\n" . $row[3];
$nouvelle = str_replace ("<p>", "\n\n", $nouvelle);
$nouvelle = str_replace ("<br>", "\n", $nouvelle);
|