Esempio n. 1
0
function bb_quote_link($link_text = 'Quote')
{
    global $bb, $page, $topic, $forum, $bb_post;
    $add = topic_pages_add();
    if (!topic_is_open($bb_post->topic_id) || !bb_is_user_logged_in()) {
        return;
    }
    $post_id = get_post_id();
    $last_page = get_page_number($topic->topic_posts + $add);
    echo '<a href="' . get_topic_link(0, $last_page) . '&quote=' . $post_id . '#postform" id="quote_' . $post_id . '">' . __($link_text) . '</a>';
}
Esempio n. 2
0
 function post_edit_text($post_id = 0)
 {
     $bb_post = bb_get_post(get_post_id($post_id));
     if (bb_current_user_can('edit_post', $bb_post->post_id)) {
         $parts[] = ' | <a href="' . attribute_escape(apply_filters('post_edit_uri', bb_get_option('uri') . 'edit.php?id=' . $bb_post->post_id, $bb_post->post_id)) . '">Edit</a>';
     }
     if (bb_current_user_can('delete_post', $bb_post->post_id)) {
         if (1 == $bb_post->post_status) {
             $parts[] = "<a href='" . attribute_escape(bb_nonce_url(bb_get_option('uri') . 'bb-admin/delete-post.php?id=' . $bb_post->post_id . '&status=0&view=all', 'delete-post_' . $bb_post->post_id)) . "' onclick='return confirm(\" " . js_escape(__('Are you sure you wanna undelete that?')) . " \");'>" . __('Undelete') . "</a>";
         } else {
             $parts[] = "<a href='" . attribute_escape(bb_nonce_url(bb_get_option('uri') . 'bb-admin/delete-post.php?id=' . $bb_post->post_id . '&status=1', 'delete-post_' . $bb_post->post_id)) . "' onclick='return ajaxPostDelete(" . $bb_post->post_id . ", \"" . get_post_author($post_id) . "\");'>" . __('Delete') . "</a>";
         }
     }
     if (count($parts) > 0) {
         echo implode(' | ', $parts);
     }
 }
function fb_redirect_2()
{
    global $current_user;
    $user_roles = $current_user->roles;
    $user_role = array_shift($user_roles);
    $post_id = get_post_id('mlm_network_details_page');
    if ($user_role == 'subscriber' && $_SESSION['ajax'] != 'ajax_check') {
        if (function_exists('admin_url')) {
            wp_redirect(get_option('siteurl') . "/?page_id={$post_id}");
        } else {
            wp_redirect(get_option('siteurl'));
        }
    }
}
function mlm_my_payout_page($id = '')
{
    if ($id == '') {
        $detailsArr = my_payout_function();
    } else {
        $detailsArr = my_payout_function($id);
    }
    //_e("<pre>");print_r($detailsArr); exit;
    $page_id = get_post_id('mlm_my_payout_details_page');
    if (count($detailsArr) > 0) {
        $mlm_settings = get_option('wp_mlm_general_settings');
        ?>
	<table width="100%" border="0" cellspacing="10" cellpadding="1" id="payout-page">
		<tr>
			<td><?php 
        _e('Date', 'unilevel-mlm-pro');
        ?>
</td>
			<td><?php 
        _e('Amount', 'unilevel-mlm-pro');
        ?>
</td>
			<td><?php 
        _e('Action', 'unilevel-mlm-pro');
        ?>
</td>
		</tr>
		<?php 
        foreach ($detailsArr as $row) {
            $amount = $row->commission_amount + $row->bonus_amount;
            ?>
		<tr>
			<td><?php 
            echo $row->payoutDate;
            ?>
</td>
			<td><?php 
            echo $mlm_settings['currency'] . ' ' . $amount;
            ?>
</td>
			<?php 
            if ($id == '') {
                ?>
			<td><a href="<?php 
                echo get_post_id_or_postname_for_payout('mlm_my_payout_details_page', $row->payout_id);
                ?>
" style="text-decoration:none;"><?php 
                _e('View', 'unilevel-mlm-pro');
                ?>
</a></td>
			<?php 
            } else {
                ?>
			<td><a href="?page=mlm-user-account&ac=payout-details&pid=<?php 
                echo $row->payout_id;
                ?>
" style="text-decoration:none;"><?php 
                _e('View', 'unilevel-mlm-pro');
                ?>
</a></td>				
				<?php 
            }
            ?>
			
		</tr>
		
		<?php 
        }
        ?>
		
	</table>
	<?php 
    } else {
        ?>
	<div class="no-payout"><?php 
        _e('You have not earned any commisssions yet.', 'unilevel-mlm-pro');
        ?>
 </div>
	
	<?php 
    }
}
Esempio n. 5
0
function bb_insert_post($args = null)
{
    global $bbdb, $bb_current_user, $bb;
    if (!($args = nxt_parse_args($args))) {
        return false;
    }
    $fields = array_keys($args);
    if (isset($args['post_id']) && false !== $args['post_id']) {
        $update = true;
        if (!($post_id = (int) get_post_id($args['post_id']))) {
            return false;
        }
        // Get from db, not cache.  Good idea?
        $post = $bbdb->get_row($bbdb->prepare("SELECT * FROM {$bbdb->posts} WHERE post_id = %d", $post_id));
        $defaults = get_object_vars($post);
        unset($defaults['post_id']);
        // Only update the args we passed
        $fields = array_intersect($fields, array_keys($defaults));
        if (in_array('topic_id', $fields)) {
            $fields[] = 'forum_id';
        }
        // No need to run filters if these aren't changing
        // bb_new_post() and bb_update_post() will always run filters
        $run_filters = (bool) array_intersect(array('post_status', 'post_text'), $fields);
    } else {
        $post_id = false;
        $update = false;
        $now = bb_current_time('mysql');
        $current_user_id = bb_get_current_user_info('id');
        $ip_address = $_SERVER['REMOTE_ADDR'];
        $defaults = array('topic_id' => 0, 'post_text' => '', 'post_time' => $now, 'poster_id' => $current_user_id, 'poster_ip' => $ip_address, 'post_status' => 0, 'post_position' => false);
        // Insert all args
        $fields = array_keys($defaults);
        $fields[] = 'forum_id';
        $run_filters = true;
    }
    $defaults['throttle'] = true;
    extract(nxt_parse_args($args, $defaults));
    // If the user is not logged in and loginless posting is ON, then this function expects $post_author, $post_email and $post_url to be sanitized (check bb-post.php for example)
    if (!($topic = get_topic($topic_id))) {
        return false;
    }
    if (bb_is_login_required() && !($user = bb_get_user($poster_id))) {
        return false;
    }
    $topic_id = (int) $topic->topic_id;
    $forum_id = (int) $topic->forum_id;
    if ($run_filters && !($post_text = apply_filters('pre_post', $post_text, $post_id, $topic_id))) {
        return false;
    }
    if ($update) {
        // Don't change post_status with this function.  Use bb_delete_post().
        $post_status = $post->post_status;
    }
    if ($run_filters) {
        $post_status = (int) apply_filters('pre_post_status', $post_status, $post_id, $topic_id);
    }
    if (false === $post_position) {
        $post_position = $topic_posts = intval(0 == $post_status ? $topic->topic_posts + 1 : $topic->topic_posts);
    }
    unset($defaults['throttle']);
    if ($update) {
        $bbdb->update($bbdb->posts, compact($fields), compact('post_id'));
        nxt_cache_delete($post_id, 'bb_post');
    } else {
        $bbdb->insert($bbdb->posts, compact($fields));
        $post_id = $topic_last_post_id = (int) $bbdb->insert_id;
        if (0 == $post_status) {
            $topic_time = $post_time;
            $topic_last_poster = !bb_is_user_logged_in() && !bb_is_login_required() ? -1 : $poster_id;
            $topic_last_poster_name = !bb_is_user_logged_in() && !bb_is_login_required() ? $post_author : $user->user_login;
            $bbdb->query($bbdb->prepare("UPDATE {$bbdb->forums} SET posts = posts + 1 WHERE forum_id = %d;", $topic->forum_id));
            $bbdb->update($bbdb->topics, compact('topic_time', 'topic_last_poster', 'topic_last_poster_name', 'topic_last_post_id', 'topic_posts'), compact('topic_id'));
            $query = new BB_Query('post', array('post_author_id' => $poster_id, 'topic_id' => $topic_id, 'post_id' => "-{$post_id}"));
            if (!$query->results) {
                $topics_replied_key = $bbdb->prefix . 'topics_replied';
                bb_update_usermeta($poster_id, $topics_replied_key, $user->{$topics_replied_key} + 1);
            }
        } else {
            bb_update_topicmeta($topic->topic_id, 'deleted_posts', isset($topic->deleted_posts) ? $topic->deleted_posts + 1 : 1);
        }
    }
    bb_update_topic_voices($topic_id);
    // if user not logged in, save user data as meta data
    if (!$user) {
        bb_update_meta($post_id, 'post_author', $post_author, 'post');
        bb_update_meta($post_id, 'post_email', $post_email, 'post');
        bb_update_meta($post_id, 'post_url', $post_url, 'post');
    }
    if ($throttle && !bb_current_user_can('throttle')) {
        if ($user) {
            bb_update_usermeta($poster_id, 'last_posted', time());
        } else {
            bb_set_transient($_SERVER['REMOTE_ADDR'] . '_last_posted', time());
        }
    }
    if (!bb_is_login_required() && !($user = bb_get_user($poster_id))) {
        $post_cookie_lifetime = apply_filters('bb_post_cookie_lifetime', 30000000);
        setcookie('post_author_' . BB_HASH, $post_author, time() + $post_cookie_lifetime, $bb->cookiepath, $bb->cookiedomain);
        setcookie('post_author_email_' . BB_HASH, $post_email, time() + $post_cookie_lifetime, $bb->cookiepath, $bb->cookiedomain);
        setcookie('post_author_url_' . BB_HASH, $post_url, time() + $post_cookie_lifetime, $bb->cookiepath, $bb->cookiedomain);
    }
    nxt_cache_delete($topic_id, 'bb_topic');
    nxt_cache_delete($topic_id, 'bb_thread');
    nxt_cache_delete($forum_id, 'bb_forum');
    nxt_cache_flush('bb_forums');
    nxt_cache_flush('bb_query');
    nxt_cache_flush('bb_cache_posts_post_ids');
    if ($update) {
        // fire actions after cache is flushed
        do_action('bb_update_post', $post_id);
    } else {
        do_action('bb_new_post', $post_id);
    }
    do_action('bb_insert_post', $post_id, $args, compact(array_keys($args)));
    // post_id, what was passed, what was used
    if (bb_get_option('enable_pingback')) {
        bb_update_postmeta($post_id, 'pingback_queued', '');
        nxt_schedule_single_event(time(), 'do_pingbacks');
    }
    return $post_id;
}
function adminMLMUserAccountInterface()
{
    //get database table prefix
    $table_prefix = mlm_core_get_table_prefix();
    global $wpdb;
    $msg = '';
    if (isset($_POST['mlm_user_account'])) {
        $search = $_POST['search_user'];
        $userId = $wpdb->get_var("SELECT ID FROM {$table_prefix}users WHERE user_login = '******' OR user_email = '{$search}'");
        if ($wpdb->num_rows > 0) {
            $_SESSION['search_user'] = $search;
            $_SESSION['session_set'] = 'sets';
            $_SESSION['userID'] = $userId;
        } else {
            $msg = __('You have entered a wrong username or email address', 'unilevel-mlm-pro');
            $_SESSION['search_user'] = $search;
            $_SESSION['session_set'] = '';
            $_SESSION['userID'] = '';
        }
    }
    ?>

<div class='wrap'>
	<div id="icon-users" class="icon32"></div><h1><?php 
    _e('User Report', 'unilevel-mlm-pro');
    ?>
</h1><br />

	<div class="notibar msginfo" style="margin:10px;">
		<a class="close"></a>
		<p><?php 
    _e("Input a member's username or email address in the input box below to get complete information about the member's account. No more switching back and forth into different member accounts to check their account details.", 'unilevel-mlm-pro');
    ?>
</p>
	</div>	

</div>

<div class="forms-ui">

<p><span style='color:red;'><?php 
    if (!empty($error)) {
        _e($error);
    }
    ?>
</span></p>

		<form name="open_user_account" method="post" action="">
	<table border="0" cellpadding="0" cellspacing="0" width="100%" class="form-table">
		<tr>
			<th scope="row" class="admin-settings">
				<a style="cursor:pointer;" title="Click for Help!" onclick="toggleVisibility('search-user');"><?php 
    _e('Search By username or email address', 'unilevel-mlm-pro');
    ?>
 :</a>
			</th>
			<td>
				<input type="text" name="search_user" id="search_user" size="52" value="<?php 
    if (!empty($_SESSION['search_user'])) {
        _e(htmlentities($_SESSION['search_user']));
    }
    ?>
">
				<a href="?page=mlm-user-account" style="cursor:pointer;text-decoration:none; margin-left:90px;"><?php 
    _e('Back to User Dashboard', 'unilevel-mlm-pro');
    ?>
</a>
				<div class="toggle-visibility" id="search-user"><?php 
    _e('Please enter username or email address.', 'unilevel-mlm-pro');
    ?>
</div>
				<div style="color:red;"><?php 
    echo $msg;
    ?>
</div>
			</td>
		</tr>
		</table>
		<p class="submit">
	<input type="submit" name="mlm_user_account" id="mlm_user_account" value="<?php 
    _e('Search', 'unilevel-mlm-pro');
    ?>
 &raquo;" class='button-primary' onclick="needToConfirm = false;">
	</p>
	</form>

	<script language="JavaScript">
  populateArrays();
</script>
<!-----sdfgdf -->
<?php 
    if (!empty($_GET['ac'])) {
        if ($_GET['ac'] == 'edit' && $_GET['page'] == 'mlm-user-account') {
            mlm_update_profile($_SESSION['userID']);
        } else {
            if ($_GET['ac'] == 'personal' && $_GET['page'] == 'mlm-user-account') {
                myPersonalGroupDetails($_SESSION['userID']);
            } else {
                if ($_GET['ac'] == 'payout' && $_GET['page'] == 'mlm-user-account') {
                    mlm_my_payout_page($_SESSION['userID']);
                } else {
                    if ($_GET['ac'] == 'payout-details' && $_GET['page'] == 'mlm-user-account') {
                        mlm_my_payout_details_page($_SESSION['userID']);
                    } else {
                        if ($_GET['ac'] == 'network' && $_GET['page'] == 'mlm-user-account') {
                            adminViewUnilevelNetwork($_SESSION['userID']);
                        }
                    }
                }
            }
        }
    } else {
        if (!empty($_SESSION['session_set']) && $_SESSION['session_set'] == 'sets') {
            $key = $wpdb->get_var("SELECT user_key FROM {$table_prefix}mlm_users WHERE user_id = {$_SESSION['userID']}");
            //Total my personal sales
            $personalSales = totalMyPersonalSales($key);
            //Total my personal sales active users
            $activePersonalSales = activeUsersOnPersonalSales($key);
            //show five users on personal sales
            $fivePersonalUsers = myFivePersonalUsers($key);
            $user_info = get_userdata($_SESSION['userID']);
            $add_page_id = get_post_id('mlm_registration_page');
            $sponsor_name = $user_info->user_login;
            $affiliateURL = site_url() . '?page_id=' . $add_page_id . '&sponsor=' . $sponsor_name;
            ?>
	
		<table width="100%" border="0" cellspacing="10" cellpadding="1">
		  <tr>
			<td width="40%" valign="top">
				<table width="100%" border="0" cellspacing="10" cellpadding="1">
				  <tr>
					<td colspan="2"><strong><?php 
            _e('Personal Information', 'unilevel-mlm-pro');
            ?>
</strong></td>
				  </tr>
				  <tr>
					<td scope="row"><?php 
            _e('Title', 'unilevel-mlm-pro');
            ?>
</td>
					<td><?php 
            _e('Details', 'unilevel-mlm-pro');
            ?>
</td>
				  </tr>
				  <tr>
					<td scope="row"><?php 
            _e('Name', 'unilevel-mlm-pro');
            ?>
</td>
					<td><?php 
            echo $user_info->first_name . ' ' . $user_info->last_name;
            ?>
</td>
				  </tr>
				  <tr>
					<td scope="row"><?php 
            _e('Address', 'unilevel-mlm-pro');
            ?>
</td>
					<td style="white-space:normal;"><?php 
            echo $user_info->user_address1 . "<br>" . $user_info->user_address2;
            ?>
</td>
				  </tr>
				  <tr>
					<td scope="row"><?php 
            _e('City', 'unilevel-mlm-pro');
            ?>
</td>
					<td><?php 
            echo $user_info->user_city;
            ?>
</td>
				  </tr>
				  <tr>
					<td scope="row"><?php 
            _e('Contact No', 'unilevel-mlm-pro');
            ?>
.</td>
					<td><?php 
            echo $user_info->user_telephone;
            ?>
</td>
				  </tr>
				  <tr>
					<td scope="row"><?php 
            _e('DOB', 'unilevel-mlm-pro');
            ?>
</td>
					<td><?php 
            echo $user_info->user_dob;
            ?>
</td>
				  </tr>
				   
				  
				  <tr>
		<td><a href="?page=mlm-user-account&ac=edit" style="text-decoration: none"><?php 
            _e('Edit', 'unilevel-mlm-pro');
            ?>
</a></td>
		<td><a href="?page=mlm-user-account&ac=network" style="text-decoration: none"><?php 
            _e('View Genealogy', 'unilevel-mlm-pro');
            ?>
</a></td>
		</tr>
				</table>
					<table width="100%" border="0" cellspacing="10" cellpadding="1">
				  <tr>
					<td colspan="2"><strong><?php 
            _e('My Payouts', 'unilevel-mlm-pro');
            ?>
</strong></td>
				  </tr>
				  <tr>
					<td scope="row"><?php 
            _e('Date', 'unilevel-mlm-pro');
            ?>
</td>
					<td><?php 
            _e('Amount', 'unilevel-mlm-pro');
            ?>
</td>
       <td><?php 
            _e('Action', 'unilevel-mlm-pro');
            ?>
</td>
				  </tr>
<?php 
            $detailsArr = my_payout_function($_SESSION['userID']);
            //_e("<pre>");print_r($detailsArr); exit;
            //$page_id = get_post_id('mlm_my_payout_details_page');
            if (count($detailsArr) > 0) {
                $mlm_settings = get_option('wp_mlm_general_settings');
                ?>
			<?php 
                foreach ($detailsArr as $row) {
                    $amount = $row->commission_amount + $row->bonus_amount;
                    ?>
		<tr>
			<td><?php 
                    echo $row->payoutDate;
                    ?>
</td>
			<td><?php 
                    echo $mlm_settings['currency'] . ' ' . $amount;
                    ?>
</td>
			<td><a href="?page=mlm-user-account&ac=payout-details&pid=<?php 
                    echo $row->payout_id;
                    ?>
" style="text-decoration:none;"><?php 
                    _e('View', 'unilevel-mlm-pro');
                    ?>
</a></td>	
		</tr>
		<tr><td colspan="2"><a href="?page=mlm-user-account&ac=payout" style="text-decoration:none;"><?php 
                    _e('View All', 'unilevel-mlm-pro');
                    ?>
</a></td></tr>
		<?php 
                }
                ?>
	<?php 
            } else {
                ?>
	<div class="no-payout"> <?php 
                _e('You have not earned any commisssions yet.', 'unilevel-mlm-pro');
                ?>
 </div>
	
	<?php 
            }
            ?>
				</table>
			</td>
			<td width="40%">
				<table width="100%" border="0" cellspacing="10" cellpadding="1">
				  <tr>
					<td><strong><?php 
            _e('Network Details', 'unilevel-mlm-pro');
            ?>
</strong></td>
				  </tr>
				   

				 	<tr>
					<td>
						<table width="100%" border="0" cellspacing="10" cellpadding="1">
							<tr>
								<td colspan="2"><strong><?php 
            _e('Personal Sales', 'unilevel-mlm-pro');
            ?>
</strong></td>
							</tr>
							
							<tr>
								<td><?php 
            _e('My Personal Sales', 'unilevel-mlm-pro');
            ?>
: <?php 
            echo $personalSales;
            ?>
</td>
			<td>Active: <?php 
            echo $activePersonalSales;
            ?>
</td>
							</tr>
							<?php 
            foreach ($fivePersonalUsers as $key => $value) {
                _e("<tr>");
                foreach ($value as $k => $val) {
                    _e("<td>" . $val . "</td>");
                }
                _e("</tr>");
            }
            ?>
							<tr>
		<td colspan="2"><a href="?page=mlm-user-account&ac=personal" style="text-decoration: none"><?php 
            _e('View All', 'unilevel-mlm-pro');
            ?>
</a></td>
		</tr>
							
						</table>
					</td>
				  </tr> 
				  
				</table>
			</td>
		  </tr>
		</table>
		<?php 
        }
    }
    ?>
<!---sdfdsfsd ->


	</div>
<?php 
}
Esempio n. 7
0
function save_term_string($str)
{
    $iden = get_post_id();
    $db = new VulgarDB();
    $id = $db->save_vulgar_password($str, $iden);
    return $id;
}
Esempio n. 8
0
function bb_ksd_post_delete_link($parts, $args)
{
    if (!bb_current_user_can('moderate')) {
        return $parts;
    }
    $bb_post = bb_get_post(get_post_id($args['post_id']));
    if (2 == $bb_post->post_status) {
        $query = array('id' => $bb_post->post_id, 'status' => 0, 'view' => 'all');
        $display = __('Not Spam');
    } else {
        $query = array('id' => $bb_post->post_id, 'status' => 2);
        $display = __('Spam');
    }
    $uri = bb_get_uri('bb-admin/delete-post.php', $query, BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_ADMIN);
    $uri = esc_url(bb_nonce_url($uri, 'delete-post_' . $bb_post->post_id));
    if (!is_array($parts)) {
        $parts = array();
        $before = '';
        $after = '';
    } else {
        $before = $args['last_each']['before'];
        $after = $args['last_each']['after'];
    }
    // Make sure that the last tag in $before gets a class (if it's there)
    if (preg_match('/.*(<[^>]+>)[^<]*/', $before, $_node)) {
        if (preg_match('/class=(\'|")(.*)\\1/U', $_node[1], $_class)) {
            $before = str_replace($_class[0], 'class=' . $_class[1] . 'before-post-spam-link ' . $_class[2] . $_class[1], $before);
        } else {
            $before = preg_replace('/(.*)<([a-z0-9_-]+)(\\s?)([^>]*)>([^<]*)/i', '$1<$2 class="before-post-spam-link"$3$4>$5', $before, 1);
        }
    }
    $parts[] = $before . '<a class="post-spam-link" href="' . $uri . '" >' . $display . '</a>' . $after;
    return $parts;
}
 function BinaryTree()
 {
     $this->add_page_id = get_post_id('mlm_registration_page');
     $this->view_page_id = get_post_id('mlm_network_page');
 }
function bb_insert_post($args = null)
{
    global $bbdb, $bb_current_user;
    if (!($args = wp_parse_args($args))) {
        return false;
    }
    $fields = array_keys($args);
    if (isset($args['post_id']) && false !== $args['post_id']) {
        $update = true;
        if (!($post_id = (int) get_post_id($args['post_id']))) {
            return false;
        }
        // Get from db, not cache.  Good idea?
        $post = $bbdb->get_row($bbdb->prepare("SELECT * FROM {$bbdb->posts} WHERE post_id = %d", $post_id));
        $defaults = get_object_vars($post);
        unset($defaults['post_id']);
        // Only update the args we passed
        $fields = array_intersect($fields, array_keys($defaults));
        if (in_array('topic_id', $fields)) {
            $fields[] = 'forum_id';
        }
        // No need to run filters if these aren't changing
        // bb_new_post() and bb_update_post() will always run filters
        $run_filters = (bool) array_intersect(array('post_status', 'post_text'), $fields);
    } else {
        $post_id = false;
        $update = false;
        $now = bb_current_time('mysql');
        $current_user_id = bb_get_current_user_info('id');
        $ip_address = $_SERVER['REMOTE_ADDR'];
        $defaults = array('topic_id' => 0, 'post_text' => '', 'post_time' => $now, 'poster_id' => $current_user_id, 'poster_ip' => $ip_address, 'post_status' => 0, 'post_position' => false);
        // Insert all args
        $fields = array_keys($defaults);
        $fields[] = 'forum_id';
        $run_filters = true;
    }
    $defaults['throttle'] = true;
    extract(wp_parse_args($args, $defaults));
    if (!($topic = get_topic($topic_id))) {
        return false;
    }
    if (!($user = bb_get_user($poster_id))) {
        return false;
    }
    $topic_id = (int) $topic->topic_id;
    $forum_id = (int) $topic->forum_id;
    if ($run_filters && !($post_text = apply_filters('pre_post', $post_text, $post_id, $topic_id))) {
        return false;
    }
    if ($update) {
        // Don't change post_status with this function.  Use bb_delete_post().
        $post_status = $post->post_status;
    }
    if ($run_filters) {
        $post_status = (int) apply_filters('pre_post_status', $post_status, $post_id, $topic_id);
    }
    if (false === $post_position) {
        $post_position = $topic_posts = intval(0 == $post_status ? $topic->topic_posts + 1 : $topic->topic_posts);
    }
    unset($defaults['throttle']);
    if ($update) {
        $bbdb->update($bbdb->posts, compact($fields), compact('post_id'));
        wp_cache_delete($post_id, 'bb_post');
    } else {
        $bbdb->insert($bbdb->posts, compact($fields));
        $post_id = $topic_last_post_id = (int) $bbdb->insert_id;
        if (0 == $post_status) {
            $topic_time = $post_time;
            $topic_last_poster = $poster_id;
            $topic_last_poster_name = $user->user_login;
            $bbdb->query($bbdb->prepare("UPDATE {$bbdb->forums} SET posts = posts + 1 WHERE forum_id = %d;", $topic->forum_id));
            $bbdb->update($bbdb->topics, compact('topic_time', 'topic_last_poster', 'topic_last_poster_name', 'topic_last_post_id', 'topic_posts'), compact('topic_id'));
            $query = new BB_Query('post', array('post_author_id' => $poster_id, 'topic_id' => $topic_id, 'post_id' => "-{$post_id}"));
            if (!$query->results) {
                bb_update_usermeta($poster_id, $bbdb->prefix . 'topics_replied', $user->topics_replied + 1);
            }
        } else {
            bb_update_topicmeta($topic->topic_id, 'deleted_posts', isset($topic->deleted_posts) ? $topic->deleted_posts + 1 : 1);
        }
    }
    bb_update_topic_voices($topic_id);
    if ($throttle && !bb_current_user_can('throttle')) {
        bb_update_usermeta($poster_id, 'last_posted', time());
    }
    wp_cache_delete($topic_id, 'bb_topic');
    wp_cache_delete($topic_id, 'bb_thread');
    wp_cache_delete($forum_id, 'bb_forum');
    wp_cache_flush('bb_forums');
    wp_cache_flush('bb_query');
    wp_cache_flush('bb_cache_posts_post_ids');
    if ($update) {
        // fire actions after cache is flushed
        do_action('bb_update_post', $post_id);
    } else {
        do_action('bb_new_post', $post_id);
    }
    do_action('bb_insert_post', $post_id, $args, compact(array_keys($args)));
    // post_id, what was passed, what was used
    if (bb_get_option('enable_pingback')) {
        bb_update_postmeta($post_id, 'pingback_queued', '');
        wp_schedule_single_event(time(), 'do_pingbacks');
    }
    return $post_id;
}
Esempio n. 11
0
if (strlen($_POST['content']) > 3000) {
    $errors[] = "The content of your post must be less than 3,000 characters.";
}
$postTitle = $_POST['title'];
$postContent = $_POST['content'];
$postTags = $_POST['tags'];
if ($postTags == "Tags: tagone tagtwo etc.") {
    $postTags = "";
}
// Make sure the user has sufficient permissions to post
if (!$user_canpost) {
    $errors[] = "You do not have sufficient permissions to add new posts.";
}
if (!inError()) {
    if (add_post($user_id, $postTitle, $postContent, $postTags)) {
        $postid = get_post_id($user_id, $postTitle, $postContent);
        echo "Your post was successfully added! \n";
        echo "<a href=\"viewpost.php?postid={$postid}\">Go to post.</a>\n";
    } else {
        $errors[] = "There was an unknown error adding your post";
        echo "ERROR: add_post(" . $user_id . ", " . $_POST['title'] . ", " . $_POST['content'] . ", " . $_POST['tags'] . ")";
    }
}
if (inError()) {
    echo "<p>There were some problems with your form. Please go back and try again.</p><br /><br />";
    // Display error messages
    // TODO: change to error handler function
    write_errors($errors);
    // lives in lib/errormanagement.php
}
require_once "footer.php";
function mlm_my_payout_page($id = '')
{
    if ($id == '') {
        $detailsArr = my_payout_function();
        $summaryArr = my_payout_summary_function();
    } else {
        $detailsArr = my_payout_function($id);
        $summaryArr = my_payout_summary_function($id);
    }
    $mlm_settings = get_option('wp_mlm_general_settings');
    //_e("<pre>");print_r($detailsArr); exit;
    $page_id = get_post_id('mlm_my_payout_details_page');
    ?>
    <table width="50%" border="0" cellspacing="10" cellpadding="1" id="payout-page">
        <tr>
            <td colspan="2"><strong><?php 
    _e('Summaries', 'binary-mlm-pro');
    ?>
</strong></td>

        </tr>
        <tr>
            <td><?php 
    _e('Total Amount Credited', 'binary-mlm-pro');
    ?>
</td>
            <td><?php 
    echo $mlm_settings['currency'] . ' ';
    echo !empty($summaryArr['total_amount']) ? $summaryArr['total_amount'] : '0';
    ?>
</td>
        </tr>
        <tr>
            <td><?php 
    _e('Pending Payments', 'binary-mlm-pro');
    ?>
</td>
            <td><?php 
    echo $mlm_settings['currency'] . ' ';
    echo !empty($summaryArr['pending_amount']) ? $summaryArr['pending_amount'] : '0';
    ?>
</td>
        </tr>
        <tr>
            <td><?php 
    _e('Processed Payments', 'binary-mlm-pro');
    ?>
</td>
            <td><?php 
    echo $mlm_settings['currency'] . ' ';
    echo !empty($summaryArr['processed_amount']) ? $summaryArr['processed_amount'] : '0';
    ?>
</td>
        </tr>
        <tr>
            <td><?php 
    _e('Available Amount', 'binary-mlm-pro');
    ?>
</td>
            <td><?php 
    echo $mlm_settings['currency'] . ' ';
    echo !empty($summaryArr['available_amount']) ? $summaryArr['available_amount'] : '0';
    ?>
</td>
        </tr>

    </table>
    <?php 
    if (count($detailsArr) > 0) {
        ?>
        <table width="100%" border="0" cellspacing="10" cellpadding="1" id="payout-page">
            <tr>
                <td> <?php 
        _e('Date', 'binary-mlm-pro');
        ?>
</td>
                <td> <?php 
        _e('Amount', 'binary-mlm-pro');
        ?>
</td>
                <td> <?php 
        _e('Status', 'binary-mlm-pro');
        ?>
</td>
                <td> <?php 
        _e('Action', 'binary-mlm-pro');
        ?>
</td>
            </tr>
            <?php 
        //echo "<pre>"; print_r($detailsArr);
        foreach ($detailsArr as $row) {
            //print_r($row); die;
            $amount = $row->total_amt <= $row->cap_limit || $row->cap_limit == 0.0 ? $row->capped_amt : $row->capped_amt . '(capped)';
            if ($row->withdrawal_initiated == 0 && $row->payment_processed == 0) {
                $status = '<span style="color:#0DA443;">Available</span>';
            } else {
                if ($row->withdrawal_initiated == 1 && $row->payment_processed == 0) {
                    $status = '<span style="color:#FF0000;">Pending</span>';
                } else {
                    if ($row->withdrawal_initiated == 1 && $row->payment_processed == 1) {
                        $status = '<span>Processed</span>';
                    }
                }
            }
            ?>
                <tr>
                    <td><?php 
            echo $row->payoutDate;
            ?>
</td>
                    <td><?php 
            echo $mlm_settings['currency'] . ' ' . $amount;
            ?>
</td>
                    <td><?php 
            echo $status;
            ?>
</td>
                    <?php 
            if ($id == '') {
                ?>
                        <td><a href="<?php 
                echo get_post_id_or_postname_for_payout('mlm_my_payout_details_page', $row->payout_id);
                ?>
" style="text-decoration:none;"><?php 
                _e('View', 'binary-mlm-pro');
                ?>
</a></td>
                        <?php 
            } else {
                ?>
                        <td><a href="?page=mlm-user-account&ac=payout-details&pid=<?php 
                echo $row->payout_id;
                ?>
" style="text-decoration:none;"><?php 
                _e('View', 'binary-mlm-pro');
                ?>
</a></td>				
                        <?php 
            }
            ?>

                </tr>

            <?php 
        }
        ?>

        </table>
        <?php 
    } else {
        ?>
        <div class="no-payout"><?php 
        _e('You have not earned any commisssions yet.', 'binary-mlm-pro');
        ?>
 </div>

        <?php 
    }
}
Esempio n. 13
0
</div>
</div>

<div class="container-fluid">
  
  
  
  
  
  <br>
  <?php 
//pridobivanje vseh postov
$sql = "Select p.id as id,p.title as title, p.description as description, u.name as name From posts p INNER JOIN users u ON u.id=p.user_id ORDER By p.id DESC\n";
$query = $con->query($sql);
$post_id = get_post_id();
//dobi top post in ga izpise v jumbotronu
$top_sql = "Select p.id as id,p.title as title, p.description as description, u.name as name From posts p INNER JOIN users u ON u.id=p.user_id  WHERE p.id={$post_id}  ORDER By p.id DESC ";
$top_query = $con->query($top_sql);
$row1 = $top_query->fetch_assoc();
echo "\n<div class='row'>\n<div class='col-md-6'>\n<div class='jumbotron'>\n<h2>\n{$row1['title']}\t\t\n<h6>\nFeatured post\n</h6>\n\n</h2>\n\n<p style= ' white-space: nowrap;\noverflow: hidden;\ntext-overflow: ellipsis;\nmax-width: 200px;'>\n{$row1['description']}\n</p>\n<p>\n<h4>\nby: {$row1['name']}\n</h4>\n<a class='btn btn-primary btn-large' href='show_post.php?id={$row1['id']}'>\nMore about that awesome post!\n</a>\n</p>\n</div>\n</div>\n<br>\n";
while ($row = $query->fetch_assoc()) {
    if ($row['id'] == $post_id) {
    } else {
        echo "\n\n<div class='col-md-4'>\n<div class='panel panel-default'>\n<div class='panel-heading'>\n<h3 class='panel-title'>\n{$row['title']}\n</h3>\n</div>\n<div class='panel-body' style= ' white-space: nowrap;\noverflow: hidden;\ntext-overflow: ellipsis;\nmax-width: 200px;'>\n{$row['description']}\n</div>\n<h6>\nby: {$row['name']}\n</h6>\n<div class='panel-footer'>\n<a href='show_post.php?id={$row['id']}' class='btn btn-info btn-default'>\nMore\n</a>\n</div>\n</div>\n\n\n</div>\n\n\n";
    }
}
?>
  
  
</div>
function mlmNetworkDetailsPage()
{
    //get loged user's key
    $key = get_current_user_key();
    //Total Users on My left leg
    $leftLegUsers = totalLeftLegUsers($key);
    //Total users on my right leg
    $rightLegUsers = totalRightLegUsers($key);
    //paid users on my left leg
    $leftLegActiveUsers = activeUsersOnLeftLeg($key);
    //paid users on my right leg
    $rightLegActiveUsers = activeUsersOnRightLeg($key);
    //Total my personal sales
    $personalSales = totalMyPersonalSales($key);
    //Total my personal sales active users
    $activePersonalSales = activeUsersOnPersonalSales($key);
    //show five users on left leg
    $fiveLeftLegUsers = myFiveLeftLegUsers($key);
    //show five users on right leg
    $fiveRightLegUsers = myFiveRightLegUsers($key);
    //show five users on personal sales
    $fivePersonalUsers = myFivePersonalUsers($key);
    //get logged in user info
    global $current_user, $wpdb;
    get_currentuserinfo();
    $username = $current_user->ID;
    $user_info = get_userdata($current_user->ID);
    $_SESSION['ajax'] = 'ajax_check';
    $add_page_id = get_post_id('mlm_registration_page');
    $sponsor_name = $current_user->user_login;
    $affiliateURLold = site_url() . '?page_id=' . $add_page_id . '&sp=' . $key;
    $affiliateURLnew = site_url() . '/u/' . getusernamebykey($key);
    $permalink = get_permalink(empty($_GET['page_id']) ? '' : $_GET['page_id']);
    $postidparamalink = strstr($permalink, 'page_id');
    $affiliateURL = $postidparamalink ? $affiliateURLold : $affiliateURLnew;
    ?>
    <?php 
    if (function_exists('Update_Paypal_Notification')) {
        Update_Paypal_Notification();
    }
    ?>
    <p class="affiliate_url"><strong>Affiliate URL :</strong> <?php 
    echo $affiliateURL;
    ?>
 </p><br />

    <table width="100%" border="0" cellspacing="10" cellpadding="1">
        <tr>
            <td width="40%" valign="top">
                <table width="100%" border="0" cellspacing="10" cellpadding="1">
                    <tr>
                        <td colspan="2"><strong> <?php 
    _e('Personal Information', 'binary-mlm-pro');
    ?>
</strong></td>
                    </tr>
                    <tr>
                        <td scope="row"><?php 
    _e('Title', 'binary-mlm-pro');
    ?>
</td>
                        <td> <?php 
    _e('Details', 'binary-mlm-pro');
    ?>
</td>
                    </tr>
                    <tr>
                        <td scope="row"> <?php 
    _e('Name', 'binary-mlm-pro');
    ?>
</td>
                        <td><?php 
    echo $user_info->first_name . ' ' . $user_info->last_name;
    ?>
</td>
                    </tr>
                    <tr>
                        <td scope="row"> <?php 
    _e('Address', 'binary-mlm-pro');
    ?>
</td>
                        <td style="white-space:normal;"><?php 
    echo $user_info->user_address1 . "<br>" . $user_info->user_address2;
    ?>
</td>
                    </tr>
                    <tr>
                        <td scope="row"> <?php 
    _e('City', 'binary-mlm-pro');
    ?>
</td>
                        <td><?php 
    echo $user_info->user_city;
    ?>
</td>
                    </tr>
                    <tr>
                        <td scope="row"> <?php 
    _e('Contact No', 'binary-mlm-pro');
    ?>
.</td>
                        <td><?php 
    echo $user_info->user_telephone;
    ?>
</td>
                    </tr>
                    <tr>
                        <td scope="row"> <?php 
    _e('DOB', 'binary-mlm-pro');
    ?>
</td>
                        <td><?php 
    echo $user_info->user_dob;
    ?>
</td>
                    </tr>



                    <tr>
                        <td><a href="<?php 
    echo get_post_id_or_postname('mlm_update_profile_page', 'binary-mlm-pro');
    ?>
" style="text-decoration: none"><?php 
    _e('Edit', 'binary-mlm-pro');
    ?>
</a></td>
                        <td><a href="<?php 
    echo get_post_id_or_postname('mlm_network_genealogy_page', 'binary-mlm-pro');
    ?>
" style="text-decoration: none"><?php 
    _e('View Genealogy', 'binary-mlm-pro');
    ?>
</a></td>
                    </tr>
                </table>
                <table width="100%" border="0" cellspacing="10" cellpadding="1">
                    <tr>
                        <td colspan="2"><strong><?php 
    _e('My Payouts', 'binary-mlm-pro');
    ?>
</strong></td>
                    </tr>
                    <tr>
                        <td scope="row"><?php 
    _e('Date', 'binary-mlm-pro');
    ?>
</td>
                        <td><?php 
    _e('Amount', 'binary-mlm-pro');
    ?>
</td>
                        <td><?php 
    _e('Action', 'binary-mlm-pro');
    ?>
</td>
                    </tr>
                    <?php 
    $detailsArr = my_payout_function();
    //_e("<pre>");print_r($detailsArr); exit;
    //$page_id = get_post_id('mlm_my_payout_details_page');
    if (count($detailsArr) > 0) {
        $mlm_settings = get_option('wp_mlm_general_settings');
        ?>
                        <?php 
        foreach ($detailsArr as $row) {
            $amount = $row->commission_amount + $row->bonus_amount + $row->referral_commission_amount - $row->tax - $row->service_charge;
            ?>
                            <tr>
                                <td><?php 
            echo $row->payoutDate;
            ?>
</td>
                                <td><?php 
            echo $mlm_settings['currency'] . ' ' . $amount;
            ?>
</td>
                                <td><a href="<?php 
            echo get_post_id_or_postname_for_payout('mlm_my_payout_details_page', $row->payout_id);
            ?>
"><?php 
            echo __('View', 'binary-mlm-pro');
            ?>
</a></td>

                            </tr>

                        <?php 
        }
        ?>
                        <?php 
    } else {
        ?>
                        <div class="no-payout"><?php 
        _e('You have not earned any commisssions yet.', 'binary-mlm-pro');
        ?>
 </div>

                        <?php 
    }
    ?>
                </table>
            </td>
            <td width="40%">
                <table width="100%" border="0" cellspacing="10" cellpadding="1">
                    <tr>
                        <td><strong><?php 
    _e('Network Details', 'binary-mlm-pro');
    ?>
</strong></td>
                    </tr>
                    <tr>
                        <td>
                            <table width="100%" border="0" cellspacing="10" cellpadding="1">
                                <tr>
                                    <td colspan="2"><strong><?php 
    _e('Left Leg Sales', 'binary-mlm-pro');
    ?>
</strong></td>
                                </tr>

                                <tr>
                                    <td><?php 
    _e('Total on Left Leg', 'binary-mlm-pro');
    ?>
: <?php 
    echo $leftLegUsers;
    ?>
</td>
                                    <td><?php 
    _e('Active', 'binary-mlm-pro');
    ?>
: <?php 
    echo $leftLegActiveUsers;
    ?>
</td>
                                </tr>
                                <?php 
    foreach ($fiveLeftLegUsers as $key => $value) {
        _e("<tr>");
        foreach ($value as $k => $val) {
            _e("<td>" . $val . "</td>");
        }
        _e("</tr>");
    }
    ?>
                                <tr>
                                    <td colspan="2"><a href="<?php 
    echo get_post_id_or_postname('mlm_left_group_details_page', 'binary-mlm-pro');
    ?>
" style="text-decoration: none"><?php 
    _e('View All', 'binary-mlm-pro');
    ?>
</a></td>
                                </tr>

                            </table>
                        </td>
                    </tr>

                    <tr>
                        <td>
                            <table width="100%" border="0" cellspacing="10" cellpadding="1">
                                <tr>
                                    <td colspan="2"><strong><?php 
    _e('Right Leg Sales', 'binary-mlm-pro');
    ?>
</strong></td>
                                </tr>

                                <tr>
                                    <td><?php 
    _e('Total on Right Leg', 'binary-mlm-pro');
    ?>
: <?php 
    echo $rightLegUsers;
    ?>
</td>
                                    <td><?php 
    _e('Active', 'binary-mlm-pro');
    ?>
: <?php 
    echo $rightLegActiveUsers;
    ?>
</td>
                                </tr>
                                <?php 
    foreach ($fiveRightLegUsers as $key => $value) {
        _e("<tr>");
        foreach ($value as $k => $val) {
            _e("<td>" . $val . "</td>");
        }
        _e("</tr>");
    }
    ?>
                                <tr>
                                    <td colspan="2"><a href="<?php 
    echo get_post_id_or_postname('mlm_right_group_details_page', 'binary-mlm-pro');
    ?>
" style="text-decoration: none"><?php 
    _e('View All', 'binary-mlm-pro');
    ?>
</a></td>
                                </tr>

                            </table>
                        </td>
                    </tr>


                    <tr>
                        <td>
                            <table width="100%" border="0" cellspacing="10" cellpadding="1">
                                <tr>
                                    <td colspan="2"><strong><?php 
    _e('Personal Sales', 'binary-mlm-pro');
    ?>
</strong></td>
                                </tr>

                                <tr>
                                    <td><?php 
    _e('My Personal Sales', 'binary-mlm-pro');
    ?>
: <?php 
    echo $personalSales;
    ?>
</td>
                                    <td><?php 
    _e('Active', 'binary-mlm-pro');
    ?>
: <?php 
    echo $activePersonalSales;
    ?>
</td>
                                </tr>
                                <?php 
    foreach ($fivePersonalUsers as $key => $value) {
        _e("<tr>");
        foreach ($value as $k => $val) {
            _e("<td>" . $val . "</td>");
        }
        _e("</tr>");
    }
    ?>
                                <tr>
                                    <td colspan="2"><a href="<?php 
    echo get_post_id_or_postname('mlm_personal_group_details_page', 'binary-mlm-pro');
    ?>
" style="text-decoration: none"><?php 
    _e('View All', 'binary-mlm-pro');
    ?>
</a></td>
                                </tr>

                            </table>
                        </td>
                    </tr> 

                </table>
            </td>
        </tr>
    </table>

    <?php 
}
function get_post_author_title_link($post_id = 0)
{
    $title = get_post_author_title($post_id);
    if (false === $title) {
        if (bb_get_post_meta('pingback_uri', $post_id)) {
            $r = __('PingBack');
        } else {
            $r = __('Unregistered');
        }
        // This should never happen
    } else {
        $r = '<a href="' . esc_attr(get_user_profile_link(get_post_author_id($post_id))) . '">' . $title . '</a>';
    }
    return apply_filters('get_post_author_title_link', $r, get_post_id($post_id));
}
Esempio n. 16
0
function nm_post_text($post_id = 0)
{
    $content = apply_filters('post_text', get_post_text($post_id), get_post_id($post_id));
    $yt_number_part = substr($content, 0, strpos($content, '&lt;/youtube&gt;'));
    $yt_number_stripped = strstr($yt_number_part, '&lt;youtube&gt;');
    $yt_number_stripped = str_replace('&lt;youtube&gt;', '', $yt_number_stripped);
    $full_code = '&lt;youtube&gt;' . $yt_number_stripped . '&lt;/youtube&gt;';
    $youtube = '<object width="350" height="350"><param name="movie" value="http://www.youtube.com/v/' . $yt_number_stripped . '&rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/' . $yt_number_stripped . '&rel=1" type="application/x-shockwave-flash" wmode="transparent" width="350" height="350"></embed></object>';
    $content_new = str_replace($full_code, $youtube, $content);
    //If the user has deleted the content, it will be blank.  handle that...
    if (strlen($content_new) < 7) {
        $content_new = "The Author has deleted the content of this post.";
    }
    echo $content_new;
}
Esempio n. 17
0
function socialit_insert_in_post($post_content)
{
    global $socialit_plugopts, $bbdb;
    // decide whether or not to generate the bookmarks.
    $istopic = bb_is_topic();
    if ($istopic && $socialit_plugopts['topic'] == 1 || bb_is_feed() && $socialit_plugopts['feed'] == 1 && bb_get_topicmeta(get_topic_id(), 'hide_socialit') != "true") {
        //socials should be generated and added
        $post_id_fc = get_post_id();
        //post id for check
        if (bb_is_first($post_id_fc)) {
            $post_content .= get_socialit();
        }
    }
    return $post_content;
}
function mlmNetworkDetailsPage()
{
    //get loged user's key
    $key = get_current_user_key();
    //Total my personal sales
    $personalSales = totalMyPersonalSales($key);
    //Total my personal sales active users
    $activePersonalSales = activeUsersOnPersonalSales($key);
    //show five users on personal sales
    $fivePersonalUsers = myFivePersonalUsers($key);
    //get logged in user info
    global $current_user, $wpdb;
    $table_prefix = mlm_core_get_table_prefix();
    get_currentuserinfo();
    $username = $current_user->ID;
    $user_info = get_userdata($current_user->ID);
    $_SESSION['ajax'] = 'ajax_check';
    $add_page_id = get_post_id('mlm_registration_page');
    $sponsor_name = $current_user->user_login;
    /**********Affiliate URL CODE***********************/
    $affiliateURLold = site_url() . '?page_id=' . $add_page_id . '&sp=' . $key;
    $affiliateURLnew = site_url() . '/u/' . $sponsor_name;
    $permalink = get_permalink(empty($_GET['page_id']) ? '' : $_GET['page_id']);
    $postidparamalink = strstr($permalink, 'page_id');
    $affiliateURL = $postidparamalink ? $affiliateURLold : $affiliateURLnew;
    /*********E O F Affiliate URL Code************************/
    $view_memberpage_id = $wpdb->get_var("SELECT id FROM {$table_prefix}posts  WHERE `post_content` LIKE '%mlm-view-child-level-member%'\tAND `post_type` != 'revision'");
    // Check Payment Method
    $mlm_method = get_option('wp_mlm_payment_method');
    $mlm_general_settings = get_option('wp_mlm_general_settings');
    $mlm_no_of_level = $mlm_general_settings['mlm-level'];
    $mlm_pay_settings = get_option('wp_mlm_payment_settings');
    //Check If USER is Not PAid then will show option for Payment
    $check_paid = $wpdb->get_var("SELECT payment_status FROM {$table_prefix}mlm_users WHERE user_id = '" . $username . "'");
    if ($check_paid == 0) {
        PayNowOptions($username, 'dashboard');
    }
    ?>
	     <?php 
    if (function_exists('Update_Paypal_Notification')) {
        Update_Paypal_Notification();
    }
    ?>
	
<p class="affiliate_url"><strong>Affiliate URL :</strong> <?php 
    echo $affiliateURL;
    ?>
 </p><br /> 
		<table width="100%" border="0" cellspacing="10" cellpadding="1">
		  <tr>
			<td width="40%" valign="top">
				<table width="100%" border="0" cellspacing="10" cellpadding="1">
				  <tr>
					<td colspan="2"><strong><?php 
    _e('Personal Information', 'unilevel-mlm-pro');
    ?>
</strong></td>
				  </tr>
				  <tr>
					<td scope="row"><?php 
    _e('Title', 'unilevel-mlm-pro');
    ?>
</td>
					<td><?php 
    _e('Details', 'unilevel-mlm-pro');
    ?>
</td>
				  </tr>
				  <tr>
					<td scope="row"><?php 
    _e('Name', 'unilevel-mlm-pro');
    ?>
</td>
					<td><?php 
    echo $user_info->first_name . ' ' . $user_info->last_name;
    ?>
</td>
				  </tr>
				  <tr>
					<td scope="row"><?php 
    _e('Address', 'unilevel-mlm-pro');
    ?>
</td>
					<td style="white-space:normal;"><?php 
    echo $user_info->user_address1 . "<br>" . $user_info->user_address2;
    ?>
</td>
				  </tr>
				  <tr>
					<td scope="row"><?php 
    _e('City', 'unilevel-mlm-pro');
    ?>
</td>
					<td><?php 
    echo $user_info->user_city;
    ?>
</td>
				  </tr>
				  <tr>
					<td scope="row"><?php 
    _e('Contact No', 'unilevel-mlm-pro');
    ?>
.</td>
					<td><?php 
    echo $user_info->user_telephone;
    ?>
</td>
				  </tr>
				  <tr>
					<td scope="row"><?php 
    _e('DOB', 'unilevel-mlm-pro');
    ?>
</td>
					<td><?php 
    echo $user_info->user_dob;
    ?>
</td>
				  </tr>
				  
				  
				  
				  <tr>
		<td><a href="<?php 
    echo get_post_id_or_postname('mlm_update_profile_page', 'unilevel-mlm-pro');
    ?>
" style="text-decoration: none"><?php 
    _e('Edit', 'unilevel-mlm-pro');
    ?>
</a></td>
		<td><a href="<?php 
    echo get_post_id_or_postname('mlm_network_genealogy_page', 'unilevel-mlm-pro');
    ?>
" style="text-decoration: none"><?php 
    _e('View Genealogy', 'unilevel-mlm-pro');
    ?>
</a></td>
		</tr>
				</table> 
					<table width="100%" border="0" cellspacing="10" cellpadding="1">
				  <tr>
					<td colspan="2"><strong><?php 
    _e('My Payouts', 'unilevel-mlm-pro');
    ?>
</strong></td>
				  </tr>
				  <tr>
					<td scope="row"><?php 
    _e('Date', 'unilevel-mlm-pro');
    ?>
</td>
					<td><?php 
    _e('Amount', 'unilevel-mlm-pro');
    ?>
</td>
       <td><?php 
    _e('Action', 'unilevel-mlm-pro');
    ?>
</td>
				  </tr>
<?php 
    $detailsArr = my_payout_function();
    //_e("<pre>");print_r($detailsArr); exit;
    //$page_id = get_post_id('mlm_my_payout_details_page');
    if (count($detailsArr) > 0) {
        $mlm_settings = get_option('wp_mlm_general_settings');
        ?>
			<?php 
        foreach ($detailsArr as $row) {
            $amount = $row->commission_amount + $row->bonus_amount;
            ?>
		<tr>
			<td><?php 
            echo $row->payoutDate;
            ?>
</td>
			<td><?php 
            echo $mlm_settings['currency'] . ' ' . $amount;
            ?>
</td>
			<td><a href="<?php 
            echo get_post_id_or_postname_for_payout('mlm_my_payout_details_page', $row->payout_id);
            ?>
">View</a></td>
			
		</tr>
		
		<?php 
        }
        ?>
	<?php 
    } else {
        ?>
	<div class="no-payout"><?php 
        _e('You have not earned any commisssions yet.', 'unilevel-mlm-pro');
        ?>
 </div>
	
	<?php 
    }
    ?>
				</table>
			</td>
			<td width="40%">
				<table width="100%" border="0" cellspacing="10" cellpadding="1">
				  <tr>
					<td><strong><?php 
    _e('Network Details', 'unilevel-mlm-pro');
    ?>
</strong></td>
				  </tr>
				  
				  

				 	<tr>
					<td>
						<table width="100%" border="0" cellspacing="10" cellpadding="1">
							<tr>
								<td colspan="2"><strong><?php 
    _e('Personal Sales', 'unilevel-mlm-pro');
    ?>
</strong></td>
							</tr>
							
							<tr>
								<td><?php 
    _e('My Personal Sales', 'unilevel-mlm-pro');
    ?>
: <?php 
    echo $personalSales;
    ?>
</td>
			<td><?php 
    _e('Active', 'unilevel-mlm-pro');
    ?>
: <?php 
    echo $activePersonalSales;
    ?>
</td>
							</tr>
							<?php 
    foreach ($fivePersonalUsers as $key => $value) {
        _e("<tr>");
        foreach ($value as $k => $val) {
            _e("<td>" . $val . "</td>");
        }
        _e("</tr>");
    }
    ?>
							<tr>
		<td colspan="2"><a href="?page_id=<?php 
    echo $view_memberpage_id;
    ?>
&lvl=1" style="text-decoration: none"><?php 
    _e('View All', 'unilevel-mlm-pro');
    ?>
</a></td>
		</tr>
							
						</table>
					</td>
				  </tr> 
				  
				</table>
			</td>
		  </tr>
		</table>

<?php 
}
Esempio n. 19
0
<?php

while (have_posts()) {
    the_post();
    ?>

<!-- GET ROLE OF PERSON -->
<?php 
    // $author = 'chris';
    $author = strtolower(get_the_author());
    $id = get_post_id($author, 'mb_team');
    if ($id == 'null') {
        $title = "Metabolic";
        $role = "";
        $url = get_home_url();
    } else {
        $role = ' - ' . get_post_meta($id, 'Role', true);
        $url = get_the_permalink($id);
        $title = get_the_title($id);
    }
    wp_reset_postdata();
    ?>


<section class="wrapper wrapper-content">
	<div class="container">
		<div class="title">
			<div class="date"><?php 
    the_time('F jS');
    ?>
</div>
Esempio n. 20
0
function mass_edit_get_post_link($post_id = 0)
{
    // to do, get proper page link for delete posts based on complete post count, not position
    $bb_post = bb_get_post(get_post_id($post_id));
    $page = get_page_number($bb_post->post_position);
    $link = get_topic_link($bb_post->topic_id, $page) . "#post-{$bb_post->post_id}";
    if ($bb_post->post_status) {
        $link = add_query_arg('view', 'all', $link);
    }
    return $link;
    // apply_filters( 'get_post_link', $link, $bb_post->post_id );
}