Advertisement:

Author Topic: main_block.png  (Read 5748 times)

Offline MovedGoalPosts

  • Jr. Member
  • **
  • Posts: 248
    • nthwgaming
main_block.png
« on: May 07, 2012, 11:51:16 AM »
So I want to change the colour schemes to my default curve forum, probably with a few other layout changes too.

From browsing the index.css file I can see there are numerous things I can change for colours of fonts, backgrounds.  But many of these don't seem to change because of the linked file main_block.png.  Opening that picture just seems to be a load of different shade colours that influence the curve skin.

But what parts of main_block.png are used by what part of the css styles.  It all looks a bit random too me?

If I remove main_block.png, amongst other stuff, the curved corners to most of the SMF blocks disappear.  But the main block.png file seems to be a series of rows, not rounded shapes, so how does that work?

Offline Jade Elizabeth

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 11,167
  • Gender: Female
  • Keep your enemies close and your friends closer ;)
    • @BunnyRabbitSex on Twitter
    • BunnyRabbitSex
Re: main_block.png
« Reply #1 on: May 07, 2012, 11:53:35 AM »
The way I figure it out is to colour each one a different colour, or make a new layer/copy and change the hues....then you get to see where the images end too :).
Once proud Documentation Writer and Help Squad Leader
I'm for HIRE! | Check out my Fiverr Jobs! | Let's play games on OMGPOP together!


Need More Posts?

Quote
[12:13am] <%Jade> link me
[12:14am] <+orstio> <a href="Jade">link</a>


Offline MovedGoalPosts

  • Jr. Member
  • **
  • Posts: 248
    • nthwgaming
Re: main_block.png
« Reply #2 on: May 07, 2012, 12:34:37 PM »
Thanks, I can see this is not going to be easy :(

Offline The Craw

  • Beta Tester
  • Jr. Member
  • *
  • Posts: 385
  • Gender: Male
    • Chinese Raundry
Re: main_block.png
« Reply #3 on: May 07, 2012, 01:18:46 PM »
It's easier than you think. The bars in the image are used as backgrounds for the bars and containers in your forum. As Jade suggested, I would color each one differently to see what they do.
http://chineseraundry.com/

Cool people don't have to brag. If what they're doing is really all that cool, others will see it for what it is without the person dancing around, shouting "Look at how AWESOME I AM!"

Having a good IDE doesn't make you a good programmer, any more than having Photoshop makes you a good artist, or sitting in your garage makes you a Ferrari. People make good tools, but tools don't make good people. :P

Offline MovedGoalPosts

  • Jr. Member
  • **
  • Posts: 248
    • nthwgaming
Re: main_block.png
« Reply #4 on: May 07, 2012, 01:43:35 PM »
So I'm trying to change stuff using GIMP (Can't afford the rip off of photoshop).  I'm probably not using GIMP correctly (latest 2.8 version), but if I manage to open and select one colour strip or area inevitably that is selecting a lot of the rest of the image too.  As a result I can't change individual parts to find out what they might affect.

