Author: pierre.andrews@gmail.com
Date: Tue Aug 1 01:01:49 2006
New Revision: 4341
Log:
formulaire_tag_forum independant
Added:
_plugins_/formulaire_tag_forum/
_plugins_/formulaire_tag_forum/formulaires/
- copied from r4331, _plugins_/tag-machine/formulaires/
_plugins_/formulaire_tag_forum/formulaires/ajax-mots-forum_fonctions.php3
- copied unchanged from r4340, _plugins_/tag-machine/formulaires/ajax-mots-forum_fonctions.php3
_plugins_/formulaire_tag_forum/formulaires/inc-formulaire_tag_forum.php
- copied unchanged from r4340, _plugins_/tag-machine/formulaires/inc-formulaire_tag_forum.php
Removed:
_plugins_/formulaire_tag_forum/formulaires/inc_formulaire_document.php
_plugins_/tag-machine/formulaires/
Removed: _plugins_/formulaire_tag_forum/formulaires/inc_formulaire_document.php
--- _plugins_/formulaire_tag_forum/formulaires/inc_formulaire_document.php (original)
+++ _plugins_/formulaire_tag_forum/formulaires/inc_formulaire_document.php (removed)
@@ -1,704 +0,0 @@
-<?php
-
- // inc_formulaire_document.php
- // Librairies pour gérerer un formulaire d'édition d'un document
- // Distribué sans garantie sous licence GPL.
- //
- // Author BoOz
-
- // Bricolage (sale) à partir du code SPIP
-
- /* utiliser : <?php
- include('inc_formulaire_document.php');
- afficher_formulaire_document_tag('[(#ENV{id_document})]','nom_groupe');
- ?> dans un squelette */
- /* ou bien
- include('inc_formulaire_document.php');
- afficher_formulaire_document_tag('$id_document','nom_groupe');
-
- dans une page php de spip */
-
- // This program is free software; you can redistribute it and/or modify
- // it under the terms of the GNU General Public License as published by
- // the Free Software Foundation; either version 2 of the License, or any later version.
- //
- // This program is distributed in the hope that it will be useful,
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- // GNU General Public License for more details.
- //
- // You should have received a copy of the GNU General Public License
- // along with this program; if not, write to the Free Software
- // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-//
-// Ce fichier ne sera execute qu'une fois
-if (defined("_LIB_FORMULAIRE_DOCUMENT")) return;
-define("_LIB_FORMULAIRE_DOCUMENT", "1");
-
-if(@file_exists('ecrire/inc_version.php')){
-include('ecrire/inc_version.php');
-include('inc-urls-standard.php');
-}elseif(@file_exists('ecrire/inc_version.php3')){
-include('ecrire/inc_version.php3');
-include('inc-urls-standard.php3');
-}elseif(@file_exists('inc_version.php')){
-include('inc_version.php');
-include('inc-urls-standard.php');
-}elseif(@file_exists('inc_version.php3')){
-include('inc_version.php3');
-include('inc-urls-standard.php3');
-}
-$path_inc_abstract_sql="inc_abstract_sql". _EXTENSION_PHP ;
-include_ecrire ($path_inc_abstract_sql);
-$path_inc_presentation ="inc_presentation". _EXTENSION_PHP ;
-$path_inc_layer ="inc_layer". _EXTENSION_PHP ;
-
-include_ecrire($path_inc_presentation);
-include_ecrire($path_inc_layer);
-include_ecrire('inc_documents.php3');
-include_ecrire('inc_texte.php3');
-include_ecrire('inc_db_mysql.php3');
-
-include('inc_tag-machine.php');
-
-function maj_tags ( $groupe_defaut='',
- $nom_objet='documents',
- $id_objet='id_document') {
- global $_POST;
-
- if ($liste_tags=$_POST['liste_tags']
- AND $id_document = intval($_POST['id_document'])
- AND $_POST['modif_tags'] == 'oui') {
- spip_query("DELETE FROM spip_mots_documents WHERE id_document=$id_document");
- ajouter_mots($liste_tags,$id_document,$groupe_defaut, $nom_objet,$id_objet) ;
- if($taguer_freres=$_POST['taguer_freres']
- AND $id_parent=$_POST['id_parent'] ){
-
- $result_freres=spip_query("SELECT id_document FROM spip_documents_syndic WHERE id_syndic_article = '$id_parent' ");
- while($row_freres=spip_fetch_array($result_freres)){
- $id_frere=$row_freres['id_document'];
- spip_query("DELETE FROM spip_mots_documents WHERE id_document=$id_frere");
- ajouter_mots($liste_tags,$id_frere,$groupe_defaut, $nom_objet,$id_objet) ;
- }
-
- }
-
-
- }elseif($liste_tags=$_POST['liste_tags']
- AND $id_document = intval($_POST['id_document'])
- AND $_POST['retirer_tags'] == 'oui'){
- retirer_mots($liste_tags,$id_document,$groupe_defaut, $nom_objet,$id_objet) ;
- }
-
- $actif= $_POST['actif'] ;
- $id_doc = intval($_POST['id_doc']) ;
- $bannir = $_POST['bannir'] ;
-
- if($actif && $id_doc){
- spip_query("UPDATE spip_documents SET actif='$actif' WHERE id_document = $id_doc");
- }
- if($bannir && $id_doc){
- spip_query("UPDATE spip_documents SET banni='$bannir' WHERE id_document = $id_doc");
- }
-
-
-}
-
-
-function afficher_liste_mot($id_document){
-
-$query = "SELECT id_mot FROM spip_mots_documents WHERE id_document='$id_document'";
-$result = spip_query($query);
-if (spip_num_rows($result) == 0){
-echo "pas de tag pour le moment";
-}else{
- echo"<ul>";
- while ($row = spip_fetch_array($result)) {
- $id_mot=$row['id_mot'];
- $query2 = "SELECT titre FROM spip_mots WHERE id_mot='$id_mot'";
- $result2 = spip_query($query2);
- while ($row2 = spip_fetch_array($result2)) {
- $titre_tag = $row2['titre'];
- echo"<form action=\"$PHP_SELF\" method=\"post\">";
- echo"<input type=\"hidden\" name=\"retirer_tags\" value=\"oui\">";
- echo"<input type=\"hidden\" name=\"id_document\" value=\"$id_document\">";
- echo"<input type=\"hidden\" name=\"liste_tags\" value=\"$titre_tag\">";
- echo "<li>$titre_tag <input type=\"submit\" name=\"suppr\" value=\"supprimer\"></li>";
- echo "</form>";
- }
- }
- echo"</ul>";
-}
-
-}
-
-function form_tag($id_document){
-$result = spip_query("SELECT * FROM spip_documents WHERE id_document = '$id_document'") ;
-$row_doc = spip_fetch_array($result);
-$result2 = spip_query("SELECT * FROM spip_documents_syndic WHERE id_document = '$id_document'") ;
-$row_parent = spip_fetch_array($result2);
-
-$query = "SELECT id_mot FROM spip_mots_documents WHERE id_document='$id_document'";
-$result3 = spip_query($query);
-
-$tags="";
-
-
- while ($row = spip_fetch_array($result3)) {
- $id_mot=$row['id_mot'];
- $query2 = "SELECT titre FROM spip_mots WHERE id_mot='$id_mot'";
- $result2 = spip_query($query2);
- while ($row2 = spip_fetch_array($result2)) {
- $titre=$row2['titre'];
- if(ereg(" ",$titre)) $titre="\"$titre\"";
- $tags .= $titre." ";
-
- }
- }
-
-
-
-echo"<div style='float:right;width:200px;font-size:xx-small;margin:10px 0px'>
-Vous pouvez ajouter un ou plusieurs tags séparés par un espace. Utiliser des guillemets pour les tags
-composés de plusieurs mots</div>";
-echo"<div><form action=\"$PHP_SELF\" method=\"post\" name=\"formulaire\">";
-echo"<div style='float:left;width:200px'>";
-echo'<input type=\'text\' name=\'liste_tags\' value=\''.$tags.'\' size=\"50\">';
-echo"<input type=\"hidden\" name=\"modif_tags\" value=\"oui\">";
-echo"<input type=\"hidden\" name=\"id_document\" value=\"$id_document\">";
-echo"<input type=\"hidden\" name=\"id_parent\" value=\"".$row_parent['id_syndic_article']."\">";
-echo"<div><input type=\"checkbox\" name=\"taguer_freres\" value=\"freres\" id=\"freres\">";
-echo "<label for='freres'>Taguer les documents frères</label></div>";
-echo"<input type=\"submit\" name=\"valider_tag\" value=\"ok\">";
-echo"</div>";
-
-echo"</form></div>";
-
-}
-
-function form_gestion_fine($id_document){
-$result = spip_query("SELECT * FROM spip_documents WHERE id_document = '$id_document'") ;
-$row_doc = spip_fetch_array($result);
-$result2 = spip_query("SELECT * FROM spip_documents_syndic WHERE id_document = '$id_document'") ;
-$row_parent = spip_fetch_array($result2);
-
-if ($row_doc['banni'] OR $row_doc['actif']){
-
- echo"<h2 style='margin-top:20px'>Gestion fine</h2>";
-
- if($row_doc['banni'] == "non"){
- echo"<form action='$PHP_SELF' method='post'>";
- echo"<input type='hidden' value='$id_document' name='id_doc'>";
- echo"<input type='hidden' value='oui' name='bannir'>";
- echo"<input type='submit' name='valider' value='Bannir'>";
- echo"</form>";
- }elseif($row_doc['banni'] == "oui"){
- echo"<form action='$PHP_SELF' method='post'>";
- echo"<input type='hidden' value='$id_document' name='id_doc'>";
- echo"<input type='hidden' value='non' name='bannir'>";
- echo"<input type='submit' name='valider' value='Re-intégrer'>";
- echo"</form>";
- }
-
- if($row_doc['actif'] == "oui"){
- echo"<form action='$PHP_SELF' method='post'>";
- echo"<input type='hidden' value='$id_document' name='id_doc'>";
- echo"<input type='hidden' value='non' name='actif'>";
- echo"<input type='submit' name='valider' value='Marquer le lien mort'>";
- echo"</form>";
- }elseif($row_doc['actif'] == "non"){
- echo"<form action='$PHP_SELF' method='post'>";
- echo"<input type='hidden' value='$id_document' name='id_doc'>";
- echo"<input type='hidden' value='oui' name='actif'>";
- echo"<input type='submit' name='valider' value='Marquer le lien actif'>";
- echo"</form>";
- }
-
- }
-}
-
-function maj_documents2 ($id_objet, $type) {
- global $_POST;
-
- if ($id_objet
- AND $id_doc = intval($_POST['id_document'])
- AND $_POST['modif_document'] == 'oui') {
-
-
-
- // "securite" : verifier que le document est bien lie a l'objet
- if($type=='syndic'){
- //echo "coucou";
- $result_doc = spip_query("SELECT * FROM spip_documents_".$type." WHERE id_document=".$id_doc."
- AND id_syndic_article = $id_objet");
- }else{
[... 470 lines stripped ...]