Language: PHP

Untitled PHP (27-Aug @ 09:59)

Syntax Highlighted Code

  1. <?php
  2.  
  3. /**
  4.  * WordPress User Page
  5. [649 more lines...]

Plain Code

<?php

/**
 * WordPress User Page
 *
 * Handles authentication, registering, resetting passwords, forgot password,
 * and other user handling.
 *
 * @package WordPress
 */

/** Make sure that the WordPress bootstrap has run before continuing. */
require( dirname(__FILE__) . '/wp-load.php' );

// Redirect to https login if forced to use SSL
if ( force_ssl_admin() && !is_ssl() ) {
    if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) {
        wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI']));
        exit();
    } else {
        wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
        exit();
    }
}

/**
 * Outputs the header for the login page.
 *
 * @uses do_action() Calls the 'login_head' for outputting HTML in the Log In
 *        header.
 * @uses apply_filters() Calls 'login_headerurl' for the top login link.
 * @uses apply_filters() Calls 'login_headertitle' for the top login title.
 * @uses apply_filters() Calls 'login_message' on the message to display in the
 *        header.
 * @uses $error The error global, which is checked for displaying errors.
 *
 * @param string $title Optional. WordPress Log In Page title to display in
 *        <title/> element.
 * @param string $message Optional. Message to display in header.
 * @param WP_Error $wp_error Optional. WordPress Error Object
 */
function login_header($title = 'Log In', $message = '', $wp_error = '') {
    global $error, $is_iphone, $interim_login, $current_site;

    // Don't index any of these forms
    add_filter( 'pre_option_blog_public', '__return_zero' );
    add_action( 'login_head', 'noindex' );

    if ( empty($wp_error) )
        $wp_error = new WP_Error();

    // Shake it!
    $shake_error_codes = array( 'empty_password', 'empty_email', 'invalid_email', 'invalidcombo', 'empty_username', 'invalid_username', 'incorrect_password' );
    $shake_error_codes = apply_filters( 'shake_error_codes', $shake_error_codes );

    if ( $shake_error_codes && $wp_error->get_error_code() && in_array( $wp_error->get_error_code(), $shake_error_codes ) )
        add_action( 'login_head', 'wp_shake_js', 12 );

    ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head>
    <title><?php bloginfo('name'); ?> &rsaquo; <?php echo $title; ?></title>
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<?php
    wp_admin_css( 'login', true );
    wp_admin_css( 'colors-fresh', true );

    if ( $is_iphone ) { ?>
    <meta name="viewport" content="width=320; initial-scale=0.9; maximum-scale=1.0; user-scalable=0;" />
    <style type="text/css" media="screen">
    form { margin-left: 0px; }
    #login { margin-top: 20px; }
    </style>
<?php
    } elseif ( isset($interim_login) && $interim_login ) { ?>
    <style type="text/css" media="all">
    .login #login { margin: 20px auto; }
    </style>
<?php
    }

    do_action('login_head'); ?>
</head>
<body class="login">
<?php   if ( !is_multisite() ) { ?>
<div id="login"><h1><a href="<?php echo apply_filters('login_headerurl', 'http://wordpress.org/'); ?>" title="<?php echo apply_filters('login_headertitle', __('Powered by WordPress')); ?>"><?php bloginfo('name'); ?></a></h1>
<?php   } else { ?>
<div id="login"><h1><a href="<?php echo apply_filters('login_headerurl', network_home_url() ); ?>" title="<?php echo apply_filters('login_headertitle', $current_site->site_name ); ?>"><span class="hide"><?php bloginfo('name'); ?></span></a></h1>
<?php   }

    $message = apply_filters('login_message', $message);
    if ( !empty( $message ) ) echo $message . "\n";

    // Incase a plugin uses $error rather than the $errors object
    if ( !empty( $error ) ) {
        $wp_error->add('error', $error);
        unset($error);
    }

    if ( $wp_error->get_error_code() ) {
        $errors = '';
        $messages = '';
        foreach ( $wp_error->get_error_codes() as $code ) {
            $severity = $wp_error->get_error_data($code);
            foreach ( $wp_error->get_error_messages($code) as $error ) {
                if ( 'message' == $severity )
                    $messages .= '    ' . $error . "<br />\n";
                else
                    $errors .= '    ' . $error . "<br />\n";
            }
        }
        if ( !empty($errors) )
            echo '<div id="login_error">' . apply_filters('login_errors', $errors) . "</div>\n";
        if ( !empty($messages) )
            echo '<p class="message">' . apply_filters('login_messages', $messages) . "</p>\n";
    }
} // End of login_header()
function wp_shake_js() {
    global $is_iphone;
    if ( $is_iphone )
        return;
?>
<script type="text/javascript">
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
function s(id,pos){g(id).left=pos+'px';}
function g(id){return document.getElementById(id).style;}
function shake(id,a,d){c=a.shift();s(id,c);if(a.length>0){setTimeout(function(){shake(id,a,d);},d);}else{try{g(id).position='static';wp_attempt_focus();}catch(e){}}}
addLoadEvent(function(){ var p=new Array(15,30,15,0,-15,-30,-15,0);p=p.concat(p.concat(p));var i=document.forms[0].id;g(i).position='relative';shake(i,p,20);});
</script>
<?php
}

/**
 * Handles sending password retrieval email to user.
 *
 * @uses $wpdb WordPress Database object
 *
 * @return bool|WP_Error True: when finish. WP_Error on error
 */
function retrieve_password() {
    global $wpdb, $current_site;

    $errors = new WP_Error();

    if ( empty( $_POST['user_login'] ) && empty( $_POST['user_email'] ) )
        $errors->add('empty_username', __('<strong>ERROR</strong>: Enter a username or e-mail address.'));

    if ( strpos($_POST['user_login'], '@') ) {
        $user_data = get_user_by_email(trim($_POST['user_login']));
        if ( empty($user_data) )
            $errors->add('invalid_email', __('<strong>ERROR</strong>: There is no user registered with that email address.'));
    } else {
        $login = trim($_POST['user_login']);
        $user_data = get_userdatabylogin($login);
    }

    do_action('lostpassword_post');

    if ( $errors->get_error_code() )
        return $errors;

    if ( !$user_data ) {
        $errors->add('invalidcombo', __('<strong>ERROR</strong>: Invalid username or e-mail.'));
        return $errors;
    }

    // redefining user_login ensures we return the right case in the email
    $user_login = $user_data->user_login;
    $user_email = $user_data->user_email;

    do_action('retreive_password', $user_login);  // Misspelled and deprecated
    do_action('retrieve_password', $user_login);

    $allow = apply_filters('allow_password_reset', true, $user_data->ID);

    if ( ! $allow )
        return new WP_Error('no_password_reset', __('Password reset is not allowed for this user'));
    else if ( is_wp_error($allow) )
        return $allow;

    $key = $wpdb->get_var($wpdb->prepare("SELECT user_activation_key FROM $wpdb->users WHERE user_login = %s", $user_login));
    if ( empty($key) ) {
        // Generate something random for a key...
        $key = wp_generate_password(20, false);
        do_action('retrieve_password_key', $user_login, $key);
        // Now insert the new md5 key into the db
        $wpdb->update($wpdb->users, array('user_activation_key' => $key), array('user_login' => $user_login));
    }
    $message = __('Someone has asked to reset the password for the following site and username.') . "\r\n\r\n";
    $message .= network_site_url() . "\r\n\r\n";
    $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
    $message .= __('To reset your password visit the following address, otherwise just ignore this email and nothing will happen.') . "\r\n\r\n";
    $message .= network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . "\r\n";

    if ( is_multisite() )
        $blogname = $GLOBALS['current_site']->site_name;
    else
        // The blogname option is escaped with esc_html on the way into the database in sanitize_option
        // we want to reverse this for the plain text arena of emails.
        $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);

    $title = sprintf( __('[%s] Password Reset'), $blogname );

    $title = apply_filters('retrieve_password_title', $title);
    $message = apply_filters('retrieve_password_message', $message, $key);

    if ( $message && !wp_mail($user_email, $title, $message) )
        wp_die( __('The e-mail could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function...') );

    return true;
}

/**
 * Handles resetting the user's password.
 *
 * @uses $wpdb WordPress Database object
 *
 * @param string $key Hash to validate sending user's password
 * @return bool|WP_Error
 */
function reset_password($key, $login) {
    global $wpdb;

    $key = preg_replace('/[^a-z0-9]/i', '', $key);

    if ( empty( $key ) || !is_string( $key ) )
        return new WP_Error('invalid_key', __('Invalid key'));

    if ( empty($login) || !is_string($login) )
        return new WP_Error('invalid_key', __('Invalid key'));

    $user = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->users WHERE user_activation_key = %s AND user_login = %s", $key, $login));
    if ( empty( $user ) )
        return new WP_Error('invalid_key', __('Invalid key'));

    // Generate something random for a password...
    $new_pass = wp_generate_password();

    do_action('password_reset', $user, $new_pass);

    wp_set_password($new_pass, $user->ID);
    update_user_option($user->ID, 'default_password_nag', true, true); //Set up the Password change nag.
    $message  = sprintf(__('Username: %s'), $user->user_login) . "\r\n";
    $message .= sprintf(__('Password: %s'), $new_pass) . "\r\n";
    $message .= site_url('wp-login.php', 'login') . "\r\n";

    if ( is_multisite() )
        $blogname = $GLOBALS['current_site']->site_name;
    else
        // The blogname option is escaped with esc_html on the way into the database in sanitize_option
        // we want to reverse this for the plain text arena of emails.
        $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);

    $title = sprintf( __('[%s] Your new password'), $blogname );

    $title = apply_filters('password_reset_title', $title);
    $message = apply_filters('password_reset_message', $message, $new_pass);

    if ( $message && !wp_mail($user->user_email, $title, $message) )
          wp_die( __('The e-mail could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function...') );

    wp_password_change_notification($user);

    return true;
}

/**
 * Handles registering a new user.
 *
 * @param string $user_login User's username for logging in
 * @param string $user_email User's email address to send password and add
 * @return int|WP_Error Either user's ID or error on failure.
 */
function register_new_user( $user_login, $user_email ) {
    $errors = new WP_Error();

    $sanitized_user_login = sanitize_user( $user_login );
    $user_email = apply_filters( 'user_registration_email', $user_email );

    // Check the username
    if ( $sanitized_user_login == '' ) {
        $errors->add( 'empty_username', __( '<strong>ERROR</strong>: Please enter a username.' ) );
    } elseif ( ! validate_username( $user_login ) ) {
        $errors->add( 'invalid_username', __( '<strong>ERROR</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) );
        $sanitized_user_login = '';
    } elseif ( username_exists( $sanitized_user_login ) ) {
        $errors->add( 'username_exists', __( '<strong>ERROR</strong>: This username is already registered, please choose another one.' ) );
    }

    // Check the e-mail address
    if ( $user_email == '' ) {
        $errors->add( 'empty_email', __( '<strong>ERROR</strong>: Please type your e-mail address.' ) );
    } elseif ( ! is_email( $user_email ) ) {
        $errors->add( 'invalid_email', __( '<strong>ERROR</strong>: The email address isn&#8217;t correct.' ) );
        $user_email = '';
    } elseif ( email_exists( $user_email ) ) {
        $errors->add( 'email_exists', __( '<strong>ERROR</strong>: This email is already registered, please choose another one.' ) );
    }

    do_action( 'register_post', $sanitized_user_login, $user_email, $errors );

    $errors = apply_filters( 'registration_errors', $errors, $sanitized_user_login, $user_email );

    if ( $errors->get_error_code() )
        return $errors;

    $user_pass = wp_generate_password();
    $user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email );
    if ( ! $user_id ) {
        $errors->add( 'registerfail', sprintf( __( '<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a href="mailto:%s">webmaster</a> !' ), get_option( 'admin_email' ) ) );
        return $errors;
    }

    update_user_option( $user_id, 'default_password_nag', true, true ); //Set up the Password change nag.

    wp_new_user_notification( $user_id, $user_pass );

    return $user_id;
}

//
// Main
//

$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'login';
$errors = new WP_Error();

if ( isset($_GET['key']) )
    $action = 'resetpass';

// validate action so as to default to the login screen
if ( !in_array($action, array('logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login'), true) && false === has_filter('login_form_' . $action) )
    $action = 'login';

nocache_headers();

header('Content-Type: '.get_bloginfo('html_type').'; charset='.get_bloginfo('charset'));

if ( defined('RELOCATE') ) { // Move flag is set
    if ( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF']) )
        $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] );

    $schema = is_ssl() ? 'https://' : 'http://';
    if ( dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != get_option('siteurl') )
        update_option('siteurl', dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) );
}

//Set a cookie now to see if they are supported by the browser.
setcookie(TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN);
if ( SITECOOKIEPATH != COOKIEPATH )
    setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN);

// allow plugins to override the default actions, and to add extra actions if they want
do_action('login_form_' . $action);

$http_post = ('POST' == $_SERVER['REQUEST_METHOD']);
switch ($action) {

case 'logout' :
    check_admin_referer('log-out');
    wp_logout();

    $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : 'wp-login.php?loggedout=true';
    wp_safe_redirect( $redirect_to );
    exit();

break;

case 'lostpassword' :
case 'retrievepassword' :
    if ( $http_post ) {
        $errors = retrieve_password();
        if ( !is_wp_error($errors) ) {
            $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : 'wp-login.php?checkemail=confirm';
            wp_safe_redirect( $redirect_to );
            exit();
        }
    }

    if ( isset($_GET['error']) && 'invalidkey' == $_GET['error'] ) $errors->add('invalidkey', __('Sorry, that key does not appear to be valid.'));
    $redirect_to = apply_filters( 'lostpassword_redirect', !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '' );

    do_action('lost_password');
    login_header(__('Lost Password'), '<p class="message">' . __('Please enter your username or e-mail address. You will receive a new password via e-mail.') . '</p>', $errors);

    $user_login = isset($_POST['user_login']) ? stripslashes($_POST['user_login']) : '';

?>

<form name="lostpasswordform" id="lostpasswordform" action="<?php echo site_url('wp-login.php?action=lostpassword', 'login_post') ?>" method="post">
    <p>
        <label><?php _e('Username or E-mail:') ?><br />
        <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr($user_login); ?>" size="20" tabindex="10" /></label>
    </p>
<?php do_action('lostpassword_form'); ?>
    <input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
    <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Get New Password'); ?>" tabindex="100" /></p>
</form>

<p id="nav">
<?php if (get_option('users_can_register')) : ?>
<a href="<?php echo site_url('wp-login.php', 'login') ?>"><?php _e('Log in') ?></a> |
<a href="<?php echo site_url('wp-login.php?action=register', 'login') ?>"><?php _e('Register') ?></a>
<?php else : ?>
<a href="<?php echo site_url('wp-login.php', 'login') ?>"><?php _e('Log in') ?></a>
<?php endif; ?>
</p>

</div>

<p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('&larr; Back to %s'), get_bloginfo('title', 'display' )); ?></a></p>

<script type="text/javascript">
try{document.getElementById('user_login').focus();}catch(e){}
if(typeof wpOnload=='function')wpOnload();
</script>
</body>
</html>
<?php
break;

case 'resetpass' :
case 'rp' :
    $errors = reset_password($_GET['key'], $_GET['login']);

    if ( ! is_wp_error($errors) ) {
        wp_redirect('wp-login.php?checkemail=newpass');
        exit();
    }

    wp_redirect('wp-login.php?action=lostpassword&error=invalidkey');
    exit();

break;

case 'register' :
    if ( is_multisite() ) {
        // Multisite uses wp-signup.php
        wp_redirect( apply_filters( 'wp_signup_location', get_bloginfo('wpurl') . '/wp-signup.php' ) );
        exit;
    }

    if ( !get_option('users_can_register') ) {
        wp_redirect('wp-login.php?registration=disabled');
        exit();
    }

    $user_login = '';
    $user_email = '';
    if ( $http_post ) {
        require_once( ABSPATH . WPINC . '/registration.php');

        $user_login = $_POST['user_login'];
        $user_email = $_POST['user_email'];
        $errors = register_new_user($user_login, $user_email);
        if ( !is_wp_error($errors) ) {
            $redirect_to = !empty( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : 'wp-login.php?checkemail=registered';
            wp_safe_redirect( $redirect_to );
            exit();
        }
    }

    $redirect_to = apply_filters( 'registration_redirect', !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '' );
    login_header(__('Registration Form'), '<p class="message register">' . __('Register For This Site') . '</p>', $errors);
?>

<form name="registerform" id="registerform" action="<?php echo site_url('wp-login.php?action=register', 'login_post') ?>" method="post">
    <p>
        <label><?php _e('Username') ?><br />
        <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr(stripslashes($user_login)); ?>" size="20" tabindex="10" /></label>
    </p>
    <p>
        <label><?php _e('E-mail') ?><br />
        <input type="text" name="user_email" id="user_email" class="input" value="<?php echo esc_attr(stripslashes($user_email)); ?>" size="25" tabindex="20" /></label>
    </p>
<?php do_action('register_form'); ?>
    <p id="reg_passmail"><?php _e('A password will be e-mailed to you.') ?></p>
    <br class="clear" />
    <input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
    <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Register'); ?>" tabindex="100" /></p>
</form>

<p id="nav">
<a href="<?php echo site_url('wp-login.php', 'login') ?>"><?php _e('Log in') ?></a> |
<a href="<?php echo site_url('wp-login.php?action=lostpassword', 'login') ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>
</p>

</div>

<p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('&larr; Back to %s'), get_bloginfo('title', 'display' )); ?></a></p>

<script type="text/javascript">
try{document.getElementById('user_login').focus();}catch(e){}
if(typeof wpOnload=='function')wpOnload();
</script>
</body>
</html>
<?php
break;

case 'login' :
default:
    $secure_cookie = '';
    $interim_login = isset($_REQUEST['interim-login']);

    // If the user wants ssl but the session is not ssl, force a secure cookie.
    if ( !empty($_POST['log']) && !force_ssl_admin() ) {
        $user_name = sanitize_user($_POST['log']);
        if ( $user = get_userdatabylogin($user_name) ) {
            if ( get_user_option('use_ssl', $user->ID) ) {
                $secure_cookie = true;
                force_ssl_admin(true);
            }
        }
    }

    if ( isset( $_REQUEST['redirect_to'] ) ) {
        $redirect_to = $_REQUEST['redirect_to'];
        // Redirect to https if user wants ssl
        if ( $secure_cookie && false !== strpos($redirect_to, 'wp-admin') )
            $redirect_to = preg_replace('|^http://|', 'https://', $redirect_to);
    } else {
        $redirect_to = admin_url();
    }

    $reauth = empty($_REQUEST['reauth']) ? false : true;

    // If the user was redirected to a secure login form from a non-secure admin page, and secure login is required but secure admin is not, then don't use a secure
    // cookie and redirect back to the referring non-secure admin page.  This allows logins to always be POSTed over SSL while allowing the user to choose visiting
    // the admin via http or https.
    if ( !$secure_cookie && is_ssl() && force_ssl_login() && !force_ssl_admin() && ( 0 !== strpos($redirect_to, 'https') ) && ( 0 === strpos($redirect_to, 'http') ) )
        $secure_cookie = false;

    $user = wp_signon('', $secure_cookie);

    $redirect_to = apply_filters('login_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user);

    if ( !is_wp_error($user) && !$reauth ) {
        if ( $interim_login ) {
            $message = '<p class="message">' . __('You have logged in successfully.') . '</p>';
            login_header( '', $message ); ?>
            <script type="text/javascript">setTimeout( function(){window.close()}, 8000);</script>
            <p class="alignright">
            <input type="button" class="button-primary" value="<?php esc_attr_e('Close'); ?>" onclick="window.close()" /></p>
            </div></body></html>
<?php        exit;
        }
        // If the user can't edit posts, send them to their profile.
        if ( !$user->has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) )
            $redirect_to = admin_url('profile.php');
        wp_safe_redirect($redirect_to);
        exit();
    }

    $errors = $user;
    // Clear errors if loggedout is set.
    if ( !empty($_GET['loggedout']) || $reauth )
        $errors = new WP_Error();

    // If cookies are disabled we can't log in even with a valid user+pass
    if ( isset($_POST['testcookie']) && empty($_COOKIE[TEST_COOKIE]) )
        $errors->add('test_cookie', __("<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href='http://www.google.com/cookies.html'>enable cookies</a> to use WordPress."));

    // Some parts of this script use the main login form to display a message
    if        ( isset($_GET['loggedout']) && TRUE == $_GET['loggedout'] )
        $errors->add('loggedout', __('You are now logged out.'), 'message');
    elseif    ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] )
        $errors->add('registerdisabled', __('User registration is currently not allowed.'));
    elseif    ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] )
        $errors->add('confirm', __('Check your e-mail for the confirmation link.'), 'message');
    elseif    ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] )
        $errors->add('newpass', __('Check your e-mail for your new password.'), 'message');
    elseif    ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] )
        $errors->add('registered', __('Registration complete. Please check your e-mail.'), 'message');
    elseif    ( $interim_login )
        $errors->add('expired', __('Your session has expired. Please log-in again.'), 'message');

    // Clear any stale cookies.
    if ( $reauth )
        wp_clear_auth_cookie();

    login_header(__('Log In'), '', $errors);

    if ( isset($_POST['log']) )
        $user_login = ( 'incorrect_password' == $errors->get_error_code() || 'empty_password' == $errors->get_error_code() ) ? esc_attr(stripslashes($_POST['log'])) : '';
    $rememberme = ! empty( $_POST['rememberme'] );
?>

<form name="loginform" id="loginform" action="<?php echo site_url('wp-login.php', 'login_post') ?>" method="post">
    <p>
        <label><?php _e('Username') ?><br />
        <input type="text" name="log" id="user_login" class="input" value="<?php echo esc_attr($user_login); ?>" size="20" tabindex="10" /></label>
    </p>
    <p>
        <label><?php _e('Password') ?><br />
        <input type="password" name="pwd" id="user_pass" class="input" value="" size="20" tabindex="20" /></label>
    </p>
<?php do_action('login_form'); ?>
    <p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90"<?php checked( $rememberme ); ?> /> <?php esc_attr_e('Remember Me'); ?></label></p>
    <p class="submit">
        <input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Log In'); ?>" tabindex="100" />
<?php    if ( $interim_login ) { ?>
        <input type="hidden" name="interim-login" value="1" />
<?php    } else { ?>
        <input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>" />
<?php     } ?>
        <input type="hidden" name="testcookie" value="1" />
    </p>
</form>

<?php if ( !$interim_login ) { ?>
<p id="nav">
<?php if ( isset($_GET['checkemail']) && in_array( $_GET['checkemail'], array('confirm', 'newpass') ) ) : ?>
<?php elseif ( get_option('users_can_register') ) : ?>
<a href="<?php echo site_url('wp-login.php?action=register', 'login') ?>"><?php _e('Register') ?></a> |
<a href="<?php echo site_url('wp-login.php?action=lostpassword', 'login') ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>
<?php else : ?>
<a href="<?php echo site_url('wp-login.php?action=lostpassword', 'login') ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>
<?php endif; ?>
</p>
</div>
<p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('&larr; Back to %s'), get_bloginfo('title', 'display' )); ?></a></p>
<?php } else { ?>
</div>
<?php } ?>

<script type="text/javascript">
function wp_attempt_focus(){
setTimeout( function(){ try{
<?php if ( $user_login || $interim_login ) { ?>
d = document.getElementById('user_pass');
<?php } else { ?>
d = document.getElementById('user_login');
<?php } ?>
d.value = '';
d.focus();
} catch(e){}
}, 200);
}

<?php if ( !$error ) { ?>
wp_attempt_focus();
<?php } ?>
if(typeof wpOnload=='function')wpOnload();
</script>
</body>
</html>
<?php

break;
} // end action switch
?>

Untitled PHP (27-Aug @ 09:58)

Syntax Highlighted Code

  1. <?php
  2.  
  3. /**
  4.  * WordPress User Page
  5. [649 more lines...]

Plain Code

<?php

/**
 * WordPress User Page
 *
 * Handles authentication, registering, resetting passwords, forgot password,
 * and other user handling.
 *
 * @package WordPress
 */

/** Make sure that the WordPress bootstrap has run before continuing. */
require( dirname(__FILE__) . '/wp-load.php' );

// Redirect to https login if forced to use SSL
if ( force_ssl_admin() && !is_ssl() ) {
    if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) {
        wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI']));
        exit();
    } else {
        wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
        exit();
    }
}

/**
 * Outputs the header for the login page.
 *
 * @uses do_action() Calls the 'login_head' for outputting HTML in the Log In
 *        header.
 * @uses apply_filters() Calls 'login_headerurl' for the top login link.
 * @uses apply_filters() Calls 'login_headertitle' for the top login title.
 * @uses apply_filters() Calls 'login_message' on the message to display in the
 *        header.
 * @uses $error The error global, which is checked for displaying errors.
 *
 * @param string $title Optional. WordPress Log In Page title to display in
 *        <title/> element.
 * @param string $message Optional. Message to display in header.
 * @param WP_Error $wp_error Optional. WordPress Error Object
 */
function login_header($title = 'Log In', $message = '', $wp_error = '') {
    global $error, $is_iphone, $interim_login, $current_site;

    // Don't index any of these forms
    add_filter( 'pre_option_blog_public', '__return_zero' );
    add_action( 'login_head', 'noindex' );

    if ( empty($wp_error) )
        $wp_error = new WP_Error();

    // Shake it!
    $shake_error_codes = array( 'empty_password', 'empty_email', 'invalid_email', 'invalidcombo', 'empty_username', 'invalid_username', 'incorrect_password' );
    $shake_error_codes = apply_filters( 'shake_error_codes', $shake_error_codes );

    if ( $shake_error_codes && $wp_error->get_error_code() && in_array( $wp_error->get_error_code(), $shake_error_codes ) )
        add_action( 'login_head', 'wp_shake_js', 12 );

    ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head>
    <title><?php bloginfo('name'); ?> &rsaquo; <?php echo $title; ?></title>
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<?php
    wp_admin_css( 'login', true );
    wp_admin_css( 'colors-fresh', true );

    if ( $is_iphone ) { ?>
    <meta name="viewport" content="width=320; initial-scale=0.9; maximum-scale=1.0; user-scalable=0;" />
    <style type="text/css" media="screen">
    form { margin-left: 0px; }
    #login { margin-top: 20px; }
    </style>
<?php
    } elseif ( isset($interim_login) && $interim_login ) { ?>
    <style type="text/css" media="all">
    .login #login { margin: 20px auto; }
    </style>
<?php
    }

    do_action('login_head'); ?>
</head>
<body class="login">
<?php   if ( !is_multisite() ) { ?>
<div id="login"><h1><a href="<?php echo apply_filters('login_headerurl', 'http://wordpress.org/'); ?>" title="<?php echo apply_filters('login_headertitle', __('Powered by WordPress')); ?>"><?php bloginfo('name'); ?></a></h1>
<?php   } else { ?>
<div id="login"><h1><a href="<?php echo apply_filters('login_headerurl', network_home_url() ); ?>" title="<?php echo apply_filters('login_headertitle', $current_site->site_name ); ?>"><span class="hide"><?php bloginfo('name'); ?></span></a></h1>
<?php   }

    $message = apply_filters('login_message', $message);
    if ( !empty( $message ) ) echo $message . "\n";

    // Incase a plugin uses $error rather than the $errors object
    if ( !empty( $error ) ) {
        $wp_error->add('error', $error);
        unset($error);
    }

    if ( $wp_error->get_error_code() ) {
        $errors = '';
        $messages = '';
        foreach ( $wp_error->get_error_codes() as $code ) {
            $severity = $wp_error->get_error_data($code);
            foreach ( $wp_error->get_error_messages($code) as $error ) {
                if ( 'message' == $severity )
                    $messages .= '    ' . $error . "<br />\n";
                else
                    $errors .= '    ' . $error . "<br />\n";
            }
        }
        if ( !empty($errors) )
            echo '<div id="login_error">' . apply_filters('login_errors', $errors) . "</div>\n";
        if ( !empty($messages) )
            echo '<p class="message">' . apply_filters('login_messages', $messages) . "</p>\n";
    }
} // End of login_header()
function wp_shake_js() {
    global $is_iphone;
    if ( $is_iphone )
        return;
?>
<script type="text/javascript">
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
function s(id,pos){g(id).left=pos+'px';}
function g(id){return document.getElementById(id).style;}
function shake(id,a,d){c=a.shift();s(id,c);if(a.length>0){setTimeout(function(){shake(id,a,d);},d);}else{try{g(id).position='static';wp_attempt_focus();}catch(e){}}}
addLoadEvent(function(){ var p=new Array(15,30,15,0,-15,-30,-15,0);p=p.concat(p.concat(p));var i=document.forms[0].id;g(i).position='relative';shake(i,p,20);});
</script>
<?php
}

/**
 * Handles sending password retrieval email to user.
 *
 * @uses $wpdb WordPress Database object
 *
 * @return bool|WP_Error True: when finish. WP_Error on error
 */
function retrieve_password() {
    global $wpdb, $current_site;

    $errors = new WP_Error();

    if ( empty( $_POST['user_login'] ) && empty( $_POST['user_email'] ) )
        $errors->add('empty_username', __('<strong>ERROR</strong>: Enter a username or e-mail address.'));

    if ( strpos($_POST['user_login'], '@') ) {
        $user_data = get_user_by_email(trim($_POST['user_login']));
        if ( empty($user_data) )
            $errors->add('invalid_email', __('<strong>ERROR</strong>: There is no user registered with that email address.'));
    } else {
        $login = trim($_POST['user_login']);
        $user_data = get_userdatabylogin($login);
    }

    do_action('lostpassword_post');

    if ( $errors->get_error_code() )
        return $errors;

    if ( !$user_data ) {
        $errors->add('invalidcombo', __('<strong>ERROR</strong>: Invalid username or e-mail.'));
        return $errors;
    }

    // redefining user_login ensures we return the right case in the email
    $user_login = $user_data->user_login;
    $user_email = $user_data->user_email;

    do_action('retreive_password', $user_login);  // Misspelled and deprecated
    do_action('retrieve_password', $user_login);

    $allow = apply_filters('allow_password_reset', true, $user_data->ID);

    if ( ! $allow )
        return new WP_Error('no_password_reset', __('Password reset is not allowed for this user'));
    else if ( is_wp_error($allow) )
        return $allow;

    $key = $wpdb->get_var($wpdb->prepare("SELECT user_activation_key FROM $wpdb->users WHERE user_login = %s", $user_login));
    if ( empty($key) ) {
        // Generate something random for a key...
        $key = wp_generate_password(20, false);
        do_action('retrieve_password_key', $user_login, $key);
        // Now insert the new md5 key into the db
        $wpdb->update($wpdb->users, array('user_activation_key' => $key), array('user_login' => $user_login));
    }
    $message = __('Someone has asked to reset the password for the following site and username.') . "\r\n\r\n";
    $message .= network_site_url() . "\r\n\r\n";
    $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
    $message .= __('To reset your password visit the following address, otherwise just ignore this email and nothing will happen.') . "\r\n\r\n";
    $message .= network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . "\r\n";

    if ( is_multisite() )
        $blogname = $GLOBALS['current_site']->site_name;
    else
        // The blogname option is escaped with esc_html on the way into the database in sanitize_option
        // we want to reverse this for the plain text arena of emails.
        $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);

    $title = sprintf( __('[%s] Password Reset'), $blogname );

    $title = apply_filters('retrieve_password_title', $title);
    $message = apply_filters('retrieve_password_message', $message, $key);

    if ( $message && !wp_mail($user_email, $title, $message) )
        wp_die( __('The e-mail could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function...') );

    return true;
}

/**
 * Handles resetting the user's password.
 *
 * @uses $wpdb WordPress Database object
 *
 * @param string $key Hash to validate sending user's password
 * @return bool|WP_Error
 */
function reset_password($key, $login) {
    global $wpdb;

    $key = preg_replace('/[^a-z0-9]/i', '', $key);

    if ( empty( $key ) || !is_string( $key ) )
        return new WP_Error('invalid_key', __('Invalid key'));

    if ( empty($login) || !is_string($login) )
        return new WP_Error('invalid_key', __('Invalid key'));

    $user = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->users WHERE user_activation_key = %s AND user_login = %s", $key, $login));
    if ( empty( $user ) )
        return new WP_Error('invalid_key', __('Invalid key'));

    // Generate something random for a password...
    $new_pass = wp_generate_password();

    do_action('password_reset', $user, $new_pass);

    wp_set_password($new_pass, $user->ID);
    update_user_option($user->ID, 'default_password_nag', true, true); //Set up the Password change nag.
    $message  = sprintf(__('Username: %s'), $user->user_login) . "\r\n";
    $message .= sprintf(__('Password: %s'), $new_pass) . "\r\n";
    $message .= site_url('wp-login.php', 'login') . "\r\n";

    if ( is_multisite() )
        $blogname = $GLOBALS['current_site']->site_name;
    else
        // The blogname option is escaped with esc_html on the way into the database in sanitize_option
        // we want to reverse this for the plain text arena of emails.
        $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);

    $title = sprintf( __('[%s] Your new password'), $blogname );

    $title = apply_filters('password_reset_title', $title);
    $message = apply_filters('password_reset_message', $message, $new_pass);

    if ( $message && !wp_mail($user->user_email, $title, $message) )
          wp_die( __('The e-mail could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function...') );

    wp_password_change_notification($user);

    return true;
}

/**
 * Handles registering a new user.
 *
 * @param string $user_login User's username for logging in
 * @param string $user_email User's email address to send password and add
 * @return int|WP_Error Either user's ID or error on failure.
 */
function register_new_user( $user_login, $user_email ) {
    $errors = new WP_Error();

    $sanitized_user_login = sanitize_user( $user_login );
    $user_email = apply_filters( 'user_registration_email', $user_email );

    // Check the username
    if ( $sanitized_user_login == '' ) {
        $errors->add( 'empty_username', __( '<strong>ERROR</strong>: Please enter a username.' ) );
    } elseif ( ! validate_username( $user_login ) ) {
        $errors->add( 'invalid_username', __( '<strong>ERROR</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) );
        $sanitized_user_login = '';
    } elseif ( username_exists( $sanitized_user_login ) ) {
        $errors->add( 'username_exists', __( '<strong>ERROR</strong>: This username is already registered, please choose another one.' ) );
    }

    // Check the e-mail address
    if ( $user_email == '' ) {
        $errors->add( 'empty_email', __( '<strong>ERROR</strong>: Please type your e-mail address.' ) );
    } elseif ( ! is_email( $user_email ) ) {
        $errors->add( 'invalid_email', __( '<strong>ERROR</strong>: The email address isn&#8217;t correct.' ) );
        $user_email = '';
    } elseif ( email_exists( $user_email ) ) {
        $errors->add( 'email_exists', __( '<strong>ERROR</strong>: This email is already registered, please choose another one.' ) );
    }

    do_action( 'register_post', $sanitized_user_login, $user_email, $errors );

    $errors = apply_filters( 'registration_errors', $errors, $sanitized_user_login, $user_email );

    if ( $errors->get_error_code() )
        return $errors;

    $user_pass = wp_generate_password();
    $user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email );
    if ( ! $user_id ) {
        $errors->add( 'registerfail', sprintf( __( '<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a href="mailto:%s">webmaster</a> !' ), get_option( 'admin_email' ) ) );
        return $errors;
    }

    update_user_option( $user_id, 'default_password_nag', true, true ); //Set up the Password change nag.

    wp_new_user_notification( $user_id, $user_pass );

    return $user_id;
}

//
// Main
//

$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'login';
$errors = new WP_Error();

if ( isset($_GET['key']) )
    $action = 'resetpass';

// validate action so as to default to the login screen
if ( !in_array($action, array('logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login'), true) && false === has_filter('login_form_' . $action) )
    $action = 'login';

nocache_headers();

header('Content-Type: '.get_bloginfo('html_type').'; charset='.get_bloginfo('charset'));

if ( defined('RELOCATE') ) { // Move flag is set
    if ( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF']) )
        $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] );

    $schema = is_ssl() ? 'https://' : 'http://';
    if ( dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != get_option('siteurl') )
        update_option('siteurl', dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) );
}

