Advertisement:

Author Topic: Will it wreak havoc to use an image here?  (Read 10408 times)

Offline Grammy

  • Full Member
  • ***
  • Posts: 423
  • Gender: Female
  • Tire Kicker
Will it wreak havoc to use an image here?
« on: July 08, 2016, 10:52:29 AM »
This isn't really a coding question and, since my forum is 2.0.11, default, I thought this might be the place to ask:

Will it wreak havoc with the Database for any reason, if, instead of having text in the title of my first board, I simply have an image, instead?  (Of course, it doesn't center on the message index page, but I'm okay with that, I guess.)

I just wondered if the database requires text in the board name and if I will cause problems by using an image?

(attached shots)

Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 48,084
Re: Will it wreak havoc to use an image here?
« Reply #1 on: July 08, 2016, 11:03:26 AM »
you should not do that. now try to move a topic to that board and it will not show you the name of the board. you really should not be putting anything but text into the name of the board. if you have to dig into the database to do what you want, you really should not do it.

Offline Grammy

  • Full Member
  • ***
  • Posts: 423
  • Gender: Female
  • Tire Kicker
Re: Will it wreak havoc to use an image here?
« Reply #2 on: July 08, 2016, 11:04:49 AM »
you should not do that. now try to move a topic to that board and it will not show you the name of the board. you really should not be putting anything but text into the name of the board. if you have to dig into the database to do what you want, you really should not do it.

Alright, thanks for letting me know, Illori.  It's on a test board, so no harm done, but that's the purpose for testing.   :)

It's gone, then. 

Offline Grammy

  • Full Member
  • ***
  • Posts: 423
  • Gender: Female
  • Tire Kicker
Re: Will it wreak havoc to use an image here?
« Reply #3 on: July 08, 2016, 11:32:17 AM »
One last question, if you don't mind...

What if I do have text in the board title, along with the image?  Still a no-no?  (I opted for no description and just added text in the board name field along with the image link.)  Will that also screw things up?

(attached)


Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 48,084
Re: Will it wreak havoc to use an image here?
« Reply #4 on: July 08, 2016, 11:37:34 AM »
you should NOT use any HTML in the board title.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,120
  • Gender: Male
    • Kindred-999 on GitHub
Re: Will it wreak havoc to use an image here?
« Reply #5 on: July 08, 2016, 11:40:27 AM »
there are 2 or 3 mods which allow you to add images or icons for boards...   do not put any html into the board title, and limited if any HTML (like bold) in the board description
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Grammy

  • Full Member
  • ***
  • Posts: 423
  • Gender: Female
  • Tire Kicker
Re: Will it wreak havoc to use an image here?
« Reply #6 on: July 08, 2016, 11:44:32 AM »
there are 2 or 3 mods which allow you to add images or icons for boards...   do not put any html into the board title, and limited if any HTML (like bold) in the board description


I'll go mod shopping, then.  Thanks!   :)

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,055
    • Arantor on GitHub
Re: Will it wreak havoc to use an image here?
« Reply #7 on: July 08, 2016, 02:00:55 PM »
I should demonstrate how to do this purely with CSS sometime, though it's awful hacky to do it that way. And it's going to be specific to one theme, and require jumping through hoops to get right.

You could just have an image in the board description though, far less messy, far more usable.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Grammy

  • Full Member
  • ***
  • Posts: 423
  • Gender: Female
  • Tire Kicker
Re: Will it wreak havoc to use an image here?
« Reply #8 on: July 08, 2016, 02:07:18 PM »
I should demonstrate how to do this purely with CSS sometime, though it's awful hacky to do it that way. And it's going to be specific to one theme, and require jumping through hoops to get right.

You could just have an image in the board description though, far less messy, far more usable.

I long for that "Someday"!   :D

Well, I play around with themes, but my production forum will always be default.  I thought about CSS but my issue is that I only wanted the first board to be different.  It's the "Come Here All You New People And Learn How To Work This Thing" board and I wanted to tart it up a bit so that the newbies would be drawn to it.   But I couldn't wrap my head around making CSS affect only that one board.  It would seem I would still need to put some sort of HTML into the title to at least assign it to a class, so I hit a snag, there.  I didn't like the image in the description but, hey, if that's what I have to do, I'll concede.   :)

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,120
  • Gender: Male
    • Kindred-999 on GitHub
Re: Will it wreak havoc to use an image here?
« Reply #9 on: July 08, 2016, 02:16:21 PM »
#board_23 .info { background-image: url("yourimage.gif"); }
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 48,084
Re: Will it wreak havoc to use an image here?
« Reply #10 on: July 08, 2016, 02:16:50 PM »
I should demonstrate how to do this purely with CSS sometime, though it's awful hacky to do it that way. And it's going to be specific to one theme, and require jumping through hoops to get right.

