My need wordpress

<!– The main stylesheet –>
<link rel=”stylesheet” href=”<?php echo get_stylesheet_directory_uri(); ?>/style.css”>
<body>
<form id=”login” action=”login” method=”post”>
<h1>Site Login</h1>
<p class=”status”></p>
<label for=”username”>Username</label>
<input id=”username” type=”text” name=”username”>
<label for=”password”>Password</label>
<input id=”password” type=”password” name=”password”>
<a class=”lost” href=”<?php echo wp_lostpassword_url(); ?>”>Lost your password?</a>
<input class=”submit_button” type=”submit” value=”Login” name=”submit”>
<a class=”close” href=””>(close)</a>
<?php wp_nonce_field( ‘ajax-login-nonce’, ‘security’ ); ?>
</form>
<?php if (is_user_logged_in()) { ?>
<a class=”login_button” href=”<?php echo wp_logout_url( home_url() ); ?>”>Logout</a>
<?php } else { ?>
<a class=”login_button” id=”show_login” href=””>Login</a>
<?php } ?>

<?php
print_r(wp_register());
?>

<!– New Post Form –>

<div id=”postbox”>

<form id=”new_post” name=”new_post” method=”post” action=””>

<p><label for=”title”>Title</label><br />

<input type=”text” id=”title” value=”” tabindex=”1″ size=”20″ name=”title” />

</p>

<p><label for=”description”>Description</label><br />

<textarea id=”description” tabindex=”3″ name=”description” cols=”50″ rows=”6″></textarea>

</p>

<p><?php wp_dropdown_categories( ‘show_option_none=Category&tab_index=4&taxonomy=category’ ); ?></p>

<p><label for=”post_tags”>Tags</label>

<input type=”text” value=”” tabindex=”5″ size=”16″ name=”post_tags” id=”post_tags” /></p>

<p align=”right”><input type=”submit” value=”Publish” tabindex=”6″ id=”submit” name=”submit” /></p>

<input type=”hidden” name=”post_type” id=”post_type” value=”post” />

<input type=”hidden” name=”action” value=”post” />

<?php wp_nonce_field( ‘new-post’ ); ?>

</form>

</div>

<!–// New Post Form –>

<?
if( ‘POST’ == $_SERVER[‘REQUEST_METHOD’] && !empty( $_POST[‘action’] )) {

// Do some minor form validation to make sure there is content
if (isset ($_POST[‘title’])) {
$title =  $_POST[‘title’];
} else {
echo ‘Please enter a title’;
}
if (isset ($_POST[‘description’])) {
$description = $_POST[‘description’];
} else {
echo ‘Please enter the content’;
}
$tags = $_POST[‘post_tags’];

// Add the content of the form to $post as an array
$post = array(
‘post_title’    => $title,
‘post_content’    => $description,
‘post_category’    => $_POST[‘cat’],  // Usable for custom taxonomies too
‘tags_input’    => $tags,
‘post_status’    => ‘publish’,            // Choose: publish, preview, future, etc.
‘post_type’    => $_POST[‘post_type’]  // Use a custom post type if you want to
);
wp_insert_post($post);  // Pass  the value of $post to WordPress the insert function
// http://codex.wordpress.org/Function_Reference/wp_insert_post
wp_redirect( home_url() );
} // end IF

// Do the wp_insert_post action to insert it
do_action(‘wp_insert_post’, ‘wp_insert_post’);

?>

<!–LOGIN–>

<?php
$current_url=’http’.(empty($_SERVER[‘HTTPS’])?”:’s’).’://’.$_SERVER[‘SERVER_NAME’].$_SERVER[‘REQUEST_URI’];
?>

<form method=”post” action=”<?php bloginfo(‘url’) ?>/wp-login.php” class=”wp-user-form”>
<div class=”username”>
<label for=”user_login”><?php _e(‘Username’, ‘tabbed-login’); ?>: </label>
<input type=”text” name=”log” value=”<?php echo esc_attr(stripslashes($user_login)); ?>” size=”20″ id=”user_login” tabindex=”11″ />
</div>
<div class=”password”>
<label for=”user_pass”><?php _e(‘Password’, ‘tabbed-login’); ?>: </label>
<input type=”password” name=”pwd” value=”” size=”20″ id=”user_pass” tabindex=”12″ />
</div>
<div class=”login_fields”>
<div class=”rememberme”>
<label for=”rememberme”>
<input type=”checkbox” name=”rememberme” value=”forever” checked=”checked” id=”rememberme” tabindex=”13″ /><?php _e(‘ Remember me’, ‘tabbed-login’); ?>
</label>
</div>
<?php do_action(‘login_form’); ?>
<input type=”submit” name=”user-submit” value=”<?php _e(‘Login’, ‘tabbed-login’); ?>” tabindex=”14″ class=”user-submit” />
<input type=”hidden” name=”redirect_to” value=”<?php echo $current_url; ?>” />
<input type=”hidden” name=”user-cookie” value=”1″ />
</div>
</form>

<!–REGISTETION–>

<div id=”register” class=”tab_content_login”>
<h3><?php _e(‘Register for this site!’, ‘tabbed-login’); ?></h3>
<p><?php _e(‘Sign up now for the good stuff.’, ‘tabbed-login’); ?></p>
<form method=”post” action=”<?php echo site_url(‘wp-login.php?action=register’, ‘login_post’) ?>” class=”wp-user-form”>
<div class=”username”>
<label for=”user_login”><?php _e(‘Username’, ‘tabbed-login’); ?>: </label>
<input type=”text” name=”user_login” value=”<?php echo esc_attr(stripslashes($user_login)); ?>” size=”20″ id=”user_login” tabindex=”101″ />
</div>
<div class=”password”>
<label for=”user_email”><?php _e(‘Your Email’, ‘tabbed-login’); ?>: </label>
<input type=”text” name=”user_email” value=”<?php echo esc_attr(stripslashes($user_email)); ?>” size=”25″ id=”user_email” tabindex=”102″ />
</div>
<div class=”login_fields”>
<?php do_action(‘register_form’); ?>
<input type=”submit” name=”user-submit” value=”<?php _e(‘Sign up!’, ‘tabbed-login’); ?>” class=”user-submit” tabindex=”103″ />
<?php $register = $_GET[‘register’]; if($register == true) { echo ‘<p>Check your email for the password!</p>’; } ?>
<input type=”hidden” name=”redirect_to” value=”<?php echo $current_url; ?>?register=true” />
<input type=”hidden” name=”user-cookie” value=”1″ />
</div>
</form>
</div>

<!–FORGOT PASSWORD–>

<div id=”forgot_password” class=”tab_content_login”>
<h3><?php _e(‘Lost Your Password?’, ‘tabbed-login’); ?></h3>
<p><?php _e(‘Enter your username or email to reset your password.’, ‘tabbed-login’); ?></p>
<form method=”post” action=”<?php echo site_url(‘wp-login.php?action=lostpassword’, ‘login_post’) ?>” class=”wp-user-form”>
<div class=”username”>
<label for=”user_login” class=”hide”><?php _e(‘Username or Email’, ‘tabbed-login’); ?>: </label>
<input type=”text” name=”user_login” value=”” size=”20″ id=”user_login” tabindex=”1001″ />
</div>
<div class=”login_fields”>
<?php do_action(‘login_form’, ‘resetpass’); ?>
<input type=”submit” name=”user-submit” value=”<?php _e(‘Reset my password’, ‘tabbed-login’); ?>” class=”user-submit” tabindex=”1002″ />
<?php $reset = $_GET[‘reset’]; if($reset == true) { echo ‘<p>’.__(‘A message was sent to your email address.’,’tabbed-login’).'</p>’; } ?>
<input type=”hidden” name=”redirect_to” value=”<?php echo $current_url; ?>?reset=true” />
<input type=”hidden” name=”user-cookie” value=”1″ />
</div>
</form>
</div>
</div>

<?php
//add_option( $option, $value, $deprecated, $autoload );
add_option( ‘myhack_extraction_length’, ‘255’, ”, ‘yes’ );
$no_exists_value = get_option( ‘myhack_extraction_length’, ‘default_value’ );
var_dump( $no_exists_value ); /* outputs ‘default_value’ */
update_option( ‘myhack_extraction_length’, ‘closed’ );
$no_exists_value = get_option( ‘myhack_extraction_length’, ‘default_value’ );
var_dump( $no_exists_value ); /* outputs ‘default_value’ */
?>

<br />
<br />
<br />

<?php

$args = array(
‘fields’ => ‘all_with_meta’,
‘role’ => ‘Subscriber’,
‘meta_query’ => array(
array(
‘key’=>’instrument’
))
);

$user_query = new WP_User_Query ($args);
print_r($user_query);
/*
// User Loop
if ( !empty( $user_query->results ) ) {

foreach ( $user_query->results as $category ) {
foreach ( $category->instrument as $cat ) {
echo ‘<h2>’ .$cat . ‘</h2>’;

echo ‘<div id=”membox”>’;
echo $category->first_name. ‘ ‘ .$category->last_name.’
‘;
echo $category->address_1.’
‘;
echo $category->city.’, ‘.$category->state.’, ‘.$category->zip.’
‘;
echo $category->phone.”;
echo ’email.'”>’.$category->email.”;
foreach ($category->instrument as $inst) {
echo ‘<b>’.$inst.'</b>, ‘; }
echo ‘</div>’;
}
}} else {
echo ‘No users found.’;
}
*/
?>

<?php
/*$args = array(
‘fields’ => ‘all’,’role’ => ‘Subscriber’,
‘meta_query’ => array(
array(
‘key’=>’instrument’
))
);
$members = get_users($args);
//custom function for comparing the data we want to sort byfunction cmp($a, $B){
if ($a->instrument == $b->instrument) {
return 0;
}
return (
$a->instrument > $b->instrument) ? 1 : -1;
}

usort($members, ‘cmp’);

foreach ($members as $member ) {
// get all the user’s data
$member_info = get_userdata($member->ID);
echo ‘<div id=”membox”>’;
echo $member_info->first_name. ‘ ‘ .$member_info->last_name.'<br />’;
echo $member_info->address_1.'<br />’;
echo $member_info->city.’, ‘.$member_info->state.’, ‘.$member_info->zip.'<br />’;
echo $member_info->phone.'<br />’;
echo ‘<a>email.'”>’.$member_info->email.'</a><br />’;
foreach ($member_info->instrument as $inst) {
echo ‘<b>’.$inst.'</b>, ‘; }echo ‘</div>’;
}*/
?>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s