[pnforum] Bouton PM (private message )

05.12.2005, 11:33 Ne pas afficher le bouton PM quand on est pas connecté

I. But



Le bouton PM s'affiche quand on est pas connecté, un personne non connecté verra le message PM sur les posts, mais il n'y aura pas accés. De plus, les bots des moteurs de recherche vont indexer la page PM, alors qu'elle redirige vers un message d'erreur. Ce qui n'a pas un trés grand intêret du point de vue du référencement.

II. Explication



Créer un fichier function.printpmbouton.php dans 'modules\pnForum\pntemplates\plugins.

Copiez coller le code suivant dedans
Code<?php
// $Id: function_printpmbouton,v 1.9 2005/10/07 11:54:56 landseer Exp $
// Mumuri : http://topflood.com
// ----------------------------------------------------------------------
// PostNuke Content Management System
// Copyright (C) 2002 by the PostNuke Development Team.
// http://www.postnuke.com/
// ----------------------------------------------------------------------
// Based on:
// PHP-NUKE Web Portal System - http://phpnuke.org/
// Thatware - http://thatware.org/
// ----------------------------------------------------------------------
// LICENSE
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License (GPL)
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) 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.
//
// To read the license please visit http://www.gnu.org/copyleft/gpl.html
// ----------------------------------------------------------------------


/**
* printpmbouton
* adds the pm button
*
*@params $params['uname'] string uname
*/
function smarty_function_printpmbouton($params, &$smarty)
{
extract($params);
unset($params);
$modinfo = pnModGetInfo( "Messages&quot ;) ;
$imagedata = pnf_getimagepath("icone-message.gif&quot ;) ;
if(pnUserLoggedIn())
{
if ($modinfo == 1 )
$out = '<a title="'._PNFORUM_SEND_PM.'" href="index.php?name=Messages&file=replypmsg&send=1&uname='.$uname.'">';
else
$out = '<a title="'._PNFORUM_SEND_PM.'" href="'.pnModURL ('Messages', 'user', 'compose', array ('uname' => $uname)).'">';
$out .='<img src="'.$imagedata['path'].'" alt="'._PNFORUM_SEND_PM.'" title="'._PNFORUM_SEND_PM.'" ></a>';
}else{$out = "";}
return $out;
}

?>
dans le templace pnforum_user_viewtopic.html situé dans modules\pnForum\pntemplatesmettre le code suivant à l'endroit ou vous désirez voir apparaitre les PM
Code<!--[printpmbouton uname=$post.poster_data.pn_uname ]-->


C'est tout

License GPL
License M1
mumuri cinemona.com
mumuri
mumuri
Messages : 14 373

  • dessin animé
  • forum
  • astuces de jeux vidéos
  • allo ciné
  • livres bds roman
  • avis livres
  • avis films & streaming
  • anime
  • smileys
  • actualité de jeux vidéos
  • séries télé
  • bourse
Tous droits réservés © 2002-2009 . Top flood. Crédits des logiciels tiers     .