forum.coppermine-gallery.net

Support => Français (French) => Language Specific Support => cpg1.4.x Français (French) => Topic started by: Pascal YAP on August 21, 2006, 09:43:13 am

Title: LOGIN Form [Plugin CPG1.4.x]
Post by: Pascal YAP on August 21, 2006, 09:43:13 am
Bonjour,

Voici un Plugin pour Coppermine 1.4.x qui ajoute un petit formulaire de connexion "normalisé".
Présenté ci-dessous (Username et Password sont déjà traduit dans le code)

La Démo n'est plus en fonction en fonction ici (PYAP Galerie (http://www.pays-dignois.com/galerie/displayimage.php?album=11&pid=1265&slideshow=4000&theme=Fruity-ZONE))

(http://forum.coppermine-gallery.net/index.php?action=dlattach;topic=33349.0;attach=4325;image)

Copiez le code ci-dessous et nommez-le codebase.php :
Code: [Select]
<?php
/**************************************************
  CPG Photo Shop Plugin for Coppermine Photo Gallery
  *************************************************
  Copyright (c) 2006 Thomas Lange <stramm@gmx.net>
  *************************************************
  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
  (at your option) any later version.
  *************************************************
  Coppermine version: 1.4.5
  Photo Shop version: 1.0
  $Revision: 1.0 $
  $Author: stramm $
***************************************************/
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');

 
$thisplugin->add_action('page_start','loginform_start');

 
function 
loginform_start()
{
    global 
$template_sub_menu;
    
$template_sub_menu .= plugin_loginform();
}

function 
plugin_loginform() {
global $CONFIG$REFERER;
if (!USER_ID) {
  
$loginFormHtml = <<<EOT
<span style="float:right">
<ins>
     <form action="login.php?referer=
$REFERER" method="post" name="loginbox" style="margin:0; padding:0;">
        <table cellpadding="0" cellspacing="3" border="0">
        <tr>
            <td><input type="text" class="textinput" name="username" size="10" /></td>
            <td><input type="password" class="textinput" name="password" size="10" /></td>
            <td><input name="submitted" type="submit" value="Login" />
            <input name="remember_me" type="hidden" class="checkbox" value="1" checked="checked" /></td>
        </tr>
        <tr>
        <td class="smallfont">Utilisateur</td>
        <td class="smallfont">Mot de Passe</td>
        <td></td>
</tr>
        </table>
        </form>
</ins>
</span>
EOT;
} else {
$loginFormHtml "<div align=\"right\" class=\"smallfont\">Welcome back <strong>".(USER_NAME)."</strong><br />";
}
  return 
$loginFormHtml;
}
?>

Copiez le code ci-dessous et nommez-le configuration.php :
Code: [Select]
<?php
/**************************************************
  CPG Loginform Plugin for Coppermine Photo Gallery
  *************************************************
  Copyright (c) 2006 Thomas Lange <stramm@gmx.net>
  *************************************************
  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
  (at your option) any later version.
  *************************************************
  Coppermine version: 1.4.8
  Loginform version: 1.0
  $Revision: 1.0 $
  $Author: stramm $
***************************************************/

$name='Loginform';
$description='Loginform adds a loginform below the menu on your Coppermine Photo Gallery.';
$author='Stramm stramm@gmx.net <a href="http://stramm.st.funpic.org" target="_blank">stramm.st.funpic.org</a>';
$version='1.0';
?>

Copiez ces deux fichiers vers un nouveau sous-dossier de votre_cpg/plugin/loginform
Depuis votre page PluginManager (pluginmgr.php) validez et installez "LogiForm".

PYAP

Sujet original by Stramm (http://forum.coppermine-gallery.net/index.php?topic=33349.0).
Title: Re: LOGIN Form [Plugin CPG1.4.x]
Post by: Pascal YAP on January 09, 2007, 11:48:32 am
Nouvelle version 1.1 (01-08-2007)

Il est possible de placer les boites de saisie où l'on veut.
Pour ce faire, éditez votre TEMPLATE.HTML et placez le tag {LOGIN_FORM} dans le code à l'emplacement adéquat.

Téléchager LOGINFORM v 1.1 (http://forum.coppermine-gallery.net/index.php?action=dlattach;topic=33349.0;attach=6125)

PYAP