-
7 February 2012, 4:21 pm
#1
Issue with a card converter plugin.
Hello. I am adding the first content to my site and downloaded a plugin that convert codes like [As] into real Poker cards.
For some reason, whenever I have this plugin activated, my PokerStars review do not work.
Review link: http://www.pokerstorm.com.br/reviews/pokerstars
Site with working plugin: http://www.pokerstorm.com.br/estrate...anking-de-maos
I tried a few things to make it work, like on plugin code that was
$ligne = transforme_carte_pokerstars($ligne); and I changed to
$ligne = transforme_carte_poker($ligne);
Any idea about I could do or where to find another plugin?
Thanks.
</pre>
Plugin code:
<?php /* Plugin Name: Cards_Poker Plugin URI: http://www.blog-du-joueur.com/category/plugins-wp/ Description: Change les balises du style [9s 10c Td] ou [As Ac] par son équivalent graphique Version: 1.3.4 Author: Hesiode Author URI: http://www.blog-du-joueur.com $Revision$ Copyright (C) 2010 Hesiode Hesiode Hesiode@replay-fr.com Tested with PHP 4.3.8, WordPress 2.0.5 & 2.2 & 3.0 */ function affiche_poker($text) { $content2=""; $lignes = explode("\n",$text); for($i=0;$i<count($lignes);$i++){ $ligne = $lignes[$i]; $ligne = transforme_carte_poker($ligne); $ligne = affiche_carte($ligne); $content2.=$ligne; } return $content2; } function transforme_carte_poker($texte){ $return = $texte; $pos = strpos($texte, "["); while($pos<>false){ $debut = $pos; $fin = strpos($texte,"]",$pos); $chaine = substr($texte,$debut+1,$fin-$debut-1); $chaine_ori = substr($texte,$debut,$fin-$debut+1); $split = explode(" ",trim($chaine)); $occ = ""; for($i=0;$i<count($split);$i++){ $occ.="[".trim($split[$i])."]"; } $return = str_replace($chaine_ori,$occ,$return); $pos = strpos($texte, "[",$fin+1); } return $return; } function affiche_carte($texte){ $motif ='`\[([akqjtAKQJT2-9]|10)([scdhDSCH])\]`e'; $chaine = "'<IMG SRC=\"".WP_PLUGIN_URL."/cards-poker/cartes/'.(strtoupper($1)).(strtolower($2)).'.gif\" alt=\"$1$2\" border=\"0\">'"; $chain = preg_replace($motif,$chaine,$texte); $motif='`\[\
[akqjtAKQJT2-9]|10)([scdhDSCH])\]`'; $chaine = "[$1$2]"; $chain = preg_replace($motif,$chaine,$chain); return $chain; } add_filter('the_content',affiche_poker); add_filter('the_excerpt', affiche_poker); add_filter('comment_text', affiche_poker); ?></pre>
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules