Fork me on GitHub






Refaire un bouton "Admin"
Aspirant
Inscrit: 09/04/2006 17:19
Messages: 55
Hello à tous !
Alors, je vous éxplique en fait j'ai une navbar dans mon thème avec marquer forum.. etc... et je voudrais rajouter le bouton 'Admin' mais visible que par les Admins...

J'ai donc essayer d'utiliser <{if $xoops_isadmin}> mais je ne sait pas ou le placer...

Je vous donne le template de mon thème:
<?php /* Smarty version 2.6.5-dev, created on 2006-08-18 14:35:28
         compiled from C:/wamp/www/nunux-world/themes/blue_ipb/theme.html */ 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->_tpl_vars['xoops_langcode']; ?>
" lang="<?php echo $this->_tpl_vars['xoops_langcode']; ?>
">

<head>
<meta http-equiv="content-type" content="text/html; charset=<?php echo $this->_tpl_vars['xoops_charset']; ?>
" />
<meta http-equiv="content-language" content="<?php echo $this->_tpl_vars['xoops_langcode']; ?>
" />
<meta name="robots" content="<?php echo $this->_tpl_vars['xoops_meta_robots']; ?>
" />
<meta name="keywords" content="<?php echo $this->_tpl_vars['xoops_meta_keywords']; ?>
" />
<meta name="description" content="<?php echo $this->_tpl_vars['xoops_meta_description']; ?>
" />
<meta name="rating" content="<?php echo $this->_tpl_vars['xoops_meta_rating']; ?>
" />
<meta name="author" content="<?php echo $this->_tpl_vars['xoops_meta_author']; ?>
" />
<meta name="copyright" content="<?php echo $this->_tpl_vars['xoops_meta_copyright']; ?>
" />
<meta name="generator" content="" />
<title><?php echo $this->_tpl_vars['xoops_sitename']; ?>
 - <?php echo $this->_tpl_vars['xoops_pagetitle']; ?>
</title>
<link href="<?php echo $this->_tpl_vars['xoops_url']; ?>
/favicon.ico" rel="SHORTCUT ICON" />
<link rel="stylesheet" type="text/css" media="all" href="<?php echo $this->_tpl_vars['xoops_url']; ?>
/xoops.css" />
<link rel="stylesheet" type="text/css" media="all" href="<?php echo $this->_tpl_vars['xoops_themecss']; ?>
" />

<script type="text/javascript">
<!--
<?php echo $this->_tpl_vars['xoops_js']; ?>

//-->
</script>

<script type="text/javascript">
<!--

var getById = (typeof document.getElementById != "undefined");

function toggleDisplay(obj,display1,display2){

    if(!getById) return;
    
    obj = getRef(obj);
    
    if(obj.style.display == display2)
        obj.style.display = display1;
    else
        obj.style.display = display2;
    
    repaintFix();
}

function getRef(obj){
    if(getById)
        return(typeof obj == "string") ? document.getElementById(obj) : obj;
}

function repaintFix(obj){ 
    
    if("undefined" == typeof document.body
      || "undefined" == typeof document.body.style) return;
    
    if(obj == null)
        obj == document.body;
    else obj = getRef(obj);
    
    document.body.style.visibility = "hidden";
    document.body.style.visibility = "visible";
}


//-->
</script>

</head>
<body>
<table cellspacing="0" cellpadding="0" class="bg">
<tr><td>

<table cellspacing="0" cellpadding="0" class="bg1" border="0" >
<tr><td class="header">
<a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
"/>
<img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
/themes/<?php echo $this->_tpl_vars['xoops_theme']; ?>
/images/logo.jpg"></a> </a>
</td>
<td class="banner"><?php echo $this->_tpl_vars['xoops_banner']; ?>
</td>
</tr></table><br>
</td>
</tr>
<tr>
<td>

