Compatibility with Page Restrict Plugin - quick hack = fix?

penfil

Joined: 2008-10-31
Posts: 1
Posted: Fri, 2008-10-31 16:17

Hello!

I have a client who wanted me to set up their blog and wanted to include Gallery2 and WPG2 but wanted to restrict access to specific pages (including the gallery page) to registered users only. The most direct approach I found was to use the Page Restrict plugin (found on wp extend).

The Page Restrict plugin worked just fine on all pages except for ones that were controlled by other plugins such as WPG2. I made contact (and am still waiting for a response) with the author of the Page Restrict plugin, and now I'm contacting you.

Here is a quick hack I made that is allowing it the plugins to get along:

File name: wpg2template.inc
Line: 129 (or there about)
Original Code: echo $g2data['bodyHtml'];
Hacked Code:
if (pr_get_opt('version')) {
echo pr_page_restrict($g2data['bodyHtml']);
}
else {
echo $g2data['bodyHtml']; //Display the gallery content
}

I am not sure this is the most efficient or best approach, but it works. I thought I might pass it along for you to consider.

Thanks!