İyinet'e Hoşgeldiniz!

Türkiye'nin En Eski Webmaster Forum'una Hemen Kayıt Olun!

Kayıt Ol!

Wordpress Bilenlerden Acil Yardım!!!

serhat_331

0
Yasakli Uye
Katılım
13 Ağustos 2012
Mesajlar
86
Reaction score
0
Merhaba arkadaşlar bilgisayara wordpress kurdum herşey hazır hosta atıcam ama şu hatayı bir türlübulamadım konuyu takip ediyorum.

Fatal error: Call to undefined function session_is_registered() in C:\EasyPHP-12.1\www\web\wordpress\wp-content\themes\qna\comments.php on line 204

Comment.php dosyası şu şekilde


<!-- Trieu:jquery -->
<?php wp_enqueue_script("jquery"); ?>
<?php wp_head(); ?>
<script type="text/javascript">
function thump (type, answer_id, post_id){
jQuery.post(
'<?php echo get_bloginfo('template_directory') . "/ajax_mark_thump.php"?>',
{"type": type, "answer_id": answer_id, "post_id": post_id},

function(data) {
if(data.accepted == '1'){
alert (data.message);
jQuery('#cup' + answer_id).html(data.up);
jQuery('#cdown' + answer_id).html(data.down);
}
else{
alert (data.message);
}
},
"json"
); //end Jquery post
} //end function thump()
</script>
<?php
if (isset($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die (__('Please do not load this page directly. Thanks!','qa'));
?>
<?php
global $wpdb;
global $comment;
$cpage = get_query_var('cpage');
$comments_per_page = intval(get_option('comments_per_page'));
$start = (get_query_var('cpage') - 1) * $comments_per_page;
$top = get_metadata('post', get_the_ID(), 'tgt_best_answer', true);
if ($top != '' ):
if ($cpage == 1){
$comments_per_page -= 1;
///////print best answer///////////
$comment = get_comment($top, OBJECT);

$link_avatar = get_user_meta($comment->user_id, 'avatar',true);
if(empty($link_avatar)){
$link_avatar = get_bloginfo('template_directory')."/images/question-img.jpg";}
else{
$link_avatar = get_bloginfo('template_directory')."/images/avatar/".$link_avatar;}

$author_comment = get_comment_author($top);
?>
<div class="question-answer"> <!-- #question-answer-->
<div class="question-answer-title">
<div class="question-user-img-nobg">
<img alt="<?php _e(' No avatar ','qa'); ?>" src="<?php echo $link_avatar;?>" height="32" width="32"/>
</div>
<div class="answer-by">
<p>
<a href="<?php echo get_bloginfo('url') . '/?action=profileusers&iduser=' . $comment->user_id; ;?>" style="color:#8497A4">
<?php $u_data = get_userdata($comment->user_id);echo $u_data->user_login;?>
</a>
</p>
<p class="answer-date-2"><?php comment_time ('F jS, Y');?></p>
</div>
<img src="<?php echo get_bloginfo('template_directory')?>/images/best.gif" style="float:right; margin-right:10px;"/>
<div style="clear:both;"></div>
</div>
<div class="answer-content">
<?php comment_text();?>
<div class="answer2">
<ul>
<li>
<a href="javascript:thump('up', '<?php echo get_comment_ID();?>', '<?php the_ID();?>');" id="<?php echo 'cup' . get_comment_ID();?>" class="up">
<?php
$arr = get_metadata('comment', get_comment_ID(), 'tgt_num_thump_up', true);
echo (count(explode('|', $arr))-1) ;
?>
</a>
</li>
<li>
<a href="javascript:thump('down', '<?php echo get_comment_ID();?>', '<?php echo the_ID();?>');" id="<?php echo 'cdown' . get_comment_ID();?>" class="down">
<?php
$arr = get_metadata('comment', get_comment_ID(), 'tgt_num_thump_down', true);
echo (count(explode('|', $arr))-1);
?>
</a>
</li>
<li style="border-right:none;">
<a href="
<?php if($user_ID) echo get_bloginfo('template_directory') . '/report_spam.php?answer=' . get_comment_ID();
else echo "javascript:alert('Please login!');";
?>">
<?php _e(' Report spam','qa'); ?>
</a>
</li>
</ul>
</div>
</div>
<img src="<?php echo get_bloginfo('template_directory')?>/images/answer-bg-bottom.jpg" />
</div>
<?php
}
else{
$start -= 1;
}
endif;
?>
<!-- print answer not best answer -->
<?php

if($start < 0 ){
$start = 0;
}
$query = "
SELECT DISTINCT c.*
FROM $wpdb->comments c, $wpdb->commentmeta cm
WHERE c.comment_post_ID = '" . get_the_ID() . "'
AND comment_approved = '1'
AND c.comment_ID <> '$top' LIMIT $start , $comments_per_page ";

$results = $wpdb->get_results ($query, OBJECT);

foreach ($results as $result){
$comment = $result;
$link_avatar = get_user_meta($comment->user_id, 'avatar',true);
if(empty($link_avatar))
$link_avatar = get_bloginfo('template_directory')."/images/question-img.jpg";
else
$link_avatar = get_bloginfo('template_directory')."/images/avatar/".$link_avatar;
?>
<div class="question-answer"> <!-- #question-answer-->
<div class="question-answer-title">
<div class="question-user-img-nobg">
<img alt="<?php _e('No Avatar','qa'); ?>" src="<?php echo $link_avatar;?>" height="32" width="32"/>
</div>
<div class="answer-by">
<p>
<a href="<?php echo get_bloginfo('url') . '/?action=profileusers&iduser=' . $comment->user_id;?>" style="color:#8497A4">
<?php $u_data = get_userdata($comment->user_id);echo $u_data->user_login;?>
</a>
</p>
<p class="answer-date-2"><?php comment_time ('F jS, Y');?></p>
</div>
<div style="clear:both;"></div>
</div>
<div class="answer-content">
<?php comment_text();?>
<div class="answer2">
<ul>
<li>
<a href="javascript:thump('up', '<?php echo get_comment_ID();?>', '<?php the_ID();?>');" id="<?php echo 'cup' . get_comment_ID();?>" class="up">
<?php
$arr = get_metadata('comment', get_comment_ID(), 'tgt_num_thump_up', true);
echo (count(explode('|', $arr))-1) ;
?>
</a>
</li>
<li>
<a href="javascript:thump('down', '<?php echo get_comment_ID();?>', '<?php echo the_ID();?>');" id="<?php echo 'cdown' . get_comment_ID();?>" class="down">
<?php
$arr = get_metadata('comment', get_comment_ID(), 'tgt_num_thump_down', true);
echo (count(explode('|', $arr))-1);
?>
</a>
</li>
<li style="border-right:none;">
<a href="
<?php if($user_ID) echo get_bloginfo('template_directory') . '/report_spam.php?answer=' . get_comment_ID();
else echo "javascript:alert('__('Please login!','qa')');";
?>" >
<?php _e(' Report Spam','qa'); ?>
</a>
</li>
</ul>
</div>
</div>
<img src="<?php echo get_bloginfo('template_directory')?>/images/answer-bg-bottom.jpg" />
</div>
<?php
}
?>
<!-- paginate -->

<div class="answer-post" style="margin:0;">
<div class="wp-pagenavi">
<p>
<?php get_comment_pagination(); ?>
</p>
</div>
</div>

<!-- form submit answer -->
<?php if ('open' == $post->comment_status){?>
<div class="answer-post">
<a name="<?php _e('Answer this question','qa') ?>"></a>
<p><?php _e(' Answer this question','qa'); ?></p>
</div>

<div id="cancel-comment-reply">
<small><?php cancel_comment_reply_link() ?></small>
</div>

<form action="<?php echo get_bloginfo ('template_directory')?>/comment_submit.php" method="post" id="comment_form" name="comment_form">
<?php comment_id_fields();
$comment_session = '';
session_start();
if(session_is_registered('comment_error_after_submit'))
{
$comment_session = $_SESSION['comment_error_after_submit'];
session_unregister('comment_error_after_submit');
}
?>
<input type="hidden" name ="id_parent" value="<?php if(isset($_GET['action']) && isset($_GET['id'])) echo $_GET['action']."&id=".$_GET['id']; ?>" />
<div class="text-publish">
<textarea name="comment" id="comment" cols="75" rows="6"><?php if(!empty($comment_session)) echo $comment_session; ?></textarea>
</div>
<?php
global $user_ID;
if($user_ID > 0 && !empty($comment_session))
{
echo '<script type="text/javascript">';
echo 'document.comment_form.submit();';
echo '</script>';
}
?>
<?php if($user_ID){ ?>
<div class="btn_red" style="margin:0 0 10px 0px; cursor:pointer;">
<div class="btn_red_left"></div>

<div class="btn_red_repeat">
<input type="submit" name="submit" class="grey" value="<?php _e(' Publish','qa'); ?>">
</div>

<div class="btn_red_right"></div>
</div>
<?php } ?>
<?php do_action('comment_form', get_the_ID()); ?>
</form>
<?php
global $post;
?>
<?php if(!$user_ID){ ?>
<div class="text-publish" style="width:auto;">
<div class="text-publish2" style="width:600px;">
<p style="float:left; margin-right:10px; width:150px;"><?php _e(' I\'m','qa'); ?></p>
<input style="float:left; margin-right:10px;" type="radio" checked class="radio" value="0" id="r0" name="radiocheck" onclick="clickcheck()" ><p style="float:left; margin-right:10px; width:auto; font-size:12px; font-weight:bold; margin-bottom:0; margin-top:3px;"><?php _e(' Existing User','qa'); ?> </p>
<input style="float:left; margin-right:10px;" type="radio" class="radio" value="1" id="r1" name="radiocheck" onclick="clickcheck()" ><p style="float:left; margin-right:10px; width:auto; font-size:12px; font-weight:bold; margin-bottom:0; margin-top:3px;"><?php _e(' New User? Register Now','qa'); ?> </p>
</div>

<div id="regis" style="display:none;">

<form action="<?php echo HOME_URL;//get_bloginfo ('template_directory')?>/?action=regis_submit" enctype="multipart/form-data" method="post" name="form_regis">
<input type="hidden" name="regis_post_id" value="<?php echo $post->ID ?>" />
<input type="hidden" name="regis_comment" id="regis_comment"/>
<div class="text-publish2">
<p style="float:left; margin-right:10px; width:150px;"><?php _e(' Upload Your Pic','qa'); ?>:</p>
<input name="image_filename" type="file" value="Browse" style="float: left; margin: 0pt; padding: 0pt;">
</div>

<div class="text-publish2">
<p style="float:left; margin-right:10px; width:150px;"><?php _e(' Username','qa'); ?:mad:*)</p>
<input style="background:#b9b9b9;" class="input" type="text" name="regis_username" id="regis_username" size="35" />
</div>

<div class="text-publish2">
<p style="float:left; margin-right:10px; width:150px;"><?php _e(' Password','qa'); ?:mad:*)</p>
<input style="background:#b9b9b9;" class="input" type="password" name="regis_password" id="regis_password" size="35" />
</div>
<div class="text-publish2">
<p style="float:left; margin-right:10px; width:150px;"><?php _e(' Email','qa'); ?:mad:*)</p>
<input style="background:#b9b9b9;" class="input" type="text" name="regis_email" id="regis_email" size="35" />
</div>
<div class="btn_red" style="margin:0 0 10px 270px; float:left;cursor:pointer;">
<div class="btn_red_left"></div>
<div class="btn_red_repeat">
<input type="button" name="reigs_submit" class="grey" value="<?php _e(' Publish','qa'); ?>" onclick="javascript:regis_submitform()">
</div>
<div class="btn_red_right"></div>
</div>
</form>
</div>
<div id="log">
<form action="<?php echo HOME_URL;//get_bloginfo ('template_directory')?>/?action=log_submit" method="post" name="log_form">
<input type="hidden" name="post_id" value="<?php echo $post->ID ?>" />
<input type="hidden" name="log_comment" id="log_comment"/>
<div class="text-publish2">
<p style="float:left; margin-right:10px; width:150px;"><?php _e(' Username','qa'); ?:mad:*)</p>
<input style="background:#b9b9b9;" class="input" type="text" id="log_username" name="log_username" size="35" />
</div>

