Advertisement:

Author Topic: Can boards have different colors?  (Read 1606 times)

Online drewactual

  • Jr. Member
  • **
  • Posts: 227
    • College Football Fan Site CFB51
Re: Can boards have different colors?
« Reply #20 on: April 01, 2018, 10:32:30 PM »
I do.. And I own both smfhacks and smfpacks ad handler... But neither suite my needs, and both argue with php7.  I dont need anything that heavy, quite frankly.   Theyre both good in different ways and I'm certain I'll use them on other ventures, but speed, clean, and heavy traffic are my concerns on the page I ised as an example.  This little script is a champ for that.
https://www.cfb51.com is a College Football Fan Site, Store, and Publisher, launched in July of 2017

Offline Gwenwyfar

  • Customizer
  • Sophist Member
  • *
  • Posts: 1,015
  • Gender: Female
    • Gwenwyfar on GitHub
Re: Can boards have different colors?
« Reply #21 on: April 01, 2018, 10:36:35 PM »
butch's solution is good, 2.1 already does that by default. But you'll need to use the right variable. I can take a look at it later if no one else does.

Offline Segnali

  • Jr. Member
  • **
  • Posts: 151
  • Gender: Male
    • Investire in Azioni
Re: Can boards have different colors?
« Reply #22 on: April 02, 2018, 12:52:19 AM »
butch's solution is good, 2.1 already does that by default. But you'll need to use the right variable. I can take a look at it later if no one else does.

I am stuck at SMF 2.0.5

If I try to upgrade I get errors and after all the mods I added, I really don't want to mess with it.

Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 48,953
Re: Can boards have different colors?
« Reply #23 on: April 02, 2018, 05:06:45 AM »
if you are still running 2.0.5, you are open to possibly being hacked. you really need to take time to upgrade to 2.0.15 for security and php compatibility.

Offline Segnali

  • Jr. Member
  • **
  • Posts: 151
  • Gender: Male
    • Investire in Azioni
Re: Can boards have different colors?
« Reply #24 on: April 07, 2018, 04:23:30 AM »
if you are still running 2.0.5, you are open to possibly being hacked. you really need to take time to upgrade to 2.0.15 for security and php compatibility.

I backup once a week. Being hacked cannot be 100% prevented even by running NASA software...

I just need butch's solution to work and it doesn't on my forum  :-\

Online Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,836
  • Gender: Male
    • Kindred-999 on GitHub
Re: Can boards have different colors?
« Reply #25 on: April 07, 2018, 09:28:57 AM »
and yet... by running a version 10 releases behind, you are pruposefully exposing your site and your users to potential hack/breaches.

You need to update ASAP
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 Steve

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 4,214
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: Can boards have different colors?
« Reply #26 on: April 07, 2018, 10:08:48 AM »
Segnali, listen to the man. Why make it easier for hackers?
Online Manual

Please do not PM me for support.

Offline butch2k

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
    • @butch2k on Twitter
    • Planète Roliste
Re: Can boards have different colors?
« Reply #27 on: April 07, 2018, 10:23:25 AM »
Could you post the index.template.php of your current theme ?

Offline Segnali

  • Jr. Member
  • **
  • Posts: 151
  • Gender: Male
    • Investire in Azioni
Re: Can boards have different colors?
« Reply #28 on: April 08, 2018, 04:57:56 AM »
Segnali, listen to the man. Why make it easier for hackers?

alright I'll do it ASAP.

P.S. I love your avatar  :)

Offline Segnali

  • Jr. Member
  • **
  • Posts: 151
  • Gender: Male
    • Investire in Azioni
Re: Can boards have different colors?
« Reply #29 on: April 08, 2018, 04:59:00 AM »
Could you post the index.template.php of your current theme ?

sure, here it is, thank you

Offline butch2k

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
    • @butch2k on Twitter
    • Planète Roliste
Re: Can boards have different colors?
« Reply #30 on: April 08, 2018, 06:58:58 AM »
Could you try modifying your css like this:

Code: [Select]
.board_94{
background: #c25 url(../images/theme/backdrop.png) repeat-x;
}
.board_106{
background: #ddd url(../images/theme/backdrop.png) repeat-x;
}
if you need the backdrop image.

