انجمن


چرا این کد کار نمیکنه؟  (۴ نوشته)

  • mehrani

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

    کد کامنت هست

    <?php // Do not delete these lines
    	if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
    		die ('Please do not load this page directly. Thanks!');
    
    	if (!empty($post->post_password)) { // if there's a password
    		if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {  // and it doesn't match the cookie
    			?>
    
    			<p class="nocomments"><?php _e('امکان درج نظر برای این مطلب مسدود شده است. با مدیر سایت تماس برقرار کنید.'); ?></p>
    
    			<?php
    			return;
    		}
    	}
    
    	/* This variable is for alternating comment background */
    	$oddcomment = 'class="alt" ';
    ?>
    
    <?php if ($comments) : ?>
    <div style="clear:both; margin-top:10px;"></div>
    	<div class="commentlist">
    		<?php foreach ($comments as $comment) : ?>
    		<li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>">
    			<?php if ($comment->comment_approved == '0') : ?>
    				<?php _e('نظر شما ثبت شده و در انتظار تاید مدیر قرار گرفته است. متشکریم. '); ?>
    			<?php endif; ?>
    			<div class="image">
    				<?php echo get_avatar( $comment, 32 ); ?>
    			</div>
    			<div class="comment-user">
    				<?php comment_author_link() ?>
    			</div>
    			<?php comment_text() ?>
    		</li>
    		<?php endforeach; /* end for each comment */ ?>
    	</div>
    	 <?php else : // this is displayed if there are no comments so far ?>
    
    	<?php if ('open' == $post->comment_status) : ?>
    		<!-- If comments are open, but there are no comments. -->
    
    	 <?php else : // comments are closed ?>
    		<!-- If comments are closed. -->
    		<?php echo('امکان درج نظر مسدود شده است. از صفحۀ تماس با ما استفاده نمایید. ')?>
    
    	<?php endif; ?>
    <?php endif; ?>
    
    <?php if ('open' == $post->comment_status) : ?>
    	<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
    		<p><?php _e('برای درج نظر وارد حساب خود شوید.'); ?> <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>"><?php _e('ورود'); ?></a> </p>
    	<?php else : ?>
    	<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
    		<?php if ( $user_ID ) : ?>
    		<p style="margin-right:30px;"><?php _e('سلام: '); ?> <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="<?php _e('?خارج شوید.'); ?>"><?php _e('خروج'); ?> &raquo;</a></p>
    		<div style="float:left; width:230px; text-align:right; margin-left:20px;">
    			<span style="font-family:tahoma; font-size:12px;">
    				نام *
    			</span>
    			<input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" style="float:left; width:150px; font-family:tahoma; font-size:11px; height:20px; background-color:#eeeeee; border:1px solid #cccccc; " />
    			<div style="clear:both; margin-top:12px;"></div>
    			<span style="font-family:tahoma; font-size:12px; margin-top:7px;">
    				رایانامه *
    			</span>
    			<input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" style="float:left; width:150px; font-family:tahoma; font-size:11px; height:20px; background-color:#eeeeee; border:1px solid #cccccc; direction:rtl;" />
    			<div style="clear:both; margin-top:12px;"></div>
    			<span style="font-family:tahoma; font-size:12px; margin-top:7px;">
    				تارنما
    			</span>
    			<input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" style="float:left; width:150px; font-family:tahoma; font-size:11px; height:20px; background-color:#eeeeee; border:1px solid #cccccc " />
    			<div style="clear:both; margin-top:9px;"></div>
    			<input name="submit" type="submit" id="submit" tabindex="5" value="" style="font-family:tahoma; font-size:10px; width:155px; float:left; height:24px; display:block; background-color: #39BDCC; border:none; background-image:url(<?php bloginfo('stylesheet_directory'); ?>/images/submit.gif); cursor:pointer; "/>
    			<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
    		</div>
    		<div style="float:right; width:250px; text-align:right;">
    			<textarea name="comment" id="comment" rows="7" tabindex="4" style="font-family:tahoma; font-size:11px; background-color:#eeeeee; border:1px solid #cccccc; text-align:right; height:100px; width:230px;"></textarea>
    		</div>
    		<?php else : ?>
    			<div style="float:left; width:230px; text-align:right; margin-left:20px;">
    			<span style="font-family:tahoma; font-size:12px;">
    				نام *
    			</span>
    			<input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" style="float:left; width:150px; font-family:tahoma; font-size:11px; height:20px; background-color:#eeeeee; border:1px solid #cccccc; " />
    			<div style="clear:both; margin-top:12px;"></div>
    			<span style="font-family:tahoma; font-size:12px; margin-top:7px;">
    				رایانامه *
    			</span>
    			<input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" style="float:left; width:150px; font-family:tahoma; font-size:11px; height:20px; background-color:#eeeeee; border:1px solid #cccccc; direction:rtl;" />
    			<div style="clear:both; margin-top:12px;"></div>
    			<span style="font-family:tahoma; font-size:12px; margin-top:7px;">
    				تارنما
    			</span>
    			<input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" style="float:left; width:150px; font-family:tahoma; font-size:11px; height:20px; background-color:#eeeeee; border:1px solid #cccccc " />
    			<div style="clear:both; margin-top:9px;"></div>
    			<input name="submit" type="submit" id="submit" tabindex="5" value="" style="font-family:tahoma; font-size:10px; width:155px; float:left; height:24px; display:block; background-color: #39BDCC; border:none; background-image:url(<?php bloginfo('stylesheet_directory'); ?>/images/submit.gif); cursor:pointer; "/>
    			<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
    		</div>
    		<div style="float:right; width:250px; text-align:right;">
    			<textarea name="comment" id="comment" rows="7" tabindex="4" style="font-family:tahoma; font-size:11px; background-color:#eeeeee; border:1px solid #cccccc; text-align:right; height:100px; width:230px;"></textarea>
    		</div>
    		<?php endif; ?>
    	</form>
    
    	<?php endif; // If registration required and not logged in ?>
    
    <?php endif; // if you delete this the sky will fall on your head ?>

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

  • mehrani

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

    سوالم خیلی فنیه؟
    چرا کسی جواب نمیده؟

  • mehrdad_67

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

    نخست که کد خیلی نا منظم هست
    بعدم اینکه به هیچ وجه valid سازی نشده هر آدرس سایت و ایملی رو قبول می کنه
    بعد برای کاربران عضو هنوز بخش سایت و ایمل فعال هست
    قابلیت مشخص کردن دیدگاه بسته است رو نداره

  • mehrani

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

    خب چیکار کنم؟
    کدش چی میشه؟

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



برچسب‌ها

هیچ برچسبی نیست.