forceagainstsomething
Forum Replies Created
-
Forum: Plugins
In reply to: $_FILES emptyblobya,
I don’t know. You may want to try hooking into WP’sinitevent, like this:add_action(‘init’, ‘myfunction’);
function myfunction() {
if ($_FILES) {
// Something here
}
}Forum: Plugins
In reply to: $_FILES emptyblobaya,
Can you point us to the upload form? Or copy/paste the HTML here so we can check that out.Personally I don’t use the is_uploaded_file() function. I just do something like this:
if ($_FILES) {
}
And that’s enough. The $_FILES array won’t exists if a file wasn’t uploaded via a form.
Are you adding
enctype="multipart/form-data"to your opening form tag? Are you using the POST method? If you simply add something like this:echo $_FILES[‘picture’][‘tmp_name’];
Does it show anything?
– Sean
Forum: Plugins
In reply to: WordPress eats my defined variables?Seth,
On another note, it’s good practice to prefix your own defined variables with something unique, to prevent them clashing with WordPress variables. Something like $MYVAR_INFO instead of just $INFO. You never know, WP might already have a variable named $INFO (it doesn’t) that would cause your variable to get wiped.You might also benefit from defining your variables in a custom plugin, and activating the plugin.
– Sean
Forum: Plugins
In reply to: header(“Location: $PHP_SELF”) problemTyssen,
This is a common problem that people make when working with PHP’s header() function. In a nutshell what the error is telling you, is that you can not redirect because your PHP script has already sent HTML to the browser.The long explanation is this: When a browser request your script from the server, it sends the request in a header, like this:
GET /index.php HTTP/1.1
Host: http://www.yoursite.comAnd the server responds with something like this:
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8Followed by the document’s HTML. Once the HTML has started flowing to the browser, *no more headers* can be sent. Now PHP’s header() function simply does this:
HTTP/1.1 302 OK
Location: http://www.myothersite.comWhen the browser gets this response, it redirects to the “location” URL instead. PHP’s header() function simply inserts “Location: http://www.myothersite.com” into the response header. But like I said above, once HTML has started flowing to the browser, you can’t send any more headers.
Use of the header() function has to be before *anything* is output in your script. No text, no HTML, not even a single space.
– Sean
Forum: Plugins
In reply to: New Plugin – Edit n Placeilludium,
#2 might have something to do with #1. Sounds like an easy fix though.Thanks!
– SeanForum: Plugins
In reply to: New Plugin – Edit n PlaceStahn,
Well… hmm. I know after doing some reading, that if the browser isn’t treating the whole document as UTF-8, then text boxes won’t display UTF-8 characters correctly, and possible JavaScript won’t either. So there really is no work around, it’s up to the user to have things configured correctly in the browser *and* in WordPress for the characters to display correctly.The SET NAMES thing turns out to be MySQL 5.x only. Didn’t realize that. 🙂 I’ll look for the MySQL 4.x equivalent.
Thanks for all your help.
– SeanForum: Plugins
In reply to: New Plugin – Edit n PlaceStahn,
Give this a try:http://editnplace.headzoo.com/downloads/editnplace_v0.3.1.zip
It’s slightly difficult to test for these kinds of things on my home computer, so I can’t say for sure that it will work. The character Å? worked fine when I testing it.
This minor version also assumes that you have your MySQL tables set to use UTF-8.
– Sean
Forum: Plugins
In reply to: New Plugin – Edit n PlaceStahn,
I’ll look into that this week. Hopefully by mid-week I’ll have the next minor version up, and I’ll try to get the Unicode problem fixed.– Sean
Forum: Plugins
In reply to: New Plugin – Edit n PlaceMarc,
Okay, the next version, 0.3, is up for download. If fixes the RSS feed bug, and also adds a Cancel button when editing post.Enjoy!
– Sean
http://www.headzoo.comForum: Plugins
In reply to: New Plugin – Edit n PlaceMarc,
Yep, looks like a bug. It’s not that it’s added for each post that you edited, but added once per feed (in v0.2). I’ll clear that up by tonight.Thanks!
-SeanForum: Plugins
In reply to: New Plugin – Edit n PlaceAlright, I put up a new version for download, version 0.2. If fixes the WP 1.5 problem, optimizes the JS a bit, and a couple other bug fixes.
Enjoy!
– Sean
http://www.headzoo.comForum: Plugins
In reply to: New Plugin – Edit n Place@illudium – Never mind, it seems it is repeating the JavaScript. 🙂 Minor bug that’ll be fixed by tonight.
– Sean
Forum: Plugins
In reply to: New Plugin – Edit n Place@sgrayban – Thanks for the input. Didn’t cross my mind that is_attachment() was a WP 2.0 function. Makes sense though. I’ll have that fixed by the end of the day.
@illudium – The JS shouldn’t be repeated before every post. Only once per page. If you’re getting it before every post (i.e. like 10 times per page), can you give me an URL so I can see?
The stylesheet has been taken out. Actually wasn’t supposed to be there in the first place. That was just something I was experimenting with and decided not to use.
As for putting it all in the head, that’s mildly impossible, or I would have. The problem is I only want the JavaScript on the page if the person viewing the page is an admin, for security purposes. Well, WP doesn’t know if the person viewing the page is an admin until *after* the head has been sent out to the browser. It seems it’s not until the first post is being displayed that the user ID becomes available.
I’ll look into it some more. It’s not a solution that I’m happy with, but it seemed the only way.
– Sean
http://www.headzoo.comForum: Plugins
In reply to: Announcement page for Auto Links PluginHowdy all,
I updated the announcement page with teaser screenshots and more information about the next version. You can still view it at:– Sean
http://www.headzoo.comForum: Fixing WordPress
In reply to: Problems after upgradeYep, I’m going to skip using the WYSIWYG editor in 2.0 until the “Send to editor” issue is fixed. It drives me nuts having to resize each image after inserting it into the post.