Jump to content

wordpress codex


kylevorster

Recommended Posts

Hey There,

 

I'm trying to build a whmcs loginshare with wordpress but hitting a snag,

 

I built a action hook in whmcs using the wordpress codex functions and on their own outside whmcs they work just fine but within whmcs it keeps on trying to run the wordpress installation as if wordpress is not installed, Here's my code.

 

<?php

function hook_wordpress_account($vars) {
@require_once('../../blog/wp-blog-header.php'); 

	$userdata = get_userdatabylogin( $vars['email'] );

	$user = array ();

	if ($userdata->ID) {
		$user['ID'] = $userdata->ID;
	}

	$user['user_pass'] = md5($vars['email']);
$user['user_login'] = $vars['email'];
$user['user_nicename'] = $vars['firstname'];
$user['user_email']   = $vars['email'];
$user['display_name'] = "{$vars['firstname']} {$vars['lastname']}";
$user['first_name'] = $vars['firstname'];
$user['last_name'] = $vars['lastname'];

 if (wp_insert_user ($user)) {
 	return true;
 } else {
 	return false;
 }
}

add_hook("ClientAdd",1,"hook_wordpress_account");
add_hook("ClientEdit",1,"hook_wordpress_account");

function hook_login_wordpress_user($vars) {

}

add_hook("ClientLogin",1,"hook_login_wordpress_user");

function hook_logout_wordpress_user($vars) {

}

add_hook("ClientLogout",1,"hook_logout_wordpress_user");

?>

 

Now when I force wordpress to know it its installed by setting the WP_INSTALLING to true or false I get the following error

 

define( 'WP_INSTALLING', false);

 

 

Notice: Undefined variable: PHP_SELF in blog/wp-includes/vars.php on line 36

 

Fatal error: Call to a member function register_handler() on a non-object in blog/wp-includes/media.php on line 1301

 

Any help ?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated