latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Protected images not displaying/Header error

Home Forums Community Forum Protected images not displaying/Header error

Tagged: ,

This topic contains 5 replies, has 2 voices. Last updated by  Cristián Lávaque 4 years, 7 months ago.

Topic Author Topic
Posted: Thursday May 31st, 2012 at 12:42 pm #15067

Hello,

i’m protecting several non-WordPress pages with the following PHP code:

<?php
include_once "../../wp-load.php";
if (current_user_can("access_s2member_level0")) {
// User is allowed to view, so display something here.
} else {
exit("Permission denied!");
}
?>

The pages contain protected images from the folder s2member-files – i.e.

<img src="/?s2member_file_download=animage.jpg" alt="" width="211" height="111" />

If there is more than one protected image on a page, some images don’t show up. The error occurs on random images (curiously even on non protected jpegs). Sometimes an image works, sometimes it doesn’t display on the page. From time to time or after hitting F5 many times another error occurs randomly:

<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /homepages
/path-to-site/wp-content/plugins/s2member/includes/classes/files-in.inc.php(387) : eval()'d code:1) in
<b>/homepages/path-to-site/wp-includes/pluggable.php</b> on line <b>866</b><br />
HTTP/1.1 200 OK
Date: Wed, 30 May 2012 16:45:23 GMT
Server: Apache
X-Powered-By: PHP/5.2.17
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, max-age=0
Pragma: no-cache
Last-Modified: Wed, 30 May 2012 16:45:23 GMT
Keep-Alive: timeout=2, max=198
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html

I’ve tried some fixes mentioned here and here but the display problem and the header error still remain.

I would appreciate any help in troubleshooting/fixing this.

Thanks

List Of Topic Replies

Viewing 5 replies - 1 through 5 (of 5 total)
Author Replies
Author Replies
Posted: Friday Jun 1st, 2012 at 3:00 am #15130

Hi Marco.

Does the image work fine if you use it in a WordPress page?

Did you add “jpg” to the inline file extensions list? [hilite path]Dashboard -› s2Member® -› Download Options -› Inline File Extensions[/hilite]

Did you try using the mod_rewrite URL for it? [hilite path]Dashboard -› s2Member® -› Download Options -› Advanced Mod-Rewrite Linkage[/hilite]

I hope that helps.

Posted: Friday Jun 1st, 2012 at 5:15 am #15137

The images work fine if used in a WordPress page. My default inline file extensions are

htm,html,pdf,jpg,jpeg,jpe,gif,png,mp3,mp4,flv,ogg,webm

I’ve tried the advanced mod_rewrite linkage options, but all variations didn’t help solving the display problem on the non WordPress pages.

Posted: Friday Jun 1st, 2012 at 9:54 pm #15222

Did you actually enter those extensions into the field for it? Or is that what’s shown below the field as an example? [hilite path]Dashboard -› s2Member® -› Download Options -› Inline File Extensions[/hilite]

You can also try using the download key, as explained here: [hilite path]Dashboard -› s2Member® -› Download Options -› Advanced Download Restrictions[/hilite]

Posted: Monday Jun 4th, 2012 at 5:07 am #15328

I’ve already entered the extensions into the field and tried using the download key – but the result is the same.

Posted: Monday Jun 4th, 2012 at 10:37 pm #15413

I see. But the downloads work properly when done from a WP page/post? It’s from outside WP that you’re having trouble?

Are the links from outside using the exact same URL that you tried from a WP page? Knowledge Base » Don't mix www and without

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

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.