Mercurial > defr > DualBlog
view tb.php @ 52:829d6b0d3d0b
Lorsqu'on édite un billet ou un brouillon, on éplingle la zone.
Cela permet de ne pas voir la zone de texte disparaitre si le curseur
ne survole plus le li correspondant.
A noter que le parentNode.parentNode n'est pas des plus esthétiques,
et qu'il y reste quelques problèmes relatifs à la non suppression
de l'état épinglé.
author | Franck Deroche <webmaster@defr.org> |
---|---|
date | Tue, 29 Jan 2008 11:33:33 +0100 |
parents | 629389204276 |
children | 434751e80c88 |
line wrap: on
line source
<?php header("Content-Type: text/xml"); echo("<?xml version='1.0' encoding='utf-8'?>"); include("classes.php"); $id = $_GET['id']; $Data->Query("SELECT * FROM Messages WHERE num_mess=$id"); $post_infos = $Data->GetRow(); $titre = array_key_exists("title", $_POST)?$_POST['title']:"Undefined"; $url = array_key_exists("url", $_POST)?$_POST['url']:"#"; $info = array_key_exists("__info", $_POST)?$_POST['__info']:-1; if($info == 1) { $error = 0; $message = "Some informations"; } else if($url == "#") { $error = 1; $message = "The url field is needed for trackback to do something usefull !"; } else if($post_infos === 0) { $error = 1; $message = "There's no post with this id"; } else { $excerpt = $_POST['excerpt']; $DateComment = gmdate("Y-m-d H:i:s"); if(strlen($excerpt) > 255) $excerpt = substr($excerpt, 0, 255) . "..."; $Data = new DataAccess(); $Data->Query("INSERT INTO Commentaires(MessId, Auteur, Adresse, Comment, DateComment, isTrackback) VALUES({$id}, '{$titre}', '{$url}', '{$excerpt}', '{$DateComment}', 1)"); $Data->Query("UPDATE Mess SET NbCommentaires=NbCommentaires+1 WHERE num_mess={$id}"); $error = 0; $excerpt = htmlentities(urlencode(substr(strip_tags($post_infos['Message']), 0, 252) . "...") } echo "<response> <error>$error</error> <message>$message</message> <engine>Dual Blog custom made PHP script</engine> <encoding>UTF-8</encoding> <blog>Dual Blog</blog> <title>{$post_infos['Titre']}</title> <url>http://defr.org/post/{$post_infos['num_mess']}</url> <excerpt>$excerpt</excerpt> </response>"; ?>