forum.coppermine-gallery.net
Support => Français (French) => Language Specific Support => cpg1.4.x Français (French) => Topic started by: Optimal on March 12, 2010, 08:03:02 am
-
Bonjour,
J'ai une galerie photo qui tourne sous Coppermine 1.4.26
Est il possible de faire en sorte que :
On ne puisse voir les votes que si l'on a soi même voté.
On ne puisse voir les commentaires des autres membres que si l'on a qoi même commenté.
Que seul les administrateurs puissent supprimer, modifier un commentaire
Merci par avance pour vos retours
-
Bonjour,
ça fait 3 questions alors que les règles du forum stipulent une seule question par sujet ;)
Pour les deux premières, il faut modifier le code (ça doit être possible, mais j'avoue ne pas savoir comment)
pour la dernière,il faut faire une modif dans le code d'affichage des commentaires (fichier theme.php du thème) dans la fonction ci-dessous
// HTML template for the display of comments
$template_image_comments = <<<EOT
<table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">
<tr>
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="tableh2_compact" nowrap="nowrap">
<b>{MSG_AUTHOR}</b><a name="comment{MSG_ID}"></a>
<!-- BEGIN ipinfo -->
({IP})
<!-- END ipinfo -->
</td>
<td class="tableh2_compact" align="right" width="100%">
<!-- BEGIN report_comment_button -->
<a href="report_file.php?pid={PID}&msg_id={MSG_ID}&what=comment" title="{REPORT_COMMENT_TITLE}"><img src="images/report.gif" width="16" height="16" border="0" align="middle" alt="{REPORT_COMMENT_TITLE}" /></a>
<!-- END report_comment_button -->
<!-- BEGIN buttons -->
<a href="javascript:;" onclick="blocking('cbody{MSG_ID}','', 'block'); blocking('cedit{MSG_ID}','', 'block'); return false;" title="{EDIT_TITLE}"><img src="images/edit.gif" border="0" align="middle" /></a>
<a href="delete.php?msg_id={MSG_ID}&what=comment" onclick="return confirm('{CONFIRM_DELETE}');"><img src="images/delete.gif" border="0" align="middle" /></a>
<!-- END buttons -->
</td>
<td class="tableh2_compact" align="right" nowrap="nowrap">
<span class="comment_date">[{MSG_DATE}]</span>
</td></tr>
</table>
</td>
</tr>
<tr>
<td class="tableb_compact">
<div id="cbody{MSG_ID}" style="display:block">
{MSG_BODY}
</div>
<div id="cedit{MSG_ID}" style="display:none">
<!-- BEGIN edit_box_smilies -->
<table width="100%" cellpadding="0" cellspacing="0">
<form name="f{MSG_ID}" method="POST" action="db_input.php">
<input type="hidden" name="event" value="comment_update" />
<input type="hidden" name="msg_id" value="{MSG_ID}" />
<tr>
<td>
<input type="text" name="msg_author" value="{MSG_AUTHOR}" class="textinput" size="25" />
</td><td>
</tr>
<tr>
<td width="80%">
<textarea cols="40" rows="2" class="textinput" name="msg_body" onselect="storeCaret_f{MSG_ID}(this);" onclick="storeCaret_f{MSG_ID}(this);" onkeyup="storeCaret_f{MSG_ID}(this);" style="width: 100%;">{MSG_BODY_RAW}</textarea>
</td>
<td class="tableb_compact">
</td>
<td>
<input type="submit" class="comment_button" name="submit" value="{OK}" />
</td>
</form>
</tr>
<tr>
<td colspan="3"><img src="images/spacer.gif" width="1" height="2" /><br /></td>
</tr>
</table>
{SMILIES}
<!-- END edit_box_smilies -->
<!-- BEGIN edit_box_no_smilies -->
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<form name="f{MSG_ID}" method="POST" action="db_input.php">
<input type="hidden" name="event" value="comment_update" />
<input type="hidden" name="msg_id" value="{MSG_ID}" />
<td>
<input type="text" name="msg_author" value="{MSG_AUTHOR}" class="textinput" size="25" />
</td>
</tr>
<tr>
<td width="100%">
<textarea cols="40" rows="2" class="textinput" name="msg_body" style="width: 100%;">{MSG_BODY_RAW}</textarea>
</td>
<td class="tableb_compact">
</td>
<td>
<input type="submit" class="comment_button" name="submit" value="{OK}" />
</td>
</form>
</tr>
<tr>
<td colspan="3"><img src="images/spacer.gif" width="1" height="2" /><br /></td>
</tr>
</table>
<!-- END edit_box_no_smilies -->
</div>
</td>
</tr>
</table>
EOT;
en ajoutant une condition testant si l'utilisateur connecté est administrateur ou pas
if (GALLERY_ADMIN_MODE) {
//code d'affichage des boutons à n'afficher que pour l'admin
}
-
Bonjour François
Merci pour la réponse.
Je vais tester ça dès ce soir en rentrant.
Désolé pour les 3 questions j'avais zappé cette partie du règlement.
Je re posterais donc séparément mes deux autres questions pour le cas ou quelqu'un puisse m'aider.