PDA


View Full Version : Limit of 1 link per member?


lee wilde
11-29-2004, 09:46 PM
Hi, I am considering purchasing today. We use vBulletin and vbadvanced CMPS.

Is there a way of limiting members to link to 1 site only?

Thanks

Brian
11-30-2004, 06:42 PM
Shouldn't be too hard to do. Once you purchase the links directory, simply open up your 'addlink.php' file and look for this code:
globalize($_POST, array('catid' => INT));

Right under that, add this:
$linkcount = $DB_site->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "links WHERE userid = '$bbuserinfo[userid]'");

if ($linkcount['count'] >= 1)
{
eval(print_standard_error('adv_links_too_many_links'));
}


*Edit*
For some reason the php and code tags are adding a space between 'too_many_link' and the 's' right after that, so please be sure to remove that space when you add the code.

Then add a new phrase with a varname of 'adv_links_too_many_links' with the text you would like displayed if a user has already submitted a link.

lee wilde
12-01-2004, 06:25 AM
Cool, thanks! Now I have a new toy to play with.