
<div id="fb-root"></div>

<script>
(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=281693948526045";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>

<div class="sp-simy"></div>
<div id="social-comment">
<a class="twitter" title="انشر عبر تويتر" href="http://twitter.com/home?status=@that_agency <?php the_title();?> <?php echo $post_url; ?>" target="_blank"></a>
<a class="facebook" title="انشر عبر فيسبوك" href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php the_title(); ?>"></a>
<a class="delis" title="انشر عبر ديليشيوز" href="http://delicious.com/save?url=<?php the_permalink() ?>&title=<?= urlencode(the_title()); ?>"></a>
<a class="digg" title="انشر عبر ديج" href="http://digg.com/submit?phase=2&url=<?php the_permalink() ?>&title=<?= urlencode(the_title()); ?>" rel="external"></a>
</div>

<div id="commenttabs">
	<ul>
		<li><a href="#site_comment"><h3>تعليقات الموقع</h3></a></li>
		<li><a href="#fb_comment"><h3>تعليقات فيس بوك</h3></a></li>
	</ul>
	<div id="site_comment">
<div id="respond">
<?php if (!empty($post->post_password) && $_COOKIE['wp-postpass_'.COOKIEHASH]!=$post->post_password) : ?> 
    <p id="comments-locked">Enter your password to view comments.</p> 
<?php return; endif; ?> 

<?php if (pings_open()) : ?> 
    <p id="respond">
<?php endif; ?> 

<?php if ($comments) : ?> 

<?php  

    /* Author values for author highlighting */ 
    /* Enter your email and name as they appear in the admin options */ 
    $author = array( 
            "highlight" => "highlight", 
            "email" => "بريدك الالكترونى هنا", 
            "name" => "اسمك الكريم هنا" 
    );  

    /* Count the totals */ 
    $numPingBacks = 0; 
    $numComments  = 0; 

    /* Loop throught comments to count these totals */ 
    foreach ($comments as $comment) { 
        if (get_comment_type() != "comment") { $numPingBacks++; } 
        else { $numComments++; } 
    } 
     
    /* Used to stripe comments */ 
    $thiscomment = 'odd';  
?> 

<?php 

    /* This is a loop for printing pingbacks/trackbacks if there are any */ 
    if ($numPingBacks != 0) : ?> 

    <h2 class="comments-header"><?php _e($numPingBacks); ?> روابط متلقاه</h2> 
    <ol id="trackbacks" class="commentlist"> 
     
<?php foreach ($comments as $comment) : ?> 
<?php if (get_comment_type()!="comment") : ?> 

    <li id="comment-<?php comment_ID() ?>" class="<?php _e($thiscomment); ?>"> 
    <?php comment_type(__('تعليق'), __('روابط متلقاه'), __('روابط متلقاه')); ?>:  
    <?php comment_author_link(); ?> on <?php comment_date(); ?> 
    </li> 
     
    <?php if('odd'==$thiscomment) { $thiscomment = 'even'; } else { $thiscomment = 'odd'; } ?> 
     
<?php endif; endforeach; ?> 

    </ol> 

<?php endif; ?> 

<?php  

    /* This is a loop for printing comments */ 
    if ($numComments != 0) : ?> 

    <h1 class="comments-header"><?php _e($numComments); ?> تعليق</h1> 
    <ol id="comments" class="commentlist"> 
     
    <?php foreach ($comments as $comment) : ?> 
    <?php if (get_comment_type()=="comment") : ?> 
     
        <li id="comment-<?php comment_ID(); ?>" class="<?php  
         
        /* Highlighting class for author or regular striping class for others */ 
         
        /* Get current author name/e-mail */ 
        $this_name = $comment->comment_author; 
        $this_email = $comment->comment_author_email; 
         
        /* Compare to $author array values */ 
        if (strcasecmp($this_name, $author["name"])==0 && strcasecmp($this_email, $author["email"])==0) 
            _e($author["highlight"]);  
        else  
            _e($thiscomment);  
         
        ?>"> 
            <div class="comment-meta"> 
<?php /* If you want to use gravatars, they go somewhere around here */ ?> 
                <span class="comment-author"><?php comment_author_link() ?></span>,  
                <span class="comment-date"><?php comment_date() ?></span>: 
            </div> 
            <div class="comment-text"> 
<?php /* Or maybe put gravatars here. The typical thing is to float them in the CSS */  
    /* Typical gravatar call:  
        <img src="<?php gravatar("R", 80, "YOUR DEFAULT GRAVATAR URL"); ?>"  
        alt="" class="gravatar" width="80" height="80"> 
    */ ?> 
                <?php comment_text(); ?> 
            </div> 
        </li> 
         
    <?php if('odd'==$thiscomment) { $thiscomment = 'even'; } else { $thiscomment = 'odd'; } ?> 
     
    <?php endif; endforeach; ?> 
     
    </ol> 
     
    <?php endif; ?> 
     
<?php else :  

    /* No comments at all means a simple message instead */  
?> 

    <h2 class="comments-header">لم يقم احد بالتعلق</h2> 

    <p>يمكنك ان تكون اول المشاركين معنا بالتعليقات</p> 
     
<?php endif; ?> 

<?php if (comments_open()) : ?> 

<?php /* This would be a good place for live preview...  
    <div id="live-preview"> 
        <h2 class="comments-header">Live Preview</h2> 
        <?php live_preview(); ?> 
    </div> 
 */ ?> 

    <div id="comments-form"> 
          
    <?php if (get_option('comment_registration') && !$user_ID ) : ?> 
        <p id="comments-blocked">يجب عليك <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to= 
        <?php the_permalink(); ?>">تسجيل الدخول</a> كى تتمكن من اضافه تعليق هنا.</p> 
    <?php else : ?> 

    <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="Log out of this account">تسجيل الخروج</a> 
    </p> 
     
    <?php else : ?> 
     
        <p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" /> 
        </p> 
         
        <p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" /> 
        </p> 
         
        <p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" /> 
       </p> 
     
    <?php endif; ?> 

    <?php /* You might want to display this:  
        <p>XHTML: You can use these tags: <?php echo allowed_tags(); ?></p> */ ?> 

        <p><textarea name="comment" id="comment" rows="5" cols="30"></textarea></p> 
         
        <?php /* Buttons are easier to style than input[type=submit],  
                but you can replace:  
                <button type="submit" name="submit" id="sub">Submit</button> 
                with:  
                <input type="submit" name="submit" id="sub" value="Submit" /> 
                if you like */  
        ?> 
        <p>
          <button type="submit" name="submit" id="sub">ارسل الان</button> 
        <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>"></p> 
     
    <?php do_action('comment_form', $post->ID); ?> 

    </form> 
    </div> 

<?php endif; // If registration required and not logged in ?> 

<?php else : // Comments are closed ?> 
    <p id="comments-closed">عفوا التعليقات مغلقه فى هذا الموضوع</p> 
<?php endif; ?>



<?php if ( !empty( $num_trackbacks ) ) : ?>
	<div id="trackbacks">
		<h3><?php printf( _n( 'تعقيب واحد فقط', '%d تعقيبات', $num_trackbacks, 'buddypress' ), number_format_i18n( $num_trackbacks ) ) ?></h3>

		<ul id="trackbacklist">
			<?php foreach ( (array)$comments as $comment ) : ?>

				<?php if ( 'comment' != get_comment_type() ) : ?>
					<li>
						<h5><?php comment_author_link() ?></h5>
						<em>بتاريخ <?php comment_date() ?></em>
					</li>
 				<?php endif; ?>

			<?php endforeach; ?>
		</ul>

	</div>
    
<?php endif; ?>	</div>	</div>
	<div id="fb_comment">
       <div class="fb-comments" data-href="<?php the_permalink(); ?>" data-num-posts="5" data-width="605"></div>
	</div>
</div>


