Forum Replies Created

Viewing 15 replies - 196 through 210 (of 681 total)
  • Plugin Author Eric Mann

    (@ericmann)

    Actually, I did find a way to enable this. It involves extending things a bit, but it’s possible.

    Basically, I build a class called RecursiveArrayAccess that implements ArrayAccess. It allows for iterative, multidimensional arrays (and I found it on StackOverflow (http://stackoverflow.com/a/13480254/326224). WP_Session will then extend this class.

    I’m still fleshing things out, but the following is proven to work:

    $wp_session = WP_Session::get_instance();
    $wp_session['colors'] = array();
    $wp_session['colors'][] = 'dda';

    Both sets and unsets seem to work with this pattern, so we should be good to go!

    Plugin Author Eric Mann

    (@ericmann)

    Interesting …

    The issue is actually in the underlying structure of PHP. I’m implementing ArrayAccess for WP_Session which is what gives you the array-like structure of the parent container. Unfortunately, ArrayAccess doesn’t play well with multidimensional arrays.

    For whatever reason, the original PHP authors chose to make ArrayAccess return properties in read mode (not by reference). So when you call $wp_session['colors'] it returns a read-only version of the array. Adding to the array will have no effect.

    A workaround, until I figure out a more permanent solution, would be to:

    $wp_session = WP_Session::get_instance();
    
    $colors = array();
    $colors[] = 'daa';
    $wp_session['colors'] = $colors;
    Plugin Author Eric Mann

    (@ericmann)

    Paul, Please open a new thread next time …

    the sticking point in using it is that a number of the publications (as on your site for PublicPolicy.ie) are hosted elsewhere.

    So you want publications hosted elsewhere to be listed, or not? If that’s a feature you want, it’s a feature that WP Publication Archive can support. The version coming out this month restores the remote hosting capabilities (which were disabled in openfile.php during the TimThumb remote code execution scare).

    Open a new thread and link to it here so we can continue the conversation …

    Plugin Author Eric Mann

    (@ericmann)

    Hmm … well, the new version of the plugin (hopefully done before the end of the year) will be dumping the openfile.php method to load files anyway. It’s old, slow, and as you’ve demonstrated, prone to failure for a variety of reasons.

    The new system will allow you to treat each publication as a post – with its own description and meta information. You can still use the shortcode to list archives, or can allow people to navigate through a deeper archive at http://yoursite.com/publications.

    Each publication will have its own link (i.e. http://yoursite.com/publication/whatever-title-you-chose) which will display document details, meta information, and present both view and download links. The download link will force the file to be downloaded (as before). The view link will dynamically stream the resource to the browser, allowing the browser to take over and do whatever it needs to the file – i.e. display on screen, continue as a download, or whatever is the default behavior for that file type.

    If there’s anything else you’d like to queue up as a change, feel free to add an issue to my internal roadmap and I’ll see what I can do: https://github.com/ericmann/WP-Publication-Archive/issues

    Plugin Author Eric Mann

    (@ericmann)

    decee2000:

    Please don’t post follow-up questions on resolved threads … the chances someone will come back to look are remote (Google flagged it for me, so you’re lucky this time).

    But to answer your question, not at this time. Sorry.

    Plugin Author Eric Mann

    (@ericmann)

    Yeah, I know what openfile.php looks like. My only guess, without seeing how your server is configured, is that your server is choking on the fetch_content() call. This is using cURL behind the scenes, which can sometimes be disabled or hobbled by the server configuration.

    Is there any chance you can check your error logs to see if anything is being reported there?

    But the Nginx error that you’re seeing is a common error. If you try to access a directory without specifying a filename, Nginx will look at whatever’s defined in the try_files declaration for the server config. Usually this includes index.htm index.html index.php. So some file, somewhere, is trying to read or access a directory without specifying a filename and that directory is lacking one of these three files.

    My guess is that the $_GET variable is being stripped off, so openfile.php is trying to do a cURL call for the directory where it resides (basically doing a cURL GET of ''). But I can’t be sure of this without seeing your error logs.

    Ideally, the logs will show exactly what’s being requested, by what, and what error is occuring. If you can copy-paste those logs, we should be able to narrow things down.

    Plugin Author Eric Mann

    (@ericmann)

    Cody,

    Looking at your site, there’s something going wrong with the download. The file that is downloading is not the PDF but is instead an HTML file containing an error:

    Directory has no index file.

    For some reason, an include somewhere either isn’t working or your server (I see you’re running Nginx) is configured in such a way that streaming the PDF file to the browser through openfile.php is disabled.

    You need to do a couple of things:

    1. Use PHP. There’s a function called jsbrotate() that is meant to be used as a template tag. The shortcode [jsbrotate] is only meant to be used inside post content.
    2. Don’t use the old image1= API. It’s been deprecated in favor of using images=

    To rewrite the code you posted as a template tag, you would use:

    <?php
    jsbrotate( 'images=http://lynkswebservices.com/rayburns/wp-content/uploads/2012/10/slides-larson1.jpg|http://lynkswebservices.com/rayburns/wp-content/uploads/2012/10/slides-crownline1.jpg&height=380&width=1000&imgdisp=5&imgfade=2' );
    ?>

    In that case, you’re not changing a subfolder installation to a subdomain installation, you’re just moving the domain. It’ll be a little involved, but you’ll need to reset the siteurl and home settings for each site on the network (and can probably do this with a search-and-replace in SQL).

    So you want to change http://www.domain.tld/sitename to http://blogs.domain.tld/sitename or http://sitename.blogs.domain.tld?

    Plugin Author Eric Mann

    (@ericmann)

    Please don’t post the same topic multiple times. We heard you the first time …

    And no, you’re not missing anything. There is not, and is not supposed to be, a front-end interface for uploads.

    .htaccess is usually hidden because of the leading . in the filename. I’m not sure what you’re using to access the server, but you might need to tell it to show hidden files.

    The .htaccess file is what tells Apache how to rewrite URLs. If you’re running with no plugins, then that’s likely what’s causing the redirect issue. It’s also the only way pretty permalinks can work (it tells Apache how to pass the pretty permalink into WordPress).

    One other thing to try is just resetting your permalinks. Go to Settings >> Permalinks in the admin. Change back to the default (?p=xxx) and save. Then change back to the setting you’re currently using and save. WordPress should flush out your .htaccess file for you … this might be just the fix you need.

    I tried loading your site, and the home page works just fine. But when I try to go to any individual post, it tries to redirect me to the same post.

    Accessing http://matthewscottbaker.com/blog/2012/11/06/movie-review-double-feature-fairy-tales-1978-full-moons-grindhouse-collection-auditions-1978/ attempts to redirect me to http://matthewscottbaker.com/blog/2012/11/06/movie-review-double-feature-fairy-tales-1978-full-moons-grindhouse-collection-auditions-1978/

    So it looks like you have a redirect set up somewhere that’s breaking things. Are you using any kind of redirection plugin? Have you recently changes your permalinks? Can you copy and paste the contents of .htaccess so we can check to see if that’s what’s causing the issue?

    Plugin Author Eric Mann

    (@ericmann)

    Authors work like tags in the current version. So when you start typing an author’s name, WordPress will make a suggestion of which author to include.

    Plugin Author Eric Mann

    (@ericmann)

    $list isn’t a command, it’s a variable. What we’re doing by applying .= is concatenating the code together.

    So if get_the_title() returns <div>Title</div> and get_the_uri() returns <a href="">Uri</a>, then

    $list .= $pub->get_the_title();
    $list .= $pub->get_the_uri();

    will store <div>Title</div><a href="">Uri</a> in the variable $list. It’s just a container, nothing more. You need to use CSS to tell the browser where to position the individual elements on the page. If you provide a link to your site, I can tell you exactly where to put it and what you need to write.

Viewing 15 replies - 196 through 210 (of 681 total)