You could just have an image in the board description though, far less messy, far more usable.

http://www.simplemachines.org/community/index.php?topic=539000.0 somewhat has been done already, although here it is the description not the title.

Offline Grammy

  • Full Member
  • ***
  • Posts: 423
  • Gender: Female
  • Tire Kicker
Re: Will it wreak havoc to use an image here?
« Reply #11 on: July 08, 2016, 02:19:50 PM »
.board_23 #info { background-image: url("yourimage.gif"); }

Wow, thanks for that, Kindred!   :D



http://www.simplemachines.org/community/index.php?topic=539000.0 somewhat has been done already, although here it is the description not the title.

Thanks, I'll give that a read.   :)

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,055
    • Arantor on GitHub
Re: Will it wreak havoc to use an image here?
« Reply #12 on: July 08, 2016, 02:20:33 PM »
#board_23 .info { background-image: url("yourimage.gif"); }

I assumed the OP wanted to replace the board name out, not leave the text in, which requires manipulating the link specifically, which is all kinds of evil.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Grammy

  • Full Member
  • ***
  • Posts: 423
  • Gender: Female
  • Tire Kicker
Re: Will it wreak havoc to use an image here?
« Reply #13 on: July 08, 2016, 03:06:24 PM »

I assumed the OP wanted to replace the board name out, not leave the text in, which requires manipulating the link specifically, which is all kinds of evil.


Well, that would be ideal...    I just didn't know how the database would react if I didn't have some sort of text in the title field. 

Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 48,084
Re: Will it wreak havoc to use an image here?
« Reply #14 on: July 08, 2016, 03:11:56 PM »
Well, that would be ideal...    I just didn't know how the database would react if I didn't have some sort of text in the title field. 

it would make it hard to move topics to a board without a title/name. using CSS to change it would not change the fact that you need a name in that field.

Offline Grammy

  • Full Member
  • ***
  • Posts: 423
  • Gender: Female
  • Tire Kicker
Re: Will it wreak havoc to use an image here?
« Reply #15 on: July 08, 2016, 03:18:58 PM »
it would make it hard to move topics to a board without a title/name. using CSS to change it would not change the fact that you need a name in that field.

That's true.  Plus, I assumed I'd need to be able to assign some sort of class to that board in order for the CSS to take affect, so HTML seems unavoidable.  If not, that'd be great and keeping text in the field would be fine.  I just want to keep the database happy.   :)

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,120
  • Gender: Male
    • Kindred-999 on GitHub
Re: Will it wreak havoc to use an image here?
« Reply #16 on: July 08, 2016, 03:38:06 PM »
Code: [Select]
#board_23 .info a {
    background-image: url("yourimage.gif") no-repeat;
    width: 0;
    height:##px; //where ## is the image height
    padding-left: ##px; // where ## is the exact image width
    color: transparent;
    display: inline-block;
    overflow: hidden;
}

not fully tested, but seems to work
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 48,084
Re: Will it wreak havoc to use an image here?
« Reply #17 on: July 08, 2016, 03:59:42 PM »
this would also work given the browser is css3 compatible


Code: [Select]
a[href*="http://www.simplemachines.org/community/index.php?board=147.0"]{content: url("http://avatars.simplemachinesweb.com/smf/avatar_1261_1459591346.png");}
first URL is the url to the board, second is the URL to the image to replace the name with.

with my custom css for this site, this what the change looks like
replacing the board name for SMF 2.0.x Support with kindred's avatar.

that will also replace it in the linktree etc where that URL is found. does not effect where the name of the board is seen in other places like when moving topics.

Offline Grammy

  • Full Member
  • ***
  • Posts: 423
  • Gender: Female
  • Tire Kicker
Re: Will it wreak havoc to use an image here?
« Reply #18 on: July 08, 2016, 04:01:54 PM »
Code: [Select]
#board_23 .info a {
    background-image: url("yourimage.gif") no-repeat;
    width: 0;
    height:##px; //where ## is the image height
    padding-left: ##px; // where ## is the exact image width
    color: transparent;
    display: inline-block;
    overflow: hidden;
}

not fully tested, but seems to work


Aha!  Here is it with pure CSS and leaving text in the title field to play nice with the database!  I changed the image to be a blank sign, so that the text would ride on top of it.
 
(I omitted a description.  Is that necessary?)


Offline Grammy

  • Full Member
  • ***
  • Posts: 423
  • Gender: Female
  • Tire Kicker
Re: Will it wreak havoc to use an image here?
« Reply #19 on: July 08, 2016, 04:12:04 PM »
this would also work given the browser is css3 compatible


Code: [Select]
a[href*="http://www.simplemachines.org/community/index.php?board=147.0"]{content: url("http://avatars.simplemachinesweb.com/smf/avatar_1261_1459591346.png");}

CSS is fascinating stuff!   :D