/includes/templates/gifts/screen.php

  1. <?php get_header('buddypress') ?> 
  2. <div id="main-content" class="main-content"> 
  3. <div id="primary" class="content-area"> 
  4. <div id="content" class="site-content" role="main"> 
  5. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 
  6.  
  7. <div class="entry-content"> 
  8. <div id="buddypress"> 
  9.  
  10. <h1 class="entry-title"> 
  11. <a href="<?php bp_displayed_user_link(); ?>" rel="bookmark"><?php bp_displayed_user_mentionname(); ?></a> 
  12. </h1> 
  13.  
  14. <?php do_action( 'bp_before_member_header' ); ?> 
  15.  
  16. <div id="item-header-avatar"> 
  17. <a href="<?php bp_displayed_user_link(); ?>"> 
  18.  
  19. <?php bp_displayed_user_avatar( 'type=full' ); ?> 
  20.  
  21. </a> 
  22. </div><!-- #item-header-avatar --> 
  23. <div id="item-header-content"> 
  24.  
  25. <h2> 
  26. <a href="<?php bp_displayed_user_link(); ?>"><?php bp_displayed_user_fullname(); ?></a> 
  27. </h2> 
  28.  
  29. <?php if ( bp_is_active( 'activity' ) && bp_activity_do_mentions() ) : ?> 
  30. <span class="user-nicename">@<?php bp_displayed_user_mentionname(); ?></span> 
  31. <?php endif; ?> 
  32.  
  33. <span class="activity"><?php bp_last_activity( bp_displayed_user_id() ); ?></span> 
  34.  
  35. <?php do_action( 'bp_before_member_header_meta' ); ?> 
  36.  
  37. <div id="item-meta"> 
  38.  
  39. <?php if ( bp_is_active( 'activity' ) ) : ?> 
  40.  
  41. <div id="latest-update"> 
  42.  
  43. <?php bp_activity_latest_update( bp_displayed_user_id() ); ?> 
  44.  
  45. </div> 
  46.  
  47. <?php endif; ?> 
  48.  
  49. <div id="item-buttons"> 
  50.  
  51. <?php //do_action( 'bp_member_header_actions' ); ?> 
  52.  
  53. </div><!-- #item-buttons --> 
  54.  
  55. <?php 
  56. /*** 
  57. * If you'd like to show specific profile fields here use: 
  58. * bp_member_profile_data( 'field=About Me' ); -- Pass the name of the field 
  59. */ 
  60. do_action( 'bp_profile_header_meta' ); 
  61.  
  62. ?> 
  63.  
  64. </div><!-- #item-meta --> 
  65.  
  66. </div><!-- #item-header-content --> 
  67. <div class="item-list-tabs no-ajax" id="object-nav"> 
  68. <ul> 
  69. <?php bp_get_displayed_user_nav(); ?> 
  70.  
  71. <?php do_action( 'bp_member_options_nav' ); ?> 
  72. </ul> 
  73. </div> 
  74. </div> 
  75.  
  76. <div id="item-body"> 
  77.  
  78. <h4><?php echo bp_word_or_name( __('Your Gifts', 'bp-gifts' ), __( "%s' Gifts", 'bp-gifts' ) , false, false) ?></h4> 
  79. <div style="height: 30px; clear: both; display: block; height: 30px;"><!-- Divider --></div> 
  80.  
  81.  
  82. <?php if (is_user_logged_in() && !bp_is_my_profile()) { 
  83.  
  84. // Check if Cubepoints and cubepoints buddypress integration is alredy installed 
  85.  
  86. if ( function_exists( 'my_bp_gift_given_add_cppoints' ) || function_exists( 'mycred_get_settings' )) { 
  87.  
  88.  
  89. if ( function_exists( 'my_bp_gift_given_add_cppoints') ) { 
  90. $Mypoint = (int)cp_getPoints(cp_currentUser());  
  91. } else { 
  92. global $current_user; 
  93. get_currentuserinfo(); 
  94. //$user_id = bp_displayed_user_id(); 
  95. $user_id = $current_user->ID; 
  96. $mycred = mycred_get_settings(); 
  97. $balance = $mycred->get_users_cred( $user_id ); 
  98. //echo 'Your balance is ' . $mycred->format_creds( $balance ); 
  99. $Mypoint = (int)$balance; 
  100.  
  101. $Giftpoints = (int)get_option('bp_gift_given_cp_bp'); 
  102.  
  103. $CheckMyPoints = $Mypoint + $Giftpoints; 
  104. $PointNeedToSendGift = $Giftpoints - 2*$Giftpoints; 
  105.  
  106. if($CheckMyPoints<0) { 
  107. ?> 
  108. <div id="message" class="info"> 
  109.  
  110.  
  111. <h4><?php _e('We are very sorry but it seems that you do not have enough points to sent a gift:', 'bp-gifts') ?></h4> 
  112. <p><?php _e('You need at least: ', 'bp-gifts'); echo $PointNeedToSendGift; _e(' Points', 'bp-gifts');?> </p> 
  113.  
  114. </div> 
  115. <div style="height: 30px; clear: both; display: block; height: 30px;"><!-- Divider --></div> 
  116. <?php  
  117.  
  118. else 
  119. { ?> 
  120.  
  121. <div id="bpgifts-waiting" style="display:none"><img src="<?php echo plugins_url('/buddypress-gifts-latest-2014/includes/templates/css/loading.gif') ?>" /></div> 
  122. <div id="bpgifts-alert"></div><br /> 
  123. <div class="sendgift-panel"> 
  124.  
  125. <div class="wrapper"> 
  126. <br /> 
  127. <div class="list_carousel"> 
  128. <ul id="mycarousel" class="jcarousel-skin-tango"> 
  129.  
  130. <!-- The content goes in here --> 
  131.  
  132. <?php 
  133.  
  134. $allgift = bp_gifts_allgift(); 
  135.  
  136. foreach ($allgift as $giftitem)  
  137.  
  138. echo '<li><div><img class="giftitem" id="'.$giftitem->id.'" name="'.$giftitem->gift_name.'" src="'.plugins_url('/buddypress-gifts-latest-2014/includes/images/').$giftitem->gift_image.'" alt="'.$giftitem->gift_name.'" point="'.$giftitem->point.'" /></div><div>'.$giftitem->point.'</div> 
  139. </li>'; 
  140. }?> 
  141.  
  142. </ul> 
  143. <div class="clearfix"></div> 
  144. <a id="prev3" class="prev" href="#"><</a> 
  145. <a id="next3" class="next" href="#">></a> 
  146. </div> 
  147. </div> 
  148.  
  149. <br/> 
  150.  
  151. <div class="sendgift-box"> 
  152.  
  153. <div class="giftbox"> 
  154.  
  155. <img class="giftbox" id="999" name="emptybox" src="<?php echo plugins_url('/buddypress-gifts-latest-2014/includes/images/admin/emptybox.png') ?>" style="float:left; padding: 20px;"/> 
  156.  
  157. </div> 
  158.  
  159.  
  160.  
  161. <div id="gift-message"> 
  162.  
  163. <div id="gift-textarea"> 
  164.  
  165. <textarea name="gift-message" id="giftms" value="" cols="68" rows="5" ></textarea> 
  166.  
  167. </div> 
  168.  
  169.  
  170.  
  171. <div id="gift-button"> 
  172.  
  173. <span class="highlight button" id="sendgift-button" >Send Gift</span> 
  174.  
  175. </div> 
  176.  
  177. </div> 
  178.  
  179. </div> 
  180.  
  181. </div> 
  182. <div style="height: 30px; clear: both; display: block; height: 30px;"><!-- Divider --></div> 
  183. <?php } ?> 
  184.  
  185. <?PHP } //end of checking function  
  186. else  
  187. { ?>  
  188.  
  189. <div id="bpgifts-waiting" style="display:none"><img src="<?php echo plugins_url('/buddypress-gifts-latest-2014/includes/templates/css/loading.gif') ?>" /></div> 
  190. <div id="bpgifts-alert"></div><br /> 
  191.  
  192.  
  193.  
  194. <div class="sendgift-panel"> 
  195.  
  196. <div class="wrapper"> 
  197. <br /> 
  198. <div class="list_carousel"> 
  199.  
  200. <ul id="mycarousel" class="jcarousel-skin-tango"> 
  201.  
  202. <!-- The content goes in here --> 
  203.  
  204. <?php 
  205.  
  206. $allgift = bp_gifts_allgift(); 
  207.  
  208. foreach ($allgift as $giftitem) { 
  209.  
  210. echo '<li><div><img class="giftitem" id="'.$giftitem->id.'" name="'.$giftitem->gift_name.'" src="'.plugins_url('/buddypress-gifts-latest-2014/includes/images/').$giftitem->gift_image.'" alt="'.$giftitem->gift_name.'" point="'.$giftitem->point.'" /></div><div>'.$giftitem->point.'</div></li>'; 
  211.  
  212.  
  213. ?> 
  214.  
  215. </ul> 
  216. <div class="clearfix"></div> 
  217. <a id="prev3" class="prev" href="#"><</a> 
  218. <a id="next3" class="next" href="#">></a> 
  219. </div> 
  220. </div> 
  221.  
  222. <br/> 
  223.  
  224. <div class="sendgift-box"> 
  225.  
  226. <div class="giftbox"> 
  227.  
  228. <img class="giftbox" id="999" name="emptybox" src="<?php echo plugins_url('/buddypress-gifts-latest-2014/includes/images/admin/emptybox.png') ?>" style="float:left; padding: 20px;"/> 
  229.  
  230. </div> 
  231.  
  232.  
  233.  
  234. <div id="gift-message"> 
  235.  
  236. <div id="gift-textarea"> 
  237.  
  238. <textarea name="gift-message" id="giftms" value="" style="overflow:hidden" cols="68" rows="5" ></textarea> 
  239.  
  240. </div> 
  241.  
  242.  
  243.  
  244. <div id="gift-button"> 
  245.  
  246. <span class="bp-gift-highlight button" id="sendgift-button" >Send Gift</span> 
  247.  
  248. </div> 
  249.  
  250. </div> 
  251.  
  252. </div> 
  253.  
  254. </div> 
  255. <div style="height: 30px; clear: both; display: block; height: 30px;"><!-- Divider --></div> 
  256. <br class="clear" /> 
  257.  
  258. <?php } ?> 
  259.  
  260. <?php } ?> 
  261.  
  262. <!--------------------- display gift activity loop ---------------------------------> 
  263.  
  264.  
  265.  
  266. <?php if ( bp_has_activities('scope=mentions&action=new_gifts&display_comments=threaded') ) : ?> 
  267.  
  268.  
  269.  
  270. <div class="pagination"> 
  271.  
  272. <div class="pag-count"><?php bp_activity_pagination_count() ?></div> 
  273.  
  274. <div class="pagination-links"><?php bp_activity_pagination_links() ?></div> 
  275.  
  276. </div> 
  277.  
  278.  
  279.  
  280. <ul id="activity-stream" class="activity-list item-list" style="list-style-type: none;"> 
  281.  
  282.  
  283.  
  284. <?php while ( bp_activities() ) : bp_the_activity(); ?> 
  285.  
  286.  
  287.  
  288. <li class="<?php bp_activity_css_class(); ?>" id="activity-<?php bp_activity_id(); ?>"> 
  289.  
  290.  
  291.  
  292. <div class="activity-avatar"> 
  293. <a href="<?php bp_activity_user_link(); ?>"> 
  294.  
  295. <?php bp_activity_avatar(); ?> 
  296.  
  297. </a> 
  298. </div> 
  299.  
  300.  
  301. <div class="activity-content"> 
  302.  
  303.  
  304.  
  305. <div class="activity-header"> 
  306.  
  307. <?php bp_activity_action(); ?> 
  308.  
  309. </div> 
  310.  
  311. <?php if ( 'activity_comment' == bp_get_activity_type() ) : ?> 
  312.  
  313. <div class="activity-inreplyto"> 
  314. <strong><?php _e( 'In reply to: ', 'buddypress' ); ?></strong><?php bp_activity_parent_content(); ?> <a href="<?php bp_activity_thread_permalink(); ?>" class="view" title="<?php _e( 'View Thread / Permalink', 'buddypress' ); ?>"><?php _e( 'View', 'buddypress' ); ?></a> 
  315. </div> 
  316.  
  317. <?php endif; ?> 
  318.  
  319.  
  320.  
  321. <?php if ( bp_activity_has_content() ) : ?> 
  322.  
  323. <div class="activity-inner"> 
  324.  
  325. <?php bp_activity_content_body(); ?> 
  326.  
  327. </div> 
  328.  
  329. <?php endif; ?> 
  330.  
  331.  
  332.  
  333. <?php do_action( 'bp_activity_entry_content' ) ?> 
  334.  
  335.  
  336.  
  337.  
  338.  
  339. </div> 
  340.  
  341. <?php /**activity comments*/ ?> 
  342.  
  343. <?php do_action( 'bp_before_activity_entry_comments' ); ?> 
  344.  
  345. <?php if ( ( is_user_logged_in() && bp_activity_can_comment() ) || bp_is_single_activity() ) : ?> 
  346.  
  347. <div class="activity-comments"> 
  348.  
  349. <?php bp_activity_comments(); ?> 
  350.  
  351. <?php if ( is_user_logged_in() ) : ?> 
  352.  
  353. <form action="<?php bp_activity_comment_form_action(); ?>" method="post" id="ac-form-<?php bp_activity_id(); ?>" class="ac-form"<?php bp_activity_comment_form_nojs_display(); ?>> 
  354. <div class="ac-reply-avatar"><?php bp_loggedin_user_avatar( 'width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT ); ?></div> 
  355. <div class="ac-reply-content"> 
  356. <div class="ac-textarea"> 
  357. <textarea id="ac-input-<?php bp_activity_id(); ?>" class="ac-input" name="ac_input_<?php bp_activity_id(); ?>"></textarea> 
  358. </div> 
  359. <input type="submit" name="ac_form_submit" value="<?php _e( 'Post', 'buddypress' ); ?>" />   <?php _e( 'or press esc to cancel.', 'buddypress' ); ?> 
  360. <input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" /> 
  361. </div> 
  362.  
  363. <?php do_action( 'bp_activity_entry_comments' ); ?> 
  364.  
  365. <?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ); ?> 
  366.  
  367. </form> 
  368.  
  369. <?php endif; ?> 
  370.  
  371. </div> 
  372.  
  373. <?php endif; ?> 
  374.  
  375. <?php do_action( 'bp_after_activity_entry_comments' ); ?> 
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383. <?php /** 
  384.  
  385. <!-- activiti comment --> 
  386.  
  387. <?php do_action( 'bp_before_activity_entry_comments' ); ?> 
  388.   
  389. <?php if ( ( is_user_logged_in() && bp_activity_can_comment() ) || bp_activity_get_comment_count() ) : ?> 
  390.   
  391. <div class="activity-comments"> 
  392.   
  393. <?php bp_activity_comments(); ?> 
  394.   
  395. <?php if ( is_user_logged_in() ) : ?> 
  396.   
  397. <form action="<?php bp_activity_comment_form_action(); ?>" method="post" id="ac-form-<?php bp_activity_id(); ?>" class="ac-form"<?php bp_activity_comment_form_nojs_display(); ?>> 
  398. <div class="ac-reply-avatar"><?php bp_loggedin_user_avatar( 'width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT ); ?></div> 
  399. <div class="ac-reply-content"> 
  400. <div class="ac-textarea"> 
  401. <textarea id="ac-input-<?php bp_activity_id(); ?>" class="ac-input" name="ac_input_<?php bp_activity_id(); ?>"></textarea> 
  402. </div> 
  403. <input type="submit" name="ac_form_submit" value="<?php _e( 'Post', 'buddypress' ); ?>" />   <?php _e( 'or press esc to cancel.', 'buddypress' ); ?> 
  404. <input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" /> 
  405. </div> 
  406.   
  407. <?php do_action( 'bp_activity_entry_comments' ); ?> 
  408.   
  409. <?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ); ?> 
  410.   
  411. </form> 
  412.   
  413. <?php endif; ?> 
  414.   
  415. </div> 
  416.   
  417. <?php endif; ?> 
  418.   
  419. <?php do_action( 'bp_after_activity_entry_comments' ); ?> 
  420.  
  421. */ ?> 
  422.  
  423.  
  424.  
  425.  
  426.  
  427. </li> 
  428.  
  429.  
  430. <hr /> 
  431. <?php endwhile; ?> 
  432.  
  433.  
  434.  
  435. </ul> 
  436.  
  437.  
  438.  
  439. <?php else : ?> 
  440.  
  441. <div id="message" class="info"> 
  442.  
  443. <p><?php echo bp_word_or_name( __('You still don\'t have any gift yet!', 'bp-gifts' ), __( "Either %s hasn't received any gift yet or they have restricted access", 'bp-gifts' ) , false, false) ?></p> 
  444.  
  445. </div> 
  446.  
  447. <?php endif; ?> 
  448.  
  449.  
  450.  
  451.  
  452.  
  453. <!--------------------------------------------------------------------> 
  454.  
  455.  
  456.  
  457.  
  458. </div> 
  459. </div><!-- #item-body --> 
  460.  
  461. <?php do_action( 'bp_after_member_home_content' ); ?> 
  462.  
  463. </article> 
  464. </div><!-- #content --> 
  465. </div> 
  466. </div> 
  467. <?php get_sidebar( 'buddypress' ); ?> 
  468. <?php get_footer( 'buddypress' ); ?> 
.