News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Theme Image Uploader

Started by Kays, December 22, 2011, 11:01:32 PM

Previous topic - Next topic

Kays

Link to Mod

This mod will add a method by which you can upload images directly to the images folder in the current theme from the Admin control panel. This is displayed in the Themes and Layout section of the Admin CP. From here, you can also upload to any of the sub-folders in the images folder. An upload box is also show in the Membergroups section of the Admin CP to allow one to upload different group "stars" to the images folder.

As well there is a means to quickly change themes. This change is not permanent and the theme selection will revert to the one selected in the user's profile after loging out and then back in again.

Notes:

  • Only JPEG, PNG and GIF image formats are allowed.

  • Due to the fact that this is designed to replace existing images. There is no overwrite protect or warning if an existing image is overwritten.

  • If an existing image is overwritten and does not appear in your browser. Press the Ctrl + F5 keys to refresh the browsers cache.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

cretaceous

Hi

I used your mod to add some images I want to show on front of site, but they refuse to show.
All permissions are 777 for files or 755 for dirs.
Any ideas why they will not show?
I can see them directly if I enter file path in the browser bar and the correcc URL is shown in 'view source'.
Is SMF doing some checking of its own?
I manually added the directory 'adverts' and set it to 777

I am using this url format :
<img src="/forum/Themes/blu/images/adverts/finderad.jpg">

(Previously I tried modding your mod to upload to a higher level directory, got half way, then got lots of errors so gave up - I just want admin to be able to upload advert images - that's all !)

Thanks!

Kays

Hi, sorry I missed this yesterday.

QuoteI am using this url format :
<img src="/forum/Themes/blu/images/adverts/finderad.jpg">

This would depend on where you are calling this. Try using the full url.

Normally, files should be at 644

Quote
(Previously I tried modding your mod to upload to a higher level directory, got half way, then got lots of errors so gave up - I just want admin to be able to upload advert images - that's all !)

In the edit to Themes.template.php:


themeImageUpload();


And change that to:


themeImageUpload('images/adverts');


(Not tested but should work provided the adverts folder is in the images folder for that theme)



If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

cretaceous

thanks for that - that limits it to specced directory

RE images not showing... my path to the images is correct
Starting the path with a  backslash  e.g. "/forum" starts it from the root server directory

Now figure this out.. it works in IE but not in Firefox - maybe it's a cache thing

NekoJonez

I can't switch the themes to upload for in 2.0.7
Retro video game blogger, writer, actor, podcaster and general amazing dude.

Twitter
My Blog

Kays

Hi, it seems to still work fine for me with an upgraded 2.0.7 forum.

What happens when you select a theme?

Have you tried another browser?

Is this with a fresh install or an upgraded forum?

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Advertisement: