Exemplo n.º 1
0
function WP_members_list_meta($i)
{
    global $getWP, $tern_wp_members_defaults, $profileuser, $current_user, $ternSel, $states, $addy;
    $o = $getWP->getOption('tern_wp_members', $tern_wp_members_defaults);
    get_currentuserinfo();
    if (!current_user_can('edit_users') and ($o['allow_display'] and $current_user->ID != $i->ID or !$o['allow_display'])) {
        return;
    }
    ?>
	<h3>Members Lists</h3>
	<table class="form-table">
	<tr>
		<th><label for="lists">Select the lists you'd like this user displayed in:</label></th>
		<td>
			<ul>
			<?php 
    foreach ($o['lists'] as $v) {
        ?>
			<li><input type="checkbox" name="lists[]" value="<?php 
        echo $v;
        ?>
" <?php 
        if (WP_members_list_is_in_list($i->ID, $v)) {
            ?>
checked<?php 
        }
        ?>
 /> <?php 
        echo $v;
        ?>
</li>
			<?php 
    }
    ?>
			</ul>
		</td>
	</tr>
	</table>
	<h3>Address</h3>
	<?php 
    foreach ($addy as $v) {
        $address[$v] = get_user_meta($i->ID, '_' . $v, true);
    }
    //$address = get_user_meta($i->ID,'_address',true);
    ?>
	<table class="form-table">
	<tr>
		<th><label for="line1">Address Line 1:</label></th>
		<td>
			<input type="text" name="line1" value="<?php 
    echo $address['line1'];
    ?>
" class="regular-text" />
		</td>
	</tr>
	<tr>
		<th><label for="line2">Address Line 2:</label></th>
		<td>
			<input type="text" name="line2" value="<?php 
    echo $address['line2'];
    ?>
" class="regular-text" />
		</td>
	</tr>
	<tr>
		<th><label for="city">City:</label></th>
		<td>
			<input type="text" name="city" value="<?php 
    echo $address['city'];
    ?>
" class="regular-text" />
		</td>
	</tr>
	<tr>
		<th><label for="state">State:</label></th>
		<td>
			<?php 
    echo $ternSel->create(array('type' => 'paired', 'data' => $states, 'name' => 'state', 'select_value' => 'select', 'selected' => array($address['state'])));
    ?>
		</td>
	</tr>
	<tr>
		<th><label for="zip">Zipcode:</label></th>
		<td>
			<input type="text" name="zip" value="<?php 
    echo $address['zip'];
    ?>
" class="regular-text" />
		</td>
	</tr>
	<tr>
		<th><label for="lat">Latitude:</label></th>
		<td>
			<input type="text" name="lat" value="<?php 
    echo get_user_meta($i->ID, '_lat', true);
    ?>
" class="regular-text" />
		</td>
	</tr>
	<tr>
		<th><label for="lng">Longitude:</label></th>
		<td>
			<input type="text" name="lng" value="<?php 
    echo get_user_meta($i->ID, '_lng', true);
    ?>
" class="regular-text" />
		</td>
	</tr>
	</table>
<?php 
}
Exemplo n.º 2
0
function WP_members_list_meta($i)
{
    global $getWP, $tern_wp_members_defaults, $profileuser, $current_user;
    $o = $getWP->getOption('tern_wp_members', $tern_wp_members_defaults);
    get_currentuserinfo();
    /*
    if(!current_user_can('edit_users') and (($o['allow_display'] and $current_user->ID != $i->ID) or !$o['allow_display'])) {
    	return;
    }
    */
    if (!current_user_can('edit_users')) {
        return;
    }
    ?>
	<h3>Members Lists</h3>
	<table class="form-table">
	<tr>
		<th><label for="lists">Select the lists you'd like this user displayed in:</label></th>
		<td>
			<ul>
			<?php 
    //$lists = explode(',',$o['lists'])
    ?>
			<?php 
    foreach ($o['lists'] as $v) {
        ?>
			<li><input type="checkbox" name="lists[]" value="<?php 
        echo $v;
        ?>
" <?php 
        if (WP_members_list_is_in_list($i->ID, $v)) {
            ?>
checked<?php 
        }
        ?>
 /> <?php 
        echo $v;
        ?>
</li>
			<?php 
    }
    ?>
			</ul>
		</td>
	</tr>
	</table>
<?php 
}