//Set a cookie now to see if they are supported by the browser.
setcookie(TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN);
if ( SITECOOKIEPATH != COOKIEPATH )
    setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN);

// allow plugins to override the default actions, and to add extra actions if they want
do_action('login_form_' . $action);

$http_post = ('POST' == $_SERVER['REQUEST_METHOD']);
switch ($action) {

case 'logout' :
    check_admin_referer('log-out');
    wp_logout();

    $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : 'wp-login.php?loggedout=true';
    wp_safe_redirect( $redirect_to );
    exit();

break;

case 'lostpassword' :
case 'retrievepassword' :
    if ( $http_post ) {
        $errors = retrieve_password();
        if ( !is_wp_error($errors) ) {
            $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : 'wp-login.php?checkemail=confirm';
            wp_safe_redirect( $redirect_to );
            exit();
        }
    }

    if ( isset($_GET['error']) && 'invalidkey' == $_GET['error'] ) $errors->add('invalidkey', __('Sorry, that key does not appear to be valid.'));
    $redirect_to = apply_filters( 'lostpassword_redirect', !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '' );

    do_action('lost_password');
    login_header(__('Lost Password'), '<p class="message">' . __('Please enter your username or e-mail address. You will receive a new password via e-mail.') . '</p>', $errors);

    $user_login = isset($_POST['user_login']) ? stripslashes($_POST['user_login']) : '';

?>

<form name="lostpasswordform" id="lostpasswordform" action="<?php echo site_url('wp-login.php?action=lostpassword', 'login_post') ?>" method="post">
    <p>
        <label><?php _e('Username or E-mail:') ?><br />
        <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr($user_login); ?>" size="20" tabindex="10" /></label>
    </p>
<?php do_action('lostpassword_form'); ?>
    <input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
    <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Get New Password'); ?>" tabindex="100" /></p>
</form>

<p id="nav">
<?php if (get_option('users_can_register')) : ?>
<a href="<?php echo site_url('wp-login.php', 'login') ?>"><?php _e('Log in') ?></a> |
<a href="<?php echo site_url('wp-login.php?action=register', 'login') ?>"><?php _e('Register') ?></a>
<?php else : ?>
<a href="<?php echo site_url('wp-login.php', 'login') ?>"><?php _e('Log in') ?></a>
<?php endif; ?>
</p>

</div>

<p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('&larr; Back to %s'), get_bloginfo('title', 'display' )); ?></a></p>

<script type="text/javascript">
try{document.getElementById('user_login').focus();}catch(e){}
if(typeof wpOnload=='function')wpOnload();
</script>
</body>
</html>
<?php
break;

case 'resetpass' :
case 'rp' :
    $errors = reset_password($_GET['key'], $_GET['login']);

    if ( ! is_wp_error($errors) ) {
        wp_redirect('wp-login.php?checkemail=newpass');
        exit();
    }

    wp_redirect('wp-login.php?action=lostpassword&error=invalidkey');
    exit();

break;

case 'register' :
    if ( is_multisite() ) {
        // Multisite uses wp-signup.php
        wp_redirect( apply_filters( 'wp_signup_location', get_bloginfo('wpurl') . '/wp-signup.php' ) );
        exit;
    }

    if ( !get_option('users_can_register') ) {
        wp_redirect('wp-login.php?registration=disabled');
        exit();
    }

    $user_login = '';
    $user_email = '';
    if ( $http_post ) {
        require_once( ABSPATH . WPINC . '/registration.php');

        $user_login = $_POST['user_login'];
        $user_email = $_POST['user_email'];
        $errors = register_new_user($user_login, $user_email);
        if ( !is_wp_error($errors) ) {
            $redirect_to = !empty( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : 'wp-login.php?checkemail=registered';
            wp_safe_redirect( $redirect_to );
            exit();
        }
    }

    $redirect_to = apply_filters( 'registration_redirect', !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '' );
    login_header(__('Registration Form'), '<p class="message register">' . __('Register For This Site') . '</p>', $errors);
?>

<form name="registerform" id="registerform" action="<?php echo site_url('wp-login.php?action=register', 'login_post') ?>" method="post">
    <p>
        <label><?php _e('Username') ?><br />
        <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr(stripslashes($user_login)); ?>" size="20" tabindex="10" /></label>
    </p>
    <p>
        <label><?php _e('E-mail') ?><br />
        <input type="text" name="user_email" id="user_email" class="input" value="<?php echo esc_attr(stripslashes($user_email)); ?>" size="25" tabindex="20" /></label>
    </p>
<?php do_action('register_form'); ?>
    <p id="reg_passmail"><?php _e('A password will be e-mailed to you.') ?></p>
    <br class="clear" />
    <input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
    <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Register'); ?>" tabindex="100" /></p>
</form>

<p id="nav">
<a href="<?php echo site_url('wp-login.php', 'login') ?>"><?php _e('Log in') ?></a> |
<a href="<?php echo site_url('wp-login.php?action=lostpassword', 'login') ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>
</p>

</div>

<p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('&larr; Back to %s'), get_bloginfo('title', 'display' )); ?></a></p>

<script type="text/javascript">
try{document.getElementById('user_login').focus();}catch(e){}
if(typeof wpOnload=='function')wpOnload();
</script>
</body>
</html>
<?php
break;

case 'login' :
default:
    $secure_cookie = '';
    $interim_login = isset($_REQUEST['interim-login']);

    // If the user wants ssl but the session is not ssl, force a secure cookie.
    if ( !empty($_POST['log']) && !force_ssl_admin() ) {
        $user_name = sanitize_user($_POST['log']);
        if ( $user = get_userdatabylogin($user_name) ) {
            if ( get_user_option('use_ssl', $user->ID) ) {
                $secure_cookie = true;
                force_ssl_admin(true);
            }
        }
    }

    if ( isset( $_REQUEST['redirect_to'] ) ) {
        $redirect_to = $_REQUEST['redirect_to'];
        // Redirect to https if user wants ssl
        if ( $secure_cookie && false !== strpos($redirect_to, 'wp-admin') )
            $redirect_to = preg_replace('|^http://|', 'https://', $redirect_to);
    } else {
        $redirect_to = admin_url();
    }

    $reauth = empty($_REQUEST['reauth']) ? false : true;

    // If the user was redirected to a secure login form from a non-secure admin page, and secure login is required but secure admin is not, then don't use a secure
    // cookie and redirect back to the referring non-secure admin page.  This allows logins to always be POSTed over SSL while allowing the user to choose visiting
    // the admin via http or https.
    if ( !$secure_cookie && is_ssl() && force_ssl_login() && !force_ssl_admin() && ( 0 !== strpos($redirect_to, 'https') ) && ( 0 === strpos($redirect_to, 'http') ) )
        $secure_cookie = false;

    $user = wp_signon('', $secure_cookie);

    $redirect_to = apply_filters('login_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user);

    if ( !is_wp_error($user) && !$reauth ) {
        if ( $interim_login ) {
            $message = '<p class="message">' . __('You have logged in successfully.') . '</p>';
            login_header( '', $message ); ?>
            <script type="text/javascript">setTimeout( function(){window.close()}, 8000);</script>
            <p class="alignright">
            <input type="button" class="button-primary" value="<?php esc_attr_e('Close'); ?>" onclick="window.close()" /></p>
            </div></body></html>
<?php        exit;
        }
        // If the user can't edit posts, send them to their profile.
        if ( !$user->has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) )
            $redirect_to = admin_url('profile.php');
        wp_safe_redirect($redirect_to);
        exit();
    }

    $errors = $user;
    // Clear errors if loggedout is set.
    if ( !empty($_GET['loggedout']) || $reauth )
        $errors = new WP_Error();

    // If cookies are disabled we can't log in even with a valid user+pass
    if ( isset($_POST['testcookie']) && empty($_COOKIE[TEST_COOKIE]) )
        $errors->add('test_cookie', __("<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href='http://www.google.com/cookies.html'>enable cookies</a> to use WordPress."));

    // Some parts of this script use the main login form to display a message
    if        ( isset($_GET['loggedout']) && TRUE == $_GET['loggedout'] )
        $errors->add('loggedout', __('You are now logged out.'), 'message');
    elseif    ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] )
        $errors->add('registerdisabled', __('User registration is currently not allowed.'));
    elseif    ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] )
        $errors->add('confirm', __('Check your e-mail for the confirmation link.'), 'message');
    elseif    ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] )
        $errors->add('newpass', __('Check your e-mail for your new password.'), 'message');
    elseif    ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] )
        $errors->add('registered', __('Registration complete. Please check your e-mail.'), 'message');
    elseif    ( $interim_login )
        $errors->add('expired', __('Your session has expired. Please log-in again.'), 'message');

    // Clear any stale cookies.
    if ( $reauth )
        wp_clear_auth_cookie();

    login_header(__('Log In'), '', $errors);

    if ( isset($_POST['log']) )
        $user_login = ( 'incorrect_password' == $errors->get_error_code() || 'empty_password' == $errors->get_error_code() ) ? esc_attr(stripslashes($_POST['log'])) : '';
    $rememberme = ! empty( $_POST['rememberme'] );
?>

<form name="loginform" id="loginform" action="<?php echo site_url('wp-login.php', 'login_post') ?>" method="post">
    <p>
        <label><?php _e('Username') ?><br />
        <input type="text" name="log" id="user_login" class="input" value="<?php echo esc_attr($user_login); ?>" size="20" tabindex="10" /></label>
    </p>
    <p>
        <label><?php _e('Password') ?><br />
        <input type="password" name="pwd" id="user_pass" class="input" value="" size="20" tabindex="20" /></label>
    </p>
<?php do_action('login_form'); ?>
    <p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90"<?php checked( $rememberme ); ?> /> <?php esc_attr_e('Remember Me'); ?></label></p>
    <p class="submit">
        <input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Log In'); ?>" tabindex="100" />
<?php    if ( $interim_login ) { ?>
        <input type="hidden" name="interim-login" value="1" />
<?php    } else { ?>
        <input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>" />
<?php     } ?>
        <input type="hidden" name="testcookie" value="1" />
    </p>
</form>

<?php if ( !$interim_login ) { ?>
<p id="nav">
<?php if ( isset($_GET['checkemail']) && in_array( $_GET['checkemail'], array('confirm', 'newpass') ) ) : ?>
<?php elseif ( get_option('users_can_register') ) : ?>
<a href="<?php echo site_url('wp-login.php?action=register', 'login') ?>"><?php _e('Register') ?></a> |
<a href="<?php echo site_url('wp-login.php?action=lostpassword', 'login') ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>
<?php else : ?>
<a href="<?php echo site_url('wp-login.php?action=lostpassword', 'login') ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>
<?php endif; ?>
</p>
</div>
<p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('&larr; Back to %s'), get_bloginfo('title', 'display' )); ?></a></p>
<?php } else { ?>
</div>
<?php } ?>

<script type="text/javascript">
function wp_attempt_focus(){
setTimeout( function(){ try{
<?php if ( $user_login || $interim_login ) { ?>
d = document.getElementById('user_pass');
<?php } else { ?>
d = document.getElementById('user_login');
<?php } ?>
d.value = '';
d.focus();
} catch(e){}
}, 200);
}

<?php if ( !$error ) { ?>
wp_attempt_focus();
<?php } ?>
if(typeof wpOnload=='function')wpOnload();
</script>
</body>
</html>
<?php

break;
} // end action switch
?>

Untitled PHP (23-Aug @ 19:38)

Syntax Highlighted Code

  1. <?
  2.   echo "hola <br>dos.";
  3. ?>

Plain Code

<?
  echo "hola <br>dos.";
?>

Untitled PHP (23-Jun @ 18:35)

Syntax Highlighted Code

  1. <?php echo "Hello World";?>

Plain Code

<?php echo "Hello World";?>

Untitled PHP (3-Jun @ 12:31)