<div class="text-publish2">
<p style="float:left; margin-right:10px; width:150px;"><?php _e(' Password','qa'); ?:mad:*)</p>
<input style="background:#b9b9b9;" class="input" type="password" id="log_password" name="log_password" size="35" />
</div>
<div class="btn_red" style="margin:0 0 10px 270px; float:left;cursor:pointer;">
<div class="btn_red_left"></div>
<div class="btn_red_repeat">
<input type="button" name="log_submit" class="grey" value="<?php _e(' Publish','qa'); ?>" onclick="javascript:submitform()">
</div>
<div class="btn_red_right"></div>
</div>
</form>
</div>
<div class="text-publish2">
<p id="error_login"><?php
//session_start();
if(session_is_registered('error_login'))
{
echo $_SESSION['error_login'];
session_unregister('error_login');
}
if(session_is_registered('regis_error'))
{
echo $_SESSION['regis_error'];
session_unregister('regis_error');
}
?></p>
</div>
</div>
<?php } ?>

<script type="text/javascript">
function clickcheck (){
if(document.getElementById('r0').checked == true && document.getElementById('r0').value == 0){
document.getElementById('log').style.display = 'block';
document.getElementById('regis').style.display = 'none';
}else{
document.getElementById('log').style.display = 'none';
document.getElementById('regis').style.display = 'block';
}
}

