News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Replace Board Title With Image

Started by dougiefresh, November 29, 2017, 05:04:09 PM

Previous topic - Next topic

dougiefresh

Link to Mod



REPLACE BOARD TITLE WITH IMAGE v1.4
By Dougiefresh -> Link to Mod



Introduction
The idea for this mod came from a topic titled A Neat Way To Enhance A Board!, which wrote about a way to use an image in place of the board title.  This mod attempts to accomplish this objective with a minimum of changes to the forum software.

Please note that at this time, there is no automated way to upload images to the server.  You must upload them to a location underneath the forum folder and refer to them as relative paths.  In other words, if you upload it to /forum/Themes/default/images/duh.png, then you would type Themes/default/images/duh.png into the board image field.

Admin Settings
In Admin => Forum => Boards, there is a new field when modifying the boards:
o Replacement Board Title image

Compatibility Notes
This mod was tested on SMF 2.0.14 and SMF 2.1 Beta 3, but should work on SMF 2.0 and up.  SMF 1.x is not and will not be supported.

This mod does not require the SVG As Image Attachment mod to be installed prior or after this mod.  Rather, if the mod has been installed, it will try to use the functions from that mod (as opposed to the built-in getimagesize function).

Related Discussions
o A Neat Way To Enhance A Board!
o Will it wreak havoc to use an image here?

Changelog
The changelog can be viewed at XPtsp.com.

License
Copyright (c) 2017 - 2018, Douglas Orend
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-Rock Lee-

The idea seems very good but it resonates to me. What happens when you have many forums would not cause a problem when loading the images? I also leave the translation in Spanish :P


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

dougiefresh

#2
Uploaded v1.1 - November 29th, 2017
o Added support for SMF 2.1 Beta 3.
o Added support for the SVG As Image Attachment mod.
o Added Spanish Latin translation, courtsey of Rock Lee!
o Added file exists check so that missing images won't cause boards to become inaccessable.





@Rock Lee:  Thank you for the translation!  It's been included in this version!

Quote from: Rock Lee on November 29, 2017, 09:42:33 PM
What happens when you have many forums would not cause a problem when loading the images?
I've read both discussions that I've linked to in the first post.  I can't foresee any issues that might arise from using this mod....  If you run into any problems running this mod, please share them with me so that I can try to fix the issue....

-Rock Lee-

Quote from: dougiefresh on November 29, 2017, 11:52:20 PM
I've read both discussions that I've linked to in the first post.  I can't foresee any issues that might arise from using this mod....  If you run into any problems running this mod, please share them with me so that I can try to fix the issue....

Great @dougiefresh will be testing to what this or that problem :P


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Aleksi "Lex" Kilpinen

Tested this out with a fresh 2.1 beta 3

PHP message:
PHP Parse error: syntax error, unexpected ',', expecting ')' in /Sources/Subs-Boards.php on line 1329

Also, the reason I wanted to test was, to see if this bit actually works:


if (file_exists($sourcedir . '/Subs-SVG.php'))
$img_dim = @getimagesize($boarddir . '/' . $boardOptions['board_image']);
else
$img_dim = @svg_getimagesize($boarddir . '/' . $boardOptions['board_image']);


In my mind, that's backwards. Is it not?
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

dougiefresh

Uploaded v1.2 - December 29th, 2017
o Fixed coding error that fails to properly get image sizes.
o SMF 2.1: Fixed syntax error in Sources/Subs-Boards.php.




@Aleksi "Lex" Kilpinen:  Thank you for reporting this bug!  It's been fixed in this version!

Aleksi "Lex" Kilpinen

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

pepa

Tried installing this and received the warning message not to proceed unless you really know what you are doing ... so obviously some incompatibilities somewhere?

SMF 2.0.14
Mods: Board-color-and-icons 1.1, reCAPTCHA for SMF 1.0.0, Responsive Curve 1.0.0, PayPal Donate 1.0, Global Topics 2.2

dougiefresh

I'll take a look and see what I can do about the incompatibility/incompatibilities...

dougiefresh

Uploaded v1.3 - January 2nd, 2018
o Resolved incompatability with Board color and icons mod.




@pepa:  Thank you for the report!  Hopefully, this solves this issue you were experiencing!

pepa

Yes thank you dougiefresh, that did the trick : )

dougiefresh

Uploaded v1.4 - October 23rd, 2018
o No functionality change.
o Updated documentation to point to new website.

landyvlad

Can I suggest some 'before and after' images as examples on the mod page so people can see what it actually can look like?
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

shadav

I installed this on 2.0.15
it works but.... it doesn't size with the image size
each image is 300 x 200 px
so shouldn't the boards all be the same spacing? why are some more and others less and one is really bad :p

thank you for this though :) but how can I fix this?

well removing the images and then adding them again seemed to have fixed this... so it's ok now :) not sure what happened.....

shadav

just noticed today that it doesn't work on child boards....

the image is fine, as I use it for another board

but this is the first time I'm trying to use it on a child board

how to fix this? it acts like it's wanting to work but the image isn't there....

[edit] forgot to say it's for a 2.0.17 :) thank you

shadav

Quote from: shadav on August 02, 2020, 12:32:06 AM
just noticed today that it doesn't work on child boards....

the image is fine, as I use it for another board

but this is the first time I'm trying to use it on a child board

how to fix this? it acts like it's wanting to work but the image isn't there....

[edit] forgot to say it's for a 2.0.17 :) thank you

figured it out

normally I'd just type in
foldername/filename

but for subcategories you have to type in
/foldername/filename

for it to work correctly
otherwise it's trying to pull the image from url/subcategory/foldername/filename, which obviously doesn't exist....

lather

I successfully installed this mod on my 2.0.15 forum but am  have not been able to make it work. I have uploaded a test image to Themes/default/images and enter that url but nothing happens. No error message but nothing changes on the board.

sam666

If it's any help, here is the url I put for one of my boards which works fine.
/Themes/default/images/android.png
image size used is 32x32

lather

#18
Quote from: stoneageman on January 24, 2021, 06:19:35 PM
If it's any help, here is the url I put for one of my boards which works fine.
/Themes/default/images/android.png
image size used is 32x32
Thanks for the reply. That is exactly the url I used (ecept for image nmae). I used a much larger image. Will try with a smaller one.

Nope that did not help!

shadav

Quote from: lather on January 23, 2021, 03:21:54 PM
I successfully installed this mod on my 2.0.15 forum but am  have not been able to make it work. I have uploaded a test image to Themes/default/images and enter that url but nothing happens. No error message but nothing changes on the board.
When you installed the mod was there any errors on the install page?
are you using a custom theme? if you switch to default theme does it work?
this shouldn't really be an issue with this mod but can't hurt....

make sure that the image was uploaded....go to the images url and make sure that it is there and viewable....

are you using cache? clear your cache then reload the page.....clear your browsers cache and reload the page....

use the parse on the mod page and make sure that all edits were made

Advertisement: