Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Members_Access plug in question

Quote Reply
Members_Access plug in question
Hello

With the Members_Access plug in by Ultranerds.com, when I restrict a category it works great for the category page itself.

But is there a way to restrict Detailed pages for links within this category only and not all detailed pages?
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] Members_Access plug in question In reply to
Hi,

Mmm.. I guess it could be done. Not really got the time to look into it at the moment though, as very bogged down with work :(

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Members_Access plug in question In reply to
I was coming to the forum to ask this exact same question. If we chipped in a bit of money could it be done?
Cheers,
Michael Bray
Quote Reply
Re: [Michael_Bray] Members_Access plug in question In reply to
Note: This is important due to

a) Links in members only categories being clickable in search results.
b) People being able to guess the URL of members only links.

If you could find the time to add this feature in it'd be greatly appreciated Smile
Cheers,
Michael Bray
Quote Reply
Re: [Michael_Bray] Members_Access plug in question In reply to
Code:

# work out if they are allowed to access this detailed page...
sub check_restrict_detail_page {
my ($page, $id, $link, $detail_match, $detail_name);
my (@ids,@locked);
$page = $IN->param('g') || $ENV{PATH_INFO} || '';
($id) = $page =~ /(\d+)\Q$CFG->{build_extension}\E$/;
if (!$id) {
print $IN->header();
print Links::SiteHTML::display('error', { error => Links::language('PAGE_INVALIDDETAIL', $page) });
return;
}

if ($DEBUG) {
print $IN->header();
print $id;
exit;
}
# grab the category in questions details....
($ids[0],$locked[0]) = $DB->table('Links')->select( ['ID','Restricted_Page'], GT::SQL::Condition->new('ID','=',"$id%") )->fetchrow;
# the current detailed page they are on requires them to be logged in.
if ($locked[0] && !$USER->{Username}) {
print $IN->header();
print Links::SiteHTML::display('error', { error => $ErrorMessage } );
exit;
}
}
# Always end with a 1.
1;


Added a new column to the Links table called Restricted_Page. Works for me. Feedback would be great.
Cheers,
Michael Bray

Last edited by:

Michael_Bray: Mar 7, 2009, 2:52 AM
Quote Reply
Re: [Michael_Bray] Members_Access plug in question In reply to
Hi,

Yup, that should work fine :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Michael_Bray] Members_Access plug in question In reply to
Helllo Michael

Just tested it and it does not work for me... Frown
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] Members_Access plug in question In reply to
Try this:

Code:
# work out if they are allowed to access this detailed page...
sub check_restrict_detail_page {

my ($page, $id, $link, $detail_match, $detail_name);
my (@ids,@locked);
$page = $IN->param('g') || $ENV{PATH_INFO} || '';
my $id;
if ($page =~ /(\d+)/) {
$id = $1;
}

if (!$id) {
print $IN->header();
print Links::SiteHTML::display('error', { error => Links::language('PAGE_INVALIDDETAIL', $page) });
return;
}

if ($DEBUG) {
print $IN->header();
print $id;
exit;
}

# grab the category in questions details....
my $cat_id = $DB->table('CatLinks')->select( { LinkID => $id } )->fetchrow;
if ($DB->table('Category')->count( { Restricted_Page => 1, ID => $cat_id } ) > 0 && !$USER->{Username}) {
print $IN->header();
print Links::SiteHTML::display('error', { error => $ErrorMessage } );
exit;
}

}

If that still doesn't work, try setting $DEUBG to 1, and then see what is outputted.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Members_Access plug in question In reply to
Hello

There is no issue to debug..

The problem is the detailed pages are still accessible by everyone.
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] Members_Access plug in question In reply to
Please email me your Members_Access.pm file.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Members_Access plug in question In reply to
Hi,

For anyone else who may wanna try this mod, you just need to make sure you *replace* the sub check_restrict_detail_page { } section, and not just add this new code to the bottom of the .pm file =)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!