Archive for May, 2008

 

Populate user form using register-plus and cforms II

May 22, 2008 in internet, php, wordpress

One very key feature of the new cforms II wordpress plugin (8.4.2) is its expanded use of custom variables for its form fields. I have found that it is rather easy to add more variables to be used. Simply add them to lib_aux.php in the cforms II directory. Using register-plus, it is possible to save even more information about the user by adding more fields upon registration as a new user. This information is stored in the usermeta table. Using standard Wordpress variables, making the extra information captured with register-plus available to cforms II as custom variables is a snap!

if ( $wp_db_version >= 3440 ) //&& function_exists( ‘wp_get_current_user’ )
$CurrUser = wp_get_current_user();
$CurrUserId = $CurrUser->ID;
$CurrUserMeta = get_userdata($CurrUserId);

$m = str_replace( ‘{Form Name}’, get_option(’cforms’.$no.’_fname’), $m );
$m = str_replace( ‘{Page}’, $page, $m );
$m = str_replace( ‘{Date}’, $date, $m );
$m = str_replace( ‘{Author}’, $find->display_name, $m );
$m = str_replace( ‘{Time}’, $time, $m );
$m = str_replace( ‘{IP}’, cf_getip(), $m );
$m = str_replace( ‘{BLOGNAME}’, get_option(’blogname’), $m );

$m = str_replace( ‘{CurUserID}’, $CurrUser->ID, $m );
$m = str_replace( ‘{CurUserName}’, $CurrUser->display_name, $m );
$m = str_replace( ‘{CurUserEmail}’,$CurrUser->user_email, $m );


//Some more custom variable for use in the form
$m = str_replace( ‘{CurUserFirstName}’, $CurrUserMeta->first_name, $m );
$m = str_replace( ‘{CurUserLastName}’, $CurrUserMeta->last_name, $m );
$m = str_replace( ‘{CurUserDepartment}’,$CurrUserMeta->department, $m );

NBA Basketball has become utterly unwatchable

May 15, 2008 in NBA, random thoughts, sports

If you know me at all, you know I am a staunch critic of the officiating in the NBA. In my opinion, its the most terribly inconstant and just plain ugly thing in all of professional sports. So here I am watching tonight’s Spurs and Hornets game where somehow they manage to call 4 offensive fouls in like 2 minutes. Granted Chris Paul did push off on Bowan the second time, the two calls on West were epically bad, and they occurred 30 seconds from each other. I think as a prerequisite for officiating in the NBA, all NBA refs should be required (at the beginning of their career) to do a season in the Big East. That’s right, start at the college level before all these players get there theater degrees so they can see what it actually takes to knock someone down. Then maybe they will be able to tell when someone is flopping. Image that. The NBA without flopping.

NBA loses all credibility…again

May 05, 2008 in NBA, sports

It has been my long held opinion that NBA officiating is about as poor as it could possibly be. I felt that way until this evenings game between the Pistons and Magic when it got even worse. Total inconsistencies regarding the acceptable amount of defensive contact, phantom calls seemingly whenever someone falls down (all you need to do to get a foul call in the NBA is fall down) straight up bad calls and ridiculous non-calls aside, tonights blunder may actually cause me to stop watching NBA games for good.

In case you didn’t see, the ref’s allowed a shot to count almost 2 seconds after the 3rd quarter ended because the clock operator didnt start the clock. The officials in there infinite lack of wisdom decided to count the shot. Brilliant!