Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: [My Account]
- */
- /* =============================================================================
- THIS FILE SHOULD NOT BE EDITED
- ========================================================================== */
- global $userdata, $CORE; get_currentuserinfo();
- $CORE->Authorize();
- $GLOBALS['flag-myaccount'] = 1;
- /* =============================================================================
- USER ACTIONS
- ========================================================================== */
- if(isset($_POST['action']) && $_POST['action'] !=""){
- switch($_POST['action']){
- case "renewalfree": {
- // 1. GET PACKAGE DATA
- $packagefields = get_option("packagefields");
- // 2. FIND OUT EXISTING PACKAGE ID
- $packageID = get_post_meta($_POST['pid'],'packageID',true);
- $renewal_days = 30;
- // 3. GET PRICE AND DATE
- if(isset($packagefields[$packageID]['expires']) && is_numeric($packagefields[$packageID]['expires']) ){
- $renewal_days = $packagefields[$packageID]['expires'];
- }
- // 3. UPDATE LISTING
- update_post_meta( $_POST['pid'], 'listing_expiry_date', date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s") . " +".$renewal_days." days")) );
- // 4. LEAVE A MESSAGE
- $GLOBALS['error_message'] = $CORE->_e(array('account','74'));
- } break;
- case "withdraw": {
- if($_POST['amount'] > 0){
- $subject = $CORE->_e(array('account','62'));
- $msg .= "Username: ".$userdata->display_name."\r\n";
- $msg .= "User ID: ".$userdata->ID."\r\n";
- $msg .= "Email: ".$userdata->user_email."\r\n";
- $msg .= "Amount: ".hook_price($_POST['amount'])."\r\n";
- $msg .= "Preferences: ".$_POST['message']."\r\n";
- // SEND EMAIL TO ADMIN
- $CORE->SENDEMAIL('admin','custom',$subject,$msg);
- $GLOBALS['error_message'] = $CORE->_e(array('account','63'));
- }
- } break;
- case "subscrption": {
- $selstring = "";
- // LOOP THROUGH AND SAVE DATA
- if(isset($_POST['selsubs'])){
- foreach($_POST['selsubs'] as $val){
- $selstring .= "*".$val."*";
- }
- }
- update_user_meta($userdata->ID,'email_subscriptions',$selstring);
- $GLOBALS['error_message'] = $CORE->_e(array('account','42'));
- } break;
- case "deletemsg": {
- update_post_meta($_POST['messageID'],'status','delete');
- $GLOBALS['error_message'] = $CORE->_e(array('account','16'));
- } break;
- case "sendmsg":
- $dd = get_userdatabylogin( $_POST['username'] );
- // ADDED TO FIX HYPEN USERNAMES
- if($dd == ""){
- $dd = get_userdatabylogin( str_replace("-"," ",$_POST['username']) );
- }
- if(isset($dd->ID)){
- // CHECK HOW MANY MESSAGES HAVE BEEN SENT ALREADY FROM THIS USER
- $SQL = "SELECT count(*) AS total FROM $wpdb->posts WHERE post_type = 'wlt_message' AND post_author = '".$userdata->ID."' AND post_date LIKE ('".date("Y-m-d")."%')";
- $found = (array)$wpdb->get_results($SQL);
- if($found[0]->total < 10){ // LIMIT 10 PER DAY
- $my_post = array();
- $my_post['post_title'] = strip_tags(strip_tags($_POST['subject']));
- $my_post['post_content'] = strip_tags(strip_tags($_POST['message']));
- $my_post['post_excerpt'] = "";
- $my_post['post_status'] = "publish";
- $my_post['post_type'] = "wlt_message";
- $my_post['post_author'] = $userdata->ID;
- $POSTID = wp_insert_post( $my_post );
- add_post_meta($POSTID, "username", $dd->user_login);
- add_post_meta($POSTID, "userID", $dd->ID);
- add_post_meta($POSTID, "status", "unread");
- $GLOBALS['error_type'] = "success"; //ok,warn,error,info
- $GLOBALS['error_message'] = $CORE->_e(array('account','17'));
- // SEND EMAIL
- $_POST['username'] = $dd->user_nicename;
- $_POST['from_username'] = $userdata->user_nicename;
- $CORE->SENDEMAIL($dd->ID,'msg_new');
- // CLEAR MESSSAGE VALUES
- $_POST['subject'] = "";
- $_POST['message'] = "";
- }else{
- $GLOBALS['error_type'] = "error"; //ok,warn,error,info
- $GLOBALS['error_message'] = $CORE->_e(array('account','18'));
- }
- } break;
- case "update": {
- // SAVE THE CUSTOM PROFILE DATA
- if(isset($_POST['custom']) && is_array($_POST['custom'])){
- foreach($_POST['custom'] as $key=>$val){
- // SAVE DATA
- if(is_array($val)){
- update_user_meta($userdata->ID, strip_tags($key), $val);
- }else{
- update_user_meta($userdata->ID, strip_tags($key), esc_html(strip_tags($val)));
- }
- }
- }
- $data = array();
- $data['ID'] = $userdata->ID;
- // CHECK IF WE ARE CHANGING PASSWORDS
- if(!defined('WLT_DEMOMODE')){
- if( ( $_POST['password'] == $_POST['password_r'] ) && $_POST['password'] !=""){
- $data['user_pass'] = $_POST['password'];
- // ERROR MESSAGE
- $GLOBALS['error_message'] = $CORE->_e(array('account','19'));
- } elseif(isset($_POST['password']) && strlen($_POST['password']) > 1){
- // PASSWORD CHECK ERROR
- $GLOBALS['error_message'] = $CORE->_e(array('account','20'));
- }else{
- // ERROR MESSAGE
- $GLOBALS['error_message'] = $CORE->_e(array('account','21'));
- }
- }
- // CHECK EMAIL IS VALID
- update_user_meta($userdata->ID, 'url', strip_tags($_POST['url']));
- update_user_meta($userdata->ID, 'phone', strip_tags($_POST['phone']));
- $data['first_name'] = strip_tags($_POST['fname']);
- $data['last_name'] = strip_tags($_POST['lname']);
- $data['description'] = strip_tags($_POST['description']);
- wp_update_user( $data );
- // FUNCTION FOR PLUGINS
- //do_action('profile_update');
- } break;
- default: {
- hook_account_save();
- } break;
- }
- }
- if(isset($_GET['did']) && is_numeric($_GET['did']) ){
- $my_post = array();
- $my_post['ID'] = $_GET['did'];
- $my_post['post_status'] = "trash";
- wp_update_post( $my_post );
- // ADD LOG ENTRY
- $CORE->ADDLOG("<a href='(ulink)'>".$userdata->user_nicename.'</a> deleted listing <b>['.get_the_title($_GET['did']).']</b>', $userdata->ID,$_GET['did'],'label-important');
- // ERROR MESSAGE
- $GLOBALS['error_message'] = $CORE->_e(array('account','22'));
- }
- if(isset($_GET['claime']) && is_numeric($_GET['claime']) ){
- // CHECK IF THE USER HAS CLAIMED ANY LISTINGS BEFORE
- if(get_user_meta($userdata->ID, "claimed_listing",true) == ""){
- // ALLOW CLAIM
- $my_post = array();
- $my_post['ID'] = $_GET['claime'];
- $my_post['post_status'] = "pending";
- $my_post['post_author'] = $userdata->ID;
- wp_update_post( $my_post );
- // ADD CUSTOM FIELD SO WE KNOW IT WAS CLAIMED
- $_POST['title'] = get_the_title($_GET['claime']);
- // SET USER FLAG
- update_user_meta($userdata->ID, "claimed_listing", $_GET['claime']);
- // REMOVE CLAIM
- $CORE->SENDEMAIL('admin','admin_newclaim');
- // ADD LOG ENTRY
- $CORE->ADDLOG("<a href='(ulink)'>".$userdata->user_nicename.'</a> claimed listing <b>['.get_the_title($_GET['claime']).']</b>', $userdate->ID,$_GET['claime'],'label-important');
- // ERROR MESSAGE
- $GLOBALS['error_message'] = $CORE->_e(array('account','23'));
- }else{
- // ADD LOG ENTRY
- $CORE->ADDLOG("<a href='(ulink)'>".$userdata->user_nicename.'</a> tried to claim listing <b>['.get_the_title($_GET['claime']).']</b> but was denied! (too many claims)', $userdate->ID,$_GET['claime'],'label-info');
- $GLOBALS['error_message'] = $CORE->_e(array('account','24'));
- $GLOBALS['error_type'] = "alert-error";
- }
- }
- if(isset($_GET['submissionlimit'])){
- $GLOBALS['error_message'] = $CORE->_e(array('account','25'));
- $GLOBALS['error_type'] = "alert-error";
- }
- /* =============================================================================
- LOAD PAGE TEMPLATE
- ========================================================================== */
- $GLOBALS['flag-account'] = 1;
- // CHECK FOR MEMBERSHIP ON REGISTRATION
- if($GLOBALS['CORE_THEME']['show_mem_registraion'] == '1'){
- $TEMPMEMID = get_user_meta($userdata->ID,'new_memID',true);
- }
- // MEMBERSHIP DATA
- $membershipfields = get_option("membershipfields");
- $GLOBALS['current_membership'] = get_user_meta($userdata->ID,'wlt_membership',true);
- $GLOBALS['current_membership_expires'] = get_user_meta($userdata->ID,'wlt_membership_expires',true);
- $GLOBALS['customtext'] = stripslashes(get_user_meta($userdata->ID,'wlt_customtext',true));
- $GLOBALS['usercredit'] = get_user_meta($userdata->ID,'wlt_usercredit',true);
- $_POST['expired'] = $GLOBALS['current_membership_expires'];
- // CHECK IF MEMBERSHIP HAS EXPIRED
- $CORE->EXPIRED(0,'membership'); // uses global $post->ID
- // DISABLE REG FIELD IF USER HAS ALREADY UPGRADED/PAID
- if($GLOBALS['current_membership'] != ""){ unset($TEMPMEMID); update_user_meta($userdata->ID,'new_memID',''); }
- // LOAD IN CHILD THEME TEMPATE FILES
- if(defined('CHILD_THEME_NAME') && file_exists(WP_CONTENT_DIR."/themes/".CHILD_THEME_NAME."/_account.php") ){
- include(WP_CONTENT_DIR."/themes/".CHILD_THEME_NAME."/_account.php");
- }elseif(file_exists(str_replace("functions/","",THEME_PATH)."/templates/".$GLOBALS['CORE_THEME']['template']."/_account.php") ){
- include(str_replace("functions/","",THEME_PATH)."/templates/".$GLOBALS['CORE_THEME']['template'].'/_account.php');
- }else{
- /* =============================================================================
- -- LOAD IN FALLBACK TEMPLATE
- ========================================================================== */
- get_header();
- hook_account_before(); ?>
- <!-- START COMMENT BLOCK -->
- <div class="block" id="MyAccountBlock" <?php if(isset($_GET['tab'])){ echo "style='display:none;'"; } ?>>
- <div class="block-title">
- <h3> <span style="float:right;margin-right:10px;"><?php echo $userdata->user_nicename; ?></span> <span><?php the_title(); ?></span></h3></div>
- <div class="block-content">
- <!-- START MEMBERSHIP DISPLAY -->
- <?php if($GLOBALS['current_membership'] != "" && is_numeric($GLOBALS['current_membership']) && is_array($membershipfields) ){ ?>
- <div class="alert alert-success">
- <b><span class="label label-success"><?php echo $CORE->_e(array('account','43')); ?></span></b>
- <span class="right"><b><?php echo $membershipfields[$GLOBALS['current_membership']]['name']; ?></b></small> </span>
- <br /><small><?php echo $CORE->_e(array('single','20')); ?>: <?php echo hook_date($GLOBALS['current_membership_expires']); ?></small>
- <div class="clearfix"></div>
- </div>
- <?php } ?>
- <?php if(is_numeric($GLOBALS['usercredit']) && $GLOBALS['usercredit'] < 0){ $current_price = str_replace("-","",$GLOBALS['usercredit']); ?>
- <div class="alert alert-error">
- <b><span class="label label-important">Negative Amount Balance</span></b>
- <span class="right"><button style="margin-top:5px;" href="#myPaymentOptions" role="button" class="btn btn-danger" data-toggle="modal">Pay Now</button></span>
- <br /><small>Amount due <?php echo hook_price($current_price); ?>. Please make payment as soon as possible.</small>
- <div class="clearfix"></div>
- </div>
- <?php
- $STRING = '
- <!-- Modal -->
- <div id="myPaymentOptions" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
- <h4 id="myModalLabel">'.$CORE->_e(array('single','13')).' ('.hook_price($current_price).')</h4>
- </div>
- <div class="modal-body">'.$CORE->PAYMENTS($current_price, "PAY-".$post->ID."-".date("Ymd"), $post->post_title, $post->ID, $subscription = false).'</div>
- <div class="modal-footer">
- '.$CORE->admin_test_checkout().'
- <button class="btn" data-dismiss="modal" aria-hidden="true">'.$CORE->_e(array('single','14')).'</button></div></div>
- <!-- End Modal -->';
- echo $STRING;
- } ?>
- <!-- START CUSTOM TEXT DISPLAY -->
- <?php if(strlen($GLOBALS['customtext']) > 1){ echo $GLOBALS['customtext']; } ?>
- <div class="row-fluid">
- <?php if($GLOBALS['CORE_THEME']['show_account_edit'] == '1'){ ?>
- <!---------- DISPLAY BLOCK -------------->
- <hr />
- <div class="media">
- <a class="pull-left hidden-phone" href="javascript:void(0);" onclick="jQuery('#MyAccountBlock').hide();jQuery('#MyDetailsBlock').show();">
- <img class="media-object" src="<?php echo FRAMREWORK_URI.'/img/'; ?>account/1.png">
- </a>
- <div class="media-body">
- <h4 class="media-heading"><a href="javascript:void(0);" onclick="jQuery('#MyAccountBlock').hide();jQuery('#MyDetailsBlock').show();"><?php echo $CORE->_e(array('account','2')); ?></a></h4>
- <p class="clearfix"><?php echo $CORE->_e(array('account','3')); ?></p>
- </div>
- </div>
- <!-- end display block --->
- <?php } ?>
- <!-- START USER CREDIT DISPLAY -->
- <?php if(is_numeric($GLOBALS['usercredit']) && is_numeric($GLOBALS['usercredit']) && $GLOBALS['usercredit'] > 0){ ?>
- <!---------- DISPLAY BLOCK -------------->
- <hr />
- <div class="media">
- <a class="pull-left hidden-phone" href="javascript:void(0);" onclick="jQuery('#MyAccountBlock').hide();jQuery('#MyWidthdrawlBlock').show();">
- <img class="media-object" src="<?php echo FRAMREWORK_URI.'/img/'; ?>account/9.png">
- </a>
- <div class="media-body">
- <h4 class="media-heading"><a href="javascript:void(0);" onclick="jQuery('#MyAccountBlock').hide();jQuery('#MyWidthdrawlBlock').show();"><?php echo $CORE->_e(array('account','54')); ?></a> (<?php echo hook_price($GLOBALS['usercredit']); ?>)</h4>
- <p class="clearfix"><?php echo $CORE->_e(array('account','55')); ?></p>
- </div>
- </div>
- <!-- end display block --->
- <?php } ?>
- <?php if($GLOBALS['CORE_THEME']['show_account_create'] == '1'){
- if(isset($membershipfields[$GLOBALS['current_membership']]['submissionamount']) && $membershipfields[$GLOBALS['current_membership']]['submissionamount'] == "0"){ }else{
- ?>
- <!---------- DISPLAY BLOCK -------------->
- <hr />
- <div class="media">
- <a class="pull-left hidden-phone" href="<?php echo $GLOBALS['CORE_THEME']['links']['add']; ?>">
- <img class="media-object" src="<?php echo FRAMREWORK_URI.'/img/'; ?>account/2.png">
- </a>
- <div class="media-body">
- <h4 class="media-heading"><a href="<?php echo $GLOBALS['CORE_THEME']['links']['add']; ?>"><?php echo $CORE->_e(array('account','4')); ?></a></h4>
- <p class="clearfix"><?php echo $CORE->_e(array('account','5')); ?></p>
- </div>
- </div>
- <!-- end display block --->
- <?php } } ?>
- <?php if($GLOBALS['CORE_THEME']['show_account_viewing'] == '1'){ ?>
- <!---------- DISPLAY BLOCK -------------->
- <hr />
- <div class="media">
- <a class="pull-left hidden-phone" href="<?php echo get_home_url(); ?>/?s=&uid=<?php echo $userdata->ID; ?>">
- <img class="media-object" src="<?php echo FRAMREWORK_URI.'/img/'; ?>account/3.png">
- </a>
- <div class="media-body">
- <h4 class="media-heading"><a href="<?php echo get_home_url(); ?>/?s=&uid=<?php echo $userdata->ID; ?>"><?php echo $CORE->_e(array('account','6')); ?></a></h4>
- <p class="clearfix"><?php echo $CORE->_e(array('account','7')); ?></p>
- </div>
- </div>
- <!-- end display block --->
- <?php } ?>
- <?php if($GLOBALS['CORE_THEME']['message_system'] == '1'){ ?>
- <!---------- DISPLAY BLOCK -------------->
- <hr />
- <div class="media">
- <a class="pull-left hidden-phone" href="javascript:void(0);" onclick="jQuery('#MyAccountBlock').hide();jQuery('#MyMsgBlock').show();">
- <img class="media-object" src="<?php echo FRAMREWORK_URI.'/img/'; ?>account/4.png">
- </a>
- <div class="media-body">
- <h4 class="media-heading"><a href="javascript:void(0);" onclick="jQuery('#MyAccountBlock').hide();jQuery('#MyMsgBlock').show();"><?php echo $CORE->_e(array('account','26')); ?></a>
- <?php $mc = $CORE->MESSAGECOUNT($userdata->user_login); if($mc > 0){ ?><span class="label label-important"><?php echo str_replace("%a",$mc,$CORE->_e(array('account','28'))); ?></span><?php } ?>
- </h4>
- <p class="clearfix"><?php echo $CORE->_e(array('account','27')); ?></p>
- </div>
- </div>
- <!-- end display block --->
- <?php } ?>
- <?php if($GLOBALS['CORE_THEME']['show_account_subscriptions'] == '1'){ ?>
- <!---------- DISPLAY BLOCK -------------->
- <hr />
- <div class="media">
- <a class="pull-left hidden-phone" href="javascript:void(0);" onclick="jQuery('#MyAccountBlock').hide();jQuery('#MySubscriptionBlock').show();">
- <img class="media-object" src="<?php echo FRAMREWORK_URI.'/img/'; ?>account/6.png">
- </a>
- <div class="media-body">
- <h4 class="media-heading"><a href="javascript:void(0);" onclick="jQuery('#MyAccountBlock').hide();jQuery('#MySubscriptionBlock').show();"><?php echo $CORE->_e(array('account','44')); ?></a></h4>
- <p class="clearfix"><?php echo $CORE->_e(array('account','45')); ?></p>
- </div>
- </div>
- <!-- end display block --->
- <?php } ?>
- <?php if($GLOBALS['CORE_THEME']['show_account_favs'] == '1'){ ?>
- <!---------- DISPLAY BLOCK -------------->
- <hr />
- <div class="media">
- <a class="pull-left hidden-phone" href="javascript:void(0);" onclick="jQuery('#MyAccountBlock').hide();jQuery('#MyFavsBlock').show();">
- <img class="media-object" src="<?php echo FRAMREWORK_URI.'/img/'; ?>account/7.png">
- </a>
- <div class="media-body">
- <h4 class="media-heading"><a href="javascript:void(0);" onclick="jQuery('#MyAccountBlock').hide();jQuery('#MyFavsBlock').show();"><?php echo $CORE->_e(array('account','46')); ?></a></h4>
- <p class="clearfix"><?php echo $CORE->_e(array('account','47')); ?></p>
- </div>
- </div>
- <?php } ?>
- <?php if($GLOBALS['CORE_THEME']['show_account_friends'] == '1'){ ?>
- <!---------- DISPLAY BLOCK -------------->
- <hr />
- <div class="media">
- <a class="pull-left hidden-phone" href="javascript:void(0);" onclick="jQuery('#MyAccountBlock').hide();jQuery('#MyFriendsBlock').show();">
- <img class="media-object" src="<?php echo FRAMREWORK_URI.'/img/'; ?>account/8.png">
- </a>
- <div class="media-body">
- <h4 class="media-heading"><a href="javascript:void(0);" onclick="jQuery('#MyAccountBlock').hide();jQuery('#MyFriendsBlock').show();"><?php echo $CORE->_e(array('account','70')); ?></a></h4>
- <p class="clearfix"><?php echo $CORE->_e(array('account','71')); ?></p>
- </div>
- </div>
- <?php } ?>
- <hr />
- <?php echo hook_account_menu(); ?>
- <a class="btn right" href="<?php echo wp_logout_url(); ?>"><?php echo $CORE->_e(array('account','8')); ?></a>
- </div><!-- end row -->
- </div><!-- end block-content -->
- </div>
- <!-- END COMMENT BLOCK -->
- <!-- START ACCOUNT WIDTHDRAWAL -->
- <div class="block" id="MyWidthdrawlBlock" style="display:none;">
- <div class="block-title"><h3><span><?php echo $CORE->_e(array('account','55')); ?></span></h3></div>
- <div class="block-content">
- <p><?php echo $CORE->_e(array('account','56')); ?></p>
- <p><b><?php echo $CORE->_e(array('account','57')); ?> <?php echo hook_price($GLOBALS['usercredit']); ?></b></p>
- <?php if(strlen($GLOBALS['CORE_THEME']['auction_house_percentage']) > 0){ ?>
- <p><?php echo str_replace("%a",$GLOBALS['CORE_THEME']['auction_house_percentage'],$CORE->_e(array('account','58'))); ?></p>
- <?php } ?>
- <hr />
- <form class="form-horizontal" method="post">
- <input type="hidden" name="action" value="withdraw" />
- <div class="control-group">
- <label class="control-label" for="inputEmail"><?php echo $CORE->_e(array('account','59')); ?></label>
- <div class="controls">
- <div class="input-prepend clearfix">
- <span class="add-on"><?php echo $GLOBALS['CORE_THEME']['currency']['symbol']; ?></span>
- <input type="text" name="amount" class="span8" />
- </div>
- </div>
- </div>
- <div class="control-group">
- <label class="control-label" for="inputPassword"><?php echo $CORE->_e(array('account','60')); ?></label>
- <div class="controls">
- <textarea name="message"></textarea>
- </div>
- </div>
- <div class="control-group">
- <div class="controls">
- <label class="checkbox">
- </label>
- <button type="submit" class="btn btn-primary"><?php echo $CORE->_e(array('account','61')); ?></button>
- </div>
- </div>
- </form>
- <hr />
- <button class="btn right" type="button" onclick="jQuery('#MyAccountBlock').show();jQuery('#MyWidthdrawlBlock').hide();"><?php echo $CORE->_e(array('button','7')); ?></button>
- <div class="clearfix"></div>
- </div>
- </div>
- <!-- END WIDTHDRAWAL -->
- <?php if($GLOBALS['CORE_THEME']['show_account_friends'] == '1'){ ?>
- <!-- START FRIENDS LIST -->
- <div class="block" id="MyFriendsBlock" style="display:none;">
- <div class="block-title"><h3><span><?php echo $CORE->_e(array('account','70')); ?></span></h3></div>
- <div class="block-content">
- <?php $my_list = get_user_meta($userdata->ID, 'friends_list',true); ?>
- <h4><?php echo $CORE->_e(array('account','72')); ?></h4>
- <hr />
- <?php if(is_array($my_list) && !empty($my_list) ){ ?>
- <table class="table table-bordered table-striped">
- <thead>
- <tr>
- <th><?php echo $CORE->_e(array('account','68')); ?></th>
- <th><?php echo $CORE->_e(array('login','10')); ?></th>
- <th><?php echo $CORE->_e(array('account','50')); ?></th>
- </tr>
- </thead>
- <tbody>
- <?php foreach($my_list as $key=>$val){
- // BUILD USER ID
- $userid = str_replace("ID:","",$key);
- if($userid < 1){ continue; }
- $user_info = get_userdata($userid);
- $listings = $CORE->count_user_posts_by_type( $userid, THEME_TAXONOMY."_type" );
- ?>
- <tr id="rem_u_<?php echo $userid; ?>">
- <td><?php echo str_replace('avatar-50','avatar-50 img-circle',get_avatar( $userid, 50 )); ?></td>
- <td><a href="<?php echo get_author_posts_url( $userid ); ?>"><b><?php echo $user_info->display_name; ?></b></a> <p><?php echo str_replace("%a", $listings, $CORE->_e(array('author','1'))); ?></p></td>
- <td>
- <code><?php echo '<i class="icon-remove-sign"></i> <a href="javascript:void(0);" onclick="jQuery(\'#rem_u_'.$userid.'\').hide();WLTAddF(\''.str_replace("http://","",get_home_url()).'\', \'friends\', '.str_replace("ID:","",$key).', \'core_ajax_callback\');">'.$CORE->_e(array('account','69')).'</a>'; ?></code>
- </td>
- </tr>
- <?php } ?>
- </tbody>
- </table>
- <?php } ?>
- <?php $my_list = get_user_meta($userdata->ID, 'blocked_list',true); ?>
- <h4><?php echo $CORE->_e(array('account','73')); ?></h4>
- <hr />
- <?php if(is_array($my_list) && !empty($my_list) ){ ?>
- <table class="table table-bordered table-striped">
- <thead>
- <tr>
- <th><?php echo $CORE->_e(array('account','68')); ?></th>
- <th><?php echo $CORE->_e(array('login','10')); ?></th>
- <th><?php echo $CORE->_e(array('account','50')); ?></th>
- </tr>
- </thead>
- <tbody>
- <?php foreach($my_list as $key=>$val){
- // BUILD USER ID
- $userid = str_replace("ID:","",$key);
- if($userid < 1){ continue; }
- $user_info = get_userdata($userid);
- $listings = $CORE->count_user_posts_by_type( $userid, THEME_TAXONOMY."_type" );
- ?>
- <tr id="rem_b_<?php echo $userid; ?>">
- <td><?php echo str_replace('avatar-50','avatar-50 img-circle',get_avatar( $userid, 50 )); ?></td>
- <td><a href="<?php echo get_author_posts_url( $userid ); ?>"><b><?php echo $user_info->display_name; ?></b></a> <p><?php echo str_replace("%a", $listings, $CORE->_e(array('author','1'))); ?></p></td>
- <td>
- <code><?php echo '<i class="icon-remove-sign"></i> <a href="javascript:void(0);" onclick="jQuery(\'#rem_b_'.$userid.'\').hide();WLTAddF(\''.str_replace("http://","",get_home_url()).'\', \'blocked\', '.str_replace("ID:","",$key).', \'core_ajax_callback\');">'.$CORE->_e(array('account','69')).'</a>'; ?></code>
- </td>
- </tr>
- <?php } ?>
- </tbody>
- </table>
- <?php } ?>
- <hr />
- <button class="btn right" type="button" onclick="jQuery('#MyAccountBlock').show();jQuery('#MyFriendsBlock').hide();"><?php echo $CORE->_e(array('button','7')); ?></button>
- <div class="clearfix"></div>
- </div>
- </div>
- <!--- END FRIENDS LIST --->
- <?php } ?>
- <?php if($GLOBALS['CORE_THEME']['show_account_favs'] == '1'){ ?>
- <!-- START FAVORITES -->
- <div class="block" id="MyFavsBlock" style="display:none;">
- <div class="block-title"><h3><span><?php echo $CORE->_e(array('account','46')); ?></span></h3></div>
- <div class="block-content">
- <?php $my_list = get_user_meta($userdata->ID, 'favorite_list',true); ?>
- <?php if(is_array($my_list) && !empty($my_list) ){ ?>
- <table class="table table-bordered table-striped">
- <thead>
- <tr>
- <th><?php echo $CORE->_e(array('account','50')); ?></th>
- <th><?php echo $CORE->_e(array('account','51')); ?></th>
- </tr>
- </thead>
- <tbody>
- <?php foreach($my_list as $key=>$val){ $title = get_the_title(str_replace("ID:","",$key));
- $post_7 = get_post(str_replace("ID:","",$key));
- if($post_7->post_type != THEME_TAXONOMY."_type"){ continue; }
- ?>
- <tr id="rem_<?php echo str_replace("ID:","",$key); ?>">
- <td>
- <code><?php echo '<i class="icon-remove-sign"></i> <a href="javascript:void(0);" onclick="jQuery(\'#rem_'.str_replace("ID:","",$key).'\').hide();WLTAddF(\''.str_replace("http://","",get_home_url()).'\', \'favorite\', '.str_replace("ID:","",$key).', \'core_ajax_callback\');">'.$CORE->_e(array('account','52')).'</a>'; ?></code>
- </td>
- <td><a href="<?php echo get_permalink(str_replace("ID:","",$key)); ?>"><?php echo $title; ?></a></td>
- </tr>
- <?php } ?>
- </tbody>
- </table>
- <?php }else{ ?>
- <div class="alert">
- <button type="button" class="close" data-dismiss="alert">×</button>
- <?php echo $CORE->_e(array('account','53')); ?>
- </div>
- <?php } ?>
- <hr />
- <button class="btn right" type="button" onclick="jQuery('#MyAccountBlock').show();jQuery('#MyFavsBlock').hide();"><?php echo $CORE->_e(array('button','7')); ?></button>
- <div class="clearfix"></div>
- </div>
- </div>
- <!--- END FAVORITES --->
- <?php } ?>
- <!-- START SUBSCRIPTIONS -->
- <div class="block" id="MySubscriptionBlock" style="display:none;">
- <div class="block-title"><h3><span><?php echo $CORE->_e(array('account','44')); ?></span></h3></div>
- <div class="block-content">
- <form method="post">
- <input type="hidden" name="action" value="subscrption" />
- <p><?php echo $CORE->_e(array('account','49')); ?></p>
- <select class="span12" name="selsubs[]" multiple="multiple" style="height:200px;">
- <?php
- $user_subscriptions = get_user_meta($userdata->ID,'email_subscriptions',true);
- $user_subscriptions = str_replace("**","*",$user_subscriptions);
- $us = explode("*",$user_subscriptions);
- echo $CORE->CategoryList(array($us,false,0,THEME_TAXONOMY)); ?>
- </select>
- <hr />
- <button class="btn btn-primary" type="submit"><?php echo $CORE->_e(array('button','6')); ?></button>
- <button class="btn right" type="button" onclick="jQuery('#MyAccountBlock').show();jQuery('#MySubscriptionBlock').hide();"><?php echo $CORE->_e(array('button','7')); ?></button>
- </form>
- </div>
- </div>
- <!--- END SUBSCRIPTIONS --->
- <!-- START ACCOUNT DETAILS BLOCK -->
- <div class="block" id="MyDetailsBlock" style="display:none;">
- <div class="block-title"><h3><span><?php echo $CORE->_e(array('account','2')); ?></span></h3></div>
- <div class="block-content">
- <div class="row-fluid">
- <form action="" method="post" onsubmit="return ValidateCoreRegFields();" enctype="multipart/form-data">
- <input type="hidden" name="action" value="update" />
- <legend><?php echo $CORE->_e(array('account','2')); ?></legend>
- <div class="row-fluid">
- <div class="span6" style="padding-right:30px;">
- <div class="control-group">
- <label class="control-label"><i class="icon-user"></i> <?php echo $CORE->_e(array('checkout','35')); ?></label>
- <div class="controls">
- <input type="text" name="fname" class="row-fluid" value="<?php echo $userdata->first_name ?>">
- </div>
- </div>
- <div class="control-group">
- <label class="control-label"><i class="icon-envelope"></i> <?php echo $CORE->_e(array('account','9')); ?></label>
- <div class="controls">
- <input type="text" name="email" class="row-fluid" value="<?php echo $userdata->user_email; ?>" disabled="disabled">
- </div>
- </div>
- <div class="control-group">
- <label class="control-label"><i class="icon-globe"></i> <?php echo $CORE->_e(array('account','14')); ?></label>
- <div class="controls">
- <input type="text" name="url" class="row-fluid" value="<?php echo get_user_meta($userdata->ID,'url',true); ?>">
- </div>
- </div>
- <div class="control-group">
- <label class="control-label"><i class="icon-bell"></i> <?php echo $CORE->_e(array('account','41')); ?></label>
- <div class="controls">
- <input type="text" name="phone" class="row-fluid" value="<?php echo get_user_meta($userdata->ID,'phone',true); ?>">
- </div>
- </div>
- <?php // USER PHOTO INTEGRATION
- if(function_exists('userphoto')){ ?>
- <style>#userphoto th { display:none; } .field-hint { font-size:11px; }</style>
- <?php
- userphoto_display_selector_fieldset();
- userphoto_thumbnail($userdata->ID);
- echo '<p><label><input type="checkbox" name="userphoto_delete" id="userphoto_delete" onclick="userphoto_onclick()"> Delete photo?</label></p>';
- }
- ?>
- </div>
- <div class="span6">
- <div class="control-group">
- <label class="control-label"> <?php echo $CORE->_e(array('checkout','36')); ?></label>
- <div class="controls">
- <input type="text" name="lname" value="<?php echo $userdata->last_name ?>" >
- </div>
- </div>
- <div class="alert">
- <div class="control-group">
- <label class="control-label"><i class="icon-lock"></i> <?php echo $CORE->_e(array('account','10')); ?></label>
- <div class="controls">
- <input type="password" name="password" class="row-fluid">
- </div>
- </div>
- <div class="control-group">
- <label class="control-label"><i class="icon-lock"></i> <?php echo $CORE->_e(array('account','11')); ?></label>
- <div class="controls">
- <input type="password" name="password_r" class="row-fluid">
- </div>
- </div>
- </div>
- <?php echo str_replace("form-row row-fluid customfield","control-group", str_replace("control-label span3","control-label", str_replace("field_wrapper span9","controls", $CORE->CORE_FIELDS(true)))); ?>
- </div>
- <div class="clearfix"></div>
- <div class="control-group">
- <label class="control-label"><i class="icon-comment"></i> <?php echo $CORE->_e(array('account','13')); ?></label>
- <textarea style="height:120px;" class="span12" name="description"><?php echo stripslashes($userdata->description); ?></textarea>
- </div>
- </div>
- <?php echo hook_account_mydetails_after(); ?>
- <div class="clearfix"></div>
- <hr />
- <button class="btn btn-primary" type="submit"><?php echo $CORE->_e(array('button','6')); ?></button>
- <button class="btn right" type="button" onclick="jQuery('#MyAccountBlock').show();jQuery('#MyDetailsBlock').hide();"><?php echo $CORE->_e(array('button','7')); ?></button>
- </form>
- </div>
- </div><!-- end block-content -->
- </div>
- <!-- END ACCOUNT DETAILS BLOCK -->
- <!-- START MESSAGE SYSTEM BLOCK -->
- <?php if(isset($GLOBALS['CORE_THEME']['message_system']) && $GLOBALS['CORE_THEME']['message_system'] != '0'){ ?>
- <div class="block" id="MyMsgBlock" <?php if(isset($_GET['tab']) && $_GET['tab'] == "msg"){ }else{ ?>style="display:none;"<?php } ?>>
- <div class="block-title"><h3><span><?php echo $CORE->_e(array('account','26')); ?></span></h3></div>
- <div class="block-content">
- <div class="row-fluid">
- <div id="msgAjax"></div>
- <form id="sendmsgform" name="sendmsgform" method="post" action="" class="alert" <?php if(isset($_GET['tab']) && $_GET['tab'] == "msg" && isset($_GET['show'])){ }else{ ?>style="display:none;"<?php } ?>>
- <input type="hidden" name="action" value="sendmsg" />
- <a href="javascript:void(0);" class="label label-warning" style="float:right;margin-top:30px;" onclick="jQuery('#sendmsgform').hide();"><?php echo $CORE->_e(array('account','48')); ?></a>
- <h3><?php echo $CORE->_e(array('account','29')); ?></h3>
- <p><?php echo $CORE->_e(array('account','30')); ?></p>
- <hr />
- <div class="input-prepend">
- <span class="add-on" id="ajaxMsgUser">@</span>
- <input class="span12" name="username" id="usernamefield" type="text" placeholder="<?php echo $CORE->_e(array('account','31')); ?>" value="<?php if(isset($_GET['u'])){ echo strip_tags($_GET['u']); } ?>">
- </div>
- <script type="application/javascript">
- jQuery('#usernamefield').change(function() { WLTValidateUsername('<?php echo str_replace("http://","",get_home_url()); ?>', this.value, 'ajaxMsgUser') } );
- </script>
- <hr />
- <p><?php echo $CORE->_e(array('account','32')); ?></p>
- <input type="text" name="subject" style="width:98%;" id="subjectfield" value="<?php if(isset($_POST['subject'])){ echo strip_tags(strip_tags($_POST['subject'])); } ?>" >
- <p><?php echo $CORE->_e(array('account','33')); ?></p>
- <textarea id="sendMsgContent" rows="3" style="width:98%;height:80px;" name="message"><?php if(isset($_POST['message'])){ echo strip_tags(strip_tags($_POST['message'])); } ?></textarea>
- <button class="btn btn-warning"><?php echo $CORE->_e(array('account','34')); ?></button>
- </form>
- <form method="post" action="" id="messageDel" name="messageDel">
- <input type="hidden" name="action" value="deletemsg" />
- <input type="hidden" name="messageID" id="messageID" value="" />
- </form>
- <table class="table table-bordered table-striped">
- <thead>
- <tr>
- <th style="width:80px;"><?php echo $CORE->_e(array('account','35')); ?></th>
- <th style="width:380px;"><?php echo $CORE->_e(array('account','36')); ?></th>
- <th><?php echo $CORE->_e(array('account','37')); ?></th>
- </tr>
- </thead>
- <tbody>
- <?php echo $CORE->MESSAGELIST($userdata->user_login); ?>
- </tbody>
- </table>
- <hr />
- <a href="javascript:void(0);" class="btn btn-primary" onclick="jQuery('#sendmsgform').show();"><?php echo $CORE->_e(array('account','38')); ?></a>
- <button class="btn right" type="button" onclick="jQuery('#MyAccountBlock').show();jQuery('#MyMsgBlock').hide();"><?php echo $CORE->_e(array('button','7')); ?></button>
- </div>
- </div>
- </div>
- <!-- end message system -->
- <?php } ?>
- <?php do_action('hook_account_after'); ?>
- <?php if($GLOBALS['CORE_THEME']['show_account_membership'] == '1'){ ?>
- <!-- START MEMBERSHIP PACKAGES -->
- <?php if(is_array($membershipfields) && count($membershipfields) > 0){ ?>
- <div class="block" id="MyMembershipPackages">
- <div class="block-title"><h3><span><?php echo $CORE->_e(array('add','24')); ?></span></h3></div>
- <div class="block-content">
- <p><?php echo $CORE->_e(array('add','25')); ?> </p>
- <ul class="packagelistitems"><?php echo $CORE->packageblock(2,'membershipfields',10); ?></ul>
- </div>
- </div>
- <!-- memberships form -->
- <form method="post" name="MEMBERSHIPFORM" action="<?php echo $GLOBALS['CORE_THEME']['links']['add']; ?>" id="MEMBERSHIPFORM" style="margin:0px;padding:0px;">
- <input type="hidden" name="membershipID" id="membershipID" value="-1" />
- </form>
- <?php } ?>
- <?php } ?>
- <!-- START MY ORDERS BLOCK -->
- <?php $order_string = $CORE->MYORDERS(); if(strlen($order_string) > 1){ ?>
- <div class="block" id="MyOrders">
- <div class="block-title"><h3><span><?php echo $CORE->_e(array('order_status','title0')); ?></span></h3></div>
- <div class="block-content">
- <table class="table table-striped">
- <thead>
- <tr>
- <th>#</th>
- <th><?php echo $CORE->_e(array('order_status','title1')); ?></th>
- <th><?php echo $CORE->_e(array('order_status','title2')); ?></th>
- <th><?php echo $CORE->_e(array('order_status','title3')); ?></th>
- <th><?php echo $CORE->_e(array('order_status','title4')); ?></th>
- <th> </th>
- </tr>
- </thead>
- <tbody>
- <?php echo $order_string; ?>
- </tbody>
- </table>
- <?php do_action('hook_account_orders_after'); ?>
- </div>
- </div>
- <!-- END MY ORDERS BLOCK -->
- <?php } ?>
- <?php
- // AUTO SUBMIT MEMBERSHIP FORM FOR MEMBERSHIPS ON REGISTRATION PAGE
- if(isset($TEMPMEMID) && is_numeric($TEMPMEMID) && isset($membershipfields[$TEMPMEMID]['price']) && $membershipfields[$TEMPMEMID]['price'] > 0){
- ?>
- <form method="post" name="MEMBERSHIPFORM1" action="<?php echo $GLOBALS['CORE_THEME']['links']['add']; ?>" id="MEMBERSHIPFORM1" style="margin:0px;padding:0px;">
- <input type="hidden" name="membershipID" id="membershipID" value="<?php echo $TEMPMEMID; ?>">
- </form>
- <script>jQuery(document).ready(function(){ jQuery('#MEMBERSHIPFORM1').submit(); });</script>
- <?php } ?>
- <?php get_footer();
- }
- // THAT'S ALL FOLKS!
- /* =============================================================================
- -- END FILE
- ========================================================================== */
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement