Hello,
I just e-mailed this list with a template I created to help keep source files and image files in sync such as a screen shot of a Visio file and the Visio file itself.
The template contained two links 1 : [[Media:{{{1}}}]] 2 : [[:Image:{{{1}}}]]
The first one is used to download the file, and the 2nd one takes you to the image page of the file so you can upload a new version or look at previous versions.
This works fine when the file already exists, but when the file doesn't exist the first link instead of downloading the file is a link to upload the file and the 2nd link brings you to edit the page for a file that doesn't exist.
I would like to have a 3rd link which will upload the file whether it exists or not which is where I'm running into problems with underscores What I have come up with so far for this is the following....
[{{fullurl:Special:Upload|wpDestFile={{{1}}}}} Upload]
The problem here is that what is contained in {{{1}}} may have spaces. So if {{{1}}} is "Some File.ppt" then the link will be to index.php?title=Special:Upload&wpDestFile=Some instead of index.php?title=Special:Upload&wpDestFile=Some_File and of course the text of the link will be File Upload instead of Upload.
I would like to know if there is a template out there that will take some text and replace spaces with underscores so that I can do what I want.
I would hope there is since the space / underscore conversion is done all over the place in MediaWiki. I just don't know where I can access that functionality.
Thanks in advance, ~Eric
Ok Heres my problem.
I've been in contact with my hosting service and ImageMagik is installed and as far as they can see everything should be working. I've been into the local settings and set it so its should be on here's what LocalSettings.php is set as at the moment:
## To enable image uploads, make sure the 'images' directory ## is writable, then set this to true: $wgEnableUploads = true; $wgUseImageResize = true; $wgUseImageMagick = true; $wgImageMagickConvertCommand = '/usr/bin/convert';
## If you want to use image uploads under safe mode, ## create the directories images/archive, images/thumb and ## images/temp, and make them all writable. Then uncomment ## this, if it's not already uncommented: $wgHashedUploadDirectory = false;
Now they say thats completly right as far as they no. And because it isnt working I should contact the script author. And As I dont know who that is I thought I'd come back to you guys.
Now I go into the Gallery of New files on my wiki (www.startrekprotection.com/wiki) as its the easiest way to check if its working or not and for each image it cant re-size it comes up with this error message.
Warning: shell_exec(): Cannot execute using backquotes in Safe Mode in /home/Jono/domains/startrekprotection.com/public_html/wiki/includes/GlobalFu nctions.php on line 1615
Now I've been into GlobalFunctions but for the life of me can't figure out what it is I have to do to make it work..
Anyone know how to help me?
Jono
Jono Bradley wrote:
I've been in contact with my hosting service and ImageMagik is installed and as far as they can see everything should be working. I've been into the local settings and set it so its should be on here's what LocalSettings.php is set as at the moment:
[snip]
Warning: shell_exec(): Cannot execute using backquotes in Safe Mode in /home/Jono/domains/startrekprotection.com/public_html/wiki/includes/GlobalFu nctions.php on line 1615
You won't be able to use ImageMagick unless you get PHP's "Safe Mode" turned off.
Note that while there are some very limited ways to execute programs in safe mode (sometimes, if the moon is just right), they're broken so that the command line is actually damaged and filenames can't be passed to the program correctly, so it wouldn't work anyway.
-- brion vibber (brion @ pobox.com)
Any Idea on how to do that?
Jono ----- Original Message ----- From: "Brion Vibber" brion@pobox.com To: "MediaWiki announcements and site admin list" mediawiki-l@Wikimedia.org Sent: Friday, September 15, 2006 8:21 PM Subject: Re: [Mediawiki-l] Help.
Jono Bradley wrote:
I've been in contact with my hosting service and ImageMagik is installed
and
as far as they can see everything should be working. I've been into the local settings and set it so its should be on here's what
LocalSettings.php
is set as at the moment:
[snip]
Warning: shell_exec(): Cannot execute using backquotes in Safe Mode in
/home/Jono/domains/startrekprotection.com/public_html/wiki/includes/GlobalFu
nctions.php on line 1615
You won't be able to use ImageMagick unless you get PHP's "Safe Mode"
turned off.
Note that while there are some very limited ways to execute programs in
safe
mode (sometimes, if the moon is just right), they're broken so that the
command
line is actually damaged and filenames can't be passed to the program
correctly,
so it wouldn't work anyway.
-- brion vibber (brion @ pobox.com) _______________________________________________ MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
On Saturday, 16th September 2006 at 00:25:21 (GMT +0100), Jono Bradley wrote:
You won't be able to use ImageMagick unless you get PHP's "Safe Mode" turned off.
Any Idea on how to do that?
If you're on a hosted server, you must request your provider to turn off Safe Mode. If they refuse to do so, you'll have to switch to a different webhosting provider.
Ok I've done that And Safe Mode is now turned off and there are no error messages at the top of the page now.
Although it doesn't actually do it I tried to thumb a pic on the main page and where the image was ment to be it came up with this -
Error creating thumbnail: convert: unable to open image `/home/Jono/domains/startrekprotection.com/public_html/wiki/images/thumb/180 px-Protection_newer.jpg': No such file or directory.
Jono ----- Original Message ----- From: wiki@avenarius.sk To: mediawiki-l@Wikimedia.org Sent: Saturday, September 16, 2006 7:23 AM Subject: Re: [Mediawiki-l] ImageMagick Help
On Saturday, 16th September 2006 at 00:25:21 (GMT +0100), Jono Bradley
wrote:
You won't be able to use ImageMagick unless you get PHP's "Safe Mode"
turned off.
Any Idea on how to do that?
If you're on a hosted server, you must request your provider to turn off Safe Mode. If they refuse to do so, you'll have to switch to a different webhosting provider.
-- Yours, Alex. [processed by "The Bat!", Version 3.80.06] (MediaWiki: 1.6.8 / PHP: 4.4.1 (cgi) / MySQL: 4.1.19-standard) http://vincentdepaul.sk/skola
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Jono,
I just went through all this myself. You need to make sure that the permissions on your image directories are all set so that apache can read and write to them and that apache also has permission to use the convert utility. If it doesn't, then it can't create the thumbnail and you'll get a no such file error (tho you should also be getting a permission denied error in that case)
(In case your provider is running SELinux... I also ended up running selinux in permissive mode because everytime I uploaded a new image, apache had no access to it... don't know how your hosting service would feel about that, but if you set all the permissions properly and still get the error, you might ask them about it.)
hope this helps, Andrea
On 9/17/06, Jono Bradley jono.bradley@ntlworld.com wrote:
Ok I've done that And Safe Mode is now turned off and there are no error messages at the top of the page now.
Although it doesn't actually do it I tried to thumb a pic on the main page and where the image was ment to be it came up with this -
Error creating thumbnail: convert: unable to open image `/home/Jono/domains/startrekprotection.com/public_html/wiki/images/thumb/180 px-Protection_newer.jpg': No such file or directory.
Jono ----- Original Message ----- From: wiki@avenarius.sk To: mediawiki-l@Wikimedia.org Sent: Saturday, September 16, 2006 7:23 AM Subject: Re: [Mediawiki-l] ImageMagick Help
On Saturday, 16th September 2006 at 00:25:21 (GMT +0100), Jono Bradley
wrote:
You won't be able to use ImageMagick unless you get PHP's "Safe Mode"
turned off.
Any Idea on how to do that?
If you're on a hosted server, you must request your provider to turn off Safe Mode. If they refuse to do so, you'll have to switch to a different webhosting provider.
-- Yours, Alex. [processed by "The Bat!", Version 3.80.06] (MediaWiki: 1.6.8 / PHP: 4.4.1 (cgi) / MySQL: 4.1.19-standard) http://vincentdepaul.sk/skola
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
You see the problem I have is this - I got to public_html then into 'Wiki' and then into 'Images' but there is no folder named 'thumbs' to set the permission.
Error creating thumbnail: convert: unable to open image `/home/Jono/domains/startrekprotection.com/public_html/wiki/images/thumb/500 px-Protection_newer.jpg': No such file or directory.
The image directory is set to permission 777 as I believe that permission allows the uploads to commence on Wiki. So I'm assuming thats the permission that allows apache to read and write.
All the images in the 'Image' file are 'apache' I think - as the UID and GID on them all are 'apache'
Jono ----- Original Message ----- From: "Andrea Forte" andrea.forte@gmail.com To: "MediaWiki announcements and site admin list" mediawiki-l@wikimedia.org Sent: Sunday, September 17, 2006 9:45 PM Subject: Re: [Mediawiki-l] ImageMagick Help
Jono,
I just went through all this myself. You need to make sure that the permissions on your image directories are all set so that apache can read and write to them and that apache also has permission to use the convert utility. If it doesn't, then it can't create the thumbnail and you'll get a no such file error (tho you should also be getting a permission denied error in that case)
(In case your provider is running SELinux... I also ended up running selinux in permissive mode because everytime I uploaded a new image, apache had no access to it... don't know how your hosting service would feel about that, but if you set all the permissions properly and still get the error, you might ask them about it.)
hope this helps, Andrea
On 9/17/06, Jono Bradley jono.bradley@ntlworld.com wrote:
Ok I've done that And Safe Mode is now turned off and there are no error messages at the top of the page now.
Although it doesn't actually do it I tried to thumb a pic on the main
page
and where the image was ment to be it came up with this -
Error creating thumbnail: convert: unable to open image
`/home/Jono/domains/startrekprotection.com/public_html/wiki/images/thumb/180
px-Protection_newer.jpg': No such file or directory.
Jono ----- Original Message ----- From: wiki@avenarius.sk To: mediawiki-l@Wikimedia.org Sent: Saturday, September 16, 2006 7:23 AM Subject: Re: [Mediawiki-l] ImageMagick Help
On Saturday, 16th September 2006 at 00:25:21 (GMT +0100), Jono Bradley
wrote:
You won't be able to use ImageMagick unless you get PHP's "Safe
Mode"
turned off.
Any Idea on how to do that?
If you're on a hosted server, you must request your provider to turn off Safe Mode. If they refuse to do so, you'll have to switch to a different webhosting provider.
-- Yours, Alex. [processed by "The Bat!", Version 3.80.06] (MediaWiki: 1.6.8 / PHP: 4.4.1 (cgi) / MySQL: 4.1.19-standard) http://vincentdepaul.sk/skola
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Presumably you created the thumb directory and set the permissions correctly when you were running in safemode? See localsettings.php:
## If you want to use image uploads under safe mode, ## create the directories images/archive, images/thumb and ## images/temp, and make them all writable. Then uncomment ## this, if it's not already uncommented: $wgHashedUploadDirectory = false;
and I assume you've commented that line back out now that you're out of safe mode.
I think that changing out of safe mode changes the directory structure that mediawiki uses for images. so when you changed out of safe mode and changed your localsettings file i think it also changed where images are stored and where thumbnails are created...
andrea
On 9/17/06, Jono Bradley jono.bradley@ntlworld.com wrote:
You see the problem I have is this - I got to public_html then into 'Wiki' and then into 'Images' but there is no folder named 'thumbs' to set the permission.
Error creating thumbnail: convert: unable to open image `/home/Jono/domains/startrekprotection.com/public_html/wiki/images/thumb/500 px-Protection_newer.jpg': No such file or directory.
The image directory is set to permission 777 as I believe that permission allows the uploads to commence on Wiki. So I'm assuming thats the permission that allows apache to read and write.
All the images in the 'Image' file are 'apache' I think - as the UID and GID on them all are 'apache'
Jono ----- Original Message ----- From: "Andrea Forte" andrea.forte@gmail.com To: "MediaWiki announcements and site admin list" mediawiki-l@wikimedia.org Sent: Sunday, September 17, 2006 9:45 PM Subject: Re: [Mediawiki-l] ImageMagick Help
Jono,
I just went through all this myself. You need to make sure that the permissions on your image directories are all set so that apache can read and write to them and that apache also has permission to use the convert utility. If it doesn't, then it can't create the thumbnail and you'll get a no such file error (tho you should also be getting a permission denied error in that case)
(In case your provider is running SELinux... I also ended up running selinux in permissive mode because everytime I uploaded a new image, apache had no access to it... don't know how your hosting service would feel about that, but if you set all the permissions properly and still get the error, you might ask them about it.)
hope this helps, Andrea
On 9/17/06, Jono Bradley jono.bradley@ntlworld.com wrote:
Ok I've done that And Safe Mode is now turned off and there are no error messages at the top of the page now.
Although it doesn't actually do it I tried to thumb a pic on the main
page
and where the image was ment to be it came up with this -
Error creating thumbnail: convert: unable to open image
`/home/Jono/domains/startrekprotection.com/public_html/wiki/images/thumb/180
px-Protection_newer.jpg': No such file or directory.
Jono ----- Original Message ----- From: wiki@avenarius.sk To: mediawiki-l@Wikimedia.org Sent: Saturday, September 16, 2006 7:23 AM Subject: Re: [Mediawiki-l] ImageMagick Help
On Saturday, 16th September 2006 at 00:25:21 (GMT +0100), Jono Bradley
wrote:
You won't be able to use ImageMagick unless you get PHP's "Safe
Mode"
turned off.
Any Idea on how to do that?
If you're on a hosted server, you must request your provider to turn off Safe Mode. If they refuse to do so, you'll have to switch to a different webhosting provider.
-- Yours, Alex. [processed by "The Bat!", Version 3.80.06] (MediaWiki: 1.6.8 / PHP: 4.4.1 (cgi) / MySQL: 4.1.19-standard) http://vincentdepaul.sk/skola
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Ahhh.... Ermmm... I havent actually created any directories or anything.. I wasnt sure that I had to.. And I didnt do anything to that part of the LocalSettings.php because I didnt think I had to either...
Jono ----- Original Message ----- From: "Andrea Forte" andrea.forte@gmail.com To: "MediaWiki announcements and site admin list" mediawiki-l@wikimedia.org Sent: Monday, September 18, 2006 12:09 AM Subject: Re: [Mediawiki-l] ImageMagick Help
Presumably you created the thumb directory and set the permissions correctly when you were running in safemode? See localsettings.php:
## If you want to use image uploads under safe mode, ## create the directories images/archive, images/thumb and ## images/temp, and make them all writable. Then uncomment ## this, if it's not already uncommented: $wgHashedUploadDirectory = false;
and I assume you've commented that line back out now that you're out of safe mode.
I think that changing out of safe mode changes the directory structure that mediawiki uses for images. so when you changed out of safe mode and changed your localsettings file i think it also changed where images are stored and where thumbnails are created...
andrea
On 9/17/06, Jono Bradley jono.bradley@ntlworld.com wrote:
You see the problem I have is this - I got to public_html then into
'Wiki'
and then into 'Images' but there is no folder named 'thumbs' to set the permission.
Error creating thumbnail: convert: unable to open image
`/home/Jono/domains/startrekprotection.com/public_html/wiki/images/thumb/500
px-Protection_newer.jpg': No such file or directory.
The image directory is set to permission 777 as I believe that
permission
allows the uploads to commence on Wiki. So I'm assuming thats the
permission
that allows apache to read and write.
All the images in the 'Image' file are 'apache' I think - as the UID and
GID
on them all are 'apache'
Jono ----- Original Message ----- From: "Andrea Forte" andrea.forte@gmail.com To: "MediaWiki announcements and site admin list" mediawiki-l@wikimedia.org Sent: Sunday, September 17, 2006 9:45 PM Subject: Re: [Mediawiki-l] ImageMagick Help
Jono,
I just went through all this myself. You need to make sure that the permissions on your image directories are all set so that apache can read and write to them and that apache also has permission to use the convert utility. If it doesn't, then it can't create the thumbnail and you'll get a no such file error (tho you should also be getting a permission denied error in that case)
(In case your provider is running SELinux... I also ended up running selinux in permissive mode because everytime I uploaded a new image, apache had no access to it... don't know how your hosting service would feel about that, but if you set all the permissions properly and still get the error, you might ask them about it.)
hope this helps, Andrea
On 9/17/06, Jono Bradley jono.bradley@ntlworld.com wrote:
Ok I've done that And Safe Mode is now turned off and there are no
error
messages at the top of the page now.
Although it doesn't actually do it I tried to thumb a pic on the
main
page
and where the image was ment to be it came up with this -
Error creating thumbnail: convert: unable to open image
`/home/Jono/domains/startrekprotection.com/public_html/wiki/images/thumb/180
px-Protection_newer.jpg': No such file or directory.
Jono ----- Original Message ----- From: wiki@avenarius.sk To: mediawiki-l@Wikimedia.org Sent: Saturday, September 16, 2006 7:23 AM Subject: Re: [Mediawiki-l] ImageMagick Help
On Saturday, 16th September 2006 at 00:25:21 (GMT +0100), Jono
Bradley
wrote:
> You won't be able to use ImageMagick unless you get PHP's "Safe
Mode"
turned off.
Any Idea on how to do that?
If you're on a hosted server, you must request your provider to turn off Safe Mode. If they refuse to do so, you'll have to switch to a different webhosting provider.
-- Yours, Alex. [processed by "The Bat!", Version 3.80.06] (MediaWiki: 1.6.8 / PHP: 4.4.1 (cgi) / MySQL: 4.1.19-standard) http://vincentdepaul.sk/skola
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org