Ajouter le bouton Facebook J'aime à chaque album Ajouter le bouton Facebook J'aime à chaque album
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Ajouter le bouton Facebook J'aime à chaque album

Started by easyjava, September 20, 2010, 09:31:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

easyjava

Dans votre fichier /coppermine/themes/your_theme/theme.php cherchez :


<td width="100%" valign="top" align="left" class="tableb tableb_alternate">
                        {ADMIN_MENU}
                        <p>{ALB_DESC}</p>
                        <p class="album_stat">{ALB_INFOS}<br />{ALB_HITS}</p>


et juste en dessous ajoutez :


<p><iframe src="http://www.facebook.com/plugins/like.php?href={$CONFIG['ecards_more_pic_target']}{ALB_LINK_TGT}&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100%; height:80px;" allowTransparency="true"></iframe></p>



exemple :


<!-- BEGIN album_cell -->
        <td width="{COL_WIDTH}%" valign="top">
        <table width="100%" cellspacing="0" cellpadding="0">
        <tr>
                <td colspan="3" height="1" align="left" valign="top" class="tableh2">
                        <span class="alblink"><a href="{ALB_LINK_TGT}">{ALBUM_TITLE}</a></span>
                </td>
        </tr>
        <tr>
                <td colspan="3">
                        <img src="images/spacer.gif" width="1" height="1" border="0" alt="" /><br />
                </td>
        </tr>
        <tr>
                <td align="center" valign="middle" class="thumbnails">
                        <img src="images/spacer.gif" width="{THUMB_CELL_WIDTH}" height="1" style="margin-top: 0px; margin-bottom: 0px; border: none;" alt="" /><br />
                        <a href="{ALB_LINK_TGT}" class="albums">{ALB_LINK_PIC}<br /></a>
                </td>
                <td>
                        <img src="images/spacer.gif" width="1" height="1" border="0" alt="" />
                </td>
                <td width="100%" valign="top" align="left" class="tableb tableb_alternate">
                        {ADMIN_MENU}
                        <p>{ALB_DESC}</p>
                        <p class="album_stat">{ALB_INFOS}<br />{ALB_HITS}</p>
<p><iframe src="http://www.facebook.com/plugins/like.php?href={$CONFIG['ecards_more_pic_target']}{ALB_LINK_TGT}&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100%; height:80px;" allowTransparency="true"></iframe></p>
                </td>
        </tr>
        </table>
        </td>
<!-- END album_cell -->


Cela affichera le bouton J'aime et la photo de tous ceux qui ont cliqué.
J'espère que de Hack vous plaira.

Bonne journée.  ;)

François Keller

merci pour ce partage, il serait toutefois intéressant d'en faire un plugin plutôt qu'un hack, ça éviterait d'avoir à le refaire lors des mises à jour dans le cas ou on effacerait le thème courant ou si on voulait changer de thème
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

easyjava

Effectivement, il faudra que je m'attarde à la création de plugins. Je n'en ai jamais fait alors il faut que je me renseigne !

easyjava

@ Francois,

J'ai bien compris comment l'on pouvait ajouter un texte en haut de la page :


$thisplugin->add_filter('gallery_header','helloworld_header');

function helloworld_header($html) {
    $html = '<p style="color:red"><b>Hello, world.</b> (tutorial 2.1)</p>'
            .$html;
    return $html;
}


Mais par quoi dois-je remplacer "gallery_header" pour faire apparaitre mon texte sous la description d'un album ?


François Keller

regarde dans la documentation les points d'entrées possibles pour les plugins http://documentation.coppermine-gallery.net/en/dev_plugin_hooks.htm#plugin_hooks_filename
tu devrais y trouver ton bonheur (il y a toute une partie de la doc qui est relative à l'écriture des plugins et qui devrait t'aider)
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog