nikhilnaik Posted October 4, 2011 Share Posted October 4, 2011 i get the following error in the comments in wordpress blog..: Warning: preg_replace() [function.preg-replace]: No ending delimiter '~' found in /home/doughhhh/public_html/wp-content/themes/upload/includes/theme-comments.php on line 75 the content of the file is: <?php // Fist full of comments if (!function_exists("custom_comment")) { function custom_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li <?php comment_class(); ?>> <a name="comment-<?php comment_ID() ?>"></a> <div id="li-comment-<?php comment_ID() ?>" class="comment-container"> <div class="comment-head"> <?php if(get_comment_type() == "comment"){ ?> <div class="avatar"><?php the_commenter_avatar($args) ?></div> <?php } ?> <div class="reply"> <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?> </div><!-- /.reply --> </div><!-- /.comment-head --> <div class="comment-entry" id="comment-<?php comment_ID(); ?>"> <span class="arrow"></span> <div class="comment-info"> <div class="left"><span class="name"><?php the_commenter_link() ?></span></div> <div class="right"> <span class="date"><?php echo get_comment_date(get_option( 'date_format' )) ?> <?php _e('at', 'themejunkie'); ?> <?php echo get_comment_time(get_option( 'time_format' )); ?></span> <span class="perma"><a href="<?php echo get_comment_link(); ?>" title="<?php _e('Direct link to this comment', 'themejunkie'); ?>">#</a></span> <span class="edit"><?php edit_comment_link(__('Edit', 'themejunkie'), '', ''); ?></span> </div> <div class="clear"></div> </div> <?php comment_text() ?> <?php if ($comment->comment_approved == '0') { ?> <p class='unapproved'><?php _e('Your comment is awaiting moderation.', 'themejunkie'); ?></p> <?php } ?> </div><!-- /comment-entry --> </div><!-- /.comment-container --> <?php } } // PINGBACK / TRACKBACK OUTPUT if (!function_exists("list_pings")) { function list_pings($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li id="comment-<?php comment_ID(); ?>"> <span class="author"><?php comment_author_link(); ?></span> - <span class="date"><?php echo get_comment_date(get_option( 'date_format' )) ?></span> <span class="pingcontent"><?php comment_text() ?></span> <?php } } if (!function_exists("the_commenter_link")) { function the_commenter_link() { $commenter = get_comment_author_link(); if ( preg_match( '~]* class=[^>]+>~', $commenter ) ) {$commenter = preg_replace( '~(]* class=[\'"]?)~', '\\1url ' , $commenter ); } else { $commenter = preg_replace( '~(<a )/', '\\1class="url "~' , $commenter );} echo $commenter ; } } if (!function_exists("the_commenter_avatar")) { function the_commenter_avatar($args) { $email = get_comment_author_email(); $avatar = str_replace( "class='avatar", "class='photo avatar", get_avatar( "$email", $args['avatar_size']) ); echo $avatar; } } ?> help! [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
requinix Posted October 4, 2011 Share Posted October 4, 2011 Help with what? Telling you what the problem is? The error message does that already. Where the problem is? Error message does that too. Fix the code to use preg_replace( '~( Quote Link to comment Share on other sites More sharing options...
nikhilnaik Posted October 4, 2011 Author Share Posted October 4, 2011 i get that error message above the comments.. so i want to avoid that error.... how can i do that Quote Link to comment Share on other sites More sharing options...
nikhilnaik Posted October 4, 2011 Author Share Posted October 4, 2011 Help with what? Telling you what the problem is? The error message does that already. Where the problem is? Error message does that too. Fix the code to use preg_replace( '~(<a )~', '\\1class="url "' , $commenter ) i did that... still same problem Quote Link to comment Share on other sites More sharing options...
requinix Posted October 4, 2011 Share Posted October 4, 2011 And what does line 75 look like now? Quote Link to comment Share on other sites More sharing options...
nikhilnaik Posted October 5, 2011 Author Share Posted October 5, 2011 And what does line 75 look like now? } else { $commenter = preg_replace( '~(<a )~', '\\1class="url "' , $commenter );} Quote Link to comment Share on other sites More sharing options...
Buddski Posted October 5, 2011 Share Posted October 5, 2011 You will need to escape your < preg_replace( '~(\<a )~', '\\1class="url "' , $commenter ); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.