else
Code: [Select]
.board_94{
background: #c25;
}
.board_106{
background: #ddd;
}

Offline Segnali

  • Jr. Member
  • **
  • Posts: 151
  • Gender: Male
    • Investire in Azioni
Re: Can boards have different colors?
« Reply #31 on: April 12, 2018, 10:03:24 AM »
what do you mean by backdrop image? sorry English is not my first language.

Thank you

Offline Segnali

  • Jr. Member
  • **
  • Posts: 151
  • Gender: Male
    • Investire in Azioni
Re: Can boards have different colors?
« Reply #32 on: April 12, 2018, 12:15:17 PM »

Code: [Select]
.board_94{
background: #c25;
}
.board_106{
background: #ddd;
}

tried the latter with color #0C090A for board #106 but did not work, nor worked #c25 for board #94  :-\

Online drewactual

  • Jr. Member
  • **
  • Posts: 227
    • College Football Fan Site CFB51
Re: Can boards have different colors?
« Reply #33 on: April 12, 2018, 03:14:47 PM »
humor me?
in your index.template, do:

before:
Code: [Select]
echo '
</head>

add:
Code: [Select]
//board color adjustment script
if(( isset($_REQUEST['board']) && $_REQUEST['board'] == '94' )  || ( isset($board) && $board == '94' )) {
  echo '<style> body\{background:#c25\}</style>'; }
if(( isset($_REQUEST['board']) && $_REQUEST['board'] == '106' ) || ( isset($board) && $board == '106' )) {
  echo '<style>body\{background:#ddd\}</style>'; }
//end board color adjustment script

lose the css adjustments...

if you need/want to change colors on more boards, simply copy/paste one of the two lines above and change the board number and the color code... it's really about that simple. 

i don't have means to test it, but this or something very close should do the trick you seek.  the '\' prior to the '{' or '}' is required, i do think, due to it having a specific purpose within php... if this doesn't do what you need, no harm no foul, remove it and go with the CSS once you iron it out... don't get me wrong, i love css and what it can do- but there is little comparison of functionality to just code it in... 
https://www.cfb51.com is a College Football Fan Site, Store, and Publisher, launched in July of 2017

Offline butch2k

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
    • @butch2k on Twitter
    • Planète Roliste
Re: Can boards have different colors?
« Reply #34 on: April 12, 2018, 05:04:34 PM »
 Segnali is it possible to get a link to your board ? I need to have a look to understand what's going on.

Offline Segnali

  • Jr. Member
  • **
  • Posts: 151
  • Gender: Male
    • Investire in Azioni
Re: Can boards have different colors?
« Reply #35 on: April 15, 2018, 05:41:54 AM »
Segnali is it possible to get a link to your board ? I need to have a look to understand what's going on.

I created a copy on a test site so we can play with the copy.

http://www.evotrading.it/forum/index.php

The boards # in the css files have been changed in the test copy because the others are for private boards.

New numbers are 98 & 103

Thank you

P.S. I know I need to update the forum software so I will get on this week starting from that copy as well.
« Last Edit: April 15, 2018, 06:23:16 AM by Segnali »

Offline Gwenwyfar

  • Customizer
  • Sophist Member
  • *
  • Posts: 1,015
  • Gender: Female
    • Gwenwyfar on GitHub
Re: Can boards have different colors?
« Reply #36 on: April 16, 2018, 06:53:27 AM »
You will have to edit your index.template to fix the variable you are using, change:

Code: [Select]
echo $context['html_headers'];

global $board;
echo '
</head>
<body class="'.(isset($board)?"board_".$board:"").'">';

to

Code: [Select]
echo $context['html_headers'];

echo '
</head>
<body', (!empty($context['current_board']) ? ' class="board_'. $context['current_board'] .'"' : ''),'>';

Offline butch2k

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
    • @butch2k on Twitter
    • Planète Roliste
Re: Can boards have different colors?
« Reply #37 on: April 17, 2018, 02:40:31 PM »
Yes it should work, $board works on my forum probably because it is set by simpleportal at some previous point which might not be the case on pure SMF.