<!-- Start Headerbar -->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="10">
<img src="<?php echo $this->_tpl_vars['xoops_imageurl']; ?>
images/hbar_left.gif" width="10" height="25" alt="" />
</td>
<td>
<img src="<?php echo $this->_tpl_vars['xoops_imageurl']; ?>
images/swich.gif" width="25" height="25" alt="block control" class="pointer" onclick="toggleDisplay('left','block','none')" />
</td>
<td width="100%" class="topnav">
<!-- navibar set -->
<a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
/">Accueil</a>
&nbsp;&bull;&nbsp;
<a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
/modules/news/">News</a>
&nbsp;&bull;&nbsp;
<a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
/modules/ipboard/">Forum</a>
&nbsp;&bull;&nbsp;
<a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
/modules/mydownloads/">Telechargement</a>
&nbsp;&bull;&nbsp;
<a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
/search.php">Recherche</a>
&nbsp;&bull;&nbsp;
<a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
/user.php">Profil/Se Connecter</a>
&nbsp;&bull;&nbsp;
[size=x-large]C'est ici que je voudrais mettre le truc admin[/size]
<a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
/admin.php">Admin</a>

</td>
<td>
<?php if ($this->_tpl_vars['xoops_showrblock'] == 1): ?>
<img src="<?php echo $this->_tpl_vars['xoops_imageurl']; ?>
images/swich.gif" width="25" height="25" alt="block control" class="pointer" onclick="toggleDisplay('right','block','none')" />
<?php endif; ?>
<?php 
if ($this->_tpl_vars['xoops_showrblock'] == 0): ?>
<img src="<?php echo $this->_tpl_vars['xoops_imageurl']; ?>
images/swi_off.gif" width="25" height="25" alt="open and close right-block" alt="block control" />
<?php endif; ?>
</td>
<td width="10">
<img src="<?php echo $this->_tpl_vars['xoops_imageurl']; ?>
images/hbar_right.gif" width="10" height="25" alt="" />
</td>
</tr>
</table>
<!-- End Headerbar -->



</td></tr>

<tr><td><br>
<table cellspacing="2" cellpadding="2"><tr><td id="left" width=170>

<!-- Start left blocks loop -->

<?php if (count($_from = (array)$this->_tpl_vars['xoops_lblocks'])):
    foreach (
$_from as $this->_tpl_vars['block']):
?>
<table class="outline"><tr><td>

<table cellspacing="0" cellpadding="2">
<tr><td class="blockTitle2">&nbsp;<?php echo $this->_tpl_vars['block']['title']; ?>
</td></tr>
<tr><td class="blockContent"><?php echo $this->_tpl_vars['block']['content']; ?>

</td></tr></table>

</td></tr></table><br>

<?php endforeach; unset($_from); endif; ?>

<!-- End left blocks loop -->

</td>
<td style="padding: 0px 5px 0px;">

<!-- Display center blocks if any -->

<?php if ($this->_tpl_vars['xoops_showcblock'] == 1): ?>
<table cellspacing="0">
<tr><td width="100%" colspan="2">

<!-- Start center-center blocks loop -->

<?php if (count($_from = (array)$this->_tpl_vars['xoops_ccblocks'])):
    foreach (
$_from as $this->_tpl_vars['block']):
?>
<table class="outline"><tr><td>
<table cellspacing="1" cellpadding="5">
<tr><td class="blockTitle">&nbsp;<?php echo $this->_tpl_vars['block']['title']; ?>
</td></tr>
<tr><td class="blockContent"><?php echo $this->_tpl_vars['block']['content']; ?>
</td></tr></table>
</td></tr></table><br />
<?php endforeach; unset($_from); endif; ?>

<!-- End center-center blocks loop -->

</td></tr>
<tr><td width="50%">

<!-- Start center-left blocks loop -->

<?php if (count($_from = (array)$this->_tpl_vars['xoops_clblocks'])):
    foreach (
$_from as $this->_tpl_vars['block']):
?>
<table class="outline"><tr><td>
<table cellspacing="1" cellpadding="5">
<tr> <td class="blockTitle">&nbsp;<?php echo $this->_tpl_vars['block']['title']; ?>
</td></tr>
<tr><td class="blockContent"><?php echo $this->_tpl_vars['block']['content']; ?>
</td></tr></table>
</td></tr></table><br />
<?php endforeach; unset($_from); endif; ?>

<!-- End center-left blocks loop -->

</td><td width="50%">

<!-- Start center-right blocks loop -->

<?php if (count($_from = (array)$this->_tpl_vars['xoops_crblocks'])):
    foreach (
$_from as $this->_tpl_vars['block']):
?>
<table class="outline"><tr><td>

