Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.37 KB | None | 0 0
  1. <?php get_header(); ?>
  2. <?php $user_ID = get_current_user_id(); ?>
  3. <div id="content" ng-controller="singletype" class="<?php echo $content_class; ?>" style="<?php echo $content_css; ?>" ng-cloak>
  4. <div class="avada-row" style="">
  5. <div id="content" class="full-width">
  6. <?php
  7. if( is_user_logged_in() ) {
  8. while ( have_posts() ) : the_post();
  9.  
  10. $checkresults = count( $wpdb->get_results( "SELECT ID FROM wp_watchlist WHERE watching = $post->ID AND userID = $user_ID" ) );
  11.  
  12. $checkresults_deal = count( $wpdb->get_results( "SELECT ID FROM wp_deals WHERE listingID = $post->ID AND Buyer = $user_ID" ) );
  13.  
  14. $postmeta = get_post_meta( $post->ID);
  15. $tojson = array();
  16. foreach ($postmeta as $key => $value) {
  17. # code...
  18. $tojson[str_replace("-", "_", $key)] = $value[0];
  19. }
  20.  
  21. $res = array();
  22. foreach ($postmeta as $key => $value) {$res[$key] = $value[0];}
  23.  
  24. $user_email = get_the_author_meta('user_firstname');
  25. $authormeta = get_user_meta($post->post_author);
  26. $user_info = get_userdata($post->post_author);
  27. $currenusermeta = $current_user->data;
  28. $listingauthor = $user_info->data;
  29. foreach ($listingauthor as $key => $value) {
  30. # code...
  31. if($key != 'user_pass' || $key != 'user_login'){
  32. $tojson['author_info'][$key] = $value;
  33. }
  34. }
  35. foreach ($currenusermeta as $key => $value) {
  36. if($key != 'user_pass' || $key != 'user_login'){
  37. $tojson['current_user_info'][$key] = $value;
  38. }
  39. }
  40.  
  41. $tojson['listingID'] = $post->ID;
  42.  
  43. $jsonarray = json_encode($tojson);
  44. ?>
  45. <div class="initvalue" ng-init='singlelistarray = <?php echo $jsonarray; ?> ' ></div>
  46. <div class="initvalue" ng-init='checkdeal = <?php echo $checkresults_deal; ?> ' ></div>
  47. <div class="wrapper_listing" ng-init="checkwatching = <?php echo $checkresults; ?> " >
  48.  
  49. <h2><?php echo $res["wpcf-listing-type"]; ?> Listing ID: <?php echo get_the_author_meta('user_firstname'); ?> <?php echo get_the_author_meta('user_lastname'); ?></h2>
  50. <hr>
  51. <p>Location: <?php echo $res["wpcf-city"]; ?> / <?php echo $res["wpcf-state"] ?></p>
  52.  
  53. <p>Asking Price: $<?php echo $res['wpcf-asking-price']; ?></p>
  54. <p>Mutual Fund Licensed: <?php echo $res['wpcf-mutual-fund-licensed']; ?></p>
  55. <p>Life Insurance Licensed: <?php echo $res['wpcf-life-insurance-licensed']; ?></p>
  56. <p>Liscenses and/or other designations: <?php echo $res["wpcf-other-license"]; ?></p>
  57. <p>Description: <?php echo $res["wpcf-buisness-description"]; ?></p>
  58.  
  59.  
  60. <button ng-show="checkwatching == 0 " ng-click="watchlist(<?php echo $user_ID; ?>, <?php echo $post->ID; ?> )">Add to Watch List</button>
  61. <button ng-show="checkwatching == 1 " ng-click="watchlistremove(<?php echo $user_ID; ?>, <?php echo $post->ID; ?> )">Remove from Watch list</button>
  62.  
  63. <?php if($res["wpcf-listing-type"] == 'Selling'){ ?>
  64.  
  65. <button ng-show="checkdeal == 0" ng-click="newdeal()">Create New Deal</button>
  66. <a href="<?php echo get_site_url(); ?>/member-area/my-deals/" ng-show="checkdeal == 1" >View your deals</button>
  67.  
  68. <?php }else{ ?>
  69. <?php } ?>
  70.  
  71. </div>
  72.  
  73. <div ng-cloak class="addealinfo" ng-hide="extrainfo">
  74. <centered>
  75. <div class="contactform addinfoinner">
  76. <p class="closethis" ng-click="closethis()">x</p>
  77. <div id="clientform">
  78.  
  79. <form action="<?php bp_messages_form_action('compose' ); ?>/compose" method="post" id="send_message_form" class="standard-form" role="main" enctype="multipart/form-data">
  80.  
  81. <?php do_action( 'bp_before_messages_compose_content' ); ?>
  82.  
  83. <?php bp_message_get_recipient_tabs(); ?>
  84.  
  85. <input type="hidden" name="send-to-input" class="send-to-input" id="send-to-input" value="<?php the_author_meta( 'user_login' ); ?>"/>
  86.  
  87. <label for="subject"><?php _e( 'Subject', 'buddypress' ); ?></label>
  88. <input type="text" name="subject" id="subject" value="<?php get_the_title(); ?>" />
  89.  
  90. <label for="content"><?php _e( 'Message', 'buddypress' ); ?></label>
  91. <textarea name="content" id="message_content" rows="15" cols="40"><?php bp_messages_content_value(); ?></textarea>
  92.  
  93. <input type="hidden" name="send_to_usernames" id="send-to-usernames" value="<?php bp_message_get_recipient_usernames(); ?>" class="<?php bp_message_get_recipient_usernames(); ?>" />
  94.  
  95. <?php do_action( 'bp_after_messages_compose_content' ); ?>
  96.  
  97. <div class="submit">
  98. <input type="submit" value="<?php esc_attr_e( "Send Message", 'buddypress' ); ?>" name="send" id="send" />
  99. </div>
  100.  
  101. <?php wp_nonce_field( 'messages_send_message' ); ?>
  102. </form>
  103.  
  104. <script type="text/javascript">
  105. document.getElementById("send-to-input").focus();
  106. </script>
  107. </div>
  108.  
  109. </div>
  110. </centered>
  111. </div>
  112. </div>
  113.  
  114.  
  115.  
  116. <?php
  117. endwhile;// end of the loop.
  118. }// end of user check
  119. else{
  120. echo "<p> you need to be a user to be here</p>";
  121. } ?>
  122. </div>
  123. </div>
  124. </div>
  125. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement