انجمن


مشکل در کد «پنجرک دیدگاه»  (۳ نوشته)

  • Valedein

    آفلاین
    عضو
    تعداد نوشته‌ها: ۱۰
    تشکر شده: ۱ بار
    # نوشته شده: ۱۲ سال پیش
    ۲۱ اسفند ۱۳۹۰ - ۱۴:۴۹

    سلام دوستان عزیز خسته نباشید.

    بنده مدیر سایت والدین هستم. ثواب می کنید اگر لطف کنید مشکل بنده رو برطرف بکنید.

    بنده به جای اینکه دیدگاه ها رو پایین مطالب بذارم ترجیح دادم که با پنجرک دیدگاه نمایششون بدم. کد رو با استفاده از استایل میهن بلاگ و کمک گرفتن از فایل پوسته اصلی وردپرس نوشتم ولی متاسفانه وقتی میذارم دائما ارور میده.

    اگر لطف کنید و کد رو برای من اصلاح کنید حقیقتا ممنون میشم. کد رو در زیر ملاحظه بفرمایید.

    <?php
    /* Don't remove these lines. */
    add_filter('comment_text', 'popuplinks');
    while ( have_posts()) : the_post();
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    	<head>
    		<title><?php the_title(); ?>|نظرات</title>
    		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <style type="text/css">
    @import url(http://static.mihanblog.com//public/styles/run/style.v20.css);
    @import url(http://static.mihanblog.com//public/styles/run/comment_theme/style10.css);
    </style>
    <style type="text/css">
    body { margin: 0; padding: 10px; background-color: #eee; color: #333; text-align: center; font-family: tahoma; font-size: 8pt; }
    .post_info {
    	text-align: center;
    	padding: 10px;
    	position: relative;
    	background: repeat-x;
    	border: 2px solid #FFFFFF;
    	background-image: url('http://static.mihanblog.com/public/images/blog/comment_theme/10/highlight_top.png');
    }
    .post_info .post_info-title{
    	color:#D2CCA2;
    	font-weight:bold;
    	font-size:23px;
    	font-family:arial;
    	direction:rtl;
    }
    .post_info .post_info-date {
    	color:#D2CCA2;
    	line-height:18px;
    	direction:rtl;
    }
    .post_info .post_info-detail {
    	color:#D2CCA2;
    	line-height:18px;
    }
    .comment_header{
    	background-color:#414A58;
    	border:1px solid #CFCFCF;
    }
    .post_info a { }
    .comment_list{
    	padding: 15px;
    	margin-bottom: 7px;
    	border: #CFCFCF 1px solid;
    	background-color: #F1EFE2;
    	text-align: right;
    	direction: rtl;
    }
    .comment{
    	background-color:#F7F5EE ;
    	padding:5px;
    	margin-bottom:15px;
    	border:1px solid #fff;
    
    }
    .comment .date {
    	font-size: 10px;
    	color: #7E7E7E;
    	background: no-repeat 100%
    -145px;
    	padding: 5px 20px 15px 0;
    	background-image: url('http://static.mihanblog.com/public/images/icon/user.gif');
    }
    .comment .comemnt_text {
    	text-align: justify;
    	line-height: 1.5em;
    }
    .comment .reply {
    	border-right:1px solid #BFBFBF;
    	font-style:italic;
    	font-size:11px;
    	padding: 5px 10px 5px;
    	margin-right:15px;
    
     }
    .comment .name {
      	font-weight: 600;
     	color: #60752D;
    	background-image: url('http://static.mihanblog.com/public/images/icon/user.gif') 100% -540px no-repeat;
     	padding-right:20px;
     	text-align:right;
    	padding-right: 20px;
    	text-align: right;
    }
    .comment .comemnt_web {
    	padding: 5px 0 5px 15px;
    	color: #999;
    	direction: ltr;
    	text-align: left;
    }
    .comment .comemnt_web a{
    	color : #FF6600;
    	text-decoration : underline;
    }
    .comment .comemnt_web a:hover{
    	color : red;
    }
    #formbox { direction: rtl; border: 0; margin: auto; }
    .powered{
    	font-weight:bold;
    	text-align:center;
    	color:#999;
    	display:block;
    	margin-top:10px;
    	font-size:10px;
    }
    .powered span{
    	color:#F00;
    }
    .comment_form	.form-row {
    	margin:0 10px;
    }
    .controls .form-row {
    	margin:0px;
    	padding-right:15px;
    }
    .form-row {
    	margin-bottom: 3px;
    	padding: 3px 0;
    	clear: both;
    	border-bottom:1px solid #D2CCA2;
    }
    #inner-layer label {
    	width: 80px;
    }
    label {
    	float: right;
    	padding-right: 2px;
    	width: 120px;
    	text-align: left;
    	margin-left: 3px;
    	color:#D2CCA2;
    }
    input, textarea {
    	float: right;
    	display: inline;
    	padding: 2px;
    }
    * html input.txt  {
    	border: #cfcfcf 1px solid;
    	padding: 1px;
    	width: 150px;
    	font-size: 12px;
    	float:right;
    }
    input{
    	font-size: 11px;
    }
    form{
    	border: #cfcfcf 1px solid;
    }
    textarea{
    	width: 260px;
    	height: 125px;
    	border: #cfcfcf 1px solid;
    	font: 12px tahoma;
    }
    label {
    	float: right;
    	padding-right: 2px;
    	width: 120px;
    	text-align: left;
    	margin-left: 3px;
    
    }
    label.required {
    	background: no-repeat 98%
    -421px;
    	padding-right: 15px;
    	width: 105px;
    	background-image: url('http://static.mihanblog.com/public/images/icon/gen.gif');
    }
    .english  {
    	direction:ltr;
    }
    .comment_form{
    	border: 2px solid #FFF;
    	background-image: url('http://static.mihanblog.com/public/images/blog/comment_theme/10/highlight_form.png');
    	background-repeat: repeat-x;
    }
    .form_top{
    	padding:6px;
    	direction:rtl;
    	position:relative;
    	height:10px;
    }
    .form_bottom{
    	padding:5px;
    	direction:rtl;
    	position:relative;
    	height:10px;
    }
    
    input[type="hidden"]{
    	padding: 0px;
    }
    .controls{
    	clear: both;
    	background: #4A4339;
    	padding: 2px 10px;
    	text-align: center;
    	height: 1%;
    }
    /* ************************************************************************* EO FORM COLOR */
    .smileLayer{
    	position:absolute;
    	display:none;
    	background-color:#fff;
    	border:1px solid #555;
    	left : 315px;
    }
    .required {
    	background: no-repeat right
    top;
    	color: #D2CCA2;
    	text-align: left;
    	background-image: url('http://static.mihanblog.com/public/images/icon/require.gif');
    }
    
    .btn {
    	width:75px;
    	height:25px;
    	border:0px;
    	color:#414A58;
    	padding-bottom:2px;
    	margin-right:175px;
    	margin-top:10px;
    	cursor:pointer;
    }
    
    .toolset li a {
    	color:#fff;
    
    }
    textarea, input, select{
    	background-color:#F7F5EE;
    }
    
    .err-msg{
    	color:#F9F344;
    	text-align:right;
    }
    
    .controls .err-msg{
    	padding-right:140px
    }
    
    /*]]>*/
    </style>
    		<div class="comment_header">
    			<div class="post_info">
    				<div class="post_info-title"><?php the_title(); ?></div>
    				<div class="post_info-date"><?php the_time('j F ,Y'); ?></div>
    				<div class="post_info-detail">
    					تعداد نظرات : <?php comments_number( '0', '1', '%' ); ?>
    				</div>
    			</div><!--post_info-->
    		</div><!--comment_header-->
    
    <?php if ( comments_open() ) { ?>
    <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
    <?php if ( $user_ID ) : ?>
    <p>شما با نام کاربری <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a> وارد سیستم شده اید. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="خروج">خروج</a></p>
    <?php else : ?>
    	<div class="comment_form">
    		<div class="form_top">
    		</div>
    			<div class="form-row clearfix">
    				<label class="" for="author">نام : <?php if ($req) _e('(required)','Valedein'); ?></label>
    				<input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" class="" tabindex="1" />			</div>
    	<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
    	<input type="hidden" name="redirect_to" value="<?php echo attribute_escape($_SERVER["REQUEST_URI"]); ?>" />
    			<div class="form-row clearfix">
    				<label class="" for="email">ایمیل : <?php if ($req) _e('(required)','Valedein'); ?></label>
    				<input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" class="english" tabindex="2" />			</div>
    
    			<div class="form-row clearfix">
    				<label class="" for="url">آدرس وب/وبلاگ :</label>
    				<input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>http://" class="english" />			</div>
    		<?php endif; ?>
    			<div class="form-row clearfix">
    				<div class="required" style="float:right;width:120px;text-align:left;padding-left:3px;" class="required" for="comment">متن نظر : </div>
    				<div style="float:right;width:260px">
    					<textarea name="comment" id="comment" class="" rows="8" cols="40" tabindex="4"></textarea>
    				</div>
    			</div>
    
    			<div class="controls clearfix">
            		<input type="submit" value="ارسال" class="btn" name="submit" tabindex="5" />
    			</div>
    		<div class="form_bottom">
    		</div>
    	</div>
    	<?php do_action('comment_form', $post->ID); ?>
    		</form>
    <?php } else { // comments are closed ?>
    <p>متاسفانه نظرات این مطلب بسته شده اند</p>
    <?php } // end password check ?>
    
    <?php if ('open' == $post->ping_status) {
    } ?>
    
    <?php
    /* Don't remove these lines. */
    add_filter('comment_text', 'popuplinks');
    if ( have_posts() ) :
    while ( have_posts() ) : the_post();
    ?>
    <?php
    // this line is WordPress' motor, do not delete it.
    $commenter = wp_get_current_commenter();
    extract($commenter);
    $comments = get_approved_comments($id);
    $post = get_post($id);
    if (!empty($post->post_password) && $_COOKIE['wp-postpass_'. COOKIEHASH] != $post->post_password) {  // and it doesn't match the cookie
    	echo(get_the_password_form());
    } else {
    } ?>
    <?php if ($comments) { ?>
    		<div class="comment_list">
    			<?php foreach ($comments as $comment) {
    } ?>
    					<div class="comment" id="comment-<?php comment_ID() ?>">
    				<div class="comment_top"></div>
    				<div class="name"><?php comment_author(); ?></div>
    				<div class="date"><?php comment_date() ?> <?php comment_time() ?></div>
    
    				<div class="comemnt_text">
    			<?php comment_text() ?>
    				</div>
    				<div class="comemnt_web"><a href="<?php comment_author_url(); ?>" title="وب/وبلاگ" target="_blank"><?php comment_author_link(); ?></a></div>
    
    					<div class="comment_bottom"></div>
    <?php } // end for each comment ?>
    			</div>
    <?php else {
    	<p>هیچ دیدگاهی ارسال نشده است</p>
    }
    ?>
    
    <?php // if you delete this the sky will fall on your head
    endwhile; //endwhile have_posts()
    else: //have_posts()
    ?>
    <p>Sorry, no posts matched your criteria.</p>
    <?php endif; ?>
    <!-- // this is just the end of the motor - don't touch that line either :) -->
    <?php //} ?>
    </body></html>

    این فایلی هست که چندین بار ویرایش شده و از نظر کدنویسی فکر کنم درسته. اگر خواستید یه کد دیگه هم هست اون رو هم میتونم بدم. با تشکر

  • Valedein

    آفلاین
    عضو
    تعداد نوشته‌ها: ۱۰
    تشکر شده: ۱ بار
    # نوشته شده: ۱۲ سال پیش
    ۲۵ اسفند ۱۳۹۰ - ۰۲:۰۸

    آقا شرمنده نمیخواستم اسپم بزنم ولی لطف می کنید بفرمایید چکار کنم؟

  • Valedein

    آفلاین
    عضو
    تعداد نوشته‌ها: ۱۰
    تشکر شده: ۱ بار
    # نوشته شده: ۱۲ سال پیش
    ۱۵ فروردین ۱۳۹۱ - ۱۴:۱۵

    خوشم میاد اینقدر سوالام فنیه هیچ کس به طرف سوال نمیاد

درباره‌ی این موضوع