function comment_form_submit()
{
alert('co the submit');
return;
document.comment_form.submit();
}
function submitform()
{
var submit = false;
var username = document.getElementById('log_username').value;
var password = document.getElementById('log_password').value;
if(username == '')
{
alert('<?php _e('Please enter your user name','qa');?>');
submit = false;
return;
}
else
{
submit = true;
}
if(password == '')
{
alert('<?php _e('Please enter your password','qa');?>');
submit = false;
return;
}
else
{
submit = true;
}
var comment = document.getElementById('comment').value;
document.getElementById('log_comment').value = comment;
if(submit)
document.log_form.submit();
}
function regis_submitform()
{
var submit = false;
var username = document.getElementById('regis_username').value;
var password = document.getElementById('regis_password').value;
var email = document.getElementById('regis_email').value;
if(username == '')
{
alert('<?php _e('Please enter your user name','qa');?>');
submit = false;
return;
}
else
{
submit = true;
}
if(password == '')
{
alert('<?php _e('Please enter your password','qa');?>');
submit = false;
return;
}
else
{
submit = true;
}
if(email == '')
{
alert('<?php _e('Please enter your email','qa');?>');
submit = false;
return;
}
else
{
if(!validateEmail(email))
{
alert('<?php _e('Email is invalid','qa');?>');
submit = false;
return;
}
else
{
submit = true;
}
}
var comment = document.getElementById('comment').value;
document.getElementById('regis_comment').value = comment;
if(submit)
document.form_regis.submit();
}
function validateEmail(str) {
var at="@";
var dot=".";
var lat=str.indexOf(at);
var lstr=str.length;
var ldot=str.indexOf(dot);
if (str.indexOf(at)==-1){
return false;
}

if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
return false;
}

if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
return false;
}

if (str.indexOf(at,(lat+1))!=-1){
return false;
}

if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
return false;
}

if (str.indexOf(dot,(lat+2))==-1){
return false;
}

if (str.indexOf(" ")!=-1){
return false;
}
return true;
}

</script>
<?php } ?> <!-- //endif -->
<script type="text/javascript"></script>
 

Türkiye’nin ilk webmaster forum sitesi iyinet.com'da forum üyeleri tarafından yapılan tüm paylaşımlardan; Türk Ceza Kanunu’nun 20. Maddesinin, 5651 Sayılı Kanununun 4. maddesinin 2. fıkrasına göre, paylaşım yapan üyeler sorumludur.

Backlink ve Tanıtım Yazısı için iletişime geçmek için Skype Adresimiz: .cid.1580508955483fe5

Üst