Advanced search  

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

Pages: [1]   Go Down

Author Topic: Ajouter le bouton Facebook J'aime à chaque album  (Read 5016 times)

0 Members and 1 Guest are viewing this topic.

easyjava

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 120
  • Be Tresh
Ajouter le bouton Facebook J'aime à chaque album
« on: September 20, 2010, 09:31:04 pm »

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

Code: [Select]
<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 :

Code: [Select]
<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 :

Code: [Select]
<!-- 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.  ;)
Logged

François Keller

  • Moderator
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: Ajouter le bouton Facebook J'aime à chaque album
« Reply #1 on: September 20, 2010, 09:49:46 pm »

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
Logged
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

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 120
  • Be Tresh
Re: Ajouter le bouton Facebook J'aime à chaque album
« Reply #2 on: September 21, 2010, 11:14:53 am »

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 !
Logged

easyjava

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 120
  • Be Tresh
Re: Ajouter le bouton Facebook J'aime à chaque album
« Reply #3 on: September 21, 2010, 08:05:31 pm »

@ Francois,

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

Code: [Select]
$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 ?

Logged

François Keller

  • Moderator
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: Ajouter le bouton Facebook J'aime à chaque album
« Reply #4 on: September 21, 2010, 08:52:43 pm »

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)
Logged
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
Pages: [1]   Go Up
 

Page created in 0.128 seconds with 19 queries.