Advertisement:

Author Topic: Replace Board Title With Image  (Read 1682 times)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,743
  • Mod King
    • XPtsp.com Community
Replace Board Title With Image
« on: November 29, 2017, 05:04:09 PM »
Link to Mod


REPLACE BOARD TITLE WITH IMAGE v1.3
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 has been removed and can be seen at XPtsp.com.

License
Quote
Copyright (c) 2017, 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.

Offline Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 1,867
  • Gender: Male
  • I also speak english :D
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: Replace Board Title With Image
« Reply #1 on: November 29, 2017, 09:42:33 PM »
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 © 2018
Ayudas - Aportes - Tutoriales - Y mucho mas!!!


Ayudame via PayPal

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,743
  • Mod King
    • XPtsp.com Community
Re: Replace Board Title With Image
« Reply #2 on: November 29, 2017, 11:52:20 PM »
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!

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....
« Last Edit: November 30, 2017, 12:15:43 AM by dougiefresh »

Offline Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 1,867
  • Gender: Male
  • I also speak english :D
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: Replace Board Title With Image
« Reply #3 on: November 30, 2017, 07:32:07 AM »
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 © 2018
Ayudas - Aportes - Tutoriales - Y mucho mas!!!


Ayudame via PayPal

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 17,385
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • aleksi-kilpinen on LinkedIn
Re: Replace Board Title With Image
« Reply #4 on: December 29, 2017, 08:09:53 AM »
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:

Code: [Select]
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?
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.

How you can help SMF

"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

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,743
  • Mod King
    • XPtsp.com Community
Re: Replace Board Title With Image
« Reply #5 on: December 29, 2017, 10:23:31 PM »
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!

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 17,385
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • aleksi-kilpinen on LinkedIn
Re: Replace Board Title With Image
« Reply #6 on: December 30, 2017, 02:38:28 AM »
You are welcome :)
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.

How you can help SMF

"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

Offline pepa

  • Jr. Member
  • **
  • Posts: 192
Re: Replace Board Title With Image
« Reply #7 on: December 31, 2017, 06:54:34 AM »
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

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,743
  • Mod King
    • XPtsp.com Community
Re: Replace Board Title With Image
« Reply #8 on: December 31, 2017, 07:21:17 AM »
I'll take a look and see what I can do about the incompatibility/incompatibilities...

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,743
  • Mod King
    • XPtsp.com Community
Re: Replace Board Title With Image
« Reply #9 on: January 02, 2018, 12:59:33 PM »
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!

Offline pepa

  • Jr. Member
  • **
  • Posts: 192
Re: Replace Board Title With Image
« Reply #10 on: January 03, 2018, 08:01:57 AM »
Yes thank you dougiefresh, that did the trick : )