<table cellspacing="1" cellpadding="5">
<tr> <td class="blockTitle">&nbsp;<?php echo $this->_tpl_vars['block']['title']; ?>
</td></tr>
<tr><td class="blockContent"><?php echo $this->_tpl_vars['block']['content']; ?>
</td></tr></table>
</td></tr></table><br />
<?php endforeach; unset($_from); endif; ?>

<!-- End center-right blocks loop -->

</td></tr></table>
<?php endif; ?>

<!-- End display center blocks -->

<div id="content"><?php echo $this->_tpl_vars['xoops_contents']; ?>
</div></td>
<?php if ($this->_tpl_vars['xoops_showrblock'] == 1): ?>
<td id="right" width=170 align=center>

<!-- Start right blocks loop -->

<?php if (count($_from = (array)$this->_tpl_vars['xoops_rblocks'])):
    foreach (
$_from as $this->_tpl_vars['block']):
?>
<table class="outline"><tr><td id="right">

<table cellspacing="0" cellpadding="2">
<tr><td class="blockTitle2">&nbsp;<?php echo $this->_tpl_vars['block']['title']; ?>
</td></tr>
<tr><td class="blockContent"><?php echo $this->_tpl_vars['block']['content']; ?>
</td></tr></table>

</td></tr></table><br>

<?php endforeach; unset($_from); endif; ?>


<!-- End right blocks loop -->

<?php endif; ?></td></tr></table>
</td></tr>
</table>


</td></tr>
</table>

</body>
</html>

Posté le : 18/08/2006 14:51
Partager Twitter Partagez cette article sur GG+
Re: Refaire un bouton "Admin"
Supporter Xoops
Inscrit: 16/02/2003 21:55
De Paris
Messages: 346
Alors voici:

<{if $xoops_isadmin}>
<a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
/admin.php">Admin</a><{/if}>

ca devrait marcher.
Mais je ne connait pas cette syntaxe: <?php echo $this->_tpl_vars['xoops_url']; ?>
Tu peux l'éviter je pense en mettant:
<a href="<{$xoops_url}>/admin.php">

Posté le : 18/08/2006 16:11

Webmaster Forever sous Xoops
www.sciencespoaix.com ==> site étudiant de Sciences Po Aix
www.intellimique.com ==> Intelligence Economique, Veille, Sécurité
Partager Twitter Partagez cette article sur GG+
Re: Refaire un bouton "Admin"
Aspirant
Inscrit: 09/04/2006 17:19
Messages: 55
Merci, ça marche impec mais une derniere chose je voudrais faire la même chose, mais avec un bouton /user.php quand on est identifié ça marque Votre profil, et quand on est pas identifié ça marque s'inscrire !

Merci encore !

Posté le : 18/08/2006 20:09
Partager Twitter Partagez cette article sur GG+
Re: Refaire un bouton "Admin"
Supporter Xoops
Inscrit: 16/02/2003 21:55
De Paris
Messages: 346
Désolé, jen'avais pas vu ta rep.
Peut être as tu trouver par toi même:

<{if $xoops_isuser}>
.....

<{else}>

<
a href="<{$xoops_url}>/register.php">Créer un compte</a>
<{/if}>


ça devrait ressemler à ça.

Posté le : 09/09/2006 17:49

Webmaster Forever sous Xoops
www.sciencespoaix.com ==> site étudiant de Sciences Po Aix
www.intellimique.com ==> Intelligence Economique, Veille, Sécurité
Partager Twitter Partagez cette article sur GG+

 Haut   Précédent   Suivant



Vous pouvez voir les sujets.
Vous ne pouvez pas débuter de nouveaux sujets.
Vous ne pouvez pas répondre aux contributions.
Vous ne pouvez pas éditer vos contributions.
Vous ne pouvez pas effacez vos contributions.
Vous ne pouvez pas ajouter de nouveaux sondages.
Vous ne pouvez pas voter en sondage.
Vous ne pouvez pas attacher des fichiers à vos contributions.
Vous ne pouvez pas poster sans approbation.

Propulsé avec XOOPS | Graphisme adapté par Tatane, Grosdunord, Montuy337513

148 Personne(s) en ligne (127 Personne(s) connectée(s) sur Forum) | Utilisateur(s): 0 | Invité(s): 148 | Plus ...