Eric Mann
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Session Manager] Can set array like $wp_session['colors'][] = 'daa'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
RecursiveArrayAccessthat implementsArrayAccess. It allows for iterative, multidimensional arrays (and I found it on StackOverflow (http://stackoverflow.com/a/13480254/326224).WP_Sessionwill 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!
Forum: Plugins
In reply to: [WP Session Manager] Can set array like $wp_session['colors'][] = 'daa'Interesting …
The issue is actually in the underlying structure of PHP. I’m implementing
ArrayAccessforWP_Sessionwhich is what gives you the array-like structure of the parent container. Unfortunately,ArrayAccessdoesn’t play well with multidimensional arrays.For whatever reason, the original PHP authors chose to make
ArrayAccessreturn 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;Forum: Plugins
In reply to: [WP Publication Archive] [Plugin: WP Publication Archive] new similar pluginPaul, 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.phpduring the TimThumb remote code execution scare).Open a new thread and link to it here so we can continue the conversation …
Forum: Plugins
In reply to: [WP Publication Archive] pdf's not readable on downloadHmm … well, the new version of the plugin (hopefully done before the end of the year) will be dumping the
openfile.phpmethod 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
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.
Forum: Plugins
In reply to: [WP Publication Archive] pdf's not readable on downloadYeah, I know what
openfile.phplooks like. My only guess, without seeing how your server is configured, is that your server is choking on thefetch_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_filesdeclaration for the server config. Usually this includesindex.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
$_GETvariable is being stripped off, soopenfile.phpis 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.
Forum: Plugins
In reply to: [WP Publication Archive] pdf's not readable on downloadCody,
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.phpis disabled.Forum: Plugins
In reply to: JS Banner Rotate and Thesis OpenHookYou need to do a couple of things:
- 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. - Don’t use the old
image1=API. It’s been deprecated in favor of usingimages=
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' ); ?>Forum: Networking WordPress
In reply to: Converting subfolder to subdomain installationIn 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
siteurlandhomesettings for each site on the network (and can probably do this with a search-and-replace in SQL).Forum: Networking WordPress
In reply to: Converting subfolder to subdomain installationSo you want to change
http://www.domain.tld/sitenametohttp://blogs.domain.tld/sitenameorhttp://sitename.blogs.domain.tld?Forum: Plugins
In reply to: [WP Publication Archive] front end uploadPlease 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.
.htaccessis 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
.htaccessfile 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.htaccessfile 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 tohttp://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
.htaccessso we can check to see if that’s what’s causing the issue?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.
Forum: Plugins
In reply to: [WP Publication Archive] Move download to same line as title$listisn’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>andget_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. - Use PHP. There’s a function called