Bonjour,
Nous vous proposons aujourd’hui un tutorial pour ajouter Le bouton J’aime de Facebook et Goolge +1 Bouton sur chaque post de votre forum PHPBB3 avec mod Rewriting PHPBB SEO
Pour cela, il faut modifier principalement trois fichiers :
viewtopic.php qui se trouve dans la racine d’installation de votre forum phpbb3
viewtopic_body.html qui se trouve dans le repertoire styles/votre style/template
overall_footer.html qui se trouve dans le repertoire styles/votre style/template
Problèmatique :
Lors de chaque connexion l’url des topic change, puisque à chaque connexion on a différent sid.
http://www.jeveuxsortir.com/diffusion-de-jvs-sur-100-chabab-t14988.html?sid=fce74139d463ea618202482ef6950309
donc si la variable ‘U_MINI_POST’ définie viewtopic.php et qui représente l’url du post ne pourra pas être utilisée pour les boutons j’aime et G+1. Si on clique une première fois sur j’aime, lors de la prochaine session cette information ne sera pas enregistrée car on aura une deuxième url pour le même topic.
Solution :
Dans viewtopic.php
chercher :
‘U_MINI_POST’ => !empty($phpbb_seo->seo_opt['no_dupe']['on']) ? append_sid(« {$phpbb_root_path}viewtopic.$phpEx », ‘t=’ . $topic_id . ‘&f=’ . $forum_id . ‘&start=’ . $start ) . ‘#p’ . $row['post_id'] : append_sid(« {$phpbb_root_path}viewtopic.$phpEx », ‘p=’ . $row['post_id'] . (($topic_data['topic_type'] == POST_GLOBAL) ? ‘&f=’ . $forum_id : »)) . ‘#p’ . $row['post_id'],
Après ajouter
‘U_MINI_POST_FB’ => @$phpbb_seo->seo_opt['no_dupe']['on'] ? ‘http://www.votrenomdedomaine.com/viewtopic.php?t=’ . $topic_id . ‘&f=’. $forum_id . ‘&start=’ . $start . ‘#p’ . $row['post_id'] : ‘http://www.votrenomdedomaine.com/viewtopic.php?p=’ . $row['post_id'] . (($topic_data['topic_type'] == POST_GLOBAL) ? ‘&f=’ . $forum_id : ») . ‘#p’ . $row['post_id'],
Dans viewtopic_body.html
chercher :
<div>{postrow.MESSAGE}</div>
Avant ajouter
<div id= »fb-root »></div><script src= »http://connect.facebook.net/en_US/all.js#appId=VOTREAPPID&xfbml=1″></script><fb:like href= »{postrow.U_MINI_POST_FB} » title= »{postrow.POST_SUBJECT}{postrow.POST_ID} » layout= »button_count » send= »false » width= »160″ show_faces= »false » font= »arial »></fb:like>
<g:plusone href= »{postrow.U_MINI_POST_FB} »></g:plusone>
Dans overall_footer.html
chercher :
<body
Avant ajouter
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"> {lang: 'fr'} </script>
Et voila le tour est joué
иконииконописikoniсвети георги






