Bonjour, je désire modifier cette fonction PHP

Eléphanteau du PHP | 17 Messages

26 oct. 2012, 11:18

En fait voici ma ligne 28 editée dans le bloc note, j'ai essayé avec un traducteur rot 13 mais tjs la même erreur T string

eval(str_rot13('shapgvba purpx_sbbgre(){$y=\'Qrfvtarq ol <n uers="uggc://jjj.qrfvtare-pybgurf.pb.hx">Qrfvtare pybgurf</n>\';$s=qveanzr(__SVYR__).\'/sbbgre.cuc\';$sq=sbcra($s,\'e\');$p=sernq($sq,svyrfvmr($s));spybfr($sq);vs(fgecbf($p,$y)==0){rpub \'Guvf gurzr vf fcbafberq, nyy yvaxf va gur sbbgre fubhyq erznva vagnpg\';qvr;}}purpx_sbbgre();'));

Merci de ton aide

Eléphanteau du PHP | 17 Messages

26 oct. 2012, 11:21

Ce qui devrait me donner cela :


<?PHP
function check_footer()
{
$l=\'Designed by <a href="http://www.designer-clothes.co.uk">Designer clothes</a>\';
$f=dirname(__FILE__).\'/footer.php\';
$fd=fopen($f,\'r\');
$c=fread($fd,filesize($f));
fclose($fd);
if(strpos($c,$l)==0)
{
echo \'This theme is sponsored, all links in the footer should remain intact\';
die;
}
}
check_footer();
?>


et non tjs la meme erreur T string

Eléphanteau du PHP | 17 Messages

26 oct. 2012, 11:59

Peut être parce qu'il y a encore du rot 13 plus bas voici ma page functiuns en entier, merci de votre aide :

<?php
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'Sidebar Right',
'before_widget' => '<div class="side-widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
register_sidebar(array('name'=>'Footer Widget 1',
'before_widget' => '<div class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
register_sidebar(array('name'=>'Footer Widget 2',
'before_widget' => '<div class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
register_sidebar(array('name'=>'Footer Widget 3',
'before_widget' => '<div class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
include(TEMPLATEPATH.'/includes/themeoptions.php');
eval(str_rot13('shapgvba purpx_sbbgre(){$y=\'Qrfvtarq ol <n uers="uggc://jjj.qrfvtare-pybgurf.pb.hx">Qrfvtare pybgurf</n>\';$s=qveanzr(__SVYR__).\'/sbbgre.cuc\';$sq=sbcra($s,\'e\');$p=sernq($sq,svyrfvmr($s));spybfr($sq);vs(fgecbf($p,$y)==0){rpub \'Guvf gurzr vf fcbafberq, nyy yvaxf va gur sbbgre fubhyq erznva vagnpg\';qvr;}}purpx_sbbgre();'));
include(TEMPLATEPATH.'/includes/images.php');


// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary-menu' => __( 'Primary Menu' ),
) );
function my_wp_nav_menu_args( $args = '' )
{
$args['container'] = false;
return $args;
} // function
add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' );



/*this function allows for the auto-creation of post excerpts*/
function truncate_post($amount,$quote_after=false) {
$truncate = get_the_content();
$truncate = apply_filters('the_content', $truncate);
$truncate = preg_replace('@<script[^>]*?>.*?</script>@si', '', $truncate);
$truncate = preg_replace('@<style[^>]*?>.*?</style>@si', '', $truncate);
$truncate = strip_tags($truncate);
$truncate = substr($truncate, 0, strrpos(substr($truncate, 0, $amount), ' '));
echo $truncate;
echo "...";
if ($quote_after) echo('');
}
eval(str_rot13('shapgvba purpx_urnqre(){vs(!(shapgvba_rkvfgf("purpx_shapgvbaf")&&shapgvba_rkvfgf("purpx_s_sbbgre"))){rpub(\'Guvf gurzr vf eryrnfrq haqre perngvir pbzzbaf yvprapr, nyy yvaxf va gur sbbgre fubhyq erznva vagnpg\');qvr;}}'));
?>
<?php
function swt_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case '' :
?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
<div class="comment-author vcard">
<?php echo get_avatar( $comment, 48 ); ?>
<?php printf( __( '%s<br />' ), sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) ); ?>

<a class="metadata" href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
<?php
/* translators: 1: date, 2: time */
printf( __( '%1$s at %2$s', 'twentyten' ), get_comment_date(), get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' );
?>
</div><!-- .comment-author .vcard -->
<div id="comment-<?php comment_ID(); ?>" <?php if (1 == $comment->user_id) { ?> class="adminclass cbody" <?php } else{ ?> class="cbody" <?php } ?>>
<?php if ( $comment->comment_approved == '0' ) : ?>
<em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentyten' ); ?></em>
<br />
<?php endif; ?>
<div class="comment-body"><?php comment_text(); ?></div>
<div class="reply">
<?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
</div><!-- .reply -->
</div><!-- #comment-## -->

<?php
break;
case 'pingback' :
case 'trackback' :
?>
<li class="post pingback">
<p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' ); ?></p>
<?php
break;
endswitch;
}?>

Mammouth du PHP | 1966 Messages

26 oct. 2012, 12:37

LES BALISES PHP PLEASE

C'est ton code original avant modification ou après ?

Tu l'a trouvé où ?

Le code original fonctionne t il ?

Que cherche tu à modifier ?
Spols
pour les fan de rubik's cube ou pour les curieux ==> le portail francophone du rubik's cube

Eléphanteau du PHP | 17 Messages

26 oct. 2012, 12:45

Et bien je cherche a enlever les eval rot 13 par le texte décodé, merci de ton aide
Cordialement Bruno
Cette page originelle fonctionne



<?php
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'Sidebar Right',
'before_widget' => '<div class="side-widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
register_sidebar(array('name'=>'Footer Widget 1',
'before_widget' => '<div class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
register_sidebar(array('name'=>'Footer Widget 2',
'before_widget' => '<div class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
register_sidebar(array('name'=>'Footer Widget 3',
'before_widget' => '<div class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
include(TEMPLATEPATH.'/includes/themeoptions.php');
eval(str_rot13('shapgvba purpx_sbbgre(){$y=\'Qrfvtarq ol <n uers="uggc://jjj.qrfvtare-pybgurf.pb.hx">Qrfvtare pybgurf</n>\';$s=qveanzr(__SVYR__).\'/sbbgre.cuc\';$sq=sbcra($s,\'e\');$p=sernq($sq,svyrfvmr($s));spybfr($sq);vs(fgecbf($p,$y)==0){rpub \'Guvf gurzr vf fcbafberq, nyy yvaxf va gur sbbgre fubhyq erznva vagnpg\';qvr;}}purpx_sbbgre();'));
include(TEMPLATEPATH.'/includes/images.php');


// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary-menu' => __( 'Primary Menu' ),
) );
function my_wp_nav_menu_args( $args = '' )
{
$args['container'] = false;
return $args;
} // function
add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' );



/*this function allows for the auto-creation of post excerpts*/
function truncate_post($amount,$quote_after=false) {
$truncate = get_the_content();
$truncate = apply_filters('the_content', $truncate);
$truncate = preg_replace('@<script[^>]*?>.*?</script>@si', '', $truncate);
$truncate = preg_replace('@<style[^>]*?>.*?</style>@si', '', $truncate);
$truncate = strip_tags($truncate);
$truncate = substr($truncate, 0, strrpos(substr($truncate, 0, $amount), ' '));
echo $truncate;
echo "...";
if ($quote_after) echo('');
}
eval(str_rot13('shapgvba purpx_urnqre(){vs(!(shapgvba_rkvfgf("purpx_shapgvbaf")&&shapgvba_rkvfgf("purpx_s_sbbgre"))){rpub(\'Guvf gurzr vf eryrnfrq haqre perngvir pbzzbaf yvprapr, nyy yvaxf va gur sbbgre fubhyq erznva vagnpg\');qvr;}}'));
?>
<?php
function swt_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case '' :
?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
<div class="comment-author vcard">
<?php echo get_avatar( $comment, 48 ); ?>
<?php printf( __( '%s
' ), sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) ); ?>

<a class="metadata" href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
<?php
/* translators: 1: date, 2: time */
printf( __( '%1$s at %2$s', 'twentyten' ), get_comment_date(), get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' );
?>
</div><!-- .comment-author .vcard -->
<div id="comment-<?php comment_ID(); ?>" <?php if (1 == $comment->user_id) { ?> class="adminclass cbody" <?php } else{ ?> class="cbody" <?php } ?>>
<?php if ( $comment->comment_approved == '0' ) : ?>
<em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentyten' ); ?></em>


<?php endif; ?>
<div class="comment-body"><?php comment_text(); ?></div>
<div class="reply">
<?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
</div><!-- .reply -->
</div><!-- #comment-## -->

<?php
break;
case 'pingback' :
case 'trackback' :
?>
<li class="post pingback">
<p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' ); ?></p>
<?php
break;
endswitch;
}?>
[PHP]

Mammouth du PHP | 1966 Messages

26 oct. 2012, 13:19

Fait toi un petit fichier php dans lequel tu met un à un les bouts de code du type eval(str_rot13([...]));
Remplace le eval par un echo, et visionne dans un navigateur. Remplace tes codes eval(str_rot13([...])); par ce qui s'affiche dans ton navigateur (mieux encore par le code source fourni)

n'hésite pas à indenter ce code, mais n'ajoute rien, ni balise <?php ni quote (simple ou double)

Une fois cela fait, tu aura un code humainement compréhensible et tu pourra tenter de le modifier petit bout par petit bout.

Cependant, les codes que tu cherches à modifier me semble être mis en place pour s'assurer que certaines mention sont bien dans le footer.
Les personnes qui ont travaillé pour creer ce contenu mérite qu'on les mentionne. Je t'encourage donc à laisser ces informations tel quelles.
Spols
pour les fan de rubik's cube ou pour les curieux ==> le portail francophone du rubik's cube

Eléphanteau du PHP | 17 Messages

26 oct. 2012, 13:33

En mettant ton bout de code
<?PHP
function check_footer()
{
        $l="Designed by <a href='http://www.designer-clothes.co.uk'>Designer clothes</a>";
        $f = dirname(__FILE__)."/footer.php";
        $fd=fopen($f,"r");
        $c=fread($fd,filesize($f));
        fclose($fd);
        if(strpos($c,$l)==0)
        {
                echo "This theme is sponsored, all links in the footer should remain intact";
                die;
        }
}
check_footer();
?>
[PHP]

il m'affiche 
Parse error: syntax error, unexpected '<' in /home6/m/morel-avocats/www/site/wp-content/themes/PatolinoMagazine/functions.php on line 28

Donc ce n'est qu'une petite erreur de syntaxe....

Merci de ton aide 
Cordialement

Bruno

Mammouth du PHP | 1966 Messages

26 oct. 2012, 13:38

Je t'ai dit de ne pas ajouter de balise <?php

c'est cela qu'il ne comprends pas

voila ce que tu devrais avoir comme fichier
<?php
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'Sidebar Right',
'before_widget' => '<div class="side-widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
register_sidebar(array('name'=>'Footer Widget 1',
'before_widget' => '<div class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
register_sidebar(array('name'=>'Footer Widget 2',
'before_widget' => '<div class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
register_sidebar(array('name'=>'Footer Widget 3',
'before_widget' => '<div class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
include(TEMPLATEPATH.'/includes/themeoptions.php');
function check_footer(){
	$l="Designed by <a href='http://www.designer-clothes.co.uk'>Designer clothes</a>";
	$f = dirname(__FILE__).'/footer.php';
	$fd = fopen($f,'r');
	$c = fread($fd,filesize($f));
	fclose($fd);
	if(strpos($c,$l)==0){
		echo 'This theme is sponsored, all links in the footer should remain intact';
		die;
	}
}
check_footer();
include(TEMPLATEPATH.'/includes/images.php');


// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary-menu' => __( 'Primary Menu' ),
) );
function my_wp_nav_menu_args( $args = '' )
{
$args['container'] = false;
return $args;
} // function
add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' );



/*this function allows for the auto-creation of post excerpts*/
function truncate_post($amount,$quote_after=false) {
$truncate = get_the_content();
$truncate = apply_filters('the_content', $truncate);
$truncate = preg_replace('@<script[^>]*?>.*?</script>@si', '', $truncate);
$truncate = preg_replace('@<style[^>]*?>.*?</style>@si', '', $truncate);
$truncate = strip_tags($truncate);
$truncate = substr($truncate, 0, strrpos(substr($truncate, 0, $amount), ' '));
echo $truncate;
echo "...";
if ($quote_after) echo('');
}
function check_header(){
	if(!(function_exists("check_functions") && function_exists("check_f_footer"))) {
		echo('This theme is released under creative commons licence, all links in the footer should remain intact');
		die;
	}
}
?>
<?php
function swt_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case '' :
?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
<div class="comment-author vcard">
<?php echo get_avatar( $comment, 48 ); ?>
<?php printf( __( '%s
' ), sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) ); ?>

<a class="metadata" href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
<?php
/* translators: 1: date, 2: time */
printf( __( '%1$s at %2$s', 'twentyten' ), get_comment_date(), get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' );
?>
</div><!-- .comment-author .vcard -->
<div id="comment-<?php comment_ID(); ?>" <?php if (1 == $comment->user_id) { ?> class="adminclass cbody" <?php } else{ ?> class="cbody" <?php } ?>>
<?php if ( $comment->comment_approved == '0' ) : ?>
<em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentyten' ); ?></em>


<?php endif; ?>
<div class="comment-body"><?php comment_text(); ?></div>
<div class="reply">
<?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
</div><!-- .reply -->
</div><!-- #comment-## -->

<?php
break;
case 'pingback' :
case 'trackback' :
?>
<li class="post pingback">
<p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' ); ?></p>
<?php
break;
endswitch;
}?>
PS les balises php sur le forum sont en minuscule
Spols
pour les fan de rubik's cube ou pour les curieux ==> le portail francophone du rubik's cube

Eléphanteau du PHP | 17 Messages

26 oct. 2012, 13:41

Donc je ne met que cela ?


function check_footer()
{
$l="Designed by <a href='http://www.designer-clothes.co.uk'>Designer clothes</a>";
$f = dirname(__FILE__)."/footer.php";
$fd=fopen($f,"r");
$c=fread($fd,filesize($f));
fclose($fd);
if(strpos($c,$l)==0)
{
echo "This theme is sponsored, all links in the footer should remain intact";
die;
}
}
check_footer();

Mammouth du PHP | 1966 Messages

26 oct. 2012, 15:12

oui
Spols
pour les fan de rubik's cube ou pour les curieux ==> le portail francophone du rubik's cube