At this rate I can see my having to create individual images for each linked file in the css :(


Offline Deezel

  • Jr. Member
  • **
  • Posts: 202
  • Gender: Male
  • It Is What It Is
    • Owner/Admin
Re: main_block.png
« Reply #6 on: May 07, 2012, 02:19:01 PM »
if you still need help after checking out ApplianceJunk's post let me know.

Offline MovedGoalPosts

  • Jr. Member
  • **
  • Posts: 248
    • nthwgaming
Re: main_block.png
« Reply #7 on: May 07, 2012, 02:29:12 PM »
Thanks I have looked at Colorize it, but that doesn't seem to be precise enough.  I don't just want to change one colour but am wanting to reskin with some subtle differences between the different areas of the board, i.e table borders, alternating post and poster backgrounds, etc.  I did have a theme I'm trying to work with and build from based on my older vbulletin forum http://web.archive.org/web/20100531060737/http://www.nthwgaming.co.uk/

I suspect I'm coming across as a numpty, but I'm sure it should be simple, I just can't get my head around how the main_block thing is actually called by the forum so that one image can create such a large number of effects.  Simply adding or changing background colors to the various css elements doens't always change the forum appearance as the main_block.png takes precedence.

Online Old Fossil

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 9,460
  • Gender: Male
  • Fussy Old Sod
    • @mkcommforum on Twitter
Re: main_block.png
« Reply #8 on: May 07, 2012, 02:30:25 PM »
if you still need help after checking out ApplianceJunk's post let me know.
My Forum
Simple Portal Beta Tester
 Mod Emulate
Forum Themes
My Forums Broken Fix

PMs for support will be returned with dynamite attached

Offline Deezel

  • Jr. Member
  • **
  • Posts: 202
  • Gender: Male
  • It Is What It Is
    • Owner/Admin
Re: main_block.png
« Reply #9 on: May 07, 2012, 02:38:01 PM »
have you considered trying one of the many other themes available as opposed to the curve theme? Just curious...
Many of the themes may be easier to change to look more like your old vB skin you mentioned.

Offline MovedGoalPosts

  • Jr. Member
  • **
  • Posts: 248
    • nthwgaming
Re: main_block.png
« Reply #10 on: May 07, 2012, 04:05:12 PM »
Yes I have looked around and tried out a couple of other themes.  But again it comes back to issues with this image file when I wish to make some modifications.

I'm coming to a conclusion that I simply deleted the block and accept my forum will have square edges to all it's corners.  That way I can edit using the css alone.

It just strikes me as really odd that one image can do so much.  Surely specific named images dealing with specific parts would have been so much easier to identify and modify.

Offline The Craw

  • Beta Tester
  • Jr. Member
  • *
  • Posts: 385
  • Gender: Male
    • Chinese Raundry
Re: main_block.png
« Reply #11 on: May 07, 2012, 06:03:21 PM »
SMF uses CSS image sprites to select specific areas of that image. The reason for this is that it's slightly faster to load one image file and use it over and over than to load several different images individually. You can change the style of SMF's cat_bars and containers in your theme's index.css file.
http://chineseraundry.com/

Cool people don't have to brag. If what they're doing is really all that cool, others will see it for what it is without the person dancing around, shouting "Look at how AWESOME I AM!"

Having a good IDE doesn't make you a good programmer, any more than having Photoshop makes you a good artist, or sitting in your garage makes you a Ferrari. People make good tools, but tools don't make good people. :P

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 22,046
  • Master of BBC Abuse
Re: main_block.png
« Reply #12 on: May 07, 2012, 06:56:19 PM »
I'm coming to a conclusion that I simply deleted the block and accept my forum will have square edges to all it's corners.  That way I can edit using the css alone.

You can set rounded corners by using css3 border-radius if you're not worried about the corners being square in IE8 or lower. We'll be using this approach in future releases.


Quote
It just strikes me as really odd that one image can do so much.  Surely specific named images dealing with specific parts would have been so much easier to identify and modify.

Not really. It's quite simple once you get your head around it, and it does give performance advantages. Take this:

Code: [Select]
.catbg, .catbg2, tr.catbg td, tr.catbg2 td, tr.catbg th, tr.catbg2 th
{
color: #fff;
font-family: arial, helvetica, sans-serif;
font-size: 1.1em;
font-weight: bold;
background: #a7b9cd url(../images/theme/main_block.png) no-repeat -10px -280px;
}

That's for the darker blue header bars that have square ends. These appear in places like some tables, etc. If you look at the image 280px from the top, you'll see that darker blue bar. That is the part of the image that shows, with the rest being clipped by the edges of the div or tr. The negative X-axis positioning of 10px clips the end of the bar, which of course has the rounded corners on it. Elements that do have rounded corners (like the first_th and last_th table headers) will use the same Y-axis positioning but use 0 or 100% for X-axis positioning.
"My idea of heaven consists of all the things I would go to Hell for."

I need another coding language like I need tertiary syphilis.

Antechinus modzRantyheinous themez - PSD pack for 2.0.x default theme

Online Old Fossil

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 9,460
  • Gender: Male
  • Fussy Old Sod
    • @mkcommforum on Twitter
Re: main_block.png
« Reply #13 on: May 07, 2012, 07:06:30 PM »
@Ant

Is there anywhere where a theme how to can be found on the forum?

preferably technobabble free.
My Forum
Simple Portal Beta Tester
 Mod Emulate
Forum Themes
My Forums Broken Fix

PMs for support will be returned with dynamite attached

Offline MovedGoalPosts

  • Jr. Member
  • **
  • Posts: 248
    • nthwgaming
Re: main_block.png
« Reply #14 on: May 07, 2012, 07:28:07 PM »
You can set rounded corners by using css3 border-radius if you're not worried about the corners being square in IE8 or lower. We'll be using this approach in future releases.
  That will make sense for the future, but we are stuck with the present as computers are upgraded.  At present I suspect too many people have older browsers that they won't or don't know how to update.  Even myself from my workplace I have to use IE8 as IE has to be used for active-x compatibility and the PC is stuck on Windows XP until replacement.


Quote
It just strikes me as really odd that one image can do so much.  Surely specific named images dealing with specific parts would have been so much easier to identify and modify.

Not really. It's quite simple once you get your head around it, and it does give performance advantages. Take this:

Code: [Select]
.catbg, .catbg2, tr.catbg td, tr.catbg2 td, tr.catbg th, tr.catbg2 th
{
color: #fff;
font-family: arial, helvetica, sans-serif;
font-size: 1.1em;
font-weight: bold;
background: #a7b9cd url(../images/theme/main_block.png) no-repeat -10px -280px;
}

That's for the darker blue header bars that have square ends. These appear in places like some tables, etc. If you look at the image 280px from the top, you'll see that darker blue bar. That is the part of the image that shows, with the rest being clipped by the edges of the div or tr. The negative X-axis positioning of 10px clips the end of the bar, which of course has the rounded corners on it. Elements that do have rounded corners (like the first_th and last_th table headers) will use the same Y-axis positioning but use 0 or 100% for X-axis positioning.

Ah thanks, now a bit of a glimmer of hope in my befuddled brain.  The pixel numbers are actually identifying the bit of the image used.  So the challenge now is identifying the pixel space and getting GIMP to edit just the specfic bits.

Offline MovedGoalPosts

  • Jr. Member
  • **
  • Posts: 248
    • nthwgaming
Re: main_block.png
« Reply #15 on: May 07, 2012, 07:32:46 PM »
SMF uses CSS image sprites to select specific areas of that image. The reason for this is that it's slightly faster to load one image file and use it over and over than to load several different images individually. You can change the style of SMF's cat_bars and containers in your theme's index.css file.

Eureka.  I was not aware of the css image sprites terminology.  With that google has become useful to work out what is actually occuring under the hood.

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 22,046
  • Master of BBC Abuse
Re: main_block.png
« Reply #16 on: May 07, 2012, 07:33:34 PM »
@Ant

Is there anywhere where a theme how to can be found on the forum?

preferably technobabble free.

It's code. That means technobabble, to some extent. :)

The sprites aren't hard to understand if you understand how css positioning works. The numbers in px or % are used to set X-axis and Y-axis positioning. In the case of single images for each bit, those numbers are usually 0 or 100%. In the case of sprites (compound images) they can be set to any required value.

You can also set them to any required value for single images if you want to, for instance if you would rather tweak the position of an icon via css instead of making a new image, but it's not often done in practice.

If you want to do theming you really need to learn at least basic css anyway. There's no way around that. In fact, with the use of non-tabular layout in large parts of 2.0 you really need to know a fair amount of css if you want to change anything substantial.

There are basic theme tutorials but I can't recall how detailed they are or where they are. Not to boast excessively, but it's been quite a while since I needed one so I haven't bothered looking.
"My idea of heaven consists of all the things I would go to Hell for."

I need another coding language like I need tertiary syphilis.

Antechinus modzRantyheinous themez - PSD pack for 2.0.x default theme

Offline MovedGoalPosts

  • Jr. Member
  • **
  • Posts: 248
    • nthwgaming
Re: main_block.png
« Reply #17 on: May 07, 2012, 07:40:39 PM »
Thanks all.  My limited understanding of css had extended to font background positioning images and stuff, but the concept of sprites was new.  That's what happens when you blunder around by trial and error picking things up as you go.  It all makes sense once pointed in the right direction :)

Online Old Fossil

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 9,460
  • Gender: Male
  • Fussy Old Sod
    • @mkcommforum on Twitter
Re: main_block.png
« Reply #18 on: May 07, 2012, 07:43:17 PM »
Quote
It all makes sense once pointed in the right direction

If you still have any hair left.

 :D
My Forum
Simple Portal Beta Tester
 Mod Emulate
Forum Themes
My Forums Broken Fix

PMs for support will be returned with dynamite attached

Offline MovedGoalPosts

  • Jr. Member
  • **
  • Posts: 248
    • nthwgaming
Re: main_block.png
« Reply #19 on: May 07, 2012, 07:44:51 PM »
Quote
It all makes sense once pointed in the right direction

If you still have any hair left.

 :D

Lost it years ago :(