Support Forum
When a user makes a purchase, he is automatically added to a usergroup using the following code (I pass the usergroup id through the url). Anyway, it used to work in 5.0 alpha, but stopped working after I upgraded to beta. Can you please tell me what's wrong with it (I think the include paths are wrong..but I can't figure out where they are now)...
<?php $path = $_SERVER['DOCUMENT_ROOT']; $path .= "/wp-content/simple-forum/library/sf-common-functions.php"; include_once($path);
$path1 = $_SERVER['DOCUMENT_ROOT']; $path1 .= "/wp-content/simple-forum/library/sf-primitives.php"; include_once($path1);
$path2 = $_SERVER['DOCUMENT_ROOT']; $path2 .= "/wp-content/simple-forum/library/sf-permissions.php"; include_once($path2);
$path3 = $_SERVER['DOCUMENT_ROOT']; $path3 .= "/wp-content/simple-forum/library/sf-database.php"; include_once($path3);
$usergroup_id=$_REQUEST['group'];
$user_id=$_REQUEST['userid']; sfc_add_membership($usergroup_id, $user_id);
?>
Hey Chica! Thank you for joining our Celebrity Photographer's 4-week Critique. You have been added to your photographer's private classroom in the forum <a href="http://<?php echo $_REQUEST['forumlink']; ?>">(http://<?php echo $_REQUEST['forumlink']; ?>)</a>. You may need to logout and login again in order to see the posts.
That would never have worked in V5...
First problem is that the 'simple-forum' folder is named 'simple-press' in V5 so that accounts for the path problems.
Next however is that all of those included files are now different. Different names, different locations.
And finally the sfc_add_membership function, while needing the same two arguments, is now called sp_add_membership().
Depending on where you are calling this from then I think if you call the function:
sp_forum_ahah_support();
The that should load the support you need to call the add membership function.
YELLOW
SWORDFISH
|
right after your assignments to $user_id and $usergroup_id, try adding this:
vshow('uid = '.$user_id);
and
vshow('ugid = '.$usergroup_id);
should at least show us if the values are correct... and please check forum - toolbox - error log and see if any errors preset... you may want to clear it first, then try to make that code execute and look back at the error log...
Visit Cruise Talk Central and Mr Papa's World
1 Guest(s)