5
Done. Here's what you need to modify to get yours working like mine.
Currently I've hard-coded the forum and categories into my hack so you'll want to edit your own category number(s) and forum(s) in the supplied code to suit your needs. Mine is set up so that if they submit a listing to the "Breeders" category then they get access to the breeder discussion private forum when an admin approves the listing. Same for Rescues.
In your file modules\xclassified\admin\index.php:
Find:
Quote:
Replace with:
Quote:
Find:
Quote:
$query = "update ".$xoopsDB->prefix("xdir_text")." set description='$description' where lid=".$lid."";
$xoopsDB->query($query) or $eh->show("0013");
global $xoopsModule;
Replace with:
Quote:
$query = "update ".$xoopsDB->prefix("xdir_text")." set description='$description' where lid=".$lid."";
$xoopsDB->query($query) or $eh->show("0013");
// ADDED BY CHAD KOVAC 7/22/04 to grant access to breeder forum
// breeder: category ID = 154, forum id = 28
// breeder: category ID = 156, forum id = 34
if($cid=='154') {
$sql = "INSERT INTO `xoops_bb_forum_access` ( `forum_id` , `user_id` , `can_post` ) VALUES ('28', '".$submitterid."', '1');";
} else {
if($cid=='156') {
$sql = "INSERT INTO `xoops_bb_forum_access` ( `forum_id` , `user_id` , `can_post` ) VALUES ('34', '".$submitterid."', '1');";
}
}
$xoopsDB->queryF($sql) or $eh->show("0013");
// END ADDITION
global $xoopsModule;
Find:
Quote:
$premium = $HTTP_POST_VARS['premium'];
if ( empty($cid) ) {
Replace with:
Quote:
$premium = $HTTP_POST_VARS['premium'];
//Added by CMK 7/22/04
$submitterid = $HTTP_POST_VARS['submitterid'];
//End addition
if ( empty($cid) ) {
Now when someone on my site submits a breeder listing and an admin approves it they are automatically given access to the breeder message forum. Same for rescue listings. I could go further and add functions to do the same for bird clubs, whatever...
Enjoy.