Syntax Highlighted Code

  1. while($rw=$r->fetch()) {
  2.         //new item
  3.         $rssItem=$channel->addChild('item');
  4.  
  5. [28 more lines...]

Plain Code

while($rw=$r->fetch()) {
        //new item
        $rssItem=$channel->addChild('item');

        //set title
        $rssItem->addChild('title',stripslashes(strip_tags($rw['nume'])));

        if ($type=='stiri') {
            //same link for all news
            $rssItem->addChild('link',$CFG['rss']['stiri']['link']);

            //description
            $rssItem->addChild(
                'description',
                substr(
                    strip_tags(
                        html_entity_decode(
                            stripslashes(
                                str_replace(
                                    array("\n\r","\r\n","\r"),
                                    "\n",
                                    $rw['descr']
                                )
                            ),
                            ENT_QUOTES,
                            'UTF-8'
                        )
                    ),
                    0,
                    $CFG['rss']['common']['textLimit']
                )
            );
        }

groups of 3 or 4 (27-May @ 23:16)

mrgenixus

Syntax Highlighted Code

  1. <?php
  2. for ($i = 1; $i < 50; $i++){
  3.     if ($total != 5 && $total > 2) {
  4.         $fours = ceil($total / 4) - ($threes = ($total % 4) ? (4 - ($total % 4)) : 0);
  5. [59 more lines...]

Plain Code

<?php 
for ($i = 1; $i < 50; $i++){
    if ($total != 5 && $total > 2) { 
        $fours = ceil($total / 4) - ($threes = ($total % 4) ? (4 - ($total % 4)) : 0);
        echo "$i = (4 x $fours) + (3 x $threes); check: " . ((3* $threes) + (4 * $fours)) . "\n";
    }
    else 
    {
        $fours = floor($i / 4); $threes = floor( ($remainder = ($i - (4 * $fours))) / 3);  
        echo "$i: (4x$fours) + (3x$threes) + $remainder = " . (($i == (4 * $fours + 3 * $threes + $remainer )) ? $i : 'invalid') . " : remainer invalid\n";
    }
}
?>
output: 

1: (4x0) + (3x0) + 1 = invalid : remainer invalid
2: (4x0) + (3x0) + 2 = invalid : remainer invalid
3: (4x0) + (3x1) + 0 = 3 : number is divisible by 3 plus 0 fours
4: (4x1) + (3x0) + 0 = 4 : number is divisible by 4 plus 0 threes
5: (4x1) + (3x0) + 1 = invalid : remainer invalid
6: (4x0) + (3x2) + 0 = 6 : number is divisible by 3 plus 0 fours
7: (4x1) + (3x1) + 0 = 7 : number is divisible by 3 plus 1 fours
8: (4x2) + (3x0) + 0 = 8 : number is divisible by 4 plus 0 threes
9: (4x0) + (3x3) + 0 = 9 : number is divisible by 3 plus 0 fours
10: (4x1) + (3x2) + 0 = 10 : number is divisible by 3 plus 1 fours
11: (4x2) + (3x1) + 0 = 11 : number is divisible by 3 plus 2 fours
12: (4x3) + (3x0) + 0 = 12 : number is divisible by 4 plus 0 threes
13: (4x1) + (3x3) + 0 = 13 : number is divisible by 3 plus 1 fours
14: (4x2) + (3x2) + 0 = 14 : number is divisible by 3 plus 2 fours
15: (4x0) + (3x5) + 0 = 15 : number is divisible by 3 plus 0 fours
16: (4x4) + (3x0) + 0 = 16 : number is divisible by 4 plus 0 threes
17: (4x2) + (3x3) + 0 = 17 : number is divisible by 3 plus 2 fours
18: (4x0) + (3x6) + 0 = 18 : number is divisible by 3 plus 0 fours
19: (4x1) + (3x5) + 0 = 19 : number is divisible by 3 plus 1 fours
20: (4x5) + (3x0) + 0 = 20 : number is divisible by 4 plus 0 threes
21: (4x0) + (3x7) + 0 = 21 : number is divisible by 3 plus 0 fours
22: (4x1) + (3x6) + 0 = 22 : number is divisible by 3 plus 1 fours
23: (4x2) + (3x5) + 0 = 23 : number is divisible by 3 plus 2 fours
24: (4x6) + (3x0) + 0 = 24 : number is divisible by 4 plus 0 threes
25: (4x1) + (3x7) + 0 = 25 : number is divisible by 3 plus 1 fours
26: (4x2) + (3x6) + 0 = 26 : number is divisible by 3 plus 2 fours
27: (4x0) + (3x9) + 0 = 27 : number is divisible by 3 plus 0 fours
28: (4x7) + (3x0) + 0 = 28 : number is divisible by 4 plus 0 threes
29: (4x2) + (3x7) + 0 = 29 : number is divisible by 3 plus 2 fours
30: (4x0) + (3x10) + 0 = 30 : number is divisible by 3 plus 0 fours
31: (4x1) + (3x9) + 0 = 31 : number is divisible by 3 plus 1 fours
32: (4x8) + (3x0) + 0 = 32 : number is divisible by 4 plus 0 threes
33: (4x0) + (3x11) + 0 = 33 : number is divisible by 3 plus 0 fours
34: (4x1) + (3x10) + 0 = 34 : number is divisible by 3 plus 1 fours
35: (4x2) + (3x9) + 0 = 35 : number is divisible by 3 plus 2 fours
36: (4x9) + (3x0) + 0 = 36 : number is divisible by 4 plus 0 threes
37: (4x1) + (3x11) + 0 = 37 : number is divisible by 3 plus 1 fours
38: (4x2) + (3x10) + 0 = 38 : number is divisible by 3 plus 2 fours
39: (4x0) + (3x13) + 0 = 39 : number is divisible by 3 plus 0 fours
40: (4x10) + (3x0) + 0 = 40 : number is divisible by 4 plus 0 threes
41: (4x2) + (3x11) + 0 = 41 : number is divisible by 3 plus 2 fours
42: (4x0) + (3x14) + 0 = 42 : number is divisible by 3 plus 0 fours
43: (4x1) + (3x13) + 0 = 43 : number is divisible by 3 plus 1 fours
44: (4x11) + (3x0) + 0 = 44 : number is divisible by 4 plus 0 threes
45: (4x0) + (3x15) + 0 = 45 : number is divisible by 3 plus 0 fours
46: (4x1) + (3x14) + 0 = 46 : number is divisible by 3 plus 1 fours
47: (4x2) + (3x13) + 0 = 47 : number is divisible by 3 plus 2 fours
48: (4x12) + (3x0) + 0 = 48 : number is divisible by 4 plus 0 threes
49: (4x1) + (3x15) + 0 = 49 : number is divisible by 3 plus 1 fours

Untitled PHP (21-May @ 12:42)

Syntax Highlighted Code

  1. echo "Hello World";

Plain Code

echo "Hello World";

Untitled PHP (17-May @ 23:14)

mrgenixus

Syntax Highlighted Code

  1. <?php if(is_front_page() and is_page()):
  2. $thisPage = $post
  3. ?>
  4. <h2>Recent Posts</h2>
  5. [6 more lines...]

Plain Code

<?php if(is_front_page() and is_page()): 
$thisPage = $post
?>
<h2>Recent Posts</h2>
<ul>
<?php foreach(wp_get_recent_posts('numberposts=5') as $post): 
setup_postdata($post); ?>
<li><a href="' .  . '" title="Look ' <?php the_title_attribute(); ?>'" > <?php the_title(); ?></a> </li>
<?php endforeach; ?>
</ul>
<?php endif; ?>

Untitled PHP (14-May @ 13:39)

desbest.myopenid.com

Syntax Highlighted Code

  1. <script type="text/javascript">
  2. $(function() {
  3.    var name = $("#name"),
  4.    email = $("#email"),
  5. [54 more lines...]

Plain Code

<script type="text/javascript">
$(function() {
   var name = $("#name"),
   email = $("#email"),
   password = $("#password"),
   itemid = $("#itemid"), //NEW LINE ADDED
   tips = $(".validateTips");

   $("#dialog-form").dialog({

      autoOpen: false,
      height: 320,
      width: 350,
      modal: true,

      buttons: {

      'Change category': function() {
               
      var bValid = true;
      $('#users tbody').append('<tr>' +
      '<td>' + name.val() + '</td>' + 
      '<td>' + email.val() + '</td>' + 
      '<td>' + password.val() + '</td>' +
      '<td>' + itemid.val() + '</td>' + //NEW LINE ADDED
      '</tr>'); 

      $(this).dialog('close');

      },
      Cancel: function() {
      $(this).dialog('close');
      }
      }
   });

   $('.changecategory')
   .button()
   .click(function() {
      var categoryid = $(this).attr("categoryid");
      var itemid = $(this).attr("itemid");
      var itemid2 = $(this).attr("itemid");
      var itemtitle = $(this).attr("itemtitle");
      var parenttag = $(this).parent().get(0).tagName;
      var removediv = "itemid_" +itemid;
      alert("The itemid is "+itemid); //NEW LINE ADDED

      $('#dialog-form').dialog('option', 'itemid', itemid); // store the id
      $('#dialog-form').dialog('open');




   });

});
</script>

Untitled PHP (6-May @ 03:52)

Syntax Highlighted Code

  1. <?php
  2.  
  3. echo "this is a test of the website";
  4.  
  5. ?>

Plain Code

<?php

echo "this is a test of the website";

?>

sdfs (5-May @ 12:15)

Syntax Highlighted Code

  1. sdfsdfs

Plain Code

sdfsdfs

Untitled PHP (4-May @ 13:53)

Syntax Highlighted Code

  1. <?php
  2.  
  3. echo "hello";
  4.  
  5. ?>

Plain Code

<?php

echo "hello";

?>

Untitled PHP (4-May @ 00:59)

Syntax Highlighted Code

  1. <?
  2. ?>

Plain Code

<?
phpinfo();
?>

Untitled PHP (30-Apr @ 09:25)

Syntax Highlighted Code

  1. dsdfsdfsdfdsfsdfsdf

Plain Code

dsdfsdfsdfdsfsdfsdf

Untitled PHP (30-Apr @ 05:09)

mrgenixus

Syntax Highlighted Code

  1. <?php
  2. $STATES = array("WAIT","SCOPE","CRITERIA","ITEM","QUOTE");
  3. function debug_this($value)
  4. {
  5. [206 more lines...]

Plain Code

<?php
$STATES = array("WAIT","SCOPE","CRITERIA","ITEM","QUOTE");
function debug_this($value)
{
    echo $value;
}
function is_escaped($escape_index,$current_index)
{
    return ($escape_index != -1 && $escape_index == ($current_index - 1));
}
function add_and_reset_scope(&$context, &$scope,&$criteria = array())
{
    if (isset($context[$scope]) && is_array($context[$scope])) $criteria = array_merge($criteria,$context[$scope]);
    $context[$scope] = $criteria;
    $criteria = array();
    $scope = "";
}
function add_new_criteria(&$criteria,$initial_character)
{
    $criteria[] = $initial_character;
    debug_this( "\10\tNEW CRITERIA BEGINS: " . $criteria[count($criteria) - 1] . "\n");
}
function add_to_current_criteria(&$criteria,$value){
    $last = count($criteria) - 1;
    $criteria[$last] .= $value;
    debug_this("\10\tCURRENT: " . $criteria[$last] . "\n");
}
function setState(&$state,$newState,$line = -1) {
    global $STATES; $out = "[$line]: STATE ";
    if(isset($state)) if (isset($STATES[($index = log($state,2))])) $out .= $STATES[$index]. "($state)";
        else $out .=  "\"$state\"";
    else $out .= "NULL";
    $out .= ", CHANGING TO " . $STATES[log($newState,2)] . "($newState)\n";
    debug_this($out);
    $state = $newState;
}
function BBranch($branch,$state,$value,$line = -1)
{
    global $STATES;
    debug_this("[$line] BRANCH {$branch} [" . $STATES[log($state,2)] . "]: $value \n" ); 
}

function parse($str,$default_scope = 'group'){
    //states
    global $STATES;
    
    foreach ($STATES as $INDEX => $STATENAME) { 
        $$STATENAME = pow(2,$INDEX); 
        debug_this($STATENAME . " = " . $$STATENAME . "\n");
    }
    debug_this("\$WAIT = $WAIT\n");
    $ERRORS = array();
    $escape = -1;
    $context = array();
    $criteria = array();
    $quote = $item = $scope = "";
    setState($state,($pre_quote_state = $WAIT),__LINE__);
    $str .= " ";
    foreach (str_split($str) as $index => $value)
    {
        if ($state > $QUOTE) setState($state,$WAIT,__LINE__);
        if(preg_match("/\s/",$value)){
        BBranch('WHITESPACE',$state,$value,__LINE__);
            if($state == $ITEM)
            {
                if (is_escaped($escape,$index)) $item .= $value;
                else {
                    add_to_current_criteria($criteria,"",__LINE__);
                    if(count($scope)) add_and_reset_scope($context,$scope,$criteria);                        
                    setState($state,$WAIT,__LINE__);
                }
            }
            elseif($state == $QUOTE)
            {
                add_to_current_criteria($criteria,$value);
            }
            elseif($state == $SCOPE)
            {
                if($default_scope != ""){
                    add_new_criteria($criteria,$scope);
                    add_and_reset_scope($context,$default_scope,$criteria);
                    setState($state,$WAIT,__LINE__);
                }
                else add_and_reset_scope($context,$scope);
                setState($state,$WAIT,__LINE__);
            }
        }
        elseif(preg_match("/[\:\=]/",$value)) {
            BBranch('EQUIV',$state,$value,__LINE__);
            if($state == $SCOPE && strlen($scope)) {
                //add_and_reset_scope($context,$scope);
                setState($state,$CRITERIA,__LINE__);
            }
            elseif($state & ( $ITEM | $QUOTE )) add_to_current_criteria($criteria,$value);
        }
        elseif(strstr("\\",$value)){
            BBranch('ESCAPE',$state,$value,__LINE__);
            if (! is_escaped($escape,$index)) $escape = $index;
            else {
                if($state & ( $ITEM | $QUOTE )) {
                    add_to_current_criteria($criteria,$value);
                }
                if($state & $CRITERIA)
                {
                    add_new_criteria($criteria,$value);
                    setState($state,$ITEM);
                }
            }
        }
        elseif(strstr(",",$value)){
            BBranch('COMMA',$state,$value,__LINE__); 
            if($state == $ITEM)
            {
                setState($state,$CRITERIA,__LINE__);
            }
            elseif($state == $SCOPE)
            {
                add_new_criteria($criteria,$scope);
                if($default_scope != ""){
                    $scope = $default_scope;
                    setState($state,$CRITERIA,__LINE__);
                }
                else {
                    add_and_reset_scope($context,$scope = null,$criteria);
                    $ERRORS[] = "UNEXPECTED T_COMMA ENCOUNTERED <INDEX: $Index>";
                    setState($state,$WAIT,__LINE__);
                }
            }
            elseif($state & ( $CRITERIA | $WAIT)) $ERRORS[] = "UNEXPECTED T_COMMA ENCOUNTERED <INDEX: $Index>";
            
        }
        elseif(preg_match("/[\"']/",$value)){
            BBranch('QUOTE',$state,$value,__LINE__);
            
            if($state == $QUOTE){
                debug_this("IS QUOTE ESCAPED: " . ((is_escaped($escape,$index)) ? "YES" : "NO") . "\n");
                if ($value == $quote && !is_escaped($escape,$index))
                {
                    
                    setState($state,$pre_quote_state,__LINE__);
                    $quote = "";
                }
                elseif($pre_quote_state & ( $CRITERIA | $ITEM))
                {
                    add_to_current_criteria($criteria,$value);
                }
                elseif($pre_quote_state & ( $WAIT | $SCOPE ))
                {
                    $scope .= $value;
                }
            }
            elseif($state & ( $WAIT | $CRITERIA ))
            {
                $pre_quote_state = $state;
                $quote = $value;
                setState($state,$QUOTE,__LINE__);
            }
        }
        else {
            BBranch('WORD',$state,$value,__LINE__);
            if($state == $WAIT) {
                
                setState($state,$SCOPE,__LINE__);
                $scope = $value;
            }
            elseif($state == $SCOPE) $scope .= $value;
            elseif ($state == $CRITERIA)
            {
                setState($state,$ITEM,__LINE__);
                add_new_criteria($criteria,$value);
            }
            elseif ($state == $ITEM) add_to_current_criteria($criteria,$value);
            elseif($state == $QUOTE){
                
                if($pre_quote_state == $WAIT){
                    
                    $pre_quote_state = $SCOPE;
                    $scope = $value;
                }
                elseif($pre_quote_state == $CRITERIA) {
                    
                    $pre_quote_state = $ITEM;
                    add_new_criteria($criteria,$value);
                }
                else
                {
                    add_to_current_criteria($criteria,$value);
                }
            }
                
        }
    }
    return $context;
}
function interpret($arr){
    $str = "";
    $str = print_r($arr,true);
    return $str;
}

$strs = array(
    "file:hello.fa start:0 end:1322251",
    "file:hello.fa group:\"wild dogs\"",
    "file:hello.fa group:\"12 angry men\" group:\"11 'angry' men\"",
    "file:hello.fa group:\"12 angry men\",\"11 \\\"angry\\\" men\""

);
foreach ($strs as $search){
    echo $search . ":\n " . str_replace("\n", "\n\t", interpret(parse($search))). "\n";
}

Untitled PHP (29-Apr @ 09:13)

Syntax Highlighted Code

  1. <?php echo 'hola'; ?>

Plain Code

<?php echo 'hola'; ?>

Untitled PHP (29-Apr @ 08:27)

Syntax Highlighted Code

  1. <?php
  2.  
  3.  
  4. echo "hello world";
  5. [1 more lines...]

Plain Code

<?php


echo "hello world";

?>

Untitled PHP (29-Apr @ 04:43)

Syntax Highlighted Code

  1. hellp

Plain Code

hellp

Untitled PHP (29-Apr @ 04:07)

mrgenixus

Syntax Highlighted Code

  1. <?php
  2.  
  3. function myTestFunction($hasDefaultParamters = true)
  4. {
  5. [47 more lines...]

Plain Code

<?php 

function myTestFunction($hasDefaultParamters = true)
{
    echo "Start\n";
    echo "num args: " . ($num = func_num_args()). "\n";
    
    if($num)
    {
        print_r(func_get_args());
    }
    echo "End\n";
}

myTestFunction("hello","world");
myTestFunction();

/*
output:
Start
num args: 2
Array
(
    [0] => hello
    [1] => world
)
End
Start
num args: 0
End
*/

function authenticate($u = null,$p = null,$redirect = 0){
        if ($numArgs = func_num_args() > 0){
            
            if($numArgs >= 2) {
                if($authID = User::__validCredentials($u,$p) {
            
                    $this->session->set_userdata(array('user_id'=>$authID));
                    return $authID;
                }
                else if ($redirect) {
                    
                    redirect('/login');
                    die("Redirecting...");
                }
            }
        }
        
        return 0;
        
    }

Untitled PHP (26-Apr @ 18:34)

Syntax Highlighted Code

  1. <?php
  2. echo 'hello';
  3. ?>

Plain Code

<?php
echo 'hello';
?>

Untitled PHP (26-Apr @ 11:24)

Syntax Highlighted Code

  1. <?
  2. echo ('Hello Word');
  3. ?>

Plain Code

<?
echo ('Hello Word');
?>

Untitled PHP (26-Apr @ 01:42)

Syntax Highlighted Code

  1. ggfdg

Plain Code

ggfdg

Untitled PHP (23-Apr @ 08:38)

Syntax Highlighted Code

  1. <?
  2. ?>

Plain Code

<?
echo phpinfo();
?>

Untitled PHP (22-Apr @ 16:16)

Syntax Highlighted Code

  1. 123

Plain Code

123

Untitled PHP (22-Apr @ 14:30)

Syntax Highlighted Code

  1. echo "what";

Plain Code

echo "what";

Untitled PHP (22-Apr @ 02:06)

Syntax Highlighted Code

  1. Fever Mania Essa onda vai te pegar pelo dedo

Plain Code

Fever Mania Essa onda vai te pegar pelo dedo

Untitled PHP (21-Apr @ 10:26)

Syntax Highlighted Code

  1. efawef

Plain Code

efawef

Untitled PHP (20-Apr @ 21:24)

Syntax Highlighted Code

  1. /**
  2.  * Redimencionar proporcionalmente
  3.  * @param
  4.  * @return void
  5. [35 more lines...]

Plain Code

/**
 * Redimencionar proporcionalmente
 * @param
 * @return void
*/
private function resizeRatio()
{
    // verifica se a imagem é maior do que o tamanho que deseja redimencionar 
    if($this->largura > $this->nova_largura || $this->altura > $this->nova_altura)
    {
        // Se a altura foi maior que a largura ele calcula com base na altura e a largura fica proporcional
        if ($this->altura > $this->largura)
        {
            $this->nova_largura    = $this->largura / ($this->altura / $this->nova_altura);
        }
        // Se a largura for maior que a altura, calcula com  base na largura e a altura fica proporcional
        elseif ($this->largura > $this->altura)
        {
            $this->nova_altura    = $this->altura / ($this->largura / $this->nova_largura);
        }
        // Se a largura for do mesmo tamanho da altura dominui as duas
        else
        {
            $this->nova_largura = $this->largura / ($this->largura / $this->nova_largura);
            $this->nova_altur    = $this->altura / ($this->altura / $this->nova_altura);
        }
    }
    // Se a imagem tiver a altura e a largura menor que o informado ele não redimensiona
    else
    {
        $this->nova_largura     = $this->largura;
        $this->nova_altura        = $this->altura;
    }
    // cria imagem de destino temporária
    $this->img_temp    = imagecreatetruecolor( $this->nova_largura, $this->nova_altura );
    
    imagecopyresampled( $this->img_temp, $this->img, 0, 0, 0, 0, $this->nova_largura, $this->nova_altura, $this->largura, $this->altura );
    $this->img    = $this->img_temp;
}

Untitled PHP (20-Apr @ 19:18)

Syntax Highlighted Code

  1. csz

Plain Code

csz

Untitled PHP (19-Apr @ 14:46)

Syntax Highlighted Code

  1. <?php
  2. echo "eu";
  3. ?>

Plain Code

<?php
echo "eu";
?>

Untitled PHP (19-Apr @ 10:51)

Syntax Highlighted Code

  1. <?php
  2. echo "hello word";
  3. ?>

Plain Code

<?php
echo "hello word";
?>

Untitled PHP (17-Apr @ 13:10)

Syntax Highlighted Code

  1. $tablo = mysql_query("select MAX(tourID) as id from tours");
  2. $a = mysql_fetch_assoc($tablo);
  3.  

Plain Code

$tablo = mysql_query("select MAX(tourID) as id from tours"); 
$a = mysql_fetch_assoc($tablo);

Untitled PHP (16-Apr @ 03:09)

Syntax Highlighted Code

  1. <?
  2. echo "this";
  3. ?>

Plain Code

<?
echo "this";
?>

Untitled PHP (15-Apr @ 15:02)

Syntax Highlighted Code

  1. A
  2. <br>
  3. b

Plain Code

A
<br>
b

Untitled PHP (13-Apr @ 00:57)

Syntax Highlighted Code

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4.     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5. [289 more lines...]

Plain Code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Phil Coffman - Art Director</title>
    <meta content="I am an Art Director based in Austin, TX with an eye for balance, finely tuned Wacom tablet skills, and an undying hatred of blurry pixels." name="Description"/>
    <meta content="Phil, Coffman, Art Director, Art Direction, Graphic Design, Interface, UI, User Experience, Austin, TX" name="Keywords"/>
    
    <link rel="stylesheet" type="text/css" media="all" href="/css/screen.css" />
    <link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
    
    <script type="text/javascript" src="/code/prototype.js"></script>

<script type="text/javascript" src="/code/scriptaculous.js"></script>
<script type="text/javascript">
    function jsonFlickrFeed(o) {
        var div = document.getElementById('photoBucket');
        for (var i = 0; i < 8; ++i) {
            div.innerHTML += '<a href="' + o.items[i].link + '"><img id="flickr_'+[i]+'" src="' + o.items[i].media.m.replace("_m", "_s") + '" alt="' + o.items[i].title +'"></a>';
        }
    }
</script></head>

<body>

    <div class="container_12" id="site">
        
        <div id="header">
            <p id="mark"><a href="/" title="Phil Coffman: Art Director + Photographer">Phil Coffman</a></p>
            
            <ul>
                <li><a href="/" title="Back to PhilCoffman.com">Home</a></li>

                <li><a href="/about.php" title="About Phil Coffman">About</a></li>
                <li><a href="/blog/" title="Phil Coffman's Blog">Blog</a></li>
                <li><a href="/work.php" title="Phil Coffman's Work">Work</a></li>
                <li><a href="/photos.php" title="Phil Coffman's Photos">Photos</a></li>
                <li><a href="/contact/" title="Contact Phil Coffman">Contact</a></li>
            </ul>

            
            <div id="fusion_ad">
                <script type="text/javascript">
                    /* <![CDATA[ */
                    document.write('<scr' + 'ipt type="text/javascript" src="http://adn.fusionads.net/www/pull/get.php?zoneid=54&charset=UTF-8&withtext=1&cb=' + Math.floor(Math.random() * 99999999999) + '"></scr' + 'ipt>');
                    /* ]]> */
                </script>
                <p id="powered_by"><a href="http://fusionads.net" class="pwr" title="Powered by Fusion Ads">Powered <em>by</em> Fusion</a></p>
            </div>
                        
            <div class="clear"></div>
        </div>

    <div class="grid_12" id="work-listing">
        <h1>Work</h1>
        <div id="projects">
            <div class="grid_12" id="project-row">
                <div class="grid_3 alpha" id="project-thumb">
                    <div>
                        <a href="work/dell_insight.php"><img src="img/work/dell_insight_thumb.jpg" class="thumbnail"/></a>
                        <h2><a href="work/dell_insight.php">Dell INsight</a></h2>

                    </div>
                    <p>A community platform focused on software that empowers users to participate in the beta process.</p>
                </div>
                <div class="grid_3" id="project-thumb">
                    <div>
                        <a href="work/gemalto.php"><img src="img/work/gemalto_thumb.jpg" class="thumbnail"/></a>
                        <h2><a href="work/gemalto.php">Gemalto "Go" Campaign</a></h2>
                    </div>

                    <p>Campaign pitch for Gemalto, one of the world's leading security chip manufacturers.</p>
                </div>
                <div class="grid_3" id="project-thumb">
                    <div>
                        <a href="work/hrh.php"><img src="img/work/hrh_thumb.jpg" class="thumbnail"/></a>
                        <h2><a href="work/hrh.php">Hard Rock Hotel and Casino</a></h2>
                    </div>
                    <p>RFP pitch to redesign the site for the Hard Rock Hotel and Casino in Las Vegas.</p>

                </div>
                <div class="grid_3 omega" id="project-thumb">
                    <div>
                        <a href="work/trans-poser.php"><img src="img/work/transposer_thumb.jpg" class="thumbnail"/></a>
                        <h2><a href="work/trans-poser.php">Trans-Poser</a></h2>
                    </div>
                    <p>Flash-based app created for Dell and X Games 15 that superimposes your face on various athletes.</p>
                </div>

                <div class="clear"></div>
            </div>

            <div class="grid_12" id="project-row">
                <div class="grid_3 alpha" id="project-thumb">
                    <div>
                        <a href="work/promanage_icons.php"><img src="img/work/promanage_icons_thumb.jpg" class="thumbnail"/></a>
                        <h2><a href="work/promanage_icons.php">ProManage Icons</a></h2>

                    </div>
                    <p>A set of icons I created for an internal Dell portal. Work like this is all about the small details, which I'm a sucker for.</p>
                </div>
                <div class="grid_3" id="project-thumb">
                    <div>
                        <a href="work/centralmarket_sommelier.php"><img src="img/work/centralmarket_sommelier_thumb.jpg" class="thumbnail"/></a>
                        <h2><a href="work/centralmarket_sommelier.php">Interactive Sommelier</a></h2>
                    </div>

                    <p>The power of a personal Sommelier at your fingertips, minus the pompousness.</p>
                </div>
                <div class="grid_3" id="project-thumb">
                    <div>
                        <a href="work/tre.php"><img src="img/work/tre_thumb.jpg" class="thumbnail"/></a>
                        <h2><a href="work/tre.php">TRE</a></h2>
                    </div>
                    <p>Translated as "three", TRE is a personal piece of art that came rolling out of the brain one day.</p>

                </div>
                <div class="grid_3 omega" id="project-thumb">
                    <div>
                        <a href="work/flytta.php"><img src="img/work/flytta_thumb.jpg" class="thumbnail"/></a>
                        <h2><a href="work/flytta.php">Flytta</a></h2>
                    </div>
                    <p>Experimenting with lines, color and extruded typefaces.</p>
                </div>

                <div class="clear"></div>
            </div>

            <div class="grid_12" id="project-row">
                <div class="grid_3 alpha" id="project-thumb">
                    <div>
                        <a href="work/1978.php"><img src="img/work/1978_thumb.jpg" class="thumbnail"/></a>
                        <h2><a href="work/1978.php">1978</a></h2>

                    </div>
                    <p>A design that came to me after a long stretch of listening to ambient music.</p>
                </div>
                <div class="grid_3" id="project-thumb">
                    <div>
                        <a href="work/ethan_durelle.php"><img src="img/work/ethan_durelle_thumb.jpg" class="thumbnail"/></a>
                        <h2><a href="work/ethan_durelle.php">Ethan Durelle</a></h2>
                    </div>

                    <p>A design I put together for my cousin Chris who used to be in the band "Ethan Durelle".</p>
                </div>
                <div class="grid_3" id="project-thumb">
                    <div>
                        <a href="work/classic_rock.php"><img src="img/work/classic_rock_thumb.jpg" class="thumbnail"/></a>
                        <h2><a href="work/classic_rock.php">Classic Rock</a></h2>
                    </div>
                    <p>An ironic design due to the fact that I'm not that big of a fan of the classic rock genre, but that's okay</p>

                </div>
                <div class="grid_3 omega" id="project-thumb">
                    <div>
                        <a href="work/showthelove.php"><img src="img/work/showthelove_thumb.jpg" class="thumbnail"/></a>
                        <h2><a href="work/showthelove.php">Show The Love</a></h2>
                    </div>
                    <p>To promote and organize a weekend of serving their local community, Intereactive built this site for Crossbridge Church.</p>
                </div>

                <div class="clear"></div>
            </div>

            <div class="grid_12" id="project-row">
                <div class="grid_3 alpha" id="project-thumb">
                    <div>
                        <a href="work/paypal_safety.php"><img src="img/work/paypal_thumb.jpg" class="thumbnail"/></a>
                        <h2><a href="work/paypal_safety.php">PayPal Safety Training</a></h2>

                    </div>
                    <p>Visit the PayPal Safety Agent Training Facility and learn how to become a top-notch security agent.</p>
                </div>                       
                <div class="grid_3" id="project-thumb">
                    <div>
                        <a href="work/centralmarket.php"><img src="img/work/centralmarket_thumb.jpg" class="thumbnail"/></a>
                        <h2><a href="work/centralmarket.php">Central Market</a></h2>
                    </div>

                    <p>One of Texas' premiere grocery chains came to Springbox with a need to completely overhaul their website.</p>
                </div>
                <div class="grid_3" id="project-thumb">
                    <div>
                        <a href="work/simplerwebb.php"><img src="img/work/simplerwebb_thumb.jpg" class="thumbnail"/></a>
                        <h2><a href="work/simplerwebb.php">Simpler-Webb</a></h2>
                    </div>
                    <p>IT infrastructure doesn't have to be all straight lines and linear and I have the whiteboard drawings to prove it.</p>

                </div>
                <div class="grid_3 omega" id="project-thumb">
                    <div>
                        <a href="work/sdxi.php"><img src="img/work/sdxi_thumb.jpg" class="thumbnail"/></a>
                        <h2><a href="work/sdxi.php">SD•X Interactive</a></h2>
                    </div>
                    <p>Bring printed material to life with SD•X Interactive's infrared technology.</p>
                </div>

                <div class="clear"></div>
            </div>

            <div class="grid_12" id="project-row">
                <div class="grid_3 alpha" id="project-thumb">
                    <div>
                        <a href="work/scion_tC.php"><img src="img/work/scion_tC_thumb.jpg" class="thumbnail"/></a>
                        <h2><a href="work/scion_tC.php">Scion tC Banner Campaign</a></h2>

                    </div>
                    <p>Building your own super-collider is probably not a good idea, so the next best thing is to use that idea in a banner campaign.</p>
                </div>
                <div class="grid_3" id="project-thumb">
                    <div>
                        <a href="work/einsteinpals.php"><img src="img/work/einsteinpals_thumb.jpg" class="thumbnail"/></a>
                        <h2><a href="work/einsteinpals.php">Einstein Pals</a></h2>
                    </div>

                    <p>Baby Einstein is working on a new addition to their property line-up called Einstein Pals and Springbox did some comps for them.</p>
                </div>
                <div class="grid_3" id="project-thumb">
                    <div>
                        <a href="work/paypal_module.php"><img src="img/work/paypal_module_thumb.jpg" class="thumbnail"/></a>
                        <h2><a href="work/paypal_module.php">PayPal Top Buyer Module</a></h2>
                    </div>
                    <p>A few presentation/e-learning style comps for a module PayPal needed to address various business strategies.</p>

                </div>
                <div class="grid_3 omega" id="project-thumb">
                    <div>
                        <a href="work/mosaic.php"><img src="img/work/mosaic_thumb.png" class="thumbnail"/></a>
                        <h2><a href="work/mosaic.php">Mosaic</a></h2>
                    </div>
                    <p>Identity for a team management web app currently in development.</p>
                </div>

                <div class="clear"></div>                        
            </div>

            <div class="grid_12" id="project-row">
                <div class="grid_3 alpha" id="project-thumb">
                    <div>
                        <a href="work/intereactive.php"><img src="img/work/intereactive_thumb.jpg" class="thumbnail"/></a>
                        <h2><a href="work/intereactive.php">Intereactive</a></h2>
                    </div>

                    <p>Site design for Intereactive, a web design company I co-found. Definitely a labor of love as I am easily my own worst client.</p>
                </div>
                <div class="grid_3 omega suffix_6" id="project-thumb">
                    <div>
                        <a href="work/nls.php"><img src="img/work/nls_thumb.jpg" class="thumbnail"/></a>
                        <h2><a href="work/nls.php">No Longer Strangers</a></h2>
                    </div>
                    <p>Florida-based band No Longer Strangers came to Intereactive to build out a full-flash site.</p>

                </div>

                <div class="clear"></div>                        
            </div>
        </div>
        
        <div class="clear"></div>
    </div>
    

        <div class="clear"></div>

        <div class="grid_12" id="footer">

            <p class="grid_6 suffix_4 alpha">&copy; 2010 Phil Coffman - All Rights Reserved<br />Powered by <a href="http://www.wordpress.org">Wordpress</a>, held together by <a href = "http://www.960.gs">960.gs</a>, and continually under threat of a redesign.</p>
            
            <ul class="grid_2 omega">
                <li><a href="http://dribbble.com/players/philcoffman" title="Phil Coffman on Dribbble"><img src="/img/dribbble_icon.jpg" alt="Dribbble" /></a></li>
                <li><a href="http://www.flickr.com/photos/philcoffman" title="Phil Coffman on Flickr"><img src="/img/flickr_icon.jpg" alt="Flickr" /></a></li>
                <li><a href="http://www.linkedin.com/profile?viewProfile=&amp;key=10771840&amp;locale=en_US&amp;trk=tab_pro" title="Phil Coffman on LinkedIn"><img src="/img/linkedin_icon.jpg" alt="LinkedIn" /></a></li>

                <li class="last"><a href="http://twitter.com/philcoffman" title="Phil Coffman on Twitter"><img src="/img/twitter_icon.jpg" alt="Twitter" /></a></li>
            </ul>
            
            <div class="clear"></div>
        </div>
    </div>
    
    <!-- Google Analytics -->
    <script type="text/javascript">
        var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
        document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
        try {
            var pageTracker = _gat._getTracker("UA-7742329-1");
            pageTracker._trackPageview();
        } catch(err) {}
    </script>

</body>
</html>

fsdfsdf (11-Apr @ 08:38)

Syntax Highlighted Code

  1. fsdfsdfsdf

Plain Code

fsdfsdfsdf

Untitled PHP (9-Apr @ 18:55)

Syntax Highlighted Code

  1. <? date('Y')?>

Plain Code

<? date('Y')?>

Untitled PHP (8-Apr @ 22:22)

Syntax Highlighted Code

  1. cv

Plain Code

cv

Untitled PHP (8-Apr @ 00:18)

Syntax Highlighted Code

  1. xcbvxcvbcv

Plain Code

xcbvxcvbcv

Untitled PHP (6-Apr @ 09:55)

Syntax Highlighted Code

  1. <?php
  2. echo("hjallo");
  3.  
  4. ?>

Plain Code

<?php
echo("hjallo");

?>

Untitled PHP (6-Apr @ 08:20)

Syntax Highlighted Code

  1. <?php
  2.  
  3. ?>

Plain Code

<?php

?>

Untitled PHP (6-Apr @ 02:48)

Syntax Highlighted Code

  1. <? phpinfo(); ?>

Plain Code

<? phpinfo(); ?>

Untitled PHP (6-Apr @ 02:32)

Syntax Highlighted Code

  1. echo "yo yo yo";
  2.  

Plain Code

echo "yo yo yo";

Untitled PHP (5-Apr @ 22:25)

Syntax Highlighted Code

  1. <?php
  2. // Läs in maträtterna från menytabellen
  3. $result = dbQuery...;
  4. while($rad=@mysql_fetch...)
  5. [24 more lines...]

Plain Code

<?php
// Läs in maträtterna från menytabellen
$result = dbQuery...;
while($rad=@mysql_fetch...) 
{
    // assigna värdena till matratt, 
    $matratter[$rad['ID']] = $rad['Namn'];
    $matratter_values[$rad['ID']] = 0;
}

if ($_POST) 
{
    // Sätt värdena till maträtt
    foreach($matratter as $key=>$value)
        $matratter_values[$key] = $_POST['matratt_'.$key];
} 
else 
{

        // Ingen post-data här..
}


// I formuläret när du ska skriva ut option..
foreach($matratter as $key => $value) 
{
    echo "Antal: <input type=\"text\" name=\"matratt_".$key."\" size=\"5\" value=\"".$matratter_values[$key]."\">&nbsp;".$value."<br />";

}

Untitled PHP (5-Apr @ 21:49)

Syntax Highlighted Code

  1. <?php
  2. // Läs in maträtterna från menytabellen
  3. $result = dbQuery...;
  4. while($rad=@mysql_fetch...)
  5. [26 more lines...]

Plain Code

<?php
// Läs in maträtterna från menytabellen
$result = dbQuery...;
while($rad=@mysql_fetch...) 
{
    // assigna värdena till matratt, 
    $matratter[$rad['ID']] = $rad['Namn'];
}

if ($_POST) 
{
    // Sätt värdena till maträtt
    foreach($matratter as $key=>$value)
        $matratter_values[$key] = $_POST['matratt_'.$key];
} 
else 
{

    // noll-initiera maträtterna (de är 0 som default)
    foreach($matratter as $key=>$value)
        $matratter_values[$key] = $value;
    
}


// I formuläret när du ska skriva ut option..
foreach($matratter as $key => $value) 
{
    echo "Antal: <input type=\"text\" name=\"matratt_".$key."\" size=\"5\" value=\"".$matratter_values[$key]."\">&nbsp;".$value."<br />";

}

Untitled PHP (5-Apr @ 13:50)

Syntax Highlighted Code

  1. <?
  2.  
  3. ?>

Plain Code

<?

?>

Untitled PHP (4-Apr @ 08:32)

Syntax Highlighted Code

  1. asdasd

Plain Code

asdasd

Untitled PHP (3-Apr @ 16:09)

Syntax Highlighted Code

  1. <?php
  2. echo 'hello world';
  3. ?>

Plain Code

<?php
echo 'hello world';
?>

Untitled PHP (2-Apr @ 19:29)

Syntax Highlighted Code

  1. <?php ?>

Plain Code

<?php ?>

Untitled PHP (1-Apr @ 21:13)

Syntax Highlighted Code

  1. asdad

Plain Code

asdad

generateSlug (31-Mar @ 05:09)

jasonbartholme

Syntax Highlighted Code

  1. function generateSlug($phrase)
  2. {
  3.   $result = strtolower($phrase);
  4.   $result = preg_replace("/[^a-z0-9\s-]/", "", $result);
  5. [4 more lines...]

Plain Code

function generateSlug($phrase)
{
  $result = strtolower($phrase);
  $result = preg_replace("/[^a-z0-9\s-]/", "", $result);
  $result = trim(preg_replace("/\s+/", " ", $result));
  $result = trim(substr($result, 0, 100));
  $result = preg_replace("/\s/", "-", $result);
  return $result;
}

Untitled PHP (30-Mar @ 10:19)

Syntax Highlighted Code

  1. <?Php
  2. echo "hej";
  3. ?>

Plain Code

<?Php
echo "hej";
?>

Untitled PHP (29-Mar @ 19:08)

Syntax Highlighted Code

  1. <?php foreach($noob as $b): ?>
  2. <p><?php echo $b['test'];?></p>
  3. <?php endforeach; ?>

Plain Code

<?php foreach($noob as $b): ?>
<p><?php echo $b['test'];?></p>
<?php endforeach; ?>

Untitled PHP (28-Mar @ 11:42)

Syntax Highlighted Code

  1. <?php
  2.  
  3. class Page extends Admin_Controller {
  4.  
  5. [101 more lines...]

Plain Code

<?php 

class Page extends Admin_Controller {

    function __construct() 
    {
        parent::__construct();
        $this->output->enable_profiler(TRUE);
        $this->load->language('page');
    }
    
    function index()
    {
        $this->load->view('errors/form');
    }
    
    function choose_template($parent_id=0) {
        $this->load->model('template_model');
        $this->title = lang("page.choose_template");
        
        $this->content_data = array(
            "templates" => $this->template_model->get_all()
        );
                        
        $this->_output_master_with('page/choose_template');        
    }

    /**
     * @param integer $template_id                The template_id as selected from page/choose_template
     * @param integer $parent_id[optional]        The id of the parent page 
     */
    function create($template_id, $parent_id=0) {
        //$extra_fields = $this->template_model->get_fields_from($template_id);
        $this->content_data['page'] = array();
        $this->content_data['extra_fields'] = array();
        
        // If we have post data
        if ($this->input->post()) {
            // Run validation
            // Check mode
            // If mode = save_and_publish
            // page_model->save_and_publish
            $mode = $this->input->post('submit');
        }
        // Output.
        $this->_register_js('jquery.idtabs.min.js');
        $this->_output_master_with('page/form');
        
        // Load the template and its extra fields.
    }
    /**
     * Deletes a page, all versions of it plus any extra fields that might exist on those versions.
     * Also clears out cached versions of the removed page via page_model->delete_all_versions. 
     * @return 
     * @param object $id
     */
    function delete($id) {

        //$page = $this->page_model->get_where(array("page_id"=>$id));
        $page = false;
        if (!$page) 
        {
            $this->title = lang("page.page_not_found");
            $this->content_data = array(
                            "header" => lang("page.page_not_found"),
                            "message" => lang("page.page_not_found.message"),
                            "link_url" => "#url-to-list-pages",
                            "link_text" => lang("page.page_not_found.link.text"),
                            );
                            
            $this->_output_master_with('errors/default');
            return;
        }
        
        // So we had a page with that id
        if (!$this->page_model->delete_all_versions($page->page_id)) 
        {
            // But failed deleting all the versions.
            $this->title = lang("page.page_not_found");
            $this->content_data = array(
                            "header" => lang("page.page_not_found"),
                            "message" => lang("page.page_not_found.message"),
                            "link_url" => "#url-to-list-pages",
                            "link_text" => lang("page.page_not_found.link.text"),
                            );
                            
            $this->_output_master_with('errors/default');
            return;
        }
        
        $this->title = lang("page.page_deleted");
        $this->content_data = array(
                        "header" => lang("page.page_deleted"),
                        "message" => lang("page.page_deleted.message"),
                        "link_url" => "#url-to-list-pages",
                        "link_text" => lang("page.page_deleted.link.text"),
                        );
                        
        $this->_output_master_with('messages/default');
        
        //TODO: delete all fields from pages where page_id=$page->page_id
        //TODO: remove all versions of this page
        //TODO: remove cached versions of the page's slug
    
    }    
}

Untitled PHP (25-Mar @ 09:21)

Syntax Highlighted Code

  1. fdgsgsdgsdg dg sdgs<dg <sdg <sdg<sd

Plain Code

fdgsgsdgsdg dg sdgs<dg <sdg <sdg<sd

12 (24-Mar @ 12:20)

Syntax Highlighted Code

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language; ?>" lang="<?php print $language->language; ?>" dir="<?php print $language->dir; ?>">
  3.  
  4. <head>
  5. [162 more lines...]

Plain Code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language; ?>" lang="<?php print $language->language; ?>" dir="<?php print $language->dir; ?>">

<head>
  <title><?php print $head_title; ?></title>
  <?php print $head; ?>
  <?php print $styles; ?>
  <?php print $scripts; ?>
</head>
<body class="<?php print $body_classes; ?>">

  <div id="page"><div id="page-inner">

    <a name="navigation-top" id="navigation-top"></a>
    <?php if ($primary_links || $secondary_links || $navbar): ?>
      <div id="skip-to-nav"><a href="#navigation"><?php print t('Skip to Navigation'); ?></a></div>
    <?php endif; ?>

    <div id="header"><div id="header-inner" class="clear-block">

      <?php if ($logo || $site_name || $site_slogan): ?>
        <div id="logo-title">

          <?php if ($logo): ?>
            <div id="logo"><a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" id="logo-image" /></a></div>
          <?php endif; ?>

          <?php if ($site_name): ?>
            <?php if ($title): ?>
              <div id="site-name"><strong>
                <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home">
                <?php print $site_name; ?>
                </a>
              </strong></div>
            <?php else: ?>
              <h1 id="site-name">
                <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home">
                <?php print $site_name; ?>
                </a>
              </h1>
            <?php endif; ?>
          <?php endif; ?>

          <?php if ($site_slogan): ?>
            <div id="site-slogan"><?php print $site_slogan; ?></div>
          <?php endif; ?>

        </div> <!-- /#logo-title -->
      <?php endif; ?>

      <?php if ($header): ?>
        <div id="header-blocks" class="region region-header">
          <?php print $header; ?>
        </div> <!-- /#header-blocks -->
      <?php endif; ?>

    </div></div> <!-- /#header-inner, /#header -->

    <div id="main"><div id="main-inner" class="clear-block<?php if ($search_box || $primary_links || $secondary_links || $navbar) { print ' with-navbar'; } ?>">

      <div id="content"><div id="content-inner">

        <?php if ($mission): ?>
          <div id="mission"><?php print $mission; ?></div>
        <?php endif; ?>

        <?php if ($content_top): ?>
          <div id="content-top" class="region region-content_top">
            <?php print $content_top; ?>
          </div> <!-- /#content-top -->
        <?php endif; ?>

        <?php if ($breadcrumb || $title || $tabs || $help || $messages): ?>
          <div id="content-header">
            <?php print $breadcrumb; ?>
            <?php if ($title): ?>
              <h1 class="title"><?php print $title; ?></h1>
            <?php endif; ?>
            <?php print $messages; ?>
            <?php if ($tabs): ?>
              <div class="tabs"><?php print $tabs; ?></div>
            <?php endif; ?>
            <?php print $help; ?>
          </div> <!-- /#content-header -->
        <?php endif; ?>

        <div id="content-area">
          <?php print $content; ?>
        </div>

        <?php if ($feed_icons): ?>
          <div class="feed-icons"><?php print $feed_icons; ?></div>
        <?php endif; ?>

        <?php if ($content_bottom): ?>
          <div id="content-bottom" class="region region-content_bottom">
            <?php print $content_bottom; ?>
          </div> <!-- /#content-bottom -->
        <?php endif; ?>

      </div></div> <!-- /#content-inner, /#content -->

      <?php if ($search_box || $primary_links || $secondary_links || $navbar): ?>
        <div id="navbar"><div id="navbar-inner" class="clear-block region region-navbar">

          <a name="navigation" id="navigation"></a>

          <?php if ($search_box): ?>
            <div id="search-box">
              <?php print $search_box; ?>
            </div> <!-- /#search-box -->
          <?php endif; ?>

          <?php if ($primary_links): ?>
            <div id="primary" class="clear-block">
              <?php print theme('links', $primary_links); ?>
            </div> <!-- /#primary -->
          <?php endif; ?>

          <?php if ($secondary_links): ?>
            <div id="secondary" class="clear-block">
              <?php print theme('links', $secondary_links); ?>
            </div> <!-- /#secondary -->
          <?php endif; ?>

          <?php print $navbar; ?>

        </div></div> <!-- /#navbar-inner, /#navbar -->
      <?php endif; ?>

      <?php if ($left): ?>
        <div id="sidebar-left"><div id="sidebar-left-inner" class="region region-left">
          <?php print $left; ?>
        </div></div> <!-- /#sidebar-left-inner, /#sidebar-left -->
      <?php endif; ?>

      <?php if ($right): ?>
        <div id="sidebar-right"><div id="sidebar-right-inner" class="region region-right">
          <?php print $right; ?>
        </div></div> <!-- /#sidebar-right-inner, /#sidebar-right -->
      <?php endif; ?>

    </div></div> <!-- /#main-inner, /#main -->

    <?php if ($footer || $footer_message): ?>
      <div id="footer"><div id="footer-inner" class="region region-footer">

        <?php if ($footer_message): ?>
          <div id="footer-message"><?php print $footer_message; ?></div>
        <?php endif; ?>

        <?php print $footer; ?>

      </div></div> <!-- /#footer-inner, /#footer -->
    <?php endif; ?>

  </div></div> <!-- /#page-inner, /#page -->

  <?php if ($closure_region): ?>
    <div id="closure-blocks" class="region region-closure"><?php print $closure_region; ?></div>
  <?php endif; ?>

  <?php print $closure; ?>

</body>
</html>

Untitled PHP (23-Mar @ 22:39)

Syntax Highlighted Code

  1. <?php
  2. $ip = $_SERVER['REMOTE_ADDR'];
  3. echo ip;
  4. ?>

Plain Code

<?php
$ip = $_SERVER['REMOTE_ADDR'];
echo ip;
?>

titulo (23-Mar @ 17:50)

Syntax Highlighted Code

  1. conteudo

Plain Code

conteudo

Untitled HTML (23-Mar @ 01:01)

jerryLee

Syntax Highlighted Code

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. [168 more lines...]

Plain Code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Custom layout by jerryLee of SEO in Texas</title>
<style type="text/css">
<!--
/*
* AUTHOR       [ jerryLee]
* DATE         [ 03/2010 ]
* AUTHOR URL   [ www.seointexas.com ]
* AUTHOR EMAIL [ contact@seointexas.com ]

===========================================[ATTENTION DEVELOPERS AND GRAPHIC DESIGNERS]=============================================

I am beginning development on a project that is going to revolutionize the SEO world, and it will more than likely make me and a    couple of other people very wealthy. If you are interested, and fairly good with code or graphics, let me know. Email me to the    address above.

*/

body {
    margin:0;
} /* notice how I do not specify pixels here, this is how you make the content snug up to the top of the page */

#wrapper {
    margin:0px auto;
    width:1000px;
    height:auto;
} /* this is where I set my main width, most everything else will style to 100% or whatever percentage applies, so if I want to change the main width later, I only have to change it here, the other widths will automatically adjust because they are in percentages. */

#top {
    margin:0px;
    width:100%;
    height:20px;
} /* this can be used above the entire page as a navigation */

#header {
    margin:0px;
    width:100%;
    height:150px;
    background-color:#cccccc;
}

#navigation {
    margin:0px;
    width:100%;
    height:30px;
}

#content_holder {
    margin:0px;
    width:100%;
    height:auto;
}

#content_left {
    margin:0px;
    padding:10px;
    width:25%;
    height:auto;
    float:left;
} /* notice this is set to 25%, and floated left, this will maintain a 25% wide left column, and the float will pull it to the left */

#content_right {
    margin:0px;
    padding:10px;
    width:25%;
    height:auto;
    float:right;
} /* same as the last one, except floated to the right, and 75%, this can also be set to something like 25%, which would make a middle column without a middle column really being there. */

#main_body {
    margin:0px;
    padding:10px;
    width:auto;
    height:auto;
    float:right;
}

#footer {
    margin:0px;
    width:100%;
    height:150px;
    background-color:#cccccc;
} /* in a lot of cases, the footer actually mirrors the header 
*/

#logo { 
    margin:20px; 
    width:150px; 
}

/* begin menu styles */

#menu { margin:0px;    width:100%;    height:30px; background-color:#000000; }

#menu ul { margin:0px; list-style-type:none; width:70%; line-height:.5; }

#menu li { margin:0px; padding:10px; float:left; width:100px; }

.selected { background-color:#0099CC; } /* this will highlight the selected link, to show which page you are on */

#menu a { font-family:Verdana, Arial, Helvetica, sans-serif; font-size:16px; color:#FFFFFF; text-decoration:none; }

#menu a:hover { font-family:Verdana, Arial, Helvetica, sans-serif; font-size:16px; color:#FF3300; text-decoration:underline; }

.clear {
    clear:both;
}
-->
</style>
<!-- styles EOF make sure to put these in a separate file and link to them with the above link, Google external style sheets if you need to -->
</head>
<link rel="stylesheet" type="text/css" href="css/styles.css">
<!-- this signifies the file you will create with the css below and paste into a file called styles.css in your styles folder -->

<body>

<div id="top"><?php include($_SERVER['DOCUMENT_ROOT']."/jerry_teaching/backlinks.php"); ?> </div><!--php code for breadcrumbs aka top links, automatically updated as you go through the site. -->

<!-- top EOF -->
<div id="wrapper">
  
  <div id="header">
    <div id="logo">
    <img src="http://www.seointexas.com/images/logo.png" width="100" />
    <span style="position:absolute; top:-5000px; left:-5000px;">Logo</span><!-- by throwing this text off the page with a position style, I can help my SEO with a little extra keyword action, and no one has to see it, they get to see the nice looking logo! -->
    </div> <!-- logo EOF -->
  </div> <!--header eof-->
  
  <div id="menu">
    <ul>
      <li><a href="#" class="selected">Home</a></li>
      <li><a href="#">Services</a></li>
      <li><a href="#">About Us</a></li>
      <li><a href="#">Schedule</a></li>
      <li><a href="#">Contact Us</a></li>
   </ul>
  </div> <!-- menu eof -->
 
 
  <div id="content_wrapper">
  
    <div id="content_left">
    <h1>Left Column</h1>
        <p>this is a great place to put navigation, advertising, or whatever else your heart desires.</p>
    </div><!--content left eof-->
    
    <div id="content_right"> 
        <h1>Right Column</h1>
        <p>this is a great place to put Articles, advertising, or whatever else your heart desires.</p>
    </div>
    <!--content right eof-->
    <div id="main_body">
        <h1>Middle  Column</h1>
        <p>this is a great place to put navigation, advertising, or whatever else your heart desires. bz';lcvbmz';clxbmz';clbmz'c;blmz'c;lbmz'x;clbmz';lbmz';lbmz';lbm</p>
   </div><!--main body eof-->
    <div class="clear"></div>
    <div id="footer"> 
    <!--php code for the date, keeps it updated -->
        © Copyright <?php
$today = mktime(0, 0, 0, date("m"), date("d"), date("y"));
echo "Today is ".date("m/d/y", $today); 
?>

    </div>
    <!--footer eof-->
  </div>
  <!--content wrapper EOF-->
</div>
<!--wrapper eof-->
</body>
</html>

Untitled PHP (22-Mar @ 15:26)

Syntax Highlighted Code

  1. 1234

Plain Code

1234

Untitled PHP (21-Mar @ 21:03)

Syntax Highlighted Code

  1. ghjkhjhgj

Plain Code

ghjkhjhgj

Untitled PHP (21-Mar @ 18:47)

Syntax Highlighted Code

  1. asdasda

Plain Code

asdasda

Untitled PHP (21-Mar @ 17:18)

Syntax Highlighted Code

  1. <?
  2. $site ='teste';
  3. $code ='nois';
  4.  
  5. [5 more lines...]

Plain Code

<?
$site ='teste';
$code ='nois';

echo $code;

?>


Untitled PHP (21-Mar @ 01:46)

Syntax Highlighted Code

  1. <?php
  2. $ljhh="fdgfg";
  3. ?>

Plain Code

<?php
$ljhh="fdgfg";
?>

Untitled PHP (20-Mar @ 16:16)

Syntax Highlighted Code

  1. <?php
  2. echo 'this is great';
  3. ?>

Plain Code

<?php 
echo 'this is great';
?>

Untitled PHP (19-Mar @ 20:18)

desbest.myopenid.com

Syntax Highlighted Code

  1. <html>
  2. <head>
  3. <title>Tryit Editor v1.4</title>
  4. <link rel="stylesheet" type="text/css" href="../stylesheet.css" />
  5. [135 more lines...]

Plain Code

<html>
<head>
<title>Tryit Editor v1.4</title>
<link rel="stylesheet" type="text/css" href="../stylesheet.css" />

</head>

<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">
<?php
$printer = $_POST[printer];
$printer = stripslashes($printer);
?>
<?php
    
if ($_POST[sendto]){
    $email = $_POST[sendto];
    $sendas = $_POST[sendas];
    
    $subject = $_POST[subject];
    $message= $_POST[printer];
    $message = stripslashes($message);
    $datenumber = date('Y-m-d');
    //include("config.php");
    $emailS = addslashes($emailS);
    $sendasS = addslashes($sendasS);
    $subjectS = addslashes($subjectS);
    $messageS = addslashes($message);
    $datenumerS = addslashes($datenumerS);
        
        /* echo "
    <textarea name=\"printerxx\" style=\"width: 400px; height: 400px;\" class=\"mediumtext\">
    $messageS
    </textarea>
    "; */

    /*
 mysql_query("INSERT INTO emailarchive(sendto, sendas, subject, message, datenumber) 
                VALUES(
                '$email', 
                '$sendas', 
                '$subject', 
                '$messageS', 
                '$datenumber' 
                )
    ") 
    or die(mysql_error());  
*/
    
    //$datenumber = date("y-m-d");
    /**/ $headers  = 'mime-version: 1.0' . "\r\n";
    /**/ $headers .= 'content-type: text/html; charset=iso-8859-1' . "\r\n";
    /**/
    if ($sendas != ""){
        //echo "<h3>you submitted</h3>";
        $emailChunks = explode(",", $email);
        $chunkCount = count($emailChunks);
        for($i = 0; $i < count($emailChunks); $i++){
            //echo "Email number $i = $emailChunks[$i] <br />";
            /**/// Additional headers
            /**/$to = "$emailChunks[$i]";
            //**/$to = $email;
            /**///$headers .= "To:<$to>" . "\r\n";
            /**/$headers .= "From: Hostingz <$sendas>" . "\r\n";
            ///**/$headers .= "Cc: <$to>" . "\r\n";
            /**///$headers .= "Bcc: <$to>" . "\r\n";
            /**/// Mail it
            $task = mail($to, $subject, $message, $headers);
            
            if ($chunkCount < 100) {echo "Piece $i = $emailChunks[$i] <br />  $headers <hr>"; } else {
            echo "<h3>The mass mail has been sent!</h3>";
            }
        }
    } else{ echo "<h3>You left the send as from field blank.</h3>"; }
    ////////////////////////////////////////////////////////////////////////
    /**////////Email the user their account details
    if ($task) {echo "<h3>The email has been sent!</h3>";} else{ echo "<h3>Error!</h3>";}
    
} else {
    //echo "<h3>you failed to provide a to address</h3>";
}
?>
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
<tr>
<td  valign="top" bgcolor="#ffcc00">
<form method="post" >
To: <input type="text" name="sendto" class="mediumtext" style="width: 400px;">
<br>Subject: <input type="text" name="subject" class="mediumtext" value="Hostingz Account Details" style="width: 400px;">
<textarea name="printer" style="width: 400px; height: 400px;" class="mediumtext"><?php
if ($printer == ""){
echo "<html>
<body>
<table id=\"Table_01\" width=\"790\" height=\"122\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">

    <tr>
            <td   width=\"790\" height=\"122\">
                          <div class=\"menuhere\">  </div> 
        
        </td>
        
    </tr>
    <tr><td>
    <div style=\"margin-left: 8px; margin-right:8px;\">
    text goes here
    
        </div>
    </td></tr></table>
</body>
</html>
";
} else {
echo "$printer";
}
?>
</textarea>
<br>
<select name="sendas" class="mediumtext">
<option value="" selected="selected">---</option>
<option value="afaninthehouse@gmail.com">afaninthehouse@gmail.com</option>
</select>

<br>
<br>To preview the email, leave the to field blank.
<input name="submit" type="submit" value="Send mail and preview" class="bigbutton">

</form>
<br>
<br><a href="sentmail.php">View sent emails</a>
</td>

<td valign="top" width="790">
<?php
echo "$printer";
?>
</td>
</tr>
</table>

</body>
</html>

Untitled PHP (19-Mar @ 09:26)

Syntax Highlighted Code

  1. <?php
  2.  
  3.  
  4. print "hello";

Plain Code

<?php


print "hello";

Untitled PHP (18-Mar @ 22:27)

Syntax Highlighted Code

  1. <?php
  2. echo "AKMAL";
  3. ?>

Plain Code

<?php
echo "AKMAL";
?>

Untitled PHP (17-Mar @ 12:32)

Syntax Highlighted Code

  1. <?php
  2.  
  3. $um = 1;
  4. $dois = 2;
  5. [3 more lines...]

Plain Code

<?php

$um = 1;
$dois = 2;

echo $um + $dois;

?>

Untitled PHP (16-Mar @ 11:52)

Syntax Highlighted Code

  1. <? echo date(Y);?>

Plain Code

<? echo date(Y);?>

Untitled PHP (14-Mar @ 11:10)

Syntax Highlighted Code

  1. <?php
  2.  
  3. echo 123;
  4. ?>

Plain Code

<?php

echo 123;
?>

template (12-Mar @ 01:06)

Syntax Highlighted Code

  1. test

Plain Code

test

Untitled PHP (11-Mar @ 22:22)

Syntax Highlighted Code

  1. <? php
  2. echo: "ciao"
  3. ?>

Plain Code

<? php
echo: "ciao"
?>

Untitled PHP (11-Mar @ 07:07)

Syntax Highlighted Code

  1. big text area

Plain Code

big text area

Untitled PHP (11-Mar @ 00:23)

Syntax Highlighted Code

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <HTML language=VBS><HEAD><TITLE>Welcome to CD4&nbsp; -&nbsp; CD - DVD
  3. Duplication, CD - DVD Replication, CD - DVD Duplicators, CD - DVD Printers,
  4. Blank CDs and DVDs</TITLE>
  5. [415 more lines...]

Plain Code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML language=VBS><HEAD><TITLE>Welcome to CD4&nbsp; -&nbsp; CD - DVD 
Duplication, CD - DVD Replication, CD - DVD Duplicators, CD - DVD Printers, 
Blank CDs and DVDs</TITLE>
<META http-equiv=Content-Language content=es-mx>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<SCRIPT>
function popup(url,name,wwidth,wheight) {
window.open(url,name,'width='+wwidth+',height='+wheight+',scrollbars=no');
}
</SCRIPT>

<STYLE type=text/css>A:link {
    COLOR: #006699; FONT-FAMILY: "Verdana"; TEXT-DECORATION: none
}
A:visited {
    COLOR: #006699; FONT-FAMILY: "Verdana"; TEXT-DECORATION: none
}
A:active {
    COLOR: #006699; FONT-FAMILY: "verdana"; TEXT-DECORATION: none
}
</STYLE>

<SCRIPT language=javascript>
<!--
function mOvr(src,clrOver) {
if (!src.contains(event.fromElement)) {
src.style.cursor = 'hand';
src.bgColor = clrOver;
}
}
function mOut(src,clrIn) {
if (!src.contains(event.toElement)) {
src.style.cursor = 'default';
src.bgColor = clrIn;
}
}
function mClk(src) {
if(event.srcElement.tagName=='TD'){
src.children.tags('A')[0].click();
}
}
// -->    
</SCRIPT>

<META http-equiv=Content-Language content=es>
<script language="JavaScript" fptype="dynamicanimation">
<!--
function dynAnimation() {}
function clickSwapImg() {}
//-->
</script>
<script language="JavaScript1.2" fptype="dynamicanimation" src="file:///C:/Program%20Files/FrontPage2003/OFFICE11/fpclass/animate.js">
</script>
</HEAD>
<BODY text=#000000 vLink=#CC9900 aLink=#CC9900 link=#CC9900 bgColor=#E7E7E7 
leftMargin=0 topMargin=0 marginwidth="0" marginheight="0" bgproperties="fixed" onload="dynAnimation()" language="Javascript1.2" background="index/fondofinal.jpg">
<table border="0" width="763" cellspacing="0" cellpadding="0">
    <tr>
        <td>
        <img border="0" src="index/Header.jpg" width="775" height="147"></td>
        <td rowspan="3" style="border-left: 1px dotted #515151; border-right-width: 1px; border-top-width: 1px; border-bottom-width: 1px" width="40">
        <table border="0" width="61" height="100%" cellspacing="0" cellpadding="0">
            <tr>
                <td>&nbsp;</td>
            </tr>
        </table>
        </td>
    </tr>
    <tr>
        <td height="542">
        <table border="0" width="100%" cellspacing="0" cellpadding="0" height="104%">
            <tr>
                <td width="225" background="index/fondoizq.jpg" bgcolor="#242424">
                <table border="0" width="100%" cellspacing="0" cellpadding="0" height="524">
                    <tr>
                        <td colspan="2">
                        <table border="0" width="100%" cellspacing="0" cellpadding="0">
                            <tr>
                                <td>
                                <table border="0" width="100%" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td align="right" width="233">
                                        <a onmouseover="var img=document['fpAnimswapImgFP1'];img.imgRolln=img.src;img.src=img.lowsrc?img.lowsrc:img.getAttribute?img.getAttribute('lowsrc'):img.src;" onmouseout="document['fpAnimswapImgFP1'].src=document['fpAnimswapImgFP1'].imgRolln" href="http://www.cd4replications.com/Repl/index1.htm">
                                        <img border="0" src="index/1.jpg" width="192" height="32" id="fpAnimswapImgFP1" name="fpAnimswapImgFP1" dynamicanimation="fpAnimswapImgFP1" lowsrc="index/1b.jpg"></a></td>
                                    </tr>
                                    <tr>
                                        <td align="right" width="233">
                                        <a onmouseover="var img=document['fpAnimswapImgFP2'];img.imgRolln=img.src;img.src=img.lowsrc?img.lowsrc:img.getAttribute?img.getAttribute('lowsrc'):img.src;" onmouseout="document['fpAnimswapImgFP2'].src=document['fpAnimswapImgFP2'].imgRolln" href="http://www.cd4replications.com/Dupl/index.htm">
                                        <img border="0" src="index/2.jpg" width="192" height="33" id="fpAnimswapImgFP2" name="fpAnimswapImgFP2" dynamicanimation="fpAnimswapImgFP2" lowsrc="index/2b.jpg"></a></td>
                                    </tr>
                                    <tr>
                                        <td align="right" width="233">
                                        <a onmouseover="var img=document['fpAnimswapImgFP3'];img.imgRolln=img.src;img.src=img.lowsrc?img.lowsrc:img.getAttribute?img.getAttribute('lowsrc'):img.src;" onmouseout="document['fpAnimswapImgFP3'].src=document['fpAnimswapImgFP3'].imgRolln" href="http://www.cd4replications.com/Vinyl/vinyl.htm">
                                        <img border="0" src="index/3.jpg" width="192" height="32" id="fpAnimswapImgFP3" name="fpAnimswapImgFP3" dynamicanimation="fpAnimswapImgFP3" lowsrc="index/3b.jpg"></a></td>
                                    </tr>
                                    <tr>
                                        <td align="right" width="233">
                                        <a onmouseover="var img=document['fpAnimswapImgFP4'];img.imgRolln=img.src;img.src=img.lowsrc?img.lowsrc:img.getAttribute?img.getAttribute('lowsrc'):img.src;" onmouseout="document['fpAnimswapImgFP4'].src=document['fpAnimswapImgFP4'].imgRolln" href="http://www.cd4replications.com/mastering.htm">
                                        <img border="0" src="index/4.jpg" width="192" height="32" id="fpAnimswapImgFP4" name="fpAnimswapImgFP4" dynamicanimation="fpAnimswapImgFP4" lowsrc="index/4b.jpg"></a></td>
                                    </tr>
                                    <tr>
                                        <td align="right" width="233">
                                        <a onmouseover="var img=document['fpAnimswapImgFP5'];img.imgRolln=img.src;img.src=img.lowsrc?img.lowsrc:img.getAttribute?img.getAttribute('lowsrc'):img.src;" onmouseout="document['fpAnimswapImgFP5'].src=document['fpAnimswapImgFP5'].imgRolln" href="http://www.cd4replications.com/design/index.htm">
                                        <img border="0" src="index/5.jpg" width="192" height="33" id="fpAnimswapImgFP5" name="fpAnimswapImgFP5" dynamicanimation="fpAnimswapImgFP5" lowsrc="index/5b.jpg"></a></td>
                                    </tr>
                                    <tr>
                                        <td align="right" width="233">
                                        <a onmouseover="var img=document['fpAnimswapImgFP6'];img.imgRolln=img.src;img.src=img.lowsrc?img.lowsrc:img.getAttribute?img.getAttribute('lowsrc'):img.src;" onmouseout="document['fpAnimswapImgFP6'].src=document['fpAnimswapImgFP6'].imgRolln" href="http://www.cd4replications.com/printing/index.htm">
                                        <img border="0" src="index/6.jpg" width="192" height="32" id="fpAnimswapImgFP6" name="fpAnimswapImgFP6" dynamicanimation="fpAnimswapImgFP6" lowsrc="index/6b.jpg"></a></td>
                                    </tr>
                                    <tr>
                                        <td align="right" width="233">
                                        <a onmouseover="var img=document['fpAnimswapImgFP7'];img.imgRolln=img.src;img.src=img.lowsrc?img.lowsrc:img.getAttribute?img.getAttribute('lowsrc'):img.src;" onmouseout="document['fpAnimswapImgFP7'].src=document['fpAnimswapImgFP7'].imgRolln" href="http://www.cd4replications.com/Templates/index.htm">
                                        <img border="0" src="index/7.jpg" width="192" height="33" id="fpAnimswapImgFP7" name="fpAnimswapImgFP7" dynamicanimation="fpAnimswapImgFP7" lowsrc="index/7b.jpg"></a></td>
                                    </tr>
                                    <tr>
                                        <td align="right" width="233">
                                        <a onmouseover="var img=document['fpAnimswapImgFP9'];img.imgRolln=img.src;img.src=img.lowsrc?img.lowsrc:img.getAttribute?img.getAttribute('lowsrc'):img.src;" onmouseout="document['fpAnimswapImgFP9'].src=document['fpAnimswapImgFP9'].imgRolln" href="http://www.cd4replications.com/Forms/forms.htm">
                                        <img border="0" src="index/8.jpg" width="192" height="32" id="fpAnimswapImgFP9" name="fpAnimswapImgFP9" dynamicanimation="fpAnimswapImgFP9" lowsrc="index/8b.jpg"></a></td>
                                    </tr>
                                </table>
                                </td>
                            </tr>
                        </table>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                        <a onmouseover="var img=document['fpAnimswapImgFP8'];img.imgRolln=img.src;img.src=img.lowsrc?img.lowsrc:img.getAttribute?img.getAttribute('lowsrc'):img.src;" onmouseout="document['fpAnimswapImgFP8'].src=document['fpAnimswapImgFP8'].imgRolln" href="http://www.cd4replications.com/Contact/index.htm">
                        <img border="0" src="index/9.jpg" width="192" height="33" align="right" id="fpAnimswapImgFP8" name="fpAnimswapImgFP8" dynamicanimation="fpAnimswapImgFP8" lowsrc="index/9b.jpg"></a></td>
                    </tr>
                    <tr>
                        <td colspan="2">&nbsp;</td>
                    </tr>
                    <tr>
                        <td colspan="2">
                        <a href="http://www.cd4replications.com/vs1.htm">
                        <img border="0" src="index/minibanner12.jpg" width="191" height="49" align="right"></a></td>
                    </tr>
                    <tr>
                        <td colspan="2">
                        &nbsp;</td>
                    </tr>
                    <tr>
                        <td width="13%">
                        &nbsp;</td>
                        <td width="87%" rowspan="6">
                        <table border="0" width="100%" cellspacing="0" cellpadding="0">
                            <tr>
                                <td>
                        <a href="http://www.cd4replications.com/printing/index.htm">
                        <img border="0" src="index/PRINTING.jpg" width="191" height="56" align="right"></a></td>
                            </tr>
                            <tr>
                                <td>
                        <hr color="#4F4F4F" size="0"></td>
                            </tr>
                            <tr>
                                <td>
                        <a href="http://www.cd4replications.com/Templates/index.htm">
                        <img border="0" src="index/template1.jpg" width="191" height="32" align="right"></a></td>
                            </tr>
                        </table>
                        </td>
                    </tr>
                    <tr>
                        <td width="13%">
                        &nbsp;</td>
                    </tr>
                    <tr>
                        <td width="13%">
                        &nbsp;</td>
                    </tr>
                    <tr>
                        <td width="13%">
                        &nbsp;</td>
                    </tr>
                    <tr>
                        <td width="13%">
                        &nbsp;</td>
                    </tr>
                    <tr>
                        <td width="13%">
                        &nbsp;</td>
                    </tr>
                    <tr>
                        <td colspan="2">
                        &nbsp;</td>
                    </tr>
                    <tr>
                        <td colspan="2">
                        &nbsp;</td>
                    </tr>
                    <tr>
                        <td colspan="2">
                        &nbsp;</td>
                    </tr>
                    </table>
                </td>
                <td background="index/fondoder.jpg" bgcolor="#242424">
                <table border="0" width="100%" cellspacing="0" cellpadding="0" height="536">
                    <tr>
                        <td colspan="2">
                        <table border="0" width="100%" height="309" cellspacing="0" cellpadding="0">
                            <tr>
                                <td height="253" width="3%">&nbsp;</td>
                                <td height="253" width="97%">
                                <img border="0" src="index/BANNER.jpg" width="507" height="257"></td>
                            </tr>
                            <tr>
                                <td>&nbsp;</td>
                                <td>
                                <table border="0" width="100%" cellspacing="0" cellpadding="0" height="100%">
                                    <tr>
                                        <td bgcolor="#FFFFFF" style="border-left-width: 1px; border-right-width: 1px; border-top: 1px dotted #808080; border-bottom-width: 1px">
                                        <table border="0" width="100%" cellspacing="0" cellpadding="0" height="100%">
                                            <tr>
                                                <td bgcolor="#000000" style="border-bottom: 1px dotted #FFFFFF">
                                                <table border="0" width="100%" cellspacing="0" cellpadding="0">
                                                    <tr>
                                                        <td>
                                                        <p align="center" style="margin-left: 8px">
                                                        <font face="Arial" style="font-size: 9pt" color="#FFFFFF">
                                                        We can Supply all 
                                                        your needs.&nbsp;&nbsp;&nbsp;&nbsp; 
                                                        Even if you only need 
                                                        one copy!</font></td>
                                                    </tr>
                                                </table>
                                                </td>
                                            </tr>
                                        </table>
                                        </td>
                                    </tr>
                                </table>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" height="21">
                                <span style="font-size: 5pt">&nbsp;</span></td>
                            </tr>
                        </table>
                        </td>
                        <td width="5%" rowspan="2">&nbsp;</td>
                    </tr>
                    <tr>
                        <td width="3%" height="237">&nbsp;</td>
                        <td width="92%" height="237">
                        <table border="0" width="100%" height="102%" cellspacing="0" cellpadding="0">
                            <tr>
                                <td height="60">
                                <table border="0" width="100%" cellspacing="0" cellpadding="0" height="223">
                                    <tr>
                                        <td width="264" align="justify" style="border-left: 1px dotted #C0C0C0" height="96">
                                        <p style="margin-left: 10px">
                                        <font face="Tahoma" color="#E8E8E8" style="font-size: 10pt">
                                        CD4 Replications is a full-service 
                                        replication company committed to giving 
                                        you high quality, low prices and 
                                        personalized attention. We offer a 
                                        variety of services for the range of 
                                        your needs.</font></td>
                                        <td width="14" height="96">&nbsp;</td>
                                        <td rowspan="3">
                                        <table border="0" width="100%" cellspacing="0" cellpadding="0">
                                            <tr>
                                                <td>
                                        <table border="0" width="100%" cellspacing="0" cellpadding="0">
                                            <tr>
                                <td height="28" align="right" style="border-left: 1px dotted #C0C0C0" width="99%">
                                <table border="0" width="85%" cellspacing="0" cellpadding="0" height="27">
                                    <tr>
                                        <td style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom: 1px dotted #F1D511">
                                <p align="right" style="margin-right: 5px">
                                <i><b>
                                <font face="Arial" color="#F1D511" style="font-size: 9pt">
                                6 easy steps in getting started</font></b></i></td>
                                    </tr>
                                </table>
                                </td>
                                            </tr>
                                            <tr>
                                                <td align="right" style="border-left: 1px dotted #C0C0C0">
                                                <table border="0" width="226" cellspacing="3" cellpadding="0" height="131">
                                                    <!-- MSTableType="nolayout" -->
                                                    <tr>
                                                        <td align="right" colspan="3" height="12">
                        <font size="1">&nbsp;</font></td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right" rowspan="6" width="37">
                        &nbsp;</td>
                                                        <td align="right">
                        <font face="Trebuchet MS" color="#DBDBDB" style="font-size: 9pt">
                        Choose your package</font></td>
                                                        <td align="right" height="19">
                                                        <img border="0" src="index/dot.jpg" width="3" height="3"></td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right" style="border-top: 1px dotted #C0C0C0">
                        <font face="Trebuchet MS" color="#DBDBDB" style="font-size: 9pt">
                        CD/DVD Master</font></td>
                                                        <td align="right" height="19">
                                                        <img border="0" src="index/dot.jpg" width="3" height="3"></td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right" style="border-top: 1px dotted #C0C0C0">
                        <font face="Trebuchet MS" color="#DBDBDB" style="font-size: 9pt">
                        CD/DVD Artwork</font></td>
                                                        <td align="right" height="19">
                                                        <img border="0" src="index/dot.jpg" width="3" height="3"></td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right" style="border-top: 1px dotted #C0C0C0">
                        <font face="Trebuchet MS" color="#DBDBDB" style="font-size: 9pt">
                        Printed Material</font></td>
                                                        <td align="right" height="19">
                                                        <img border="0" src="index/dot.jpg" width="3" height="3"></td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right" style="border-top: 1px dotted #C0C0C0">
                        <font face="Trebuchet MS" color="#DBDBDB" style="font-size: 9pt">
                        Fill out the forms</font></td>
                                                        <td align="right" height="19">
                                                        <img border="0" src="index/dot.jpg" width="3" height="3"></td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right" width="175" style="border-top: 1px dotted #C0C0C0">
                        <font face="Trebuchet MS" color="#DBDBDB" style="font-size: 9pt">
                        Submit your order</font></td>
                                                        <td width="15" align="right" height="19">
                                                        <img border="0" src="index/dot.jpg" width="3" height="3"></td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right" colspan="3" height="5">
                        <span style="font-size: 4pt">&nbsp;</span></td>
                                                        </tr>
                                                </table>
                                                </td>
                                            </tr>
                                            </table>
                                                </td>
                                            </tr>
                                        </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="264" align="justify" style="border-left: 1px dotted #C0C0C0" height="19">
                                        <font style="font-size: 6pt">&nbsp;</font></td>
                                        <td width="14" height="19">&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td width="264" align="justify" style="border-left: 1px dotted #C0C0C0" height="64">
                                        <p style="margin-left: 10px">
                                        <font face="Tahoma" color="#E8E8E8" style="font-size: 10pt">
                                        From quick turnaround orders to high 
                                        volume projects. We provide complete 
                                        replication and duplication services, as 
                                        well as design and printing</font></td>
                                        <td width="14" height="64">&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td width="265" align="justify">
                                        &nbsp;</td>
                                        <td width="14">&nbsp;</td>
                                        <td rowspan="2">
                                        <table border="0" width="100%" cellspacing="0" cellpadding="0">
                                            <tr>
                                                <td>&nbsp; </td>
                                            </tr>
                                            <tr>
                                                <td>&nbsp; </td>
                                            </tr>
                                        </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="265" align="justify">
                                        &nbsp;</td>
                                        <td width="14">&nbsp;</td>
                                    </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td height="23">&nbsp;</td>
                            </tr>
                        </table>
                        </td>
                    </tr>
                    </table>
                </td>
            </tr>
        </table>
        </td>
    </tr>
    <tr>
        <td style="border-top: 1px dotted #C0C0C0; border-bottom: 1px dotted #C0C0C0">
        <table border="0" width="100%" cellspacing="0" cellpadding="0" height="32">
            <tr>
                <td bgcolor="#000000" width="33">&nbsp;</td>
                <td bgcolor="#000000">
                <font face="Arial" style="font-size: 8pt" color="#D9BF0D">
                323-663-7853 | 4242 W. Sunset Blvd, Suite 2 | Los Angeles, CA 
                90029</font></td>
                <td width="278" bgcolor="#000000">
                <p align="right">
                <font face="Arial" style="font-weight: 700" size="1" color="#F1D511">
                <a href="mailto:info@cd4replications.com">
                <font face="Arial" color="#F1D511">Get a Quote </font></a>| 
                <a href="index.htm"><font face="Arial" color="#F1D511">Home</font></a> </font></td>
                <td width="30" bgcolor="#000000">&nbsp;</td>
            </tr>
        </table>
        </td>
    </tr>
</table>

                </BODY></HTML>

Untitled PHP (10-Mar @ 17:59)

Syntax Highlighted Code

  1. asas

Plain Code

asas

Untitled PHP (10-Mar @ 08:36)

Syntax Highlighted Code

  1. sdfsdgdsfg

Plain Code

sdfsdgdsfg

Untitled PHP (9-Mar @ 14:09)

Syntax Highlighted Code

  1. dd

Plain Code

dd

Untitled PHP (8-Mar @ 01:00)

Syntax Highlighted Code

  1. ddssdf
  2. sd
  3. f
  4. sd
  5. sdfdsf

Plain Code

ddssdf
sd
f
sd
sdfdsf

Untitled PHP (7-Mar @ 21:39)

Syntax Highlighted Code

  1. <?
  2. ?>

Plain Code

<?
phpInfo();
?>

Untitled PHP (7-Mar @ 15:59)

Syntax Highlighted Code

  1. <?php echo 'A ver' ?>

Plain Code

<?php echo 'A ver' ?>

Untitled PHP (6-Mar @ 18:57)

Syntax Highlighted Code

  1. <?php
  2.  echo "nader";
  3. ?>

Plain Code

<?php
 echo "nader";
?>

Untitled PHP (6-Mar @ 11:04)

Syntax Highlighted Code

  1. <?
  2. echo "Hello";
  3. ?>

Plain Code

<?
echo "Hello";
?>

teste (3-Mar @ 14:49)

Syntax Highlighted Code

  1. teste

Plain Code

teste

Untitled PHP (24-Feb @ 19:22)

Syntax Highlighted Code

  1. <?
  2.   include_once '../config/config.php';
  3.   include_once $setts['themDir'] . "/_classes/membersarea/migration/accountMigrationMain.class.php";
  4.  
  5. [163 more lines...]

Plain Code

<?
  include_once '../config/config.php';
  include_once $setts['themDir'] . "/_classes/membersarea/migration/accountMigrationMain.class.php";

  $bbParserObj = new BBparser();

  function parceDetailFinal($text) {
      global $bbParserObj;
      $text = str_replace("\n", "<br>", $text);
      return $bbParserObj->BB_Parse(addSpecialChars($text),false);
  }

  function getUahAmountConverted($amount, $currency) {
      if ($currency == 'UAH') {
          return (float)$amount;
      }

      $currency = empty($currency) ? 'USD' : $currency;
      $getCurrentCurrency = getSqlRow("SELECT * FROM probid_currencies WHERE symbol = '" . $currency . "'");

      $getAllCurrencies = mysql_query("SELECT * FROM probid_currencies WHERE symbol != '" . $currency . "'");
      while($convert = mysql_fetch_array($getAllCurrencies)) {
          $converted = $amount * ($getCurrentCurrency['converter'] / $convert['converter']);
          if ($convert['symbol'] == 'UAH') {
              return (float)$converted;
          }
      }
  }

  function convertFuncCallback(&$e) {
      $e = iconv('windows-1251', 'utf-8//IGNORE', $e);
  }

  function migrationCronCriticalError($migrationID, $soapFault) {
      $faultTrace = $soapFault->getTrace();
      mysql_query("INSERT INTO probid_migration_item_error VALUES (NULL, ".(int)$migrationID.", '".mysql_real_escape_string($faultTrace[1]['function'])."', '".mysql_real_escape_string(soapExceptionFaultEncoded($soapFault->getMessage()))."', NOW())");
      mysql_query("UPDATE probid_migration_item SET state = 'error' WHERE id = ".(int)$migrationID);
  }


  // Some auction options
  $arrayDurationAuction = array( 3 => 0, 5 => 1, 7 => 2, 10 => 3, 14 => 4, 21 => 5);
  $arrayQueryMethods = array(
      'current' => 'SELECT * FROM probid_auctions AS a LEFT JOIN probid_migration_item_state AS s ON (a.id = s.auc_item_id AND a.ownerid = s.auc_user_id) WHERE s.id IS NULL AND a.ownerid = %s AND a.closed = 0 AND a.deleted != 1 AND a.active = 1'
      'closed' => 'SELECT * FROM probid_auctions_closed AS c LEFT JOIN probid_migration_item_state AS s ON (c.id = s.auc_item_id AND c.ownerid = s.auc_user_id) WHERE s.id IS NULL AND c.ownerid = %s AND c.closed = 1 AND c.deleted != 1 AND c.active = 1 AND DATE_ADD(c.enddate, INTERVAL 2 MONTH) > NOW()'
      'limit' => 100
  );

  mb_internal_encoding("UTF-8");

  $query = mysql_query("SELECT * FROM probid_migration_item WHERE state = 'work' ORDER BY id LIMIT 1");

  while ($dataApp = mysql_fetch_assoc($query)) {
      // Connect to SOAP server
      try {
          $soapClient = new SoapClient(accountMigrationMain::$soapConfig['soapURL']);
      } catch (Exception $soapFault) {
          migrationCronCriticalError($dataApp['id'], $soapFault);
          break;
      }
      // Get local version ID
      try {
          $soapSysVersion = $soapClient->doQuerySysStatus(1, accountMigrationMain::$soapConfig['countryID'], accountMigrationMain::$soapConfig['apiKey']);
      } catch (Exception $soapFault) {
          migrationCronCriticalError($dataApp['id'], $soapFault);
          break;
      }

      array_walk($dataApp, 'convertFuncCallback');
      // Try to login
      try {
          $soapUserSession = $soapClient->doLogin($dataApp['aukro_login'], $dataApp['aukro_pass'], accountMigrationMain::$soapConfig['countryID'], accountMigrationMain::$soapConfig['apiKey'], $soapSysVersion['ver-key']);
      } catch (Exception $soapFault) {
          migrationCronCriticalError($dataApp['id'], $soapFault);
          break;
      }
      // Get user personal data
      try {
          $soapUserInfo = $soapClient->doGetMyData($soapUserSession['session-handle-part']);
      } catch (Exception $soapFault) {
          migrationCronCriticalError($dataApp['id'], $soapFault);
          break;
      }
      // Prepare query
      if ($dataApp['move_current'] == 'Y' && $dataApp['move_closed'] == 'N') { // only current item's
          $queryItems = mysql_query(sprintf($arrayQueryMethods['current'], (int)$dataApp['auc_id']) . " LIMIT " . $arrayQueryMethods['limit']);
      } else if ($dataApp['move_current'] == 'N' && $dataApp['move_closed'] == 'Y') { // only closed item's
          $queryItems = mysql_query(sprintf($arrayQueryMethods['closed'], (int)$dataApp['auc_id']) . " LIMIT " . $arrayQueryMethods['limit']);
      } else if ($dataApp['move_current'] == 'Y' && $dataApp['move_closed'] == 'Y') { // all item's
          $queryItems = mysql_query("(" . sprintf($arrayQueryMethods['current'], (int)$dataApp['auc_id']) . ") UNION (" . sprintf($arrayQueryMethods['closed'], (int)$dataApp['auc_id']) . ") LIMIT " . $arrayQueryMethods['limit']);
      }
      if (mysql_num_rows($queryItems) == 0) {
          mysql_query("UPDATE probid_migration_item SET state = 'complete' WHERE id = ".(int)$dataApp['id']);
      }
      while ($dataItem = mysql_fetch_assoc($queryItems)) {
         $dataItem['description'] = parceDetailFinal($dataItem['description']);
         $dataItem['itemname'] = addSpecialChars($dataItem['itemname']);
         array_walk($dataItem, 'convertFuncCallback');
         $affectedArray = array(
             array('fid' => 1, 'fvalue-string' => mb_strcut($dataItem['itemname'], 0, 49)), // itemname
             array('fid' => 2, 'fvalue-int' => 28721), // category
             array('fid' => 4, 'fvalue-int' => array_key_exists($dataItem['duration'], $arrayDurationAuction) ? $arrayDurationAuction[$dataItem['duration']] : 1), // duration
             array('fid' => 5, 'fvalue-int' => 1), // quantity
             array('fid' => 6, 'fvalue-float' => getUahAmountConverted($dataItem['bidstart'], $dataItem['currency'])), // start bid
             array('fid' => 9, 'fvalue-int' => (int)$soapUserInfo['user-data']->{'user-country-id'}), // country
             array('fid' => 10, 'fvalue-int' => (int)$soapUserInfo['user-data']->{'user-state-id'}), // state
             array('fid' => 11, 'fvalue-string' => $soapUserInfo['user-data']->{'user-city'}), // city
             array('fid' => 12, 'fvalue-int' => $dataItem['sc'] == 'SP' ? 0 : 1), // delivery
             array('fid' => 13, 'fvalue-int' => empty($dataItem['shipping_details']) ? 1 : 16), // delivery additional
             array('fid' => 24, 'fvalue-string' => $dataItem['description']), // description
             array('fid' => 27, 'fvalue-string' => mb_strcut($dataItem['shipping_details'], 0, 450)), // shipping_details
             array('fid' => 40, 'fvalue-int' => 1) // pay method
         );

         if ($dataItem['rp'] == 'Y' && $soapUserInfo['user-data']->{'user-rating'} >=3) { // reserv price
            $affectedArray[] = array('fid' => 7, 'fvalue-float' => getUahAmountConverted($dataItem['rpvalue'], $dataItem['currency']));
         }

         if ($dataItem['bn'] == 'Y') { // buy now
            $affectedArray[] = array('fid' => 8, 'fvalue-float' => getUahAmountConverted($dataItem['bnvalue'], $dataItem['currency']));
         }

         if ($dataItem['sc'] == 'SD') { //self delivery
            $affectedArray[] = array('fid' => 35, 'fvalue-int' => 1);
         }

         // Parce image's
         $userImageArray = array_merge((array)$dataItem['picpath'], getUserImages($dataItem['ownerid'], '1 day'));

         $imageInterator = 16;
         foreach ($userImageArray as $singleImage) {
             $fileImageName = strpos($singleImage, "http://") === false ? $site_root . $singleImage : $singleImage;
             if (!empty($singleImage) && file_exists($fileImageName)) {
                 $imageCode = @file_get_contents($fileImageName);
                 if(!empty($imageCode) && $imageInterator < 22) {
                     $affectedArray[] = array('fid' => $imageInterator++, 'fvalue-image' => $imageCode);
                 }
             }
         }


         // Add obligatory field
         $obligatoryField = array('fvalue-string', 'fvalue-int', 'fvalue-float', 'fvalue-image', 'fvalue-text', 'fvalue-datetime', 'fvalue-boolean');

         foreach ($affectedArray as &$propertyArray) {
            foreach ($obligatoryField as $oblField) {
              if (array_key_exists($oblField, $propertyArray)) continue;
              $propertyArray[$oblField] = '';
            }
         }

         // Post new auction to aukro
         try {
             $postResult = $soapClient->doNewAuctionExt($soapUserSession['session-handle-part'], $affectedArray, 0, 565551486);
             mysql_query("INSERT INTO probid_migration_item_state VALUES(NULL, ".(int)$dataItem['ownerid'].", ".(int)$dataItem['id'].", ".(int)$postResult['item-id'].", 'done', NOW())");
         } catch(Exception $soapFault) {
             mysql_query("INSERT INTO probid_migration_item_state VALUES(NULL, ".(int)$dataItem['ownerid'].", ".(int)$dataItem['id'].", 0, 'error', NOW())");
             $lastStateID = mysql_insert_id();
             if ($lastStateID > 0) {
                 mysql_query("INSERT INTO probid_migration_item_state_error VALUES(NULL, ".$lastStateID.", '".mysql_real_escape_string(soapExceptionFaultEncoded($soapFault->getMessage()))."'))");
             }
         }


      }
      mysql_free_result($queryItems);
  }
?>

Untitled PHP (28-Jan @ 22:49)

Syntax Highlighted Code

  1. <?php
  2.     $x++;
  3. ?>

Plain Code

<?php
    $x++;
?>

templates/subsilver2/ucp_register.html (26-Jan @ 13:06)

desbest.myopenid.com

Syntax Highlighted Code

  1. <!-- INCLUDE overall_header.html -->
  2.  
  3. <script type="text/javascript">
  4. // <![CDATA[
  5. [114 more lines...]

Plain Code

<!-- INCLUDE overall_header.html -->

<script type="text/javascript">
// <![CDATA[
    /**
    * Change language
    */
    function change_language(lang_iso)
    {
        document.forms['register'].change_lang.value = lang_iso;
        document.forms['register'].submit.click();
    }

// ]]>
</script>

<form name="register" method="post" action="{S_UCP_ACTION}">

<table class="tablebg" width="100%" cellspacing="1">
<tr>
    <th colspan="2" valign="middle">{L_REGISTRATION}</th>
</tr>

<!-- IF ERROR -->
    <tr>
        <td class="row3" colspan="2" align="center"><span class="gensmall error">{ERROR}</span></td>
    </tr>
<!-- ENDIF -->

<!-- IF L_REG_COND -->
    <tr>
        <td class="row2" colspan="2"><span class="gensmall">{L_REG_COND}</span></td>
    </tr>
<!-- ENDIF -->
<!-- IF .profile_fields -->
    <tr>
        <td class="row2" colspan="2"><span class="gensmall">{L_ITEMS_REQUIRED}</span></td>
    </tr>
<!-- ENDIF -->
<!-- desbest edit starts -->
<tr>
    <td class="row1"><span class="gen">What is is 5+2?</span></td>
    <td class="row2">
        <input type="text" class="post" style="width: 200px" name="math_question" value="{MATH_QUESTION}"size="6" maxlength="6" value="" />
    </td>
</tr>
<!-- desbest edit ends -->
<tr>
    <td class="row1" width="38%"><b class="genmed">{L_USERNAME}: </b><br /><span class="gensmall">{L_USERNAME_EXPLAIN}</span></td>
    <td class="row2"><input class="post" type="text" name="username" size="25" value="{USERNAME}" /></td>
</tr>
<tr>
    <td class="row1"><b class="genmed">{L_EMAIL_ADDRESS}: </b></td>
    <td class="row2"><input class="post" type="text" name="email" size="25" maxlength="100" value="{EMAIL}" /></td>
</tr>
<tr>
    <td class="row1"><b class="genmed">{L_CONFIRM_EMAIL}: </b></td>
    <td class="row2"><input class="post" type="text" name="email_confirm" size="25" maxlength="100" value="{EMAIL_CONFIRM}" /></td>
</tr>
<tr>
    <td class="row1"><b class="genmed">{L_PASSWORD}: </b><br /><span class="gensmall">{L_PASSWORD_EXPLAIN}</span></td>
    <td class="row2"><input class="post" type="password" name="new_password" size="25" value="{PASSWORD}" /></td>
</tr>
<tr>
    <td class="row1"><b class="genmed">{L_CONFIRM_PASSWORD}: </b></td>
    <td class="row2"><input class="post" type="password" name="password_confirm" size="25" value="{PASSWORD_CONFIRM}" /></td>
</tr>
<tr>
    <td class="row1"><b class="genmed">{L_LANGUAGE}: </b></td>
    <td class="row2"><select name="lang" onchange="change_language(this.value); return false;">{S_LANG_OPTIONS}</select></td>
</tr>
<tr>
    <td class="row1"><b class="genmed">{L_TIMEZONE}: </b></td>
    <td class="row2"><select name="tz">{S_TZ_OPTIONS}</select></td>
</tr>
<!-- BEGIN profile_fields -->
    <tr>
        <td class="row1" width="35%">
            <b class="genmed">{profile_fields.LANG_NAME}: </b>
            <!-- IF profile_fields.S_REQUIRED --><b>*</b><!-- ENDIF -->
            <!-- IF profile_fields.LANG_EXPLAIN --><br /><span class="gensmall">{profile_fields.LANG_EXPLAIN}</span><!-- ENDIF -->
        </td>
        <td class="row2">{profile_fields.FIELD}<!-- IF profile_fields.ERROR --><br /><span class="gensmall error">{profile_fields.ERROR}</span><!-- ENDIF --></td>
    </tr>
<!-- END profile_fields -->

<!-- IF S_CONFIRM_CODE -->
    <tr>
        <th colspan="2" valign="middle">{L_CONFIRMATION}</th>
    </tr>
    <tr>
        <td class="row3" colspan="2"><span class="gensmall">{L_CONFIRM_EXPLAIN}</span></td>
    </tr>
    <tr>
        <td class="row1" colspan="2" align="center">{CONFIRM_IMG}</td>
    </tr>
    <tr>
        <td class="row1"><b class="genmed">{L_CONFIRM_CODE}: </b><br /><span class="gensmall">{L_CONFIRM_CODE_EXPLAIN}</span></td>
        <td class="row2"><input class="post" type="text" name="confirm_code" size="8" maxlength="8" /></td>
    </tr>
<!-- ENDIF -->

<!-- IF S_COPPA -->
    <tr>
        <th colspan="2" valign="middle">{L_COPPA_COMPLIANCE}</th>
    </tr>
    <tr>
        <td class="row3" colspan="2"><span class="gensmall">{L_COPPA_EXPLAIN}</span></td>
    </tr>
<!-- ENDIF -->

<tr>
    <td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="submit" id="submit" value="{L_SUBMIT}" />  <input class="btnlite" type="reset" value="{L_RESET}" name="reset" /></td>
</tr>
</table>
{S_FORM_TOKEN}
</form>

<!-- INCLUDE overall_footer.html -->

includes/ucp/ucp_register.php (26-Jan @ 13:04)

desbest.myopenid.com

Syntax Highlighted Code

  1. <?php
  2. /**
  3. *
  4. * @package ucp
  5. [575 more lines...]

Plain Code

<?php
/**
*
* @package ucp
* @version $Id: ucp_register.php 8782 2008-08-23 17:20:55Z acydburn $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
    exit;
}

/**
* ucp_register
* Board registration
* @package ucp
*/
class ucp_register
{
    var $u_action;

    function main($id, $mode)
    {
        global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;

        //
        if ($config['require_activation'] == USER_ACTIVATION_DISABLE)
        {
            trigger_error('UCP_REGISTER_DISABLE');
        }

        include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);

        $confirm_id        = request_var('confirm_id', '');
        $coppa            = (isset($_REQUEST['coppa'])) ? ((!empty($_REQUEST['coppa'])) ? 1 : 0) : false;
        $agreed            = (!empty($_POST['agreed'])) ? 1 : 0;
        $submit            = (isset($_POST['submit'])) ? true : false;
        $change_lang    = request_var('change_lang', '');
        $user_lang        = request_var('lang', $user->lang_name);

        if ($agreed)
        {
            add_form_key('ucp_register');
        }
        else
        {
            add_form_key('ucp_register_terms');
        }


        if ($change_lang || $user_lang != $config['default_lang'])
        {
            $use_lang = ($change_lang) ? basename($change_lang) : basename($user_lang);

            if (file_exists($user->lang_path . $use_lang . '/'))
            {
                if ($change_lang)
                {
                    $submit = false;

                    // Setting back agreed to let the user view the agreement in his/her language
                    $agreed = (empty($_GET['change_lang'])) ? 0 : $agreed;
                }

                $user->lang_name = $lang = $use_lang;
                $user->lang = array();
                $user->add_lang(array('common', 'ucp'));
            }
            else
            {
                $change_lang = '';
                $user_lang = $user->lang_name;
            }
        }

        $cp = new custom_profile();

        $error = $cp_data = $cp_error = array();


        if (!$agreed || ($coppa === false && $config['coppa_enable']) || ($coppa && !$config['coppa_enable']))
        {
            $add_lang = ($change_lang) ? '&change_lang=' . urlencode($change_lang) : '';
            $add_coppa = ($coppa !== false) ? '&coppa=' . $coppa : '';

            $s_hidden_fields = ($confirm_id) ? array('confirm_id' => $confirm_id) : array();

            // If we change the language, we want to pass on some more possible parameter.
            if ($change_lang)
            {
                // We do not include the password
                $s_hidden_fields = array_merge($s_hidden_fields, array(
                    'username'            => utf8_normalize_nfc(request_var('username', '', true)),
                    'email'                => strtolower(request_var('email', '')),
                    'email_confirm'        => strtolower(request_var('email_confirm', '')),
                    'confirm_code'        => request_var('confirm_code', ''),
                    'confirm_id'        => request_var('confirm_id', ''),
                    'lang'                => $user->lang_name,
                    'tz'                => request_var('tz', (float) $config['board_timezone']),
                ));
            }

            if ($coppa === false && $config['coppa_enable'])
            {
                $now = getdate();
                $coppa_birthday = $user->format_date(mktime($now['hours'] + $user->data['user_dst'], $now['minutes'], $now['seconds'], $now['mon'], $now['mday'] - 1, $now['year'] - 13), $user->lang['DATE_FORMAT']);
                unset($now);

                $template->assign_vars(array(
                    'L_COPPA_NO'        => sprintf($user->lang['UCP_COPPA_BEFORE'], $coppa_birthday),
                    'L_COPPA_YES'        => sprintf($user->lang['UCP_COPPA_ON_AFTER'], $coppa_birthday),

                    'U_COPPA_NO'        => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&coppa=0' . $add_lang),
                    'U_COPPA_YES'        => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&coppa=1' . $add_lang),

                    'S_SHOW_COPPA'        => true,
                    'S_HIDDEN_FIELDS'    => build_hidden_fields($s_hidden_fields),
                    'S_UCP_ACTION'        => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register' . $add_lang),
                ));
            }
            else
            {
                $template->assign_vars(array(
                    'L_TERMS_OF_USE'    => sprintf($user->lang['TERMS_OF_USE_CONTENT'], $config['sitename'], generate_board_url()),

                    'S_SHOW_COPPA'        => false,
                    'S_REGISTRATION'    => true,
                    'S_HIDDEN_FIELDS'    => build_hidden_fields($s_hidden_fields),
                    'S_UCP_ACTION'        => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register' . $add_lang . $add_coppa),
                    )
                );
            }

            $this->tpl_name = 'ucp_agreement';
            return;
        }


        // Try to manually determine the timezone and adjust the dst if the server date/time complies with the default setting +/- 1
        $timezone = date('Z') / 3600;
        $is_dst = date('I');

        if ($config['board_timezone'] == $timezone || $config['board_timezone'] == ($timezone - 1))
        {
            $timezone = ($is_dst) ? $timezone - 1 : $timezone;

            if (!isset($user->lang['tz_zones'][(string) $timezone]))
            {
                $timezone = $config['board_timezone'];
            }
        }
        else
        {
            $is_dst = $config['board_dst'];
            $timezone = $config['board_timezone'];
        }

        //desbest edit: (look for math_question as that is the added edit)
        $data = array(
            'username'            => utf8_normalize_nfc(request_var('username', '', true)),
            'math_question'            => request_var('math_question', '', true),
            'new_password'        => request_var('new_password', '', true),
            'password_confirm'    => request_var('password_confirm', '', true),
            'email'                => strtolower(request_var('email', '')),
            'email_confirm'        => strtolower(request_var('email_confirm', '')),
            'confirm_code'        => request_var('confirm_code', ''),
            'lang'                => basename(request_var('lang', $user->lang_name)),
            'tz'                => request_var('tz', (float) $timezone),
        );

        // Check and initialize some variables if needed
        if ($submit)
        {
            $error = validate_data($data, array(
                'username'            => array(
                    array('string', false, $config['min_name_chars'], $config['max_name_chars']),
                    array('username', '')),
                'new_password'        => array(
                    array('string', false, $config['min_pass_chars'], $config['max_pass_chars']),
                    array('password')),
                'password_confirm'    => array('string', false, $config['min_pass_chars'], $config['max_pass_chars']),
                'email'                => array(
                    array('string', false, 6, 60),
                    array('email')),
                'email_confirm'        => array('string', false, 6, 60),
                'confirm_code'        => array('string', !$config['enable_confirm'], 5, 8),
                'tz'                => array('num', false, -14, 14),
                'lang'                => array('match', false, '#^[a-z_\-]{2,}$#i'),
            ));
            if (!check_form_key('ucp_register'))
            {
                $error[] = $user->lang['FORM_INVALID'];
            }
            
            //desbest edit starts
            if ($data['math_question'] != "7")
            {
                $error[] = "You silly spambot failed to get the question right";
                //echo "<h1>".$data['math_question']."question is wrong</h1>";
                //$error[] = $user->lang['MATH_QUESTION_ERROR'];
            }
            //desbest edit ends

            // Replace "error" strings with their real, localised form
            $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);

            // DNSBL check
            if ($config['check_dnsbl'])
            {
                if (($dnsbl = $user->check_dnsbl('register')) !== false)
                {
                    $error[] = sprintf($user->lang['IP_BLACKLISTED'], $user->ip, $dnsbl[1]);
                }
            }

            // validate custom profile fields
            $cp->submit_cp_field('register', $user->get_iso_lang_id(), $cp_data, $error);
            
            
            }
            

            //desbest edit: validation begins
            // Visual Confirmation handling
            $wrong_confirm = false;
            if ($config['enable_confirm'])
            {
                if (!$confirm_id)
                {
                    $error[] = $user->lang['CONFIRM_CODE_WRONG'];
                    $wrong_confirm = true;
                }
                else
                {
                    $sql = 'SELECT code
                        FROM ' . CONFIRM_TABLE . "
                        WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "'
                            AND session_id = '" . $db->sql_escape($user->session_id) . "'
                            AND confirm_type = " . CONFIRM_REG;
                    $result = $db->sql_query($sql);
                    $row = $db->sql_fetchrow($result);
                    $db->sql_freeresult($result);

                    if ($row)
                    {
                        if (strcasecmp($row['code'], $data['confirm_code']) === 0)
                        {
                            $sql = 'DELETE FROM ' . CONFIRM_TABLE . "
                                WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "'
                                    AND session_id = '" . $db->sql_escape($user->session_id) . "'
                                    AND confirm_type = " . CONFIRM_REG;
                            $db->sql_query($sql);
                        }
                        else
                        {
                            $error[] = $user->lang['CONFIRM_CODE_WRONG'];
                            $wrong_confirm = true;
                        }
                    }
                    else
                    {
                        $error[] = $user->lang['CONFIRM_CODE_WRONG'];
                        $wrong_confirm = true;
                    }
                }
            }
                //desbest edit
                //$damath = $user->lang['MATH_QUESTION_ERROR']; /* print_r($user->lang); */ exit();
                
                
                                                
            if (!sizeof($error))
            {
                if ($data['new_password'] != $data['password_confirm'])
                {
                    $error[] = $user->lang['NEW_PASSWORD_ERROR'];
                }

                if ($data['email'] != $data['email_confirm'])
                {
                    $error[] = $user->lang['NEW_EMAIL_ERROR'];
                }
            
            
            


            if (!sizeof($error))
            {
                $server_url = generate_board_url();

                // Which group by default?
                $group_name = ($coppa) ? 'REGISTERED_COPPA' : 'REGISTERED';

                $sql = 'SELECT group_id
                    FROM ' . GROUPS_TABLE . "
                    WHERE group_name = '" . $db->sql_escape($group_name) . "'
                        AND group_type = " . GROUP_SPECIAL;
                $result = $db->sql_query($sql);
                $row = $db->sql_fetchrow($result);
                $db->sql_freeresult($result);

                if (!$row)
                {
                    trigger_error('NO_GROUP');
                }

                $group_id = $row['group_id'];

                if (($coppa ||
                    $config['require_activation'] == USER_ACTIVATION_SELF ||
                    $config['require_activation'] == USER_ACTIVATION_ADMIN) && $config['email_enable'])
                {
                    $user_actkey = gen_rand_string(10);
                    $key_len = 54 - (strlen($server_url));
                    $key_len = ($key_len < 6) ? 6 : $key_len;
                    $user_actkey = substr($user_actkey, 0, $key_len);

                    $user_type = USER_INACTIVE;
                    $user_inactive_reason = INACTIVE_REGISTER;
                    $user_inactive_time = time();
                }
                else
                {
                    $user_type = USER_NORMAL;
                    $user_actkey = '';
                    $user_inactive_reason = 0;
                    $user_inactive_time = 0;
                }

                $user_row = array(
                    'username'                => $data['username'],
                    'user_password'            => phpbb_hash($data['new_password']),
                    'user_email'            => $data['email'],
                    'group_id'                => (int) $group_id,
                    'user_timezone'            => (float) $data['tz'],
                    'user_dst'                => $is_dst,
                    'user_lang'                => $data['lang'],
                    'user_type'                => $user_type,
                    'user_actkey'            => $user_actkey,
                    'user_ip'                => $user->ip,
                    'user_regdate'            => time(),
                    'user_inactive_reason'    => $user_inactive_reason,
                    'user_inactive_time'    => $user_inactive_time,
                );

                // Register user...
                $user_id = user_add($user_row, $cp_data);

                // This should not happen, because the required variables are listed above...
                if ($user_id === false)
                {
                    trigger_error('NO_USER', E_USER_ERROR);
                }

                if ($coppa && $config['email_enable'])
                {
                    $message = $user->lang['ACCOUNT_COPPA'];
                    $email_template = 'coppa_welcome_inactive';
                }
                else if ($config['require_activation'] == USER_ACTIVATION_SELF && $config['email_enable'])
                {
                    $message = $user->lang['ACCOUNT_INACTIVE'];
                    $email_template = 'user_welcome_inactive';
                }
                else if ($config['require_activation'] == USER_ACTIVATION_ADMIN && $config['email_enable'])
                {
                    $message = $user->lang['ACCOUNT_INACTIVE_ADMIN'];
                    $email_template = 'admin_welcome_inactive';
                }
                else
                {
                    $message = $user->lang['ACCOUNT_ADDED'];
                    $email_template = 'user_welcome';
                }

                if ($config['email_enable'])
                {
                    include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);

                    $messenger = new messenger(false);

                    $messenger->template($email_template, $data['lang']);

                    $messenger->to($data['email'], $data['username']);

                    $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
                    $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
                    $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
                    $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);

                    $messenger->assign_vars(array(
                        'WELCOME_MSG'    => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])),
                        'USERNAME'        => htmlspecialchars_decode($data['username']),
                        'PASSWORD'        => htmlspecialchars_decode($data['new_password']),
                        'U_ACTIVATE'    => "$server_url/ucp.$phpEx?mode=activate&u=$user_id&k=$user_actkey")
                    );

                    if ($coppa)
                    {
                        $messenger->assign_vars(array(
                            'FAX_INFO'        => $config['coppa_fax'],
                            'MAIL_INFO'        => $config['coppa_mail'],
                            'EMAIL_ADDRESS'    => $data['email'])
                        );
                    }

                    $messenger->send(NOTIFY_EMAIL);

                    if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
                    {
                        // Grab an array of user_id's with a_user permissions ... these users can activate a user
                        $admin_ary = $auth->acl_get_list(false, 'a_user', false);
                        $admin_ary = (!empty($admin_ary[0]['a_user'])) ? $admin_ary[0]['a_user'] : array();

                        // Also include founders
                        $where_sql = ' WHERE user_type = ' . USER_FOUNDER;

                        if (sizeof($admin_ary))
                        {
                            $where_sql .= ' OR ' . $db->sql_in_set('user_id', $admin_ary);
                        }

                        $sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type
                            FROM ' . USERS_TABLE . ' ' .
                            $where_sql;
                        $result = $db->sql_query($sql);

                        while ($row = $db->sql_fetchrow($result))
                        {
                            $messenger->template('admin_activate', $row['user_lang']);
                            $messenger->to($row['user_email'], $row['username']);
                            $messenger->im($row['user_jabber'], $row['username']);

                            $messenger->assign_vars(array(
                                'USERNAME'            => htmlspecialchars_decode($data['username']),
                                'U_USER_DETAILS'    => "$server_url/memberlist.$phpEx?mode=viewprofile&u=$user_id",
                                'U_ACTIVATE'        => "$server_url/ucp.$phpEx?mode=activate&u=$user_id&k=$user_actkey")
                            );

                            $messenger->send($row['user_notify_type']);
                        }
                        $db->sql_freeresult($result);
                    }
                }

                $message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
                trigger_error($message);
            }
        }

        $s_hidden_fields = array(
            'agreed'        => 'true',
            'change_lang'    => 0,
        );

        if ($config['coppa_enable'])
        {
            $s_hidden_fields['coppa'] = $coppa;
        }
        $s_hidden_fields = build_hidden_fields($s_hidden_fields);

        $confirm_image = '';

        // Visual Confirmation - Show images

        if ($config['enable_confirm'])
        {
            if ($change_lang)
            {
                $str = '&change_lang=' . $change_lang;
                $sql = 'SELECT code
                        FROM ' . CONFIRM_TABLE . "
                        WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "'
                            AND session_id = '" . $db->sql_escape($user->session_id) . "'
                            AND confirm_type = " . CONFIRM_REG;
                $result = $db->sql_query($sql);
                if (!$row = $db->sql_fetchrow($result))
                {
                    $confirm_id = '';
                }
                $db->sql_freeresult($result);
            }
            else
            {
                $str = '';
            }
            if (!$change_lang || !$confirm_id)
            {
                $user->confirm_gc(CONFIRM_REG);

                $sql = 'SELECT COUNT(session_id) AS attempts
                    FROM ' . CONFIRM_TABLE . "
                    WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
                        AND confirm_type = " . CONFIRM_REG;
                $result = $db->sql_query($sql);
                $attempts = (int) $db->sql_fetchfield('attempts');
                $db->sql_freeresult($result);

                if ($config['max_reg_attempts'] && $attempts > $config['max_reg_attempts'])
                {
                    trigger_error('TOO_MANY_REGISTERS');
                }

                $code = gen_rand_string(mt_rand(5, 8));
                $confirm_id = md5(unique_id($user->ip));
                $seed = hexdec(substr(unique_id(), 4, 10));

                // compute $seed % 0x7fffffff
                $seed -= 0x7fffffff * floor($seed / 0x7fffffff);

                $sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array(
                    'confirm_id'    => (string) $confirm_id,
                    'session_id'    => (string) $user->session_id,
                    'confirm_type'    => (int) CONFIRM_REG,
                    'code'            => (string) $code,
                    'seed'            => (int) $seed)
                );
                $db->sql_query($sql);
            }
            $confirm_image = '<img src="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=confirm&id=' . $confirm_id . '&type=' . CONFIRM_REG . $str) . '" alt="" title="" />';
            $s_hidden_fields .= '<input type="hidden" name="confirm_id" value="' . $confirm_id . '" />';
        }

        //
        $l_reg_cond = '';
        switch ($config['require_activation'])
        {
            case USER_ACTIVATION_SELF:
                $l_reg_cond = $user->lang['UCP_EMAIL_ACTIVATE'];
            break;

            case USER_ACTIVATION_ADMIN:
                $l_reg_cond = $user->lang['UCP_ADMIN_ACTIVATE'];
            break;
        }

        $template->assign_vars(array(
            'ERROR'                => (sizeof($error)) ? implode('<br />', $error) : '',
            'USERNAME'            => $data['username'],
            'PASSWORD'            => $data['new_password'],
            'MATH_QUESTION'            => $data['math_question'],
            'PASSWORD_CONFIRM'    => $data['password_confirm'],
            'EMAIL'                => $data['email'],
            'EMAIL_CONFIRM'        => $data['email_confirm'],
            'CONFIRM_IMG'        => $confirm_image,

            'L_CONFIRM_EXPLAIN'            => sprintf($user->lang['CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'),
            'L_REG_COND'                => $l_reg_cond,
            'L_USERNAME_EXPLAIN'        => sprintf($user->lang[$config['allow_name_chars'] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']),
            'L_PASSWORD_EXPLAIN'        => sprintf($user->lang[$config['pass_complex'] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']),

            'S_LANG_OPTIONS'    => language_select($data['lang']),
            'S_TZ_OPTIONS'        => tz_select($data['tz']),
            'S_CONFIRM_CODE'    => ($config['enable_confirm']) ? true : false,
            'S_COPPA'            => $coppa,
            'S_HIDDEN_FIELDS'    => $s_hidden_fields,
            'S_UCP_ACTION'        => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'),
            )
        );

        //
        $user->profile_fields = array();

        // Generate profile fields -> Template Block Variable profile_fields
        $cp->generate_profile_fields('register', $user->get_iso_lang_id());

        //
        $this->tpl_name = 'ucp_register';
        $this->page_title = 'UCP_REGISTRATION';
    }
}

?>

soundcloud.php debug (15-Jan @ 22:32)

desbest.myopenid.com

Syntax Highlighted Code

  1. <?php
  2. /**
  3.  * API Wrapper for SoundCloud written in PHP with support for authication using OAuth.
  4.  *
  5. [187 more lines...]

Plain Code

<?php
/**
 * API Wrapper for SoundCloud written in PHP with support for authication using OAuth.
 *
 * @author Anton Lindqvist <anton@qvister.se>
 * @version 1.1
 * @link http://github.com/mptre/php-soundcloud/
 */
        // desbest edit. uncomment the lines below 
        //if the api fails to generate a token
        //one line at a time. working DoWnWaRdS
        //echo "$consumer_key<br> $consumer_secret,<br>  "; 
//        echo "$oauth_token <br> $oauth_token_secret"; 
        //exit();
        //
        
class Soundcloud {
    const VERSION = '1.1';
    const URL_API = 'http://api.soundcloud.com/';
    const URL_OAUTH = 'http://api.soundcloud.com/oauth/';

    function __construct($consumer_key, $consumer_secret, $oauth_token = NULL, $oauth_token_secret = NULL) {
        $this->sha1_method = new OAuthSignatureMethod_HMAC_SHA1() or die ("could not sha1 method");
        $this->consumer = new OAuthConsumer($consumer_key, $consumer_secret)or die ("could not make a consumer");

        if (!empty($oauth_token) && !empty($oauth_token_secret)) {
            $this->token = new OAuthConsumer($oauth_token, $oauth_token_secret);
        } else {
            echo "<span style=\"background-color: yellow;\">This yellow section is coming from soundcloud.php
            <br>A token could not be generated.
            <br>$oauth_token and $oauth_token_secret
            </span><hr>";
            $this->token = NULL;
        }
    }

    function get_authorize_url($token) {
        if (is_array($token)) {
            $token = $token['oauth_token'];
        }

        return $this->_get_url('authorize') . sprintf('?oauth_token=%s', $token);
    }

    function get_request_token($oauth_callback) {
        $request = $this->request(
            $this->_get_url('request'),
            'POST',
            array('oauth_callback' => $oauth_callback)
        );
        $token = $this->_parse_response($request);

        $this->token = new OAuthConsumer(
            $token['oauth_token'],
            $token['oauth_token_secret']
        );

        return $token;
    }

    function get_access_token($token) {
        $response = $this->request(
            $this->_get_url('access'),
            'POST',
            array('oauth_verifier' => $token)
        );
        $token = $this->_parse_response($response);
        $this->token = new OAuthConsumer(
            $token['oauth_token'],
            $token['oauth_token_secret']
        );

        return $token;
    }

    function request($resource, $method = 'GET', $args = array(), $headers = NULL) {
        if (!preg_match('/http:\/\//', $resource)) {
            $url = self::URL_API . $resource;
        } else {
            $url = $resource;
        }

        if (stristr($headers['Content-Type'], 'multipart/form-data')) {
            $body = FALSE;
        } elseif (stristr($headers['Content-Type'], 'application/xml')) {
            $body = FALSE;
        } else {
            $body = TRUE;
        }

        $request = OAuthRequest::from_consumer_and_token(
            $this->consumer,
            $this->token,
            $method,
            $url,
            ($body === TRUE) ? $args : NULL
        );
        $request->sign_request($this->sha1_method, $this->consumer, $this->token);

        return $this->_curl(
            $request->get_normalized_http_url(),
            $request,
            $args,
            $headers
        );
    }

    private function _build_header($headers) {
        $h = array();

        if (count($headers) > 0) {
            foreach ($headers as $key => $val) {
                $h[] = $key . ': ' . $val;
            }

            return $h;
        } else {
            return $headers;
        }
    }

    private function _curl($url, $request, $post_data = NULL, $headers = NULL) {
        $ch = curl_init();
        $mime = (stristr($headers['Content-Type'], 'multipart/form-data')) ? TRUE : FALSE;
        $headers['User-Agent'] = (isset($headers['User-Agent']))
            ? $headers['User-Agent']
            : 'PHP SoundCloud/' . self::VERSION;
        $headers = (is_array($headers)) ? $this->_build_header($headers) : array();
        $options = array(
            CURLOPT_URL => $url,
            CURLOPT_HEADER => FALSE,
            CURLOPT_RETURNTRANSFER => TRUE
        );

        if (in_array($request->get_normalized_http_method(), array('DELETE', 'PUT'))) {
            $options[CURLOPT_CUSTOMREQUEST] = $request->get_normalized_http_method();
            $options[CURLOPT_POSTFIELDS] = '';
        }

        if (is_array($post_data) && count($post_data) > 0 || $mime === TRUE) {
            $options[CURLOPT_POSTFIELDS] = (is_array($post_data) && count($post_data) == 1)
                ? ((isset($post_data[0])) ? $post_data[0] : $post_data)
                : $post_data;
            $options[CURLOPT_POST] = TRUE;
        }

        $headers[] = $request->to_header();
        $options[CURLOPT_HTTPHEADER] = $headers;

        curl_setopt_array($ch, $options);

        $response = curl_exec($ch);
        $this->http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

        curl_close($ch);

        return $response;
    }

    private function _get_url($type) {
        switch ($type) {
            case 'access':
                $method = 'access_token';
                break;
            case 'authorize':
                $method = 'authorize';
                break;
            case 'request':
                $method = 'request_token';
                break;
        }

        return self::URL_OAUTH . $method;
    }

    private function _parse_response($response) {
        $return = array();
        $response = explode('&', $response);

        foreach ($response as $r) {
            if (strstr($r, '=')) {
                list($key, $val) = explode('=', $r);

                if (!empty($key) && !empty($val)) {
                    $return[urldecode($key)] = urldecode($val);
                }
            }
        }

        return (count($return) > 0) ? $return : FALSE;
    }
}

Untitled PHP (13-Jan @ 20:38)

Syntax Highlighted Code

  1. <?php
  2.  
  3. for ($i = 0; $i <= 10; $i++){
  4. [4 more lines...]

Plain Code

<?php
session_start();

for ($i = 0; $i <= 10; $i++){
     echo "Bonjour numero $i";
}

session_destroy();
?>

Fresherplay Soundcloud Authentication (import.php) (13-Jan @ 18:43)

desbest.myopenid.com

Syntax Highlighted Code

  1. <?php
  2. require_once 'oauth.php';
  3. require_once 'soundcloud.php';
  4. [336 more lines...]

Plain Code

<?php
error_reporting(E_ALL);
require_once 'oauth.php';
require_once 'soundcloud.php';

session_start();

// Clear the session i.e delete all stored tokens.
if (isset($_GET['logout'])) {
    session_destroy();
}

// Change these four variables, note the that temporary path must be writable by the server.
$consumer_key = '6Sg4X3oTeaq5U6qJGJehw';
$consumer_secret = '6JBq9Qz2UHBMfSWS26tYx7jP6YUlW6DZqQxSMXENc2c';
$callback_url = 'http://fresherplay.tk/';
$tmp_path = 'temp/';

// Variables used for verifying the status of the "OAuth dance".
$oauth_token = (isset($_GET['oauth_verifier']))
    ? $_GET['oauth_verifier']
    : ((isset($_SESSION['oauth_access_token'])) ? $_SESSION['oauth_access_token'] : NULL);
$oauth_request_token = (isset($_SESSION['oauth_request_token']))
    ? $_SESSION['oauth_request_token']
    : NULL;
$oauth_request_token_secret = (isset($_SESSION['oauth_request_token_secret']))
    ? $_SESSION['oauth_request_token_secret']
    : NULL;

if (isset($oauth_token) && isset($oauth_request_token) && isset($oauth_request_token_secret)) {
    // Retreive access tokens if missing.
    if (!isset($_SESSION['oauth_access_token']) && !isset($_SESSION['oauth_access_token_secret'])) {
        $soundcloud = new Soundcloud(
            $consumer_key,
            $consumer_secret,
            $_SESSION['oauth_request_token'],
            $_SESSION['oauth_request_token_secret']
        );
        $token = $soundcloud->get_access_token($oauth_token);
        $_SESSION['oauth_access_token'] = $token['oauth_token'];
        $_SESSION['oauth_access_token_secret'] = $token['oauth_token_secret'];
    }

    // Construct a fully authicated connection with SoundCloud.
    $soundcloud = new Soundcloud(
        $consumer_key,
        $consumer_secret,
        $_SESSION['oauth_access_token'],
        $_SESSION['oauth_access_token_secret']
    );

    // Get basic info about the authicated visitor.
    $me = $soundcloud->request('me');
    $me = new SimpleXMLElement($me);
    $me = get_object_vars($me);
    $mytracks = $soundcloud->request('me/tracks/');
    $mytracks = new SimpleXMLElement($mytracks);
    $mytracks = get_object_vars($mytracks);
    $x1 = $soundcloud->request('me/tracks/');
    $x1 = new SimpleXMLElement($x1);
    $x2 = $soundcloud->request('me/tracks/');
    $x2 = new SimpleXMLElement($x2);

    // If a track is submitted.
    if (isset($_POST['submit'])) {
        // We have to make sure it's a valid and supported format by SoundCloud.
        // Note that you also can include artwork for your tracks. Use the same
        // procedure as for the tracks. PNG, JPG, GIF allowed and a max size of 5MB.
        // The artwork field is called track[artwork_data].
        $mimes = array(
            'aac' => 'video/mp4',
            'aiff' => 'audio/x-aiff',
            'flac' => 'audio/flac',
            'mp3' => 'audio/mpeg',
            'ogg' => 'audio/ogg',
            'wav' => 'audio/x-wav'
        );
        $extension = explode('.', $_FILES['file']['name']);
        $extension = (isset($extension[count($extension) - 1]))
            ? $extension[count($extension) - 1]
            : NULL;
        $mime = (isset($mimes[$extension])) ? $mimes[$extension] : NULL;

        if (isset($mime)) {
            $tmp_file = $tmp_path . $_FILES['file']['name'];

            // Store the track temporary.
            if (move_uploaded_file($_FILES['file']['tmp_name'], $tmp_file)) {
                $post_data = array(
                    'track[title]' => stripslashes($_POST['title']),
                    'track[asset_data]' => realpath($tmp_file),
                    'track[sharing]' => 'private'
                );

                if ($response = $soundcloud->upload_track($post_data, $mime)) {
                    $response = new SimpleXMLElement($response);
                    $response = get_object_vars($response);
                    $message = 'Success! <a href="' . $response['permalink-url'] . '">Your track</a> has been uploaded!';

                    // Delete the temporary file.
                    unlink(realpath($tmp_file));
                } else {
                    $message = 'Something went wrong while talking to SoundCloud, please try again.';
                }
            } else {
                $message = 'Couldn\'t move file, make sure the temporary path is writable by the server.';
            }
        } else {
            $message = 'SoundCloud support .mp3, .aiff, .wav, .flac, .aac, and .ogg files. Please select a different file.';
        }
    }
} else {
    // This is the first step in the "OAuth dance" where we ask the visitior to authicate himself.
    $soundcloud = new Soundcloud($consumer_key, $consumer_secret);
    $token = $soundcloud->get_request_token($callback_url) 
       or die ("    <h1>Could not connect to soundcloud via the api</h1>    <br>Email fresherplay about this error     <br>Use the back button to go back")
       ;

    $_SESSION['oauth_request_token'] = $token['oauth_token'];
    $_SESSION['oauth_request_token_secret'] = $token['oauth_token_secret'];

    $login = $soundcloud->get_authorize_url($token['oauth_token']);
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Fresherplay</title>

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="ui-core.js"></script>
<script type="text/javascript" src="flash.js"></script>
<script type="text/javascript" src="localscroll.js"></script>
<script type="text/javascript" src="hide.js"></script>
<script type='text/javascript' src='swfobject.js'></script>

<SCRIPT LANGUAGE="JavaScript">
<!-- Idea by:  Nic Wolfe -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=528,height=158');");
}
// End -->
</script>


<script type="text/javascript">

// Array variable to hold a list of all player IDs on the page
var mediaPlayer = ['s1', 's2', 's3', 's4'];

// Add a listener to trigger function stopOtherPlayers whenever an item is played
function playerReady(obj) {
document.getElementById(obj.id).addControllerListener('ITEM', 'stopOtherPlayers');
}

// Loop through all player IDs and, unless the player ID is the currently selected player ID, tell them to stop
function stopOtherPlayers(obj) {
for ( var id in mediaPlayer ) {
if ( obj.id != mediaPlayer[id] ) document.getElementById(mediaPlayer[id]).sendEvent('STOP');
}
}
</script>

<link rel="stylesheet"  type="text/css" href="stylesheet.css">
</head>
<body>
<div class="headerpane" id="thetop">
<img src="header.png" align="left" style="z-index: 3"> 



</div>

<div class="leftpane">    

<div class="menuhere"><div id="navcontainer">
    <ul id="navlist">
    <li id="active"><a>Import Music</a></li>
    <!-- <li id="sel4"><a>Email Fresherplay</a></li> -->

    </ul>
    </div>
</div></div>


    
</div>
<div class="rightpane">  

<div class="content5" id="thechart">    

<div id="rev1">    
    <font class="headline">Import Music from Soundcloud</font>
        <?php if (isset($login)): ?>
            <a class="button" href="<?php echo $login; ?>"><img src="sc-connect.png"></a>
        <?php elseif (isset($me)): ?>
                        <img src="<?php echo $me['avatar-url']; ?>" width="75" height="75" alt="" align="left"/>
                        <a href="<?php echo $me['permalink-url']; ?>"><?php echo $me['permalink']; ?></a>
                    <br><?php echo $me['full-name'] ?>, <?php echo $me['city']; ?>, <?php echo $me['country']; ?></p>
                    <br>
                    <?php if (isset($me)): ?>
                    <br><a class="logout" href="?logout=true">logout from soundcloud</a><br> 
                    <?php endif; ?>
                    <br>You have <?php echo $me['track-count']; ?> <?php echo ($me['track-count'] == 1) ? 'track' : 'tracks'; ?>.</p>
<br>
<?php
    echo "<table cellspacing=\"5\" cellpadding=\"5\">";    
foreach($x2 as $user){
echo "<tr><td>";
if (!isset($numbera)) {$number = "0";}
$numbera = $numbera +1;

    echo '<img src="arrow.png" align="left">'.$user->title.' 
    <!-- Address: '.$user->address.' -->
    <br />
    ';
$stream2 = $user->xpath('stream-url');
$perma2 = $user->xpath('permalink');
//print_r($perma2);
//echo "<b> $perma2[0] </b>";
$stream3 = $stream2[0];
$perma3 = $perma2[0];
$stream4 = urlencode($stream3);
$perma4 = urlencode($perma3);
echo "
<div id=\"YouTubeReloadedPlayer$numbera\">
To play music on this website you need the Adobe Flash Plugin.
<br><a href=\"http://www.adobe.com/go/EN_US-H-GET-FLASH\"><img src=\"getflash.png\"></a>
</div>

<script type='text/javascript'>
  var so = new SWFObject('player2/player.swf','mpl','470','55','9');
  so.addParam('allowfullscreen','true');
  so.addParam('allowscriptaccess','always');
  so.addParam('wmode','opaque');
  so.addVariable('file','$stream3');
  so.addVariable('provider','sound');
  so.write('YouTubeReloadedPlayer$numbera');
</script>
";
echo "
</td>
<td>
<img src=\"upload.png\" height=\"60\" width=\"60\">
<br><font size=\"-2\"><a href=\"import2.php?url=$stream4&permalink=$perma4\">Add to Fresherplay</a></font>
</td>
</tr>
";

} echo "</table>";
//print_r($x2->tracks->track);
//print $x2->tracks->track->permalink-XXurl . "\n";

/*
        foreach($x1->story as $story) {
    print("<h2>" . $story->headline . "</h2><br />");
    print($story->description . "<br />_________________________<br />");
    print($story->headline["date"] . "<br /><br />");
    
}
    
    */    
//print_r($x1);
//echo "<hr size=\"30\" color=\"#6633ff\">";



//echo $x1->getName() . "<br />";
//echo "<hr size=\"30\" color=\"#336633\">";
foreach($x1->children() as $child)
{

//print_r($child);
//echo $child->getName() . ": " . $child . "<br />";
//echo "$child[title]";
foreach($child->children() as $childx)
{
//echo ("$childx[0]" );
/*
*/
//echo $childx->getName() . ": " . $childx . "<br />";

}
print($child[tracks][track]);
//echo $child->getName() . ": " . $child . "<br />";
//echo "<hr size=\"30\" bgcolor=\"#cc0000\" color=\"#cc0000\">";
}
  
  
  
          //$myvar = $mytracks->[track]->uri;
        //print_r($);
        ?>                <!-- <h2>Upload a new track</h2>
                <form action="" method="post" enctype="multipart/form-data">
                    <p>
                        <label for="title">Track title</label>
                        <input class="text" type="text" name="title" id="title" />
                    </p>
                    <p>
                        <label for="file">File</label>
                        <input class="file" type="file" name="file" value="" id="file" />
                    </p>
                    <p class="center">
                        <input class="submit" type="submit" name="submit" value="Upload" id="submit" />
                    </p>
                </form>
                -->
                <?php if (isset($message)): ?>
                    <div id="message">
                        <p><?php echo $message; ?></p>
                    </div>
                <?php endif; ?>
            <?php endif; ?>
        </div>
    </div>
</div>
    

    
</div>    <!-- CLOSE content5 -->


</div> <!-- CLOSE rightside -->


<script type="text/javascript" src="//counter.goingup.com/js/tracker.js?st=bc4gyw7&amp;b=5"></script>
<noscript><a href="http://www.goingup.com" title=""><img src="//counter.goingup.com/default.php?st=bc4gyw7&amp;b=5" border="0" /></a></noscript>



</body>
</html>

Untitled PHP (31-Dec @ 13:45)

Syntax Highlighted Code

  1.  
  2. //See what file is being requested by the web client, also store the arguments just in case.
  3. list($file,$arguments) = explode("?", $_SERVER['REQUEST_URI']);
  4. [14 more lines...]

Plain Code

 session_start();
 
//See what file is being requested by the web client, also store the arguments just in case.
list($file,$arguments) = explode("?", $_SERVER['REQUEST_URI']);
 
//if the user just logged out, destroy this session and redirect them to root
if("/wp-login.php?loggedout=true" == $file ."?" .$arguments)
{ session_destroy(); header("location: /"); }
 
//If our sentinel variable is set and true do nothing, allow normal script execution
if(isset($_SESSION['valid_entrance']) &amp;&amp; $_SESSION['valid_entrance'] == true) { /* As they say, "Silence is golden" */ }
 
//Now if the user is requesting wp-login.php and our sentinel is not true, redirect the "attacker" to root.
elseif($file == "/wp-login.php" &amp;&amp; !isset($_SESSION['valid_entrance']))
{  header("Location: /"); exit(); }
 
//If the user is requesting the right login entrance set the sentinel to true
elseif ($file == "/secure-login")
{  $_SESSION['valid_entrance'] = true; }

Untitled PHP (31-Dec @ 10:33)

Syntax Highlighted Code

  1. <?php
  2.  
  3. ?>

Plain Code

<?php

?>

Untitled PHP (25-Dec @ 14:30)

Syntax Highlighted Code

  1. <?php
  2. echo "fdfdf";
  3.  
  4. ?>

Plain Code

<?php
echo "fdfdf";

?>

Untitled PHP (21-Dec @ 09:58)

Syntax Highlighted Code

  1. hi!

Plain Code

hi!

Untitled PHP (9-Dec @ 13:24)

Syntax Highlighted Code

  1. function myFnc(){
  2.  
  3. }

Plain Code

function myFnc(){

}

Untitled PHP (7-Dec @ 12:52)

Syntax Highlighted Code

  1. <?php
  2. echo "hello world";
  3. ?>

Plain Code

<?php
echo "hello world";
?>

jQuery.stickyFooter (25-Nov @ 11:34)

joshuabaker

Syntax Highlighted Code

  1. /**
  2.  * jQuery.stickyFooter - Sticky footer plugin
  3.  * @author Joshua Baker
  4.  * @version 1.0.0
  5. [50 more lines...]

Plain Code

/**
 * jQuery.stickyFooter - Sticky footer plugin
 * @author Joshua Baker
 * @version 1.0.0
 */
;(function($){
  
  // Defined jQuery.stickyFooterPos();
  // Outputs a console message until $(element).stickyFooter(); is run
  $.extend({
    stickyFooterPos: function() { console.log('jQuery.stickyFooterPos() has not been initialized.'); }
  });
  
  // Define jQuery(element).stickyFooter();
  $.fn.extend({
    stickyFooter: function() {
      // Create the footer push element
      var stickyFooterPush = $('<div style="clear:both;"></div>');
      
      // Append a clear to the bottom of the body to handle any potential float issues
      $('body').append('<div style="clear:both;"></div>');
      
      // Place the footer push above the selected footer element
      $(this).before(stickyFooterPush);
      
      // Re-define jQuery.stickyFooterPos();
      // This can be called at any point after
      $.extend({
        stickyFooterPos: function() {
          var documentHeight = $(document.body).height() - stickyFooterPush.height();
          var windowHeight = $(window).height();
          if (documentHeight < windowHeight) {
            stickyFooterPush.height(windowHeight - documentHeight);
          }
        }
      });
      
      // Initial run (on DOM ready)
      $.stickyFooterPos();
      
      // Bind events to loading, resizing and scrolling of the window
      $(window).bind('load resize scroll', $.stickyFooterPos);
    }
  });
  
})(jQuery);



/**
 * jQuery.stickyFooter - Sticky footer plugin
 * @author Joshua Baker
 * @version 1.0.0
 */
;(function(a){a.extend({stickyFooterPos:function(){console.log("jQuery.stickyFooterPos() has not been initialized.")}});a.fn.extend({stickyFooter:function(){var b=a('<div style="clear:both;"></div>');a("body").append('<div style="clear:both;"></div>');a(this).before(b);a.extend({stickyFooterPos:function(){var c=a(document.body).height()-b.height();var d=a(window).height();if(c<d){b.height(d-c)}}});a.stickyFooterPos();a(window).bind("load resize scroll",a.stickyFooterPos)}})})(jQuery);

Untitled PHP (3-Nov @ 18:54)

Syntax Highlighted Code

  1. include_once 'yo.php';
  2. echo 'yo';

Plain Code

include_once 'yo.php';
echo 'yo';

yt-upload a video (1-Nov @ 16:11)

desbest.myopenid.com

Syntax Highlighted Code

  1. <?php
  2. $ret=YT_upload($token,$media_title, $media_desc, $remote_url,$developerkey,'/tmp/','Funny Stuff','Film');
  3. if($ret['status']==true){
  4.     $vid_id=$ret['video_id'];
  5. [6 more lines...]

Plain Code

<?php
$ret=YT_upload($token,$media_title, $media_desc, $remote_url,$developerkey,'/tmp/','Funny Stuff','Film');
if($ret['status']==true){
    $vid_id=$ret['video_id'];
    echo "Check out your video at <a href='http://www.youtube.com/watch?v={$vid_id}'>Vid!</a>";
}else{
        $errorcode=$ret['errorcode'];
        $errormessage=$ret['error'];
    echo "Sorry.. there has been an error (code: {$errorcode}) Message: {$errormessage}";
}
?>

yt-authenticate (1-Nov @ 16:11)

desbest.myopenid.com

Syntax Highlighted Code

  1. <?php
  2. include('ytlib.php'); //this is the downloaded YT lib file from our repository.
  3.  
  4. //$user and $pass come from your form, cookies or wherever.
  5. [11 more lines...]

Plain Code

<?php
include('ytlib.php'); //this is the downloaded YT lib file from our repository.

//$user and $pass come from your form, cookies or wherever.
//they are the YouTube username (or google email address) and password respectively

$ret=YT_authenticate($user, $pass);
if($ret!==false){
        //Success!
        echo "Success! You have logged in to YouTube";
        //$ret holds the authentication token.
}else{
        echo "Sorry, your credentials are incorrect";
}

?>

yt-lib_Youtube Class (1-Nov @ 16:10)

desbest.myopenid.com

Syntax Highlighted Code

  1. <?php
  2. /* Reminder: always indent with 4 spaces (no tabs). */
  3. // +-----------------------------------------------------------------------------+
  4. // | Minimal YouTube library                                                     |
  5. [224 more lines...]

Plain Code

<?php
/* Reminder: always indent with 4 spaces (no tabs). */
// +-----------------------------------------------------------------------------+
// | Minimal YouTube library                                                     |
// | Date: November, 2008                                                        |
// +-----------------------------------------------------------------------------+
// | ytlib.php - custom written youtube handlers to save many hundreds of megs of|
// | ram over the existing Google/Youtube library                                |
// | Please note that this is not a direct replacement of the YT library from    |
// | Google.  This is a streamlined authentication mechanism and uploader        |
// | Please read the disclaimer below before using!                              |
// +-----------------------------------------------------------------------------+
// | Copyright (C) 2008 by the following authors:                                |
// |  Author: Randy Kolenko -- randy@nextide.ca                                  |
// +-----------------------------------------------------------------------------+
// |                                                                             |
// | This program is licensed under the terms of the GNU General Public License  |
// | as published by the Free Software Foundation; either version 2              |
// | of the License, or (at your option) any later version.                      |
// |                                                                             |
// | This program is part of the Nextide nexpro Suite and is licenced under      |
// | The GNU license and OpenSource but relesased under closed distribution.     |
// | You are freely able to modify the source code to meet your needs but you    |
// | are not free to distribute the original or modified code without permission |
// | Refer to the license.txt file or contact nextide if you have any questions  |
// |                                                                             |
// | This program is distributed in the hope that it will be useful, but         |
// | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY  |
// | or FITNESS FOR A PARTICULAR PURPOSE.                                        |
// | See the GNU General Public License for more details.                        |
// |                                                                             |
// | You should have received a copy of the GNU General Public License           |
// | along with this program; if not, write to the Free Software Foundation,     |
// | Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             |
// |                                                                             |
// +-----------------------------------------------------------------------------+
//

// this file can't be used on its own
if (strpos ($_SERVER['PHP_SELF'], 'ytlib.php') !== false)
{
    die ('This file can not be used on its own.');
}


/**
* YT_authenticate -- Function to authenticate the end user.
*
* @param    string username -- The YT username (either the native username or the goolge username)
* @param    string password -- the YT user's password.
* @return   string -- returns the authentication token on success or FALSE on failure
* @access   public
*/
function YT_authenticate($username, $password){
    $cobj=curl_init('https://www.google.com/youtube/accounts/ClientLogin');
    curl_setopt($cobj,CURLOPT_RETURNTRANSFER,TRUE);
    curl_setopt($cobj,CURLOPT_POST,TRUE);
    curl_setopt($cobj,CURLOPT_SSL_VERIFYPEER,FALSE);
    $header=array();
    $header[]='Content-Type: application/x-www-form-urlencoded';
    curl_setopt($cobj,CURLOPT_HTTPHEADER,$header);
    curl_setopt($cobj,CURLOPT_POSTFIELDS,'Email='. $username . '&Passwd=' . $password . '&service=youtube&source=yoursource');

    $xml=curl_exec($cobj);
    $connectionInfo=curl_getinfo ( $cobj );
    curl_close($cobj);
    $statusCode=$connectionInfo['http_code'];
    if($statusCode==200){// some kind of structure returned but we've deleted
        $a=explode(chr(10),$xml);  //[0] is auth, [1] is yt username
        $x=str_replace("Auth=","",$a[0]);
        $x=str_replace(chr(10),"",$x);
        //$ret=$x;
        return true;
    }else{//500 error  this user dosent exist anyways
        //$ret=false;
        return false;
    }
    return $ret;
}

/**
* YT_upload -- Function to perform a chunked upload to YouTube.
*
* @param    string token -- The YT Authentication token from the YT_authenticate function
* @param    string title -- the YT Movie's title
* @param    string description -- the YT Movie's description
* @param    string filename -- the source file to upload.  THis is your AVI, MOV, FLV or whatever you are trying to upload.  This file has to be local to the system.
* @param    string YTdeveloperKey -- the YT Developer key you need to get from Google/Youtube
* @param    string localDropDirectory -- the local directory that is WRITE enabled to deposit the movie you wish to upload.  Must end in a slash
* @param    string keywords -- the keywords to associate to this clip for YT
* @param    string category -- the Category you wish to classify this clip with.  Please refer to the YT documentation for valid categories
* @return   Array -- returns an aray of status, video_id, error and errorcode as array keys to denote what has happened during upload
* @access   public
*/
function YT_upload($token, $title, $description, $filename, $YTdeveloperKey, $localDropDirectory='/tmp/', $keywords='Your Keywords', $category='Film'){
    $retarray=array();
    $retarray['status']=false;
    $retarray['video_id']='';
    $retarray['error']='';
    $retarray['errorcode']=0;
    $boundary='--f93dcbA3';
    $boundaryheader='f93dcbA3';
    $basefilename=md5(uniqid(rand())).'.flv';
    $localDropFile = $localDropDirectory.$basefilename;
    $title=htmlspecialchars(stripslashes($title));
    $description=htmlspecialchars(stripslashes($description));

    $data=$boundary.chr(13).chr(10).'Content-Type: application/atom+xml; charset=UTF-8'.chr(13).chr(10).chr(13).chr(10);
    $data .='<?xml version="1.0"?>';
    $data .='<entry xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007">';
    $data .='<media:group>';
    $data .='<media:title type="plain">' . $title . '</media:title>';
    $data .='<media:description type="plain">' . $description . '</media:description>';
    $data .='<media:category scheme="http://gdata.youtube.com/schemas/2007/categories.cat">' . $category . '</media:category>';
    $data .='<media:keywords>' . $keywords . '</media:keywords>';
    $data .='</media:group>';
    $data .='</entry>';
    $data.=chr(13).chr(10).$boundary;
    $data.=chr(13).chr(10).'Content-Type: video/x-flx';
    $data.=chr(13).chr(10).'Content-Transfer-Encoding: binary';
    $data.=chr(13).chr(10);
    $data.=chr(13).chr(10);
    $footer=chr(13).chr(10).$boundary.'--'.chr(13).chr(10);

    //fetch the remote file
    //Please note that you may have to alter this section of code to suit your requirements
    //this will fetch the passed in $filename file and bring it down locally
    //if you already have the file local to you, please augment this section of code to simply use
    //$filename to set $localDropFile as the locally accessible file to upload.
    $ch = curl_init ($filename);
    $f = fopen ($localDropFile, "w");
    curl_setopt ($ch, CURLOPT_FILE, $f);
    curl_setopt ($ch, CURLOPT_HEADER, 0);
    curl_exec ($ch);
    curl_close ($ch);
    fclose ($f);
    //remote file is now saved locally
    //$localDropFile now stores the path to the locally accessible file to upload to YouTube
    //we do NOT use $filename to upload to YT.

    $contentlength=strlen($data);
    $contentlength+=filesize($localDropFile);
    $contentlength+=strlen($footer);

    $header ="POST /feeds/api/users/default/uploads HTTP/1.1\r\n";
    $header.="Host: uploads.gdata.youtube.com\r\n";
    $header.="Content-length: $contentlength\r\n";
    $header.="Content-Type: multipart/related; boundary=\"$boundaryheader\"\r\n";
    $header.="Authorization: GoogleLogin auth=\"$token\"\r\n";
    $header.="X-GData-Key: key=$YTdeveloperKey\r\n";
    $header.="Slug: $basefilename\r\n";
    $header.="Connection: close\r\n\r\n";
    $fp = fsockopen("uploads.gdata.youtube.com", 80, $errno, $errstr, 30);

    if (!$fp) {
        $retarray['error']= "$errstr ($errno)<br />\n";
        $retarray['errorcode']=1;
        return $retarray;
    } else {//send some stuff!
        fputs($fp,$header);
        fputs($fp,$data);
        //upload the remote file
        try{
            $f=fopen($localDropFile,"r");
            while(!feof($f)){
                $fstuff=fread($f,8164);
                @fputs($fp,$fstuff,8164);
            }
            fclose($f);
            @fputs($fp,$footer);
            $returnstream='';

            while (!feof($fp)) {
                $returnstream.= fgets($fp, 128);
            }

            fclose($fp);
            @unlink($localDropFile);
            //POST stream manipulation
            $arr=explode("\r\n\r\n",$returnstream);

            $headers=explode("\r\n",$arr[0]);
            $statusheader=explode(" ",$headers[0]);
            $statuscode=$statusheader[1];
            $statusmessage=$statusheader[2];
            if($statuscode=='201'){
                $body=explode("\r\n",$arr[1]);
                $xml='';
                for($cntr=1;$cntr<count($body);$cntr+=2){
                    $xml.=$body[$cntr];  //lines 0 and 2, 4 etc are hex line length numbers.. ignore!
                }

                $p = xml_parser_create();
                xml_parse_into_struct($p, $xml, $vals, $index);
                xml_parser_free($p);

                $item=$index['ID'][0];
                $id=$vals[$item]['value'];
                $loc=strrpos($id,"/");
                if($loc!==false){
                    $id=substr($id,$loc+1);
                }else{
                    $retarray['error']='A valid YouTube ID has not been returned.';
                    $retarray['errorcode']=2;
                    return $retarray;
                }
                $retarray['status']=true;
                $retarray['statuscode']=$statuscode;
                $retarray['statusmessage']=$statusmessage;
                $retarray['video_id']=$id;
                $retarray['errorcode']=0;
                return $retarray;
            }else{
                $retarray['error']= "We did not get a complete notification from YouTube.  Please check your account and try the upload again if it has failed.";
                $retarray['errorcode']=3;
                return $retarray;
            }

        }catch(Exception $e){
            @fclose($fp);
            @unlink($localDropFile);
            $retarray['error']='An error during pushing the file to YouTube has ocurred. Please check your account and try the upload again if it has failed.';
            $retarray['errorcode']=4;
            return $retarray;
        }
    }
}

?>

Untitled PHP (31-Oct @ 06:52)

Syntax Highlighted Code

  1. <?php
  2.  
  3. //See what file is being requested by the web client, also store the arguments just in case.
  4. [23 more lines...]

Plain Code

<?php
session_start();
 
//See what file is being requested by the web client, also store the arguments just in case.
list($file,$arguments) = explode("?", $_SERVER['REQUEST_URI']);
 
//if the user just logged out, destroy this session and redirect them to root
if("/wp-login.php?loggedout=true" == $file ."?" .$arguments)
{ session_destroy(); header("location: /"); }
 
//If our sentinel variable is set and true do nothing, allow normal script execution
if(isset($_SESSION['valid_entrance']) && $_SESSION['valid_entrance'] == true) { /* As they say, "Silence is golden" */ }
 
//Now if the user is requesting wp-login.php and our sentinel is not true, redirect the "attacker" to root.
elseif($file == "/wp-login.php" && !isset($_SESSION['valid_entrance']))
{  header("Location: /"); exit(); }
 
//If the user is requesting the right login entrance set the sentinel to true
elseif ($file == "/mycryptic-non-wp-login")
{  $_SESSION['valid_entrance'] = true; }

/**
 * WordPress User Page
 *
 * Handles authentication, registering, resetting passwords, forgot password,
 * and other user handling.
 *

Untitled PHP (15-Oct @ 17:56)

Syntax Highlighted Code

  1. public function main() {
  2.    
  3.     // page details
  4.     $this->pagedetails->settitle ( t ( 'Forum' ) );
  5. [54 more lines...]

Plain Code

public function main() {
    
    // page details
    $this->pagedetails->settitle ( t ( 'Forum' ) );
    
    // tpl
    $tpl = new SmartyTemplate ( );
    
    // get categories
    $categories = $this->categorymanager->getParentChildCategoryList ( 'forum', false, 0 );
    $tpl->assign ( 'categories', $categories );
    
    // assign forum details
    $query = "SELECT a.id, a.cid, a.status, a.posts, a.topics, a.redirect, a.password FROM " . DB_PREFIX . "forum a";
    if ($forums = $this->db->getrows ( $query )) {
        foreach ( $forums as $forum ) {
            // $forum['lastpost_date'] = getLocalDate(false,$forum['lastpost_date']);
            

            $query = "SELECT * FROM `" . DB_PREFIX . "forum_topics` WHERE forumid=" . $forum ['cid'] . " ORDER by lastpost DESC";
            if ($topic = $this->db->getrow ( $query )) {
                
                $topic ['date'] = getlocaldate ( false, $forum ['topic'] ['date'] );
                
                // get last post
                $this->_load ( 'contentbase' );
                $postObj = $this->contentbase->getPostObject ( 'forumtopic' );
                $topic ['lastpost'] = $postObj->getSingleContentById ( $topic ['lastpostid'], 'array' );
                
                $query = "SELECT 
                            * 
                            FROM " . DB_PREFIX . "forum_unread a 
                            LEFT JOIN " . DB_PREFIX . "forum_topics b ON forum_id = " . $forum ['cid'] . " 
                            WHERE a.member = '2'"
                            ;
                echo $query;
                $query = mysql_query($query);
                if(mysql_num_rows($query) > 0) {
                    $forum ['status'] = 'unread';
                }
                
                $forum ['topic'] = $topic;
            
            }
            
            $forumList [$forum ['cid']] = safeoutput ( $forum );
        
        }
    }
    
    $tpl->assign ( 'forums', $forumList );
    
    // output
    $this->content = $tpl->smartFetch ();
    $this->display ();

}

Untitled PHP (29-Sep @ 19:45)

Syntax Highlighted Code

  1. default:
  2.  case 0:    
  3.  
  4.     // Admin Menu Header
  5. [18 more lines...]

Plain Code

default:
 case 0:    
 
    // Admin Menu Header
    $xag_job                 = 0;
    $admin_menu         = '<div class="page_title"><h1 class="page_title">Welcome... `' . $username . '`' . $home_logout;
    $js_editor            = '';
    $js_general            = '';        
    $more_reading        = '';
    $article_title    = '';
    
    // Article Content management..
    $out    = '<p>This section allows you to manage the content of this site.</p>';
    $out    .= '<p><a href="'. $root_url    .'?job=1">Create an Article</a>.</p>';
    $out    .= '<p><a href="'. $root_url    .'?job=88">Create an Image Article</a>.</p>';
    $out    .= '<p><a href="'. $root_url    .'?job=8">Display Article Listing</a>.</p>';
    $out    .= '<p><a href="'. $root_url    .'?job=100">Add a URL</a>.</p>';
            
    // Debugging only..
    //new dBug($out); 
    
break;

Untitled PHP (18-Sep @ 18:20)

Syntax Highlighted Code

  1. <?php
  2. if ($data->rankvord >= 100.00){
  3. mysql_query("UPDATE `[users]` SET `rank`=`rank`+1,`rankvord`='0.00' WHERE `login`='{$data->login}'");
  4. print "";
  5. [869 more lines...]

Plain Code

<?php 
if ($data->rankvord >= 100.00){
mysql_query("UPDATE `[users]` SET `rank`=`rank`+1,`rankvord`='0.00' WHERE `login`='{$data->login}'");
print "";
}
include("_include-config.php"); 

if (isset($data)) { 

?> 

<?php /* ------------------------- */
session_start();
  include_once("_include-funcs1.php");
  if(isset($_COOKIE['login'],$_COOKIE['validate'])) {
    setcookie("login",$_COOKIE['login'],time()+24*60*60,"/","");
    setcookie("validate",$_COOKIE['validate'],time()+24*60*60,"/","");
  }

mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}'");
if($data->level == -1){
print"<table width=100%><tr><td class=maintxt>Je bent Verbannen!</td></tr></table>";
die();
}
if ($data->rank <= 9){
if ($data->rankvord >= 100.00){
mysql_query("UPDATE `[users]` SET `rank`=`rank`+1,`rankvord`='0.00' WHERE `login`='{$data->login}'");
print "";
}
}
mysql_query("UPDATE `[users]` SET `moordexp1`=(100+(`rank`*'50')) WHERE `login`='{$data->login}'");
print"";

/* ------------------------- */ ?>
<LINK REL="StyleSheet" HREF="style/style.css" TYPE="text/css">
<style>BODY { height: 100%; background: #101010 url('bg.gif') repeat-x; margin: 0px; padding: 0px }</style> 

<title>HipHopperz.nl! - Wordt een bekende artiest op het net!</title>
<?php


include_once 'header.php';
mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}'");
  include_once("_include-funcs1.php");
if ( isset($_GET['p'] ) )
{ 
$p = $_GET['p']; 
$file = "content/$p.php"; 
  if ( file_exists($file) ) 
  { 
        include_once($file);
       include_once 'footer.php'; 
  } 
  else 
  { 
    include_once 'content/home.php'; 
  } 
} 
else 
{ 

include_once 'content/home.php';

}

include_once 'footer.php'; 

?>
<? 
} 
else { 
?> 

<?
include("config.php");
?>

<?php
  $dbres                = mysql_query("SELECT `id` FROM `[users]` WHERE `activated`=1");
  $members                = mysql_num_rows($dbres);
  $dbresxa = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300");
  $onliner = mysql_num_rows($dbresxa);
 ?>
<script type="text/javascript">
function favorieten()
{
  if(document.all) {
    window.external.AddFavorite('<?php echo $site; ?>','HipHopperz.nl! - Wordt een bekende artiest op het net!');
  }
  else {
    alert("Je browser ondersteunt deze functie niet!");
  }
}
</script>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<LINK REL="StyleSheet" HREF="style/style.css" TYPE="text/css">
<style>BODY { height: 100%; background: #101010 url('bg.gif') repeat-x; margin: 0px; padding: 0px }</style> 

<title>HipHopperz.nl! - Wordt een bekende artiest op het net!</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
</head>
<body bgcolor="#fff" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<table width="744" height="645" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
<tr>
        <td colspan="10">
            <img src="images/Hiphopperz.nl-designstore_01.gif" width="743" height="19" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="1" height="19" alt=""></td>
    </tr>
    <tr>
        <td colspan="5">
            <img src="images/Hiphopperz.nl-designstore_02.gif" width="226" height="19" alt=""></td>
        <td colspan="5" rowspan="2" background="images/Hiphopperz.nl-designstore_03.gif" class="stijl1"> <div align="right"><a href="javascript:favorieten()">Toevoegen Aan Favorieten</a> | <a href="#" onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('<?php echo $site; ?>');">Instellen Als Startpagina</a><img src="../Underground/images/spacer.gif" width="5" height="1"> </div></td>
<td>
            <img src="images/spacer.gif" width="1" height="19" alt=""></td>
    </tr>
    <tr>
        <td rowspan="2">
            <img src="images/Hiphopperz.nl-designstore_04.gif" width="1" height="23" alt=""></td>
        <td colspan="3" rowspan="2">
            <img src="images/Hiphopperz.nl-designstore_05.gif" width="183" height="23" alt="" border="0"></td>
  <td>
            <img src="images/Hiphopperz.nl-designstore_06.gif" width="42" height="1" alt="" border="0"></td>
        <td>
            <img src="images/spacer.gif" width="1" height="1" alt="" border="0"></td>
    </tr>
    <tr>
        <td colspan="6" rowspan="6">
            <img src="images/Hiphopperz.nl-designstore_07.gif" width="559" height="133" alt="" border="0"></td>
        <td>
            <img src="images/spacer.gif" width="1" height="22" alt="" border="0"></td>
    </tr>
    <tr>
        <td colspan="4">
            <img src="images/Hiphopperz.nl-designstore_08.gif" width="184" height="20" alt="" border="0"></td>
  <td>
            <img src="images/spacer.gif" width="1" height="20" alt=""></td>
    </tr>
    <tr>
        <td colspan="4">
            <img src="images/Hiphopperz.nl-designstore_09.gif" width="184" height="23" alt="" border="0"></td>
  <td>
            <img src="images/spacer.gif" width="1" height="23" alt="" border="0"></td>
    </tr>
    <tr>
        <td colspan="4">
            <img src="images/Hiphopperz.nl-designstore_10.gif" width="184" height="22" alt="" border="0"></td>
  <td>
            <img src="images/spacer.gif" width="1" height="22" alt=""></td>
    </tr>
    <tr>
        <td colspan="4">
            <img src="images/Hiphopperz.nl-designstore_11.gif" width="184" height="23" alt="" border="0"></td>
  <td>
            <img src="images/spacer.gif" width="1" height="23" alt=""></td>
    </tr>
    <tr>
        <td colspan="4">
            <img src="images/Hiphopperz.nl-designstore_12.gif" width="184" height="23" alt="" border="0"></td>
  <td>
            <img src="images/spacer.gif" width="1" height="23" alt=""></td>
    </tr>
    <tr>
        <td colspan="6">
            <img src="images/Hiphopperz.nl-designstore_13.gif" width="271" height="18" alt=""></td>
        <td colspan="4" rowspan="2" background="images/Hiphopperz.nl-designstore_14.gif"><div align="right"><span class="stijl1"><font size=2><a href="?p=contact">Meld je snel aan als artiest op HipHopperz!</a>!</font></div></td>
<td>
            <img src="images/spacer.gif" width="1" height="18" alt=""></td>
    </tr>
    <tr>
        <td width="1" height="434" rowspan="2" bgcolor="#FFFFFF">
            <img src="images/spacer.gif" width="1" height="434" alt=""></td>
        <td colspan="5">
            <img src="images/Hiphopperz.nl-designstore_16.gif" width="270" height="2" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="1" height="2" alt=""></td>
    </tr>
    <tr>
        <td width="1" height="432" bgcolor="#141414">
            <img src="images/spacer.gif" width="1" height="432" alt=""></td>
        <td width="1" height="432" bgcolor="#FFFFFF">
            <img src="images/spacer.gif" width="1" height="432" alt=""></td>
        <td width="737" height="432" colspan="4" bgcolor="#141414" valign="top"><table border='0' cellspacing='1' width='100%' bgcolor='#000' align='center'> 
    <tr> 
        <td class='top' colspan='1'> <b>
<b>Statistieken</b> </font></b></td>
    </tr>
    <tr>
        <td class='inhoud'>


<center><font size=2>Leden: <b><?php echo $members; ?></b> | </font> <? include("include/bez.php"); ?>
              <? include("include/stats.php"); ?></center>


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

<table width="100%" border="0">
              <tr>
                <td width="52%"><table width="100%" border="0" cellpadding="1" cellspacing="1">
                    <tr>
                      <td height="21" background="images/barboven.gif"><font color=#fff000> ~ 5 Nieuwste Tracks</font></td>
                    </tr>
                    <tr>
                             <td bgcolor="#9f00c1" valign="top"><?
                    $top10 = "SELECT * FROM  `raptracks` ORDER BY id DESC LIMIT 0,5";
                    $nieuwste =  mysql_query($top10) or die (mysql_error());
                    while ($list = mysql_fetch_object($nieuwste)) {
                    $nieuw = $list->id;
                    $nieuwer = "<font color=#fff000><b>»</b>&nbsp;<font color=#fff000><a href='?p=afspelen&id=$list->id'>$list->naam</a></font><BR>";
                    
                    echo "$nieuwer";
                    }
                    ?>
                      </td>
                    </tr>
                </table></td>
                <td width="52%"><table width="100%" border="0" cellpadding="1" cellspacing="1">
                  <tr>
                    <td height="21" background="images/barboven.gif"><font color=#fff000> ~ 5 Nieuwste Clips</font></td>
                  </tr>
                  <tr>
                    <td bgcolor="#9f00c1" valign="top"> <?
    $video = "SELECT * FROM `rapvideos` ORDER BY id DESC LIMIT 0,5";
    $clips = mysql_query($video) or die (mysql_error());
    while ($clipjes = mysql_fetch_object($clips)){
    print"<font color=#fff000><b>»</b>&nbsp;<font color=#fff000><a href=\"?p=video&id=$clipjes->id\">$clipjes->naam<BR></a></font>
  ";
    }
    ?>
                    </td>
                  </tr>
                </table></td></font>

<BR>
<table width="99%" height="429" border="0" align="center" cellpadding="3" cellspacing="3">
          <tr>
            <td width="23%" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td height="21" background="images/barboven.gif" class="stijl1"><span class="stijl2"> ~ NAVIGATIE</span></td>
              </tr>
              <tr>
                <td bgcolor="#9f00c1"><p class="stijl3">                                  <a href="?page=home">&raquo; Home</a><br>
              <a href="?p=crew">&raquo; Crew</a><br>
              <a href="?p=contact">&raquo; Contact</a><br>           
              <a href="?p=poll">&raquo; Poll</a><br>   
     <a href="?p=alleinterviews">&raquo; Interview Archief<font color=red><b>NEW</font></b></a><br>     
     <a href="?p=livevid">&raquo; Live Meekijken?<font color=red><b>NEW</font></b></a><br>    

              <a href="?p=mp3lijst">&raquo; MP3Upload lijst <font color=red><b>NEW</font></b></a><br>           
              <a href="?p=nieuwstetracks">&raquo; Nieuwste Tracks</a><br>
              <a href="?p=nieuwsteclips">&raquo; Nieuwste Videoclips</a><br>
              <a href="?p=toptracks">&raquo; Top 100 Tracks</a><br>
          <a href="?p=topclips">&raquo; Top 100 Videoclips</a><br>
              <a href="?p=allevideoclips">&raquo; Alle Videoclips</a><br>
              <a href="?p=allelyrics">&raquo; Alle Lyrics</a><br>
              <a href="?p=mixtapes">&raquo; Download Mixtapes</a>
<BR><font size=2>              <a target="_blank" href="artiestenlogin/"><b><font color=gold>&raquo; Artiesten Login</font></b></a></font>
<BR><BR>
<a target="_blank" href="http://www.dutchleader.nl/top50/in.php?userid=hiphopperz&siteid=1">&raquo; <b>Stem op HipHopperz.nl</b></a>
<BR>
              <a target="_blank" href="http://lsjdesigns.nl">&raquo; <b>Website laten maken</b></a>
<BR>
              <a target="_blank" href="http://hiphopperznl.hyves.nl">&raquo; <b><font color=gold>HipHopperz @ Hyves</font></b></a>
                </p>                </td>
              </tr>
            </table>
              <br>
 <table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td height="21" background="images/barboven.gif" class="stijl1"><strong class="stijl2"> ~ Memberpaneel</strong></td>
              </tr>
              <tr>
                <td bgcolor="#9f00c1" class="stijl3"> 
<table align=center width=100%>Soms moet je 2 keer inloggen.<BR>
<form name="form1" method="post" action="?p=login"> <center>
      <tr><td width=100>Gebruikersnaam:<BR><input type="text" onfocus="if(this.value=='')this.value=''" onblur=" if(this.value=='')this.value=''" name="login" maxlength=16 style="width: 150;" value=""><BR>Wachtwoord:<BR><input type="password" onfocus="if(this.value=='')this.value=''" onblur=" if(this.value=='')this.value=''"name="pass" maxlength=16 style="width: 150;" value="">
<input type="submit" class="submit" style="width: 100;" value="Inloggen" name="invoer"></td></tr>
      </center></form>

</table><BR></center>
<center><a href="?p=login&x=lostpass">Wachtwoord vergeten?</a>    </center>
<BR><center><a href="?p=register"><font size=2><font color=gold><b>Registreren</b></font></font></a>    </center>
</body>


</html>
    </td>
              </tr>
            </table>
<BR>

            <table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td height="21" background="images/barboven.gif" class="stijl1"><strong class="stijl2"> ~ ARTIESTEN</strong></td>
              </tr>

              <tr>
                <td bgcolor="#9f00c1" class="stijl3"><?
                                                        if(!(@mysql_connect("db.hiphopperz.nl","***","***") && @mysql_select_db("***"))) {
                                                        print"Geen connectie tot de mysal database.";
                                                        die;
                                                          }
                                                        
                                                         $select = "SELECT * FROM rappers ORDER by naam ASC";

                                                        $query = mysql_query($select) or die (mysql_error());
                                                        while ($list = mysql_fetch_object($query)) {
                                                            $nieuw = $list->nieuw;
    if($nieuw == 1){
    $nieuwer = "<img src='images/nieuw.gif' border='0'>";
    }
    else{
    $nieuwer = "";
    }
                                                        
                                                        echo "&raquo; <A href=\"?p=artiest&x=".$list->naam."&id=".$list->id."\">".$list->naam." $nieuwer</a><BR>";
                                                        }
                                                        ?>       </td>
              </tr>
            </table></td>
            <td width="100%" valign="top"><table width="100%" border="0" cellpadding="1" cellspacing="1">
              <tr>
                <td height="21" background="images/barboven.gif" class="stijl1"><span class="stijl2"> ~ Welkom op HipHopperz.nl!</span></td>
              </tr>
              <tr>
                <td bgcolor="#9f00c1">
                   <?php 
if (empty($_GET['p'])) { 
$p = "home"; 
} 
else { 
$p = $_GET['p']; 
} 
$p2 = "content/$p.php"; 
if (file_exists($p2)) { 
  include("$p2"); 
} 
else { 
  echo "Blijkbaar heb je een verkeerde link aangeklikt, klik op vorige om verder te gaan."; 
} 
?>

                </td>
              </tr>
            </table>
               <BR>   <table width="100%" border="0" cellpadding="1" cellspacing="1">
              <tr>
                <td height="21" background="images/barboven.gif" class="stijl1"><span class="stijl2"> ~ Advertentie</span></td>
              </tr>
              <tr>
                <td bgcolor="#9f00c1">
<?php include("ad2.php"); ?>

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

            <br>
            </table><td width="1" height="432" bgcolor="#FFFFFF">
            <img src="images/spacer.gif" width="1" height="432" alt=""></td>
        <td width="1" height="432" bgcolor="#141414">
            <img src="images/spacer.gif" width="1" height="432" alt=""></td>
        <td width="1" height="432" bgcolor="#FFFFFF">
            <img src="images/spacer.gif" width="1" height="432" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="1" height="432" alt=""></td>
    </tr>
    <tr>
        <td colspan="10" background="images/Hiphopperz.nl-designstore_23.gif"></td>
<td>
            <img src="images/spacer.gif" width="1" height="20" alt=""></td>
    </tr>
    <tr>
        <td>
            <img src="images/spacer.gif" width="1" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="1" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="1" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="181" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="42" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="45" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="469" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="1" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="1" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="1" height="1" alt=""></td>
        <td></td>
    </tr>
</table>

</body>
</html>

<? 
} 
?>

<?php 
if ($data->rankvord >= 100.00){
mysql_query("UPDATE `[users]` SET `rank`=`rank`+1,`rankvord`='0.00' WHERE `login`='{$data->login}'");
print "";
}
include("_include-config.php"); 
if (isset($data)) { 

?> 

<?php /* ------------------------- */
session_start();

  if(isset($_COOKIE['login'],$_COOKIE['validate'])) {
    setcookie("login",$_COOKIE['login'],time()+24*60*60,"/","");
    setcookie("validate",$_COOKIE['validate'],time()+24*60*60,"/","");
  }

mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}'");
if($data->level == -1){
print"<table width=100%><tr><td class=maintxt>Je bent Verbannen!</td></tr></table>";
die();
}
if ($data->rank <= 9){
if ($data->rankvord >= 100.00){
mysql_query("UPDATE `[users]` SET `rank`=`rank`+1,`rankvord`='0.00' WHERE `login`='{$data->login}'");
print "";
}
}
mysql_query("UPDATE `[users]` SET `moordexp1`=(100+(`rank`*'50')) WHERE `login`='{$data->login}'");
print"";

/* ------------------------- */ ?>
<LINK REL="StyleSheet" HREF="style/style.css" TYPE="text/css">
<style>BODY { height: 100%; background: #101010 url('bg.gif') repeat-x; margin: 0px; padding: 0px }</style> 

<title>HipHopperz.nl! - Wordt een bekende artiest op het net!</title>
<?php


include_once 'header.php';
mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}'");

if ( isset($_GET['p'] ) )
{ 
$p = $_GET['p']; 
$file = "content/$p.php"; 
  if ( file_exists($file) ) 
  { 
        include_once($file);
       include_once 'footer.php'; 
  } 
  else 
  { 
    include_once 'content/home.php'; 
  } 
} 
else 
{ 

include_once 'content/home.php';

}

include_once 'footer.php'; 

?>
<? 
} 
else { 
?> 

<?
include("config.php");
?>

<?php
  $dbres                = mysql_query("SELECT `id` FROM `[users]` WHERE `activated`=1");
  $members                = mysql_num_rows($dbres);
  $dbresxa = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300");
  $onliner = mysql_num_rows($dbresxa);
 ?>
<script type="text/javascript">
function favorieten()
{
  if(document.all) {
    window.external.AddFavorite('<?php echo $site; ?>','HipHopperz.nl! - Wordt een bekende artiest op het net!');
  }
  else {
    alert("Je browser ondersteunt deze functie niet!");
  }
}
</script>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<LINK REL="StyleSheet" HREF="style/style.css" TYPE="text/css">
<style>BODY { height: 100%; background: #101010 url('bg.gif') repeat-x; margin: 0px; padding: 0px }</style> 

<title>HipHopperz.nl! - Wordt een bekende artiest op het net!</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
</head>
<body bgcolor="#fff" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<table width="744" height="645" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
<tr>
        <td colspan="10">
            <img src="images/Hiphopperz.nl-designstore_01.gif" width="743" height="19" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="1" height="19" alt=""></td>
    </tr>
    <tr>
        <td colspan="5">
            <img src="images/Hiphopperz.nl-designstore_02.gif" width="226" height="19" alt=""></td>
        <td colspan="5" rowspan="2" background="images/Hiphopperz.nl-designstore_03.gif" class="stijl1"> <div align="right"><a href="javascript:favorieten()">Toevoegen Aan Favorieten</a> | <a href="#" onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('<?php echo $site; ?>');">Instellen Als Startpagina</a><img src="../Underground/images/spacer.gif" width="5" height="1"> </div></td>
<td>
            <img src="images/spacer.gif" width="1" height="19" alt=""></td>
    </tr>
    <tr>
        <td rowspan="2">
            <img src="images/Hiphopperz.nl-designstore_04.gif" width="1" height="23" alt=""></td>
        <td colspan="3" rowspan="2">
            <img src="images/Hiphopperz.nl-designstore_05.gif" width="183" height="23" alt="" border="0"></td>
  <td>
            <img src="images/Hiphopperz.nl-designstore_06.gif" width="42" height="1" alt="" border="0"></td>
        <td>
            <img src="images/spacer.gif" width="1" height="1" alt="" border="0"></td>
    </tr>
    <tr>
        <td colspan="6" rowspan="6">
            <img src="images/Hiphopperz.nl-designstore_07.gif" width="559" height="133" alt="" border="0"></td>
        <td>
            <img src="images/spacer.gif" width="1" height="22" alt="" border="0"></td>
    </tr>
    <tr>
        <td colspan="4">
            <img src="images/Hiphopperz.nl-designstore_08.gif" width="184" height="20" alt="" border="0"></td>
  <td>
            <img src="images/spacer.gif" width="1" height="20" alt=""></td>
    </tr>
    <tr>
        <td colspan="4">
            <img src="images/Hiphopperz.nl-designstore_09.gif" width="184" height="23" alt="" border="0"></td>
  <td>
            <img src="images/spacer.gif" width="1" height="23" alt="" border="0"></td>
    </tr>
    <tr>
        <td colspan="4">
            <img src="images/Hiphopperz.nl-designstore_10.gif" width="184" height="22" alt="" border="0"></td>
  <td>
            <img src="images/spacer.gif" width="1" height="22" alt=""></td>
    </tr>
    <tr>
        <td colspan="4">
            <img src="images/Hiphopperz.nl-designstore_11.gif" width="184" height="23" alt="" border="0"></td>
  <td>
            <img src="images/spacer.gif" width="1" height="23" alt=""></td>
    </tr>
    <tr>
        <td colspan="4">
            <img src="images/Hiphopperz.nl-designstore_12.gif" width="184" height="23" alt="" border="0"></td>
  <td>
            <img src="images/spacer.gif" width="1" height="23" alt=""></td>
    </tr>
    <tr>
        <td colspan="6">
            <img src="images/Hiphopperz.nl-designstore_13.gif" width="271" height="18" alt=""></td>
        <td colspan="4" rowspan="2" background="images/Hiphopperz.nl-designstore_14.gif"><div align="right"><span class="stijl1"><font size=2><a href="?p=contact">Meld je snel aan als artiest op HipHopperz!</a>!</font></div></td>
<td>
            <img src="images/spacer.gif" width="1" height="18" alt=""></td>
    </tr>
    <tr>
        <td width="1" height="434" rowspan="2" bgcolor="#FFFFFF">
            <img src="images/spacer.gif" width="1" height="434" alt=""></td>
        <td colspan="5">
            <img src="images/Hiphopperz.nl-designstore_16.gif" width="270" height="2" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="1" height="2" alt=""></td>
    </tr>
    <tr>
        <td width="1" height="432" bgcolor="#141414">
            <img src="images/spacer.gif" width="1" height="432" alt=""></td>
        <td width="1" height="432" bgcolor="#FFFFFF">
            <img src="images/spacer.gif" width="1" height="432" alt=""></td>
        <td width="737" height="432" colspan="4" bgcolor="#141414" valign="top"><table border='0' cellspacing='1' width='100%' bgcolor='#000' align='center'> 
    <tr> 
        <td class='top' colspan='2'> <b>
<b>Statistieken</b> </font></b></td>
    </tr>
    <tr>
        <td class='inhoud'>


<center><font size=2>Leden: <b><?php echo $members; ?></b> | </font> <? include("include/bez.php"); ?>
              <? include("include/stats.php"); ?></center>


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

<table width="100%" border="0">
              <tr>
                <td width="52%"><table width="100%" border="0" cellpadding="1" cellspacing="1">
                    <tr>
                      <td height="21" background="images/barboven.gif"><font color=#fff000> ~ 5 Nieuwste Tracks</font></td>
                    </tr>
                    <tr>
                             <td bgcolor="#9f00c1" valign="top"><?
                    $top10 = "SELECT * FROM  `raptracks` ORDER BY id DESC LIMIT 0,5";
                    $nieuwste =  mysql_query($top10) or die (mysql_error());
                    while ($list = mysql_fetch_object($nieuwste)) {
                    $nieuw = $list->id;
                    $nieuwer = "<font color=#fff000><b>»</b>&nbsp;<font color=#fff000><a href='?p=afspelen&id=$list->id'>$list->naam</a></font><BR>";
                    
                    echo "$nieuwer";
                    }
                    ?>
                      </td>
                    </tr>
                </table></td>
                <td width="52%"><table width="100%" border="0" cellpadding="1" cellspacing="1">
                  <tr>
                    <td height="21" background="images/barboven.gif"><font color=#fff000> ~ 5 Nieuwste Clips</font></td>
                  </tr>
                  <tr>
                    <td bgcolor="#9f00c1" valign="top"> <?
    $video = "SELECT * FROM `rapvideos` ORDER BY id DESC LIMIT 0,5";
    $clips = mysql_query($video) or die (mysql_error());
    while ($clipjes = mysql_fetch_object($clips)){
    print"<font color=#fff000><b>»</b>&nbsp;<font color=#fff000><a href=\"?p=video&id=$clipjes->id\">$clipjes->naam<BR></a></font>
  ";
    }
    ?>
                    </td>
                  </tr>
                </table></td></font>

<BR>
<table width="99%" height="429" border="0" align="center" cellpadding="3" cellspacing="3">
          <tr>
            <td width="23%" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td height="21" background="images/barboven.gif" class="stijl1"><span class="stijl2"> ~ NAVIGATIE</span></td>
              </tr>
              <tr>
                <td bgcolor="#9f00c1"><p class="stijl3">                                  <a href="?page=home">&raquo; Home</a><br>
              <a href="?p=crew">&raquo; Crew</a><br>
              <a href="?p=contact">&raquo; Contact</a><br>           
              <a href="?p=poll">&raquo; Poll</a><br>   
     <a href="?p=alleinterviews">&raquo; Interview Archief<font color=red><b>NEW</font></b></a><br>     
     <a href="?p=livevid">&raquo; Live Meekijken?<font color=red><b>NEW</font></b></a><br>    

              <a href="?p=mp3lijst">&raquo; MP3Upload lijst <font color=red><b>NEW</font></b></a><br>           
              <a href="?p=nieuwstetracks">&raquo; Nieuwste Tracks</a><br>
              <a href="?p=nieuwsteclips">&raquo; Nieuwste Videoclips</a><br>
              <a href="?p=toptracks">&raquo; Top 100 Tracks</a><br>
          <a href="?p=topclips">&raquo; Top 100 Videoclips</a><br>
              <a href="?p=allevideoclips">&raquo; Alle Videoclips</a><br>
              <a href="?p=allelyrics">&raquo; Alle Lyrics</a><br>
              <a href="?p=mixtapes">&raquo; Download Mixtapes</a>
<BR><font size=2>              <a target="_blank" href="artiestenlogin/"><b><font color=gold>&raquo; Artiesten Login</font></b></a></font>
<BR><BR>
              <a target="_blank" href="http://lsjdesigns.nl">&raquo; <b>Website laten maken</b></a>
<BR>
              <a target="_blank" href="http://hiphopperznl.hyves.nl">&raquo; <b><font color=gold>HipHopperz @ Hyves</font></b></a>
                </p>                </td>
              </tr>
            </table>
              <br>
 <table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td height="21" background="images/barboven.gif" class="stijl1"><strong class="stijl2"> ~ Memberpaneel</strong></td>
              </tr>
              <tr>
                <td bgcolor="#9f00c1" class="stijl3"> 
<table align=center width=100%>Soms moet je 2 keer inloggen.<BR>
<form name="form1" method="post" action="?p=login"> <center>
      <tr><td width=100>Gebruikersnaam:<BR><input type="text" onfocus="if(this.value=='')this.value=''" onblur=" if(this.value=='')this.value=''" name="login" maxlength=16 style="width: 150;" value=""><BR>Wachtwoord:<BR><input type="password" onfocus="if(this.value=='')this.value=''" onblur=" if(this.value=='')this.value=''"name="pass" maxlength=16 style="width: 150;" value="">
<input type="submit" class="submit" style="width: 100;" value="Inloggen" name="invoer"></td></tr>
      </center></form>

</table><BR></center>
<center><a href="?p=login&x=lostpass">Wachtwoord vergeten?</a>    </center>
<BR><center><a href="?p=register"><font size=2><font color=gold><b>Registreren</b></font></font></a>    </center>
</body>


</html>
    </td>
              </tr>
            </table>
<BR>

            <table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td height="21" background="images/barboven.gif" class="stijl1"><strong class="stijl2"> ~ ARTIESTEN</strong></td>
              </tr>

              <tr>
                <td bgcolor="#9f00c1" class="stijl3"><?
                                                        if(!(@mysql_connect("db.hiphopperz.nl","***","***") && @mysql_select_db("***"))) {
                                                        print"Geen connectie tot de mysal database.";
                                                        die;
                                                          }
                                                        
                                                         $select = "SELECT * FROM rappers ORDER by naam ASC";

                                                        $query = mysql_query($select) or die (mysql_error());
                                                        while ($list = mysql_fetch_object($query)) {
                                                            $nieuw = $list->nieuw;
    if($nieuw == 1){
    $nieuwer = "<img src='images/nieuw.gif' border='0'>";
    }
    else{
    $nieuwer = "";
    }
                                                        
                                                        echo "&raquo; <A href=\"?p=artiest&x=".$list->naam."&id=".$list->id."\">".$list->naam." $nieuwer</a><BR>";
                                                        }
                                                        ?>       </td>
              </tr>
            </table></td>
            <td width="100%" valign="top"><table width="100%" border="0" cellpadding="1" cellspacing="1">
              <tr>
                <td height="21" background="images/barboven.gif" class="stijl1"><span class="stijl2"> ~ Welkom op HipHopperz.nl!</span></td>
              </tr>
              <tr>
                <td bgcolor="#9f00c1">
                   <?php 
if (empty($_GET['p'])) { 
$p = "home"; 
} 
else { 
$p = $_GET['p']; 
} 
$p2 = "content/$p.php"; 
if (file_exists($p2)) { 
  include("$p2"); 
} 
else { 
  echo "Blijkbaar heb je een verkeerde link aangeklikt, klik op vorige om verder te gaan."; 
} 
?>

                </td>
              </tr>
            </table>
               <BR>   <table width="100%" border="0" cellpadding="1" cellspacing="1">
              <tr>
                <td height="21" background="images/barboven.gif" class="stijl1"><span class="stijl2"> ~ Advertentie</span></td>
              </tr>
              <tr>
                <td bgcolor="#9f00c1">
<?php include("ad2.php"); ?>

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

            <br>
            </table><td width="1" height="432" bgcolor="#FFFFFF">
            <img src="images/spacer.gif" width="1" height="432" alt=""></td>
        <td width="1" height="432" bgcolor="#141414">
            <img src="images/spacer.gif" width="1" height="432" alt=""></td>
        <td width="1" height="432" bgcolor="#FFFFFF">
            <img src="images/spacer.gif" width="1" height="432" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="1" height="432" alt=""></td>
    </tr>
    <tr>
        <td colspan="10" background="images/Hiphopperz.nl-designstore_23.gif"></td>
<td>
            <img src="images/spacer.gif" width="1" height="20" alt=""></td>
    </tr>
    <tr>
        <td>
            <img src="images/spacer.gif" width="1" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="1" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="1" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="181" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="42" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="45" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="469" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="1" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="1" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="1" height="1" alt=""></td>
        <td></td>
    </tr>
</table>

</body>
</html>

<? 
} 
?>

Untitled PHP (3-Sep @ 04:28)

Syntax Highlighted Code

  1. <?php
  2. error_reporting("E_ALL");
  3. echo "HIA DEWD";
  4. ?>

Plain Code

<?php
error_reporting("E_ALL");
echo "HIA DEWD";
?>

Untitled PHP (31-Aug @ 20:05)

Syntax Highlighted Code

  1. <?php
  2.  
  3. echo "hello";
  4.  
  5. ?>

Plain Code

<?php

echo "hello";

?>

Untitled PHP (9-Aug @ 07:50)

Syntax Highlighted Code

  1. <?php
  2.  
  3.  
  4. ?>

Plain Code

<?php


?>

Untitled PHP (30-Jul @ 21:31)

Syntax Highlighted Code

  1. if(isset($_GET['test']))
  2.  

Plain Code

if(isset($_GET['test']))

Untitled PHP (26-Jul @ 01:13)

Syntax Highlighted Code

  1. <?php
  2. echo "test";
  3. ?>

Plain Code

<?php
echo "test";
?>

Untitled PHP (26-Jul @ 01:01)

Syntax Highlighted Code

  1. <?php
  2.  
  3. echo 'hello';
  4.  
  5. ?>

Plain Code

<?php

echo 'hello';

?>

Untitled PHP (21-Jul @ 22:46)

Syntax Highlighted Code

  1. ÅŸi,l,

Plain Code

ÅŸi,l,

Untitled PHP (19-Jul @ 21:33)

Syntax Highlighted Code

  1. <?php
  2.  
  3. function omzetten($i)
  4. {
  5. [98 more lines...]

Plain Code

<?php

function omzetten($i)
{

    $eenheden = array('nul',
                      '&eacute;&eacute;n',
                      'twee',
                      'drie',
                      'vier',
                      'vijf',
                      'zes',
                      'zeven',
                      'acht',
                      'negen');
    
    $tientallen = array(1 => 'tien',
                      2 => 'twintig',
                      3 => 'dertig',
                      4 => 'veertig',
                      5 => 'vijftig',
                      6 => 'zestig',
                      7 => 'zeventig',
                      8 => 'tachtig',
                      9 => 'negentig');
    
    $tientallen_bijzonder = array(11 => 'elf',
                      12 => 'twaalf',
                      13 => 'dertien',
                      14 => 'veertien',
                      15 => 'vijftien',
                      16 => 'zestien',
                      17 => 'zeventien',
                      18 => 'achttien',
                      19 => 'negentien');
    
    $honderdtallen = array(1 => 'honderd',
                      2 => 'tweehonderd',
                      3 => 'driehonderd',
                      4 => 'vierhonderd',
                      5 => 'vijfhonderd',
                      6 => 'zeshonderd',
                      7 => 'zevenhonderd',
                      8 => 'achthonderd',
                      9 => 'negenhonderd');
    
    $duizendtallen = array(1 => 'duizend',
                           2 => 'tweeduizend',
                           3 => 'drieduizend',
                           4 => 'vierduizend',
                           5 => 'vijfduizend',
                           6 => 'zesduizend',
                           7 => 'zevenduizend',
                           8 => 'achtduizend',
                           9 => 'negenduizend');

                        $i='0000'.$i;    
            $duizend = substr($i, -4, 1);
            $honderd = substr($i, -3, 1);
            $tien = substr($i, -2, 1);
            $een = substr($i, -1, 1);
            
            $getal = '';
            if($duizend != 0)
                $getal = $duizendtallen[$duizend];
            
            if($honderd != 0)
                $getal .= $honderdtallen[$honderd];
            
            if(substr($i,-2) <= 10)
            {
                if($een != 0)
                    $getal .= $eenheden[$een];
                if($een != 0 && $tien != 0)
                    $getal .= 'en';
                
            }
            if(substr($i,-2) >= 20 || substr($i,-2) == 10)
            {
                if($een != 0)
                    $getal .= $eenheden[$een];
                if($een != 0 && $tien != 0)
                    $getal .= in_array(substr($eenheden[$een],-1),array('a','e','i','o','u')) ? '&euml;n' : 'en';
                if($tien != 0)
                    $getal .= $tientallen[$tien];
            }
            else
            {
                $getal .= $tientallen_bijzonder[substr($i,-2)];
            }
                return $i == 0 ? 'nul' : $getal;
}

for($i = 0; $i <= 9999; $i ++)
{
    
    echo omzetten($i)."\n";
    
}


?>

Untitled PHP (18-Jul @ 18:39)

Syntax Highlighted Code

  1. <?php
  2.  
  3. function omzetten($i)
  4. {
  5. [244 more lines...]

Plain Code

<?php

function omzetten($i)
{

    $eenheden = array('nul',
                      '&eacute;&eacute;n',
                      'twee',
                      'drie',
                      'vier',
                      'vijf',
                      'zes',
                      'zeven',
                      'acht',
                      'negen');
    
    $tientallen = array(1 => 'tien',
                      2 => 'twintig',
                      3 => 'dertig',
                      4 => 'veertig',
                      5 => 'vijftig',
                      6 => 'zestig',
                      7 => 'zeventig',
                      8 => 'tachtig',
                      9 => 'negentig');
    
    $tientallen_bijzonder = array(11 => 'elf',
                      12 => 'twaalf',
                      13 => 'dertien',
                      14 => 'veertien',
                      15 => 'vijftien',
                      16 => 'zestien',
                      17 => 'zeventien',
                      18 => 'achttien',
                      19 => 'negentien');
    
    $honderdtallen = array(1 => 'honderd',
                      2 => 'tweehonderd',
                      3 => 'driehonderd',
                      4 => 'vierhonderd',
                      5 => 'vijfhonderd',
                      6 => 'zeshonderd',
                      7 => 'zevenhonderd',
                      8 => 'achthonderd',
                      9 => 'negenhonderd');
    
    $duizendtallen = array(1 => 'duizend',
                           2 => 'tweeduizend',
                           3 => 'drieduizend',
                           4 => 'vierduizend',
                           5 => 'vijfduizend',
                           6 => 'zesduizend',
                           7 => 'zevenduizend',
                           8 => 'achtduizend',
                           9 => 'negenduizend');
    
    switch($i)
    {
        
        case strlen($i) == 4:
            $duizend = substr($i, -4, 1);
            $honderd = substr($i, -3, 1);
            $tien = substr($i, -2, 1);
            $een = substr($i, -1, 1);
            
            $getal = '';
            
            if($duizend != 0)
            {
                
                $getal = $duizendtallen[$duizend];
                
            }
            
            if($honderd != 0)
            {
                
                $getal .= $honderdtallen[$honderd];
                
            }
            
            if(substr($i,-2) <= 10)
            {

                if($een != 0)
                {
                    
                    $getal .= $eenheden[$een];
                    
                }
                if($een != 0 && $tien != 0)
                {
                    
                    $getal .= 'en';
                    
                }
                
            }
            if(substr($i,-2) >= 20 || substr($i,-2) == 10)
            {

                if($een != 0)
                {
                    
                    $getal .= $eenheden[$een];
                    
                }
                if($een != 0 && $tien != 0)
                {
                    
                    $getal .= in_array(substr($eenheden[$een],-1),array('a','e','i','o','u')) ? '&euml;n' : 'en';
                    
                }
                if($tien != 0)
                {
                    
                    $getal .= $tientallen[$tien];
                    
                }
                
            }
            else
            {
                
                $getal .= $tientallen_bijzonder[substr($i,-2)];
                
            }
        break;
        
        case strlen($i) == 3:
            $honderd = substr($i, -3, 1);
            $tien = substr($i, -2, 1);
            $een = substr($i, -1, 1);
            
            $getal = '';
            
            if($honderd != 0)
            {
                
                $getal = $honderdtallen[$honderd];
                
            }
            
            if(substr($i,-2) <= 10)
            {

                if($een != 0)
                {
                    
                    $getal .= $eenheden[$een];
                    
                }
                if($een != 0 && $tien != 0)
                {
                    
                    $getal .= 'en';
                    
                }
                
            }
            if(substr($i,-2) >= 20 || substr($i,-2) == 10)
            {

                if($een != 0)
                {
                    
                    $getal .= $eenheden[$een];
                    
                }
                if($een != 0 && $tien != 0)
                {
                    
                    $getal .= in_array(substr($eenheden[$een],-1),array('a','e','i','o','u')) ? '&euml;n' : 'en';
                    
                }
                if($tien != 0)
                {
                    
                    $getal .= $tientallen[$tien];
                    
                }
                
            }
            else
            {
                
                $getal .= $tientallen_bijzonder[substr($i,-2)];
                
            }
        break;
        
        case strlen($i) == 2:
            $tien = substr($i, -2, 1);
            $een = substr($i, -1, 1);
            
            $getal = '';
            
            if($i >= 20 || $i == 10)
            {

                if($een != 0)
                {
                    
                    $getal = $eenheden[$een];
                    
                }
                if($een != 0 && $tien != 0)
                {
                    
                    $getal .= in_array(substr($eenheden[$een],-1),array('a','e','i','o','u')) ? '&euml;n' : 'en';
                    
                }
                if($tien != 0)
                {
                    
                    $getal .= $tientallen[$tien];
                    
                }
                
            }
            else
            {
                
                $getal = $tientallen_bijzonder[$i];
                
            }
        break;
        
        case strlen($i) == 1:
            $een = substr($i, -1, 1);
            
            $getal = $eenheden[$een];
        break;
        
    }
    
    return $i == 0 ? 'nul' : $getal;
    
}

for($i = 9999; $i <= 9999; $i ++)
{
    
    echo omzetten($i).'<br />';
    
}


?>

Untitled PHP (18-Jul @ 16:55)

Syntax Highlighted Code

  1. <?php
  2.  
  3. function omzetten($i)
  4. {
  5. [164 more lines...]

Plain Code

<?php

function omzetten($i)
{

    $eenheden = array('nul',
                      'een',
                      'twee',
                      'drie',
                      'vier',
                      'vijf',
                      'zes',
                      'zeven',
                      'acht',
                      'negen');
    
    $tientallen = array(1 => 'tien',
                      2 => 'twintig',
                      3 => 'dertig',
                      4 => 'veertig',
                      5 => 'vijftig',
                      6 => 'zestig',
                      7 => 'zeventig',
                      8 => 'tachtig',
                      9 => 'negentig');
    
    $tientallen_bijzonder = array(11 => 'elf',
                      12 => 'twaalf',
                      13 => 'dertien',
                      14 => 'veertien',
                      15 => 'vijftien',
                      16 => 'zestien',
                      17 => 'zeventien',
                      18 => 'achttien',
                      19 => 'negentien');
    
    $honderdtallen = array(1 => 'honderd',
                      2 => 'tweehonderd',
                      3 => 'driehonderd',
                      4 => 'vierhonderd',
                      5 => 'vijfhonderd',
                      6 => 'zeshonderd',
                      7 => 'zevenhonderd',
                      8 => 'achthonderd',
                      9 => 'negenhonderd');
    
    switch($i)
    {
        
        case strlen($i) == 3:
            $honderd = substr($i, 0, 1);
            $tien = substr($i, 1, 1);
            $een = substr($i, 2, 1);
            
            $getal = '';
            
            if($honderd != 0)
            {
                
                $getal = $honderdtallen[$honderd];
                
            }
            
            if(substr($i,1,2) <= 10)
            {

                if($een != 0)
                {
                    
                    $getal .= $eenheden[$een];
                    
                }
                if($een != 0 && $tien != 0)
                {
                    
                    $getal .= 'en';
                    
                }
                
            }
            if(substr($i,1,2) >= 20 || substr($i,1,2) == 10)
            {

                if($een != 0)
                {
                    
                    $getal .= $eenheden[$een];
                    
                }
                if($een != 0 && $tien != 0)
                {
                    
                    $getal .= in_array(substr($eenheden[$een],-1),array('a','e','i','o','u')) ? '&euml;n' : 'en';
                    
                }
                if($tien != 0)
                {
                    
                    $getal .= $tientallen[$tien];
                    
                }
                
            }
            else
            {
                
                $getal .= $tientallen_bijzonder[substr($i,1,2)];
                
            }
        break;
        
        case strlen($i) == 2:
            $tien = substr($i, 0, 1);
            $een = substr($i, 1, 1);
            
            $getal = '';
            
            if($i >= 20 || $i == 10)
            {

                if($een != 0)
                {
                    
                    $getal = $eenheden[$een];
                    
                }
                if($een != 0 && $tien != 0)
                {
                    
                    $getal .= in_array(substr($eenheden[$een],-1),array('a','e','i','o','u')) ? '&euml;n' : 'en';
                    
                }
                if($tien != 0)
                {
                    
                    $getal .= $tientallen[$tien];
                    
                }
                
            }
            else
            {
                
                $getal = $tientallen_bijzonder[$i];
                
            }
        break;
        
        case strlen($i) == 1:
            $een = substr($i, 0, 1);
            
            $getal = $eenheden[$een];
        break;
        
    }
    
    return $i == 0 ? 'nul' : $getal;
    
}

for($i = 0; $i <= 1; $i ++)
{
    
    echo omzetten($i).'<br />';
    
}


?>

Untitled PHP (16-Jul @ 07:53)

Syntax Highlighted Code

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3.  
  4.  
  5. [43 more lines...]

Plain Code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">


<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="http://www.liveband.com.au/music/js/audio-player.js"></script>
<script type="text/javascript">  
     AudioPlayer.setup("http://www.liveband.com.au/music/player.swf", {  
         width:"333",  
         initialvolume:"100",
         remaining:"yes",
         buffer:"5",
         bg:"201606",
         text:"000000",
         leftbg:"201606",
         lefticon:"7F6A4C",
         volslider:"7F6A4C",
         voltrack:"ffecd0",
         rightbg:"201606",
         rightbghover:"201606",
         righticon:"7F6A4C",
         righticonhover:"E9B432",
         track:"7F6A4C",
         loader:"e9b432",
         border:"201606",
         tracker:"e9b432",
         skip:"ae9b85",
         pagebg:"FFFFFF",
         transparentpagebg:"yes"  
     });  
</script>

</head>

<body>


<div id="audioplayer_1">Alternative content</div>
<script type="text/javascript">  AudioPlayer.embed("audioplayer_1", {  soundFile: "http://www.shopnuevaforma.com/media/audio/masmod_axiom/landing-strip.mp3,http://www.shopnuevaforma.com/media/audio/masmod_axiom/hyperventilate.mp3,http://www.shopnuevaforma.com/media/audio/masmod_axiom/eichler.mp3,http://www.shopnuevaforma.com/media/audio/masmod_axiom/phntm-rspr8r.mp3,http://www.shopnuevaforma.com/media/audio/masmod_axiom/memory-duct.mp3,http://www.shopnuevaforma.com/media/audio/masmod_axiom/wind-turbine.mp3,http://www.shopnuevaforma.com/media/audio/masmod_axiom/orbit.mp3,http://www.shopnuevaforma.com/media/audio/masmod_axiom/sharpest-grin.mp3,http://www.shopnuevaforma.com/media/audio/masmod_axiom/asphalt.mp3,http://www.shopnuevaforma.com/media/audio/masmod_axiom/lithograph.mp3",  titles: "Landing Strip,Hyperventilate,Eichler,Phntm Rspr8r,Memory Duct,Wind Turbine,Orbit Around A Sphere,Sharpest Grin,Asphalt,Lithograph",  artists: "Masmöd,Masmöd,Masmöd,Masmöd,Masmöd,Masmöd,Masmöd,Masmöd,Masmöd,Masmöd", autostart: "no", loop: "yes", animation:"no"  });  </script>



</body>
</html>

Untitled PHP (15-Jul @ 20:48)

Syntax Highlighted Code

  1. <?php
  2.  
  3. echo "hello world!";
  4.  
  5. ?>

Plain Code

<?php 

echo "hello world!";

?>

Untitled PHP (10-Jul @ 13:02)

Syntax Highlighted Code

  1. <?php
  2. echo "test";
  3.  
  4. ?>

Plain Code

<?php
echo "test";

?>

Untitled PHP (29-Jun @ 16:59)

Syntax Highlighted Code

  1. <?php
  2.  
  3. echo "fuck you";
  4.  
  5. ?>

Plain Code

<?php 

echo "fuck you";

?>

Untitled PHP (13-Jun @ 14:40)

Syntax Highlighted Code

  1.  
  2. class CaptchaImage {
  3.  
  4. [68 more lines...]

Plain Code

session_start();
 
class CaptchaImage {
 
    var $font = 'monofont.ttf';
     private $width     = "120";
    private $height = "40";
    private $tekens = "6";
     
    private function maakCode() {
        
        $tekens = 'abcdfghjkmnpqrstvwxyz123456789';
        
        $code = '';
        $i = 0;
        while ($i < 6) { 
            
            $code.= substr($tekens, mt_rand(0, strlen($tekens)-1), 1);
            $i++;
            
        }
        return $code;
        
    }
    
    public function CaptchaImage() {
           
        $code = $this->maakCode();
        
        /* font size will be 75% of the image height */
        $font_size     = $this->height * 0.75;
        $image         = imagecreate($this->width, $this->height);
        
        //De kleuren van de afbeelding aanamken
        $background_color     = imagecolorallocate($image, 255, 255, 255);
        $text_color         = imagecolorallocate($image, 20, 40, 100);
        $noise_color         = imagecolorallocate($image, 100, 120, 180);
              
        //Creeëren van de puntjes op de achtergrond
        for( $i=0; $i<($this->width * $this->height) / 3; $i++) {
            
            imagefilledellipse($image, mt_rand(0,$this->width), mt_rand(0,$this->height), 1, 1, $noise_color);
            
        }
              
        //Creeëren van de lijnen op de achtergrond
        for( $i=0; $i<($this->width * $this->height) / 150; $i++) {
            
            imageline($image, mt_rand(0,$this->width), mt_rand(0,$this->height), mt_rand(0,$this->width), mt_rand(0,$this->height), $noise_color);
        
        }
              
        //Creeëren van een tekstbox en de tekst er in plaatsen
        $textbox     = imagettfbbox($font_size, 0, $this->font, $code);
        $x             = ($this->width - $textbox[4])/2;
        $y             = ($this->height - $textbox[5])/2;
        
        imagettftext($image, $font_size, 0, $x, $y, $text_color, $this->font , $code);
              
        //De afbeelding naar de browser doorsturen en deze laten aanmaken
        header('Content-Type: image/jpeg');
        imagejpeg($image);
        imagedestroy($image);
        $_SESSION['security_code'] = $code;
        
    }
 
}
 
$captcha = new CaptchaImage();

?>
<img src="captcha.php" alt="captcha">

Untitled PHP (2-Jun @ 12:37)

Syntax Highlighted Code

  1. <?=isset($page)?$page:show_404()?>

Plain Code

<?=isset($page)?$page:show_404()?>

Untitled PHP (28-May @ 17:21)

Syntax Highlighted Code

  1. /*
  2.  
  3.                 CONNECTION DIAGRAM
  4.  
  5. [547 more lines...]

Plain Code

/*

                CONNECTION DIAGRAM

                      ------
                PB0 -|1   40|- PA0    
                PB1 -|2   39|- PA1    
                PB2 -|3   28|- PA2    
                PB3 -|4   37|- PA3    
                PB4 -|5   36|- PA4    
                PB5 -|6   35|- PA5    
                PB6 -|7   34|- PA6
                PB7 -|8   33|- PA7
                RESET -|9   32|- AREF
                VCC -|10  31|- GND
                GND -|11  30|- AVCC
              XTAL2 -|12  29|- PC7    UCNT1
              XTAL1 -|13  28|- PC6    UCNT2
                PD0 -|14  27|- PC5    UCNT3
    USARTTX        PD1 -|15  26|- PC4    LVL1
      APOLLOEN    PD2 -|16  25|- PC3    LVL2
    MDIR        PD3 -|17  24|- PC2    LVL3
    MSEL0        PD4 -|18  23|- PC1    LVL4
    MSEL1        PD5 -|19  22|- PC0
    PWMOUT        PD6 -|20  21|- PD7    HERMESEN
                      ------

*/


#include <avr/io.h>
#include <util/delay.h>
#include <stdio.h>
#include <inttypes.h>

#define BAUD 9600
#define MYUBRR F_CPU/16/BAUD-1

#define RAMPTIME        3000    // PWM ramping time (ms)
#define RAMPINTERVAL    300        // PWM ramping interval (ms)

#define LVL4            PC1    // Nivåbryter nivå 4
#define LVL3            PC2    // Nivåbryter nivå 3
#define LVL2            PC3    // Nivåbryter nivå 2
#define LVL1            PC4    // Nivåbryter nivå 1
#define UCNT3            PC5    // Enhetsteller nivå 3
#define UCNT2            PC6    // Enhetsteller nivå 2
#define UCNT1            PC7    // Enhetsteller nivå 1
#define SENSINPUTPIN    PINC // Porten sensorene er koblet til
#define SENSDDR            DDRC // Dataretningsregister for sensorer 

#define TEMP0    1            // Temperaturkanal 1
#define TEMP1    2            // Temperaturkanal 2
#define TEMP2    3            // Temperaturkanal 3
#define TEMP3    4            // Temperaturkanal 4

#define DOOR1    PA5            // Dørbryter 1
#define DOOR2    PA6            // Dørbryter 2
#define DOOR3    PA7            // Dørbryter 3
#define DOORPIN    PINA        // Porten dørbryterne er koblet til

#define HERMESEN    PD7        // Hermes enable
#define APOLLOEN    PD2        // Apollo enable
#define UCPORT        PORTD     // Porten enable-utgangene er på

#define MDIR        PD3        // Motor direction
#define MSEL0        PD4        // Motor selection bit0
#define MSEL1        PD5        // Motor selection bit1
#define PWMOUT        PD6        // Motor PWM channel
#define MOTORPORT    PORTD     // Porten motordriveren er koblet til
#define MOTORDDR    DDRD    // Dataretningsregister for motorport
#define HOME        4

#define HIS        PA0            // Aktiveringsbryter for bordet
#define HISPIN    PINA         // Porten aktiveringsbryteren står på

#define EMPTY 0

#define FORWARD 1
#define REVERSE 0
#define UP         1
#define DOWN    0

#define BOUNCELIMIT    30        // Avprelleingsteller grenseverdi

int sensecnt = 0;            // Avprellingsteller
int holdflag=0;                // Hold-flagg for avprelling

int lvlcnt1 = 1;            // Enhetsteller for nivå 1
int lvlcnt2 = 1;            // Enhetsteller for nivå 2
int lvlcnt3 = 1;            // Enhetsteller for nivå 3

int curtemp0 = 1023;        // Temperaturvariabel for nivå 1
int curtemp1 = 1023;        // Temperaturvariabel for nivå 2
int curtemp2 = 1023;        // Temperaturvariabel for nivå 3
int curtemp3 = 1023;        // Temperaturvariabel for nivå 4

int picklvl = EMPTY;
int motor = 1;
int motordir = FORWARD;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/*
    Les inn verdi fra ADC-omforming
    @param int chan - Hvilken ADC-kanal det skal leses fra.
*/
int readADC (int chan){
    int i;
    int ADC_temp;
    int ADCx = 0;
        
    ADMUX  = chan; // Velg kanal

    ADMUX |= (1 << REFS0);                 // Sett referanse til AVCC med ekstern kodensator på AREF
    ADMUX &= ~(1<<REFS1);
    ADCSRA |= (1<<ADPS2)|(1<<ADPS0);     // Sett /16 presacling
    ADCSRA |= (1<<ADEN);                 // Aktiver ADCen

    for(i=0;i<8;i++) {                     // Kjør 8 omforminger av signalet, og bruk gjennomsnittet
        ADCSRA |= (1<<ADSC);             // Kjør en enkel omforming
        while(!(ADCSRA & 0x10));         // Vent til omformingen er ferdig. (ADIF-flagget settes)
        ADC_temp = ADCL;                 // Les nedre del av SAR-registeret
        ADC_temp += (ADCH<<8);             // Legg til øvre del av SAR-registert. (Dette må skiftes 8 plasser)
        ADCx += ADC_temp;                // Akkumuler verdien
    }
    ADCx = (ADCx>>3);                    // Del på 8 (Finn gjennomsnittsverdien)

    ADCSRA &= ~(1<<ADEN);                 // Deaktiver ADCen
    return ADCx;                        // Returner ADC-verdien

}

/*
    USART Initialiseringsrutine
    @param unsigned int baud - Overføringshastigheten
*/
void USARTInit( unsigned int baud ){
    
    UBRR0H = (unsigned char) (baud>>8);            // Sett overføringshastigheten
    UBRR0L = (unsigned char) baud;
    
    UCSR0B = (1<< TXEN0);                        // Aktiver USART-sendemodul
    UCSR0C = (1<<USBS0)|(1<<UCSZ01)|(1<<UCSZ00);// Sett rammeformat til: 1 start-, 8 data- og 2 stoppbit

}
/*
    USART Sending av ett tegn
    @param unsigned char data - Tegnet som skal sendes
*/
void USARTTransmitByte( unsigned char data ){
    
    while (!(UCSR0A & (1<<UDRE0)));    // Vent til USART-modulen er klar for sending
    UDR0 = data;                     // Start overføringen
}

/*
    USART Sending av tekststreng
    @param const char *str - Peker til hvilken streng som skal sendes
*/
void USARTTransmit(const char *str){
    while(*str) {
        USARTTransmitByte((unsigned char)(*str));
        str++;
    }
    USARTTransmitByte(0x04); // Send stopp-byte (EOT)
}

/*
    USART Initialiseringsrutine    
*/
void PWMInit(void){
    // Setter COM0A1 = 1, COM0A0 = 0 i TCCR0A => Clear OC0A on Compare Match, SET OC0A at BOTTOM (Non-Inverting mode)
    // Setter WGM01 = 1, WGM00 = 1 i TCCR0A, og WGM02 = 0 i TCCR0B => Fast-PWM mode        
    TCCR2A |= (0<<COM2B1) | (0<<COM2B0)| (1<<WGM21) | (1<<WGM20);
    TCCR2B &= ~(1<<WGM22);
    TCCR2B |= (1<<CS20); // Ingen skalering av PWM-frekvensen

    // Sett dataretning på de benyttede pinnene til ut.
    MOTORDDR |= (1<<PWMOUT) | (1<<MSEL1) | (1<<MSEL0) | (1<<MDIR);

}

/*
    Acpreller en puls fra en sensor/bryter
    @param unsigned int sens - Referanse til hvilken sensor som skal avprelles
    @param volatile uint8_t *port - Referanse til hvilken port sensoren er koblet på
*/
int debounce_pulse(unsigned int sens, volatile uint8_t *port){
int returnvar = 0;

    while(*port & (1<<sens)){
        sensecnt++;

        if(sensecnt >= BOUNCELIMIT){
            returnvar = 1;
        }
    }

    sensecnt=0;
    
    return returnvar;    
}

/*
    Avpreller en sensor/bryter som holdes inne
    @param unsigned int sens - Referanse til hvilken sensor som skal avprelles
    @param volatile uint8_t *port - Referanse til hvilken port sensoren er koblet på
*/
int debounce_hold(unsigned int sens, volatile uint8_t *pin) {
int returnvar = 0;

    if(holdflag){
        if(!(*pin & (1<<sens))){
            holdflag=0;
        }
    } else {
        if(*pin & (1<<sens)){
            _delay_us(500);
            if(*pin & (1<<sens)){
                returnvar = 1;
                holdflag=1;
            }
        }
    }

    return returnvar;
}

/*
    Lagrer temperaturer i "nåværende temperatur"-variabler
*/
void readtemps(){
    curtemp0 = readADC(TEMP0);
    curtemp1 = readADC(TEMP1);
    curtemp2 = readADC(TEMP3);
    curtemp3 = readADC(TEMP3);
}


/*
    Finner kaldeste nivå
    @returns int - Returnerer en referanse til det kaldeste nivået
*/
int getcoldestlevel(){
    int min = 1023;
    int coldest = 1;
    
    if(curtemp1 < min && lvlcnt1 > 0){
        coldest = 1;
        min = curtemp1;
    }


    if(curtemp2 < min && lvlcnt2 > 0){
        coldest = 2;
        min = curtemp2;
    }

    if(curtemp3 < min && lvlcnt3 > 0){
        coldest = 3;
        min = curtemp3;
    }

    return coldest;
}



/*
    Initialisering av dataretningsregisteret for sensorene    
*/
void SensorInit(){
    SENSDDR = 0x01; // Sett alle pinner på port C til innganger.
}

/*
    Sender systemstatus til Hermes via USART
*/
void SerialSendStatus(){

    char usarttext[40];
    int n;

    readtemps();            
    n=sprintf(usarttext,"T1%dT2%dT3%dC1%dC2%dC3%d", curtemp1, curtemp2, curtemp3, lvlcnt1, lvlcnt2, lvlcnt3);                        
    USARTTransmit(usarttext);
    
}

/*
    Initialisering av motor
    @param unsigned int motor - Hvilken motor som skal kjøres
    @param unsigned in direction - Hvilken retning motoren skal rotere i
*/
void motor_init(unsigned int motor, unsigned int direction){
    // Velg motor
    if(motor == 0){
        MOTORPORT &= ~(1<<MSEL0);    // 0
        MOTORPORT &= ~(1<<MSEL1);    // 0
    } else if (motor == 1){
        MOTORPORT |= (1<<MSEL0);    // 1
        MOTORPORT &= ~(1<<MSEL1);    // 0
    } else if (motor == 2){
        MOTORPORT &= ~(1<<MSEL0);    // 0
        MOTORPORT |= (1<<MSEL1);    // 1
    } else if (motor == 3){
        MOTORPORT |= (1<<MSEL0);    // 1
        MOTORPORT |= (1<<MSEL1);    // 1
    }

    if(direction){                // Sett retningen motoren skal kjøre
        MOTORPORT |= (1<<MDIR);
    } else {
        MOTORPORT &= ~(1<<MDIR);
    }    

}

/*
    Setter hastigheten (pådraget) til motorene
    @param unsigned int speed - Hastigheten i prosent av fullt pådrag
*/
void motor_setspeed(unsigned int speed){
    OCR2B = (255*speed)/100;
}

/*
    Start motoren
*/
void motor_start(){
    TCCR2A |= (1<<COM2B1);

}

/*
    Stopp motoren
*/
void motor_stop(){
    TCCR2A &= ~(1<<COM2B1);

}

/*
    Øker pådraget til motorene gradvis (såkalt ramping)
*/
void motor_rampup(){
    //int i = 1;
    for(int i = 1;i<=100;i++){
        _delay_ms(10);
        motor_setspeed((255*i)/100); // Kalkuler pådragsverdi fra prosentverdi.
    }
}

/*
    Reduserer pådraget til motorene gradvis (såkalt ramping)
*/
void motor_rampdown(){
    for(int i = 100;i>=1;i--){
        _delay_ms(10);
        motor_setspeed((255*i)/100); // Kalkuler pådragsverdi fra prosentverdi.
    }
}

/*
    Kjør heisen til ønsket nivå
    @param unsigned int level - Hvilket nivå heisen skal kjøre til
*/
void elevator_goto(unsigned int level){
    unsigned int dir;

    if(level < HOME){
        dir = DOWN;
    } else {
        dir = UP;
    }

    motor_init(level, dir);
    motor_setspeed(60);
    motor_start();
    
    while(1){
        if(level == 1){
            if(debounce_hold(LVL1, &SENSINPUTPIN)){
                break;    
            }
        } else if (level == 2){
            if(debounce_hold(LVL2, &SENSINPUTPIN)){
                break;    
            }
        } else if (level == 3){
            if(debounce_hold(LVL3, &SENSINPUTPIN)){
                break;    
            }
        } else if (level == HOME){
            if(debounce_hold(LVL3, &SENSINPUTPIN)){
                break;
            }
        }
    }
            
    motor_stop();
}

/*
    Roter et gitt nivå
    @param unsigned int level - Hvilket nivå som skal roteres
    @param unsigned int direction - Hvilken retnings skal nivået roteres i
    @param unsigned int duration - Hvor lenge skal nivået rotere. (0 for uendelig).
*/
void rotatelevel(unsigned int level, unsigned int direction, unsigned int duration){
    // Initialiser motoren med riktige verdier
    motor_init(level, direction);

    motor_setspeed(0); // Start motoren med 0 i pådrag
    motor_start();


    // Gradvis økning av pådrag (ramping) i 100*10ms = 1 sekund
    motor_rampup();

    // Motoren kjører nå på fullt pådrag

    if(duration > 0){
        _delay_ms(duration);

        // Gradvis redusering av pådrag i 1 sekund
        motor_rampdown();

        motor_setspeed(0);
        motor_stop();
    }

}

/*
    Starter dispenseringen av en enhet
    @param unsigned int level - Hvilket nivå det skal hentes en enhet fra
*/
void dispenseunit(unsigned int level){

    elevator_goto(level);

    UCPORT |= (1<<APOLLOEN); // Aktiver Apollo (Lyseffekter)
    
    rotatelevel(level, FORWARD, 5000);
    
    elevator_goto(HOME);

    UCPORT &= ~(1<<APOLLOEN); // Deaktiver Apollo (Lyseffekter)
}

/*
    Starter påfyllingsmodus for et gitt nivå
    @param unsigned int level - Hvilket nivå skal gå i påfyllingsmodus
    @param unsigned int sens - Hvilken sensor/bryter som skal avbryte påfyllingen
    @param volatile uint8_t *port - Hvilken port sensoren/bryteren er koblet til
*/
void startrefillmode(unsigned int level, unsigned int sens, volatile uint8_t *port){
    rotatelevel(level, FORWARD, 0);    // Roter nivået kontinuerlig
    int count = 0;

    while(debounce_hold(sens, port)){
        // Øk antallet enheter i hvertnivå når en enhet blir satt inn
        if(level == 1){
            if(debounce_pulse(UCNT1, &SENSINPUTPIN)){
                lvlcnt1++;
                count = 1;
            }
        } else if(level == 2){
            if(debounce_pulse(UCNT2, &SENSINPUTPIN)){
                lvlcnt2++;
                count = 1;
            }
        } else if(level == 3){
            if(debounce_pulse(UCNT3, &SENSINPUTPIN)){
                lvlcnt3++;
                count = 1;
            }
        }
        
        // Dersom en enhetsteller har økt, gi beskjed til Hermes.
        if(count){
            SerialSendStatus();
            count = 0;
        }    

    }

    // Stopp rotasjonen av platået når døren lukkes

    motor_rampdown();
    motor_setspeed(0);
    motor_stop();

}

/*
    HÃ¥ndtering av sensorer
*/
void handle_sensors(){

    if(debounce_hold(DOOR1, &DOORPIN)){ // Dersom dør 1 er åpnet...
        startrefillmode(1, DOOR1, &DOORPIN);             // ... start påfyllingsmodus i nivå 1
    }

    if(debounce_hold(DOOR2, &DOORPIN)){ // Dersom dør 1 er åpnet...
        startrefillmode(2, DOOR2, &DOORPIN);             // ... start påfyllingsmodus i nivå 1
    }

    if(debounce_hold(DOOR3, &DOORPIN)){ // Dersom dør 1 er åpnet...
        startrefillmode(3, DOOR3, &DOORPIN);             // ... start påfyllingsmodus i nivå 1
    }

    if(debounce_pulse(HIS, &HISPIN)){     // Dersom sensoren i bordplaten aktiveres...
        dispenseunit(getcoldestlevel());     // ... start dispenseringen av en enhet
    }


}

/*
    Hovedprogram
*/
int main(void){    
    
    USARTInit(MYUBRR);     // Initialiser USART
    PWMInit();             // Initialiser PWM
    SensorInit();        // Initialiser sensorport
    
    DDRA = 0x00;         // Alle pinner i port A settes til innganger.
    //ADCInit() ; // Init ADC

    //DDRD = 0xFF;     // Port D datadir: All out.


    UCPORT |= (1<<HERMESEN); // Enable Hermes

    int i=0;    

    for(;;){
        if(i++ >= 2000){ // Send status til Hermes ved jevne mellomrom.
            SerialSendStatus();
            i=0;
        }

        handle_sensors(); // HÃ¥ndter sensoraktivering/brytertrykk

    }

}

Untitled PHP (27-May @ 19:34)

Syntax Highlighted Code

  1. sfsdfsdfsfd

Plain Code

sfsdfsdfsfd

Untitled PHP (19-May @ 13:44)

Syntax Highlighted Code

  1. if($i="1") {
  2. $toto = "vas y ";
  3. }

Plain Code

if($i="1") {
$toto = "vas y ";
}

Untitled PHP (16-May @ 14:10)

Syntax Highlighted Code

  1. // Top of page.
  2. <?php include("forums/SSI.php"); ?>
  3.  
  4.  
  5. [18 more lines...]

Plain Code

// Top of page.
<?php include("forums/SSI.php"); ?>


// Huge fucking mess excuse for a smf news ssi puller.
<?php

$array = ssi_boardNews(26, 4, null, null, 'array');

    foreach ($array as $news)
    {
        echo '  
            <font face="Verdana"><b>', $news['subject'], '</b><br /><font size="1"><b>Posted On:</b> ', $news['time'], ' <b>By:</b> ', $news['poster']['link'], '<br /> 
                <font size="2"> ', $news['body'], '<br /><br /></font><font size="1">
                ', $news['link'], ' | ', $news['new_comment'], ' 
            <br /></font></font>';

        if (!$news['is_last'])
            echo '
            <br /><br />';
    }

?>

Untitled PHP (15-May @ 12:59)

Syntax Highlighted Code

  1. $subject = "Inregistrare Targul Agricol";
  2. $body = 'Pentru activarea contului dumneavoastra va rugam sa dati click <a href="http://'.$_SERVER['HTTP_HOST'].'/activare.php?key='.$codConfirmare.'">aici</a>!';
  3. $from = "office@targulagricol.ro";
  4.  
  5. [4 more lines...]

Plain Code

$subject = "Inregistrare Targul Agricol";
$body = 'Pentru activarea contului dumneavoastra va rugam sa dati click <a href="http://'.$_SERVER['HTTP_HOST'].'/activare.php?key='.$codConfirmare.'">aici</a>!';
$from = "office@targulagricol.ro";

$mail = new MailB(array('to' => $data['email'],'from' => $from,'subject' => $subject,'body' => $body));
//$mail->debug();
$mail->send();                                  

Untitled PHP (12-May @ 17:27)

Syntax Highlighted Code

  1. <?php
  2. echo "Blaa";
  3. ?>

Plain Code

<?php
echo "Blaa";
?>

Untitled PHP (5-May @ 03:03)

Syntax Highlighted Code

  1. <?php defined('SYSPATH') OR die('No direct access allowed.');
  2.  
  3. class Ask_Model extends Model
  4. {
  5. [34 more lines...]

Plain Code

<?php defined('SYSPATH') OR die('No direct access allowed.');

class Ask_Model extends Model
{
    protected $table_name = 'cbs_ask';

    public static function factory()
    {
        return new Ask_Model();
    }

    public function  __construct()
    {
        parent::__construct();
    }

    public function get_all()
    {
        $sql = "SELECT * FROM ".$this->table_name;

        return $this->db->query($sql)->result();
    }
    
    public function get_by_person($person_id)
    {
        $sql = "SELECT * FROM ".$this->table_name." WHERE is_public = 1 AND person_id = ".(int)$person_id;

        return $this->db->query($sql)->result();
    }

    public function insert($data)
    {
        $data['dt_create'] = date("Y-m-d H:i:s");

        $query = $this->db->insert($this->table_name, $data);

        return $query->insert_id();
    }
}

Untitled PHP (29-Apr @ 18:39)

Syntax Highlighted Code

  1. <?php
  2.  
  3. echo "hello world";
  4.  
  5. ?>

Plain Code

<?php

echo "hello world";

?>

Untitled PHP (22-Apr @ 12:33)

Syntax Highlighted Code

  1. <?php
  2.  
  3. /**
  4.  * @author shubby
  5. [70 more lines...]

Plain Code

<?php

/**
 * @author shubby
 * @copyright 2008
 */

session_start();
require_once("includes/tpl/Smarty.class.php");    
require('includes/tpl/SmartyPaginate.class.php');
$tpl = new Smarty;
$tpl->template_dir = 'templates';
$tpl->compile_dir  = 'templates_c/';
$tpl->config_dir   = 'configs/';
$tpl->cache_dir    = 'cache/';
$smarty->caching = true;

SmartyPaginate::reset();
SmartyPaginate::connect();
SmartyPaginate::setLimit(5);
SmartyPaginate::setPageLimit(5);


include("includes/config.php");

$var = explode("/", $_SERVER['REQUEST_URI']);
$link = string_to_filename(RemoveXSS($var[2]));


if($link != "" && $var[1] == "news") {

    $sql2 = "SELECT * FROM fritz_news WHERE news_link='$link'";
    $query = mysql_query($sql2);
    $result = mysql_affected_rows();
    
    if($result) {

        $row = mysql_fetch_array($query);
        $news_data = array('id' => $row[0], 'title' => stripslashes($row[1]), 'link' => stripslashes($row[2]), 'date' => cleanupdate($row[3]), 'message' => stripslashes($row[4]));
        
        $tpl->assign('news', $news_data);
        $tpl->assign('one_post', 'true');
        $tpl->display('home.tpl');
        
} else {
    $tpl->assign('error', 'The requested news post could not be found.');
    $tpl->display('error.tpl');
}

} else {

$sql = "SELECT SQL_CALC_FOUND_ROWS * FROM fritz_news ORDER BY news_date DESC LIMIT " . SmartyPaginate::getCurrentIndex() . ", " . SmartyPaginate::getLimit();

$result = mysql_query($sql);

$query = mysql_query("SELECT FOUND_ROWS() as total");
$row = mysql_fetch_array($query);
SmartyPaginate::setTotal($row['total']);
   
$news_data = array();

   for($i = 0; $i < mysql_num_rows($result); ++$i) {
      $news_data[$i] =  array('id' => mysql_result($result, $i, 'id'),
                           'title' => stripslashes(mysql_result($result, $i, 'news_title')),
                           'link' => stripslashes(mysql_result($result, $i, 'news_link')),
                           'date' => cleanupdate(mysql_result($result, $i, 'news_date')),
                           'message' => stripslashes(mysql_result($result, $i, 'news_message')));
   }
   SmartyPaginate::assign($tpl);
   $tpl->assign('news', $news_data);
   $tpl->assign('rss', 'true');
   $tpl->display('home.tpl');

}
?>

Untitled PHP (22-Apr @ 02:46)

Syntax Highlighted Code

  1. <?php
  2.  
  3.  
  4.  
  5. [138 more lines...]

Plain Code

<?php



$MailToAddress = "simon@boasfalas.com.br"; // your email address

$redirectURL = "b-resposta.html"; // the URL of the thank you page.



# optional settings

$MailSubject = "[Boas Falas - Visitante do Site]"; // the subject of the email

$MailToCC = ""; // CC (carbon copy) also send the email to this address (leave empty if you dont use it)

# in the $MailToCC field you can have more then one e-mail address like "a@yoursite.com, b@yoursite.com, c@yoursite.com"



# If you are asking for a name and an email address in your form, you can name the input fields "name" and "email".

# If you do this, the message will apear to come from that email address and you can simply click the reply button to answer it.

# You can use this scirpt to submit your forms or to receive orders by email.



# If you have a multiple selection box or multiple checkboxes, you MUST name the multiple list box or checkbox as "name[]" instead of just "name"

# you must also add "multiple" at the end of the tag like this: <select name="myselectname[]" multiple>

# you have to do the same with checkboxes



# This script was written by George A. & Calin S. from Web4Future.com

# There are no copyrights in the sent emails.



# SPAMASSASSIN RATING: 0.4



# DO NOT EDIT BELOW THIS LINE ==================================================================

# ver. 1.5

$w4fMessage = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html><head><title>$MailSubject</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"></head><body>";

if (count($_GET) >0) {

    reset($_GET);

    while(list($key, $val) = each($_GET)) {

        $GLOBALS[$key] = $val;

        if (is_array($val)) {

            $w4fMessage .= "<b>$key:</b> ";

            foreach ($val as $vala) {

                $vala =stripslashes($vala);

                $w4fMessage .= "$vala, ";

            }

            $w4fMessage .= "<br>";

        }

        else {

            $val = stripslashes($val);

            if (($key == "Submit") || ($key == "submit")) { }

            else {     if ($val == "") { $w4fMessage .= "$key: - <br>"; }

                    else { $w4fMessage .= "<b>$key:</b> $val<br>"; }

            }

        }

    } // end while

}//end if

else {

    reset($_POST);

    while(list($key, $val) = each($_POST)) {

        $GLOBALS[$key] = $val;

        if (is_array($val)) {

            $w4fMessage .= "<b>$key:</b> ";

            foreach ($val as $vala) {

                $vala =stripslashes($vala);

                $w4fMessage .= "$vala, ";

            }

            $w4fMessage .= "<br>";

        }

        else {

            $val = stripslashes($val);

            if (($key == "Submit") || ($key == "submit")) { }

            else {     if ($val == "") { $w4fMessage .= "$key: - <br>"; }

                    else { $w4fMessage .= "<b>$key:</b> $val<br>"; }

            }

        }

    } // end while

    }//end else

$w4fMessage = "<font face=verdana size=2>".$w4fMessage."</font></body></html>";

if (!mail($MailToAddress, $MailSubject, $w4fMessage, "From: $name <$email>\r\nReply-To: $name <$email>\r\nMessage-ID: <". md5(rand()."".time()) ."@". ereg_replace("www.","",$_SERVER["SERVER_NAME"]) .">\r\nMIME-Version: 1.0\r\nX-Priority: 3\r\nX-Mailer: PHP/" . phpversion()."\r\nX-MimeOLE: Produced By Web4Future Easiest Form2Mail v1.5\r\nBCc: $MailToCC\r\nContent-Type: text/html; charset=UTF-8\r\nContent-Transfer-Encoding: 8bit\r\n")) { echo "Error sending e-mail!";}

else { header("Location: ".$redirectURL); }

?>