Forum Replies Created
-
!!!!!
!!!!!!!!!New Instructions – DO NOT USE THE ABOVE INSTRUCTIONS, USE THESE. I left out a couple of things earlier and changed some other things.
!!!!!
!!!!!!!!!I was able to correct this problem with some mods to the welcome-pack.php file.
And I must preface this by saying that this fix is a hack. I am really not that familiar with the plugin and don’t know that my changes won’t result in some problem.
Basically, it appeared that none of the following functions were using the $meta value being passed in. So, I removed it. Here is the simple change. For each of these three, around lines 74, 102 and 132, respectively – change them from this:
function dp_welcomepack_welcomemessage( $user_id, $password, $meta )
function dp_welcomepack_defaultfriend( $user_id, $password, $meta )
function dp_welcomepack_defaultgroup( $user_id, $password, $meta )
to this:
function dp_welcomepack_welcomemessage( $user_id, $password )
function dp_welcomepack_defaultfriend( $user_id, $password )
function dp_welcomepack_defaultgroup( $user_id, $password )
NEW!!!: Change the following lines in “dp_welcomepack_onuserandblogregistration” from this:
—
dp_welcomepack_defaultfriend( $user_id, $password, $meta );
dp_welcomepack_defaultgroup( $user_id, $password, $meta );
dp_welcomepack_welcomemessage( $user_id, $password, $meta );
—
to this:
—
if(is_array($user_id)){
$user_id = implode($user_id);
}
dp_welcomepack_defaultfriend( $user_id, $password );
dp_welcomepack_defaultgroup( $user_id, $password );
dp_welcomepack_welcomemessage( $user_id, $password );
—
That will correct your undefined argument problems and should solve your array problem. Note!!! I am not entirely sure why the user_id value was being converted to an array in the first place, so, make these changes with that in mind. I don’t believe it will be a problem but it is possible that somehow you might get an actual array of more than one value and that would be an issue. One way to check this that I did not add would be to get an array count if it is an array and only set the value if it’s equal to 1.
If for some reason you are experiencing other problems, feel free to message me privately and I can investigate further.
The second piece of code is to fix that. you need to add the little if statement to the dp_welcomepack_defaultfriend function. That will convert the array casted user_id back to a string.
I was able to correct this problem with some mods to the welcome-pack.php file.
And I must preface this by saying that this fix is a hack. I am really not that familiar with the plugin and don’t know that my changes won’t result in some problem.
Basically, it appeared that none of the following functions were using the $meta value being passed in. So, I removed it. Here is the simple change. For each of these three, around lines 74, 102 and 132, respectively – change them from this:
function dp_welcomepack_welcomemessage( $user_id, $password, $meta )
function dp_welcomepack_defaultfriend( $user_id, $password, $meta )
function dp_welcomepack_defaultgroup( $user_id, $password, $meta )
to this:
function dp_welcomepack_welcomemessage( $user_id, $password )
function dp_welcomepack_defaultfriend( $user_id, $password )
function dp_welcomepack_defaultgroup( $user_id, $password )
That will correct your undefined argument problems.
After that, you will need to add the following code to the function “dp_welcomepack_defaultfriend” which starts at line 102. At the end of the function, just before the line “friends_add_friend( $friend, $user_id );” add the following conditional code:
if(is_array($user_id)){
$user_id = implode($user_id);
}
This should solve your array problem. Note!!! I am not entirely sure why the user_id value was being converted to an array in the first place, so, make these changes with that in mind. I don’t believe it will be a problem but it is possible that somehow you might get an actual array of more than one value and that would be an issue. One way to check this that I did not add would be to get an array count if it is an array and only set the value if it’s equal to 1.