- Posts: 9
- Thank you received: 0
[Datso gallery] interdire les invités de voter
19 years 5 months ago #3222
by odas
[Datso gallery] interdire les invités de voter was created by odas
Puisque quelqu'un a posé la question sur un autre forum et que j'y ai posté la solution, j'en fait profiter tout le monde...
Ca interessera peut-etre quelqu'un.
Pour empecher les utilisateurs non connecté de voter dans datso gallery :
ouvrir le fichier sub_viewdetails.php (site\components\com_datsogallery), trouver ces lignes de code :
[PHP]if ($ad_showrating) {
echo "<form name='ratingform' action='index.php' target='_top' method='post'>";
echo "<input type='hidden' name='option' value='com_datsogallery' />";
echo "<input type='hidden' name='Itemid' value='$Itemid' />";
echo "<input type='hidden' name='func' value='votepic' />";
[/PHP]
Et rajouter [PHP]if ($my->username) {[/PHP] en dessous de [PHP]if ($ad_showrating) {[/PHP]
On obtient donc ca :
[PHP]if ($ad_showrating) {
if ($my->username) {
echo "<form name='ratingform' action='index.php' target='_top' method='post'>";
echo "<input type='hidden' name='option' value='com_datsogallery' />";[/PHP]
Puis chercher ces lignes :
[PHP]echo "<td align='center'>$i ("._DG_GOOD.")</td>\n<td align='right'>
<input class='button' type='submit' value='" . _DG_VOTE . "' name='Vote' /></td>\n</tr>\n</table>\n";
echo "</td>\n</tr>\n";
echo "</table>\n</form>";[/PHP]
Et juste en dessous de celle ci y rajouter :
[PHP]} else {
echo "<table width='100%' border='0' cellspacing='1' cellpadding='3'>";
echo "<tr><td class='sectiontableheader' colspan='2'><strong>". _DG_VOTE."</strong></td>\n</tr>\n";
echo "<tr class='sectiontableentry1'><td width='70%' valign='top'>". _DG_LOGIN_FIRST."</td>\n</tr>\n";
echo "</table>\n";
}[/PHP]
Voila, maintenant seul les utilisateurs connectés peuvent voter.
Attention, selon la version de datso, les codes peuvent etre légerement différents.
A+ :cligne:
Ca interessera peut-etre quelqu'un.
Pour empecher les utilisateurs non connecté de voter dans datso gallery :
ouvrir le fichier sub_viewdetails.php (site\components\com_datsogallery), trouver ces lignes de code :
[PHP]if ($ad_showrating) {
echo "<form name='ratingform' action='index.php' target='_top' method='post'>";
echo "<input type='hidden' name='option' value='com_datsogallery' />";
echo "<input type='hidden' name='Itemid' value='$Itemid' />";
echo "<input type='hidden' name='func' value='votepic' />";
[/PHP]
Et rajouter [PHP]if ($my->username) {[/PHP] en dessous de [PHP]if ($ad_showrating) {[/PHP]
On obtient donc ca :
[PHP]if ($ad_showrating) {
if ($my->username) {
echo "<form name='ratingform' action='index.php' target='_top' method='post'>";
echo "<input type='hidden' name='option' value='com_datsogallery' />";[/PHP]
Puis chercher ces lignes :
[PHP]echo "<td align='center'>$i ("._DG_GOOD.")</td>\n<td align='right'>
<input class='button' type='submit' value='" . _DG_VOTE . "' name='Vote' /></td>\n</tr>\n</table>\n";
echo "</td>\n</tr>\n";
echo "</table>\n</form>";[/PHP]
Et juste en dessous de celle ci y rajouter :
[PHP]} else {
echo "<table width='100%' border='0' cellspacing='1' cellpadding='3'>";
echo "<tr><td class='sectiontableheader' colspan='2'><strong>". _DG_VOTE."</strong></td>\n</tr>\n";
echo "<tr class='sectiontableentry1'><td width='70%' valign='top'>". _DG_LOGIN_FIRST."</td>\n</tr>\n";
echo "</table>\n";
}[/PHP]
Voila, maintenant seul les utilisateurs connectés peuvent voter.
Attention, selon la version de datso, les codes peuvent etre légerement différents.
A+ :cligne:
Please Connectez-vous or Create an account to join the conversation.
19 years 5 months ago #3223
by lavsteph
Replied by lavsteph on topic Re : [Datso gallery] interdire les invités de voter
Merci de faire partager cette astuce :bienjoue:
Please Connectez-vous or Create an account to join the conversation.
Moderators: serge
Time to create page: 0.123 seconds
