Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Forum: Plugins
    In reply to: Page Restriction

    Ok, I think I solved it. Not sure if I’m implementing the fixes “correctly,” but everything works now.

    To fix:

    WordPress database error: [You have an error in your SQL syntax near '; ' at line 7]
    select distinct page from wp_page_access_group_line_item inner join wp_page_access_user_line_item using(group_id) where wp_page_access_user_line_item.user_id = 1 order by page;

    Find this part in page-restriction.php:

    select distinct page
    from wp_page_access_group_line_item
    inner join wp_page_access_user_line_item
    using(group_id)
    where wp_page_access_user_line_item.user_id = $user_ID
    order by page;

    Put the above part all on one line so it looks like:

    select distinct page from wp_page_access_group_line_item inner join wp_page_access_user_line_item using(group_id) where wp_page_access_user_line_item.user_id = $user_ID order by page;

    To fix:

    Warning: Invalid argument supplied for foreach() in /home/virtual/site14/fst/var/www/html/wp-content/plugins/page-restriction.php on line 221

    Find this line in page-restriction.php:

    foreach ($pages as $k => $v) {

    Change it to:

    foreach ((array)$pages as $k => $v) {

    Finally, the infamous header error:

    Warning: Cannot modify header information - headers already sent by (output started at /home/virtual/site14/fst/var/www/html/wp-content/themes/default/header.php:5) in /home/virtual/site14/fst/var/www/html/wp-includes/pluggable-functions.php on line 129

    Remove this line from page-restriction.php (near the end):

    add_action('wp_head', 'check_the_user');

    Open your theme’s header.php and put this before everything, make sure there are no spaces/tabs/lines before it:

    <?php check_the_user(); ?>

    Note, becareful if you’re using Notepad, apparently it puts 3 lines above the first line that you see… If it says the problem is on header.php line 4 after you do it, then open up the file in Wordpad and delete the 3 lines above it.

    Hope this helps.

    Forum: Plugins
    In reply to: Page Restriction

    I get almost the same problem as kartlink and I’ve posted some background on your blog comments as well.

    I am using this plugin in conjunction with Page Access, but it doesn’t work by itself either.

    The errors I get when used with Page Access are:

    When I am logged in as a user without access privileges for the page:

    code
    WordPress database error: [You have an error in your SQL syntax near ‘; ‘ at line 7]
    select distinct page from wp_page_access_group_line_item inner join wp_page_access_user_line_item using(group_id) where wp_page_access_user_line_item.user_id = 1 order by page;

    Warning: Invalid argument supplied for foreach() in /home/virtual/site14/fst/var/www/html/wp-content/plugins/page-restriction.php on line 221

    Warning: Cannot modify header information – headers already sent by (output started at /home/virtual/site14/fst/var/www/html/wp-content/themes/default/header.php:5) in /home/virtual/site14/fst/var/www/html/wp-includes/pluggable-functions.php on line 129
    code

    When I am not logged in:

    code
    Warning: Cannot modify header information – headers already sent by (output started at /home/virtual/site14/fst/var/www/html/wp-content/themes/default/header.php:5) in /home/virtual/site14/fst/var/www/html/wp-includes/pluggable-functions.php on line 109

    Warning: Cannot modify header information – headers already sent by (output started at /home/virtual/site14/fst/var/www/html/wp-content/themes/default/header.php:5) in /home/virtual/site14/fst/var/www/html/wp-includes/pluggable-functions.php on line 110

    Warning: Cannot modify header information – headers already sent by (output started at /home/virtual/site14/fst/var/www/html/wp-content/themes/default/header.php:5) in /home/virtual/site14/fst/var/www/html/wp-includes/pluggable-functions.php on line 111

    Warning: Cannot modify header information – headers already sent by (output started at /home/virtual/site14/fst/var/www/html/wp-content/themes/default/header.php:5) in /home/virtual/site14/fst/var/www/html/wp-includes/pluggable-functions.php on line 112

    Warning: Cannot modify header information – headers already sent by (output started at /home/virtual/site14/fst/var/www/html/wp-content/themes/default/header.php:5) in /home/virtual/site14/fst/var/www/html/wp-includes/pluggable-functions.php on line 114
    code

    When I use Page Restriction by itself, I get the above error as well.

    I’ve tried both WP 1.5.1.3 and WordPress 1.5.2, neither solves the problem. WordPress and other plug-ins run perfectly, so that’s why I am wondering if this is due to something in the Page Restriction script.

    I am using MediaTemple.net as my host.
    Apache: 2.0.46
    PHP: 4.3.10
    MySQL: 3.23.58

    Their PHP runs in safe mode (https://www.php.net/manual/en/features.safe-mode.php), I don’t know if this has anything to do with the problem but at a quick glance it shouldn’t.

    I have been able to run an identical installation successfully at another host with Apache 1.3.31, PHP 4.3.9, and MySQL 4.1.12.

Viewing 2 replies - 1 through 2 (of 2 total)