Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: Deezel on February 08, 2011, 08:56:17 AM

Title: Putting section back in admin
Post by: Deezel on February 08, 2011, 08:56:17 AM
Hi guys,
I want to add the section attached back into a custom theme. Any one know what i need to add, and what file to add it to?
SMF 2.0 RC4
Thanks in advance.
Deezel.
Title: Re: Putting section back in admin
Post by: Joker™ on February 08, 2011, 10:20:28 AM
Thats a fairly easy job, but before giving you the code I would like to know which theme are you using as even after creating the those columns your theme might not be able to utilize them.
Title: Re: Putting section back in admin
Post by: Deezel on February 08, 2011, 11:41:24 AM
it's called Blue Line... it's a new theme by a friend of mine.
Here is a link to it at my site...... will remove link if not allowed.
hxxp://www.pixelmansion.com/index.php?action=downloads;sa=view;down=27
Title: Re: Putting section back in admin
Post by: Joker™ on February 08, 2011, 12:39:05 PM
So here we go (Make backup of all files listed below before modifying them)

We need these file

Themes\<theme you are using>\index.template.php
Themes\<theme you are using>\Settings.php
Themes\<theme you are using>\css\index.css


Now make these modifications

Themes\<theme you are using>\index.template.php
Find:
<div id="bodybg">';
echo '



Replace it with:
<div id="bodybg">';
echo !empty($settings['forum_width']) ? '
<div id="wrapper" style="width: ' . $settings['forum_width'] . '">' : '', '



Find:
echo '
<a href="'.$scripturl.'" title=""><span id="logo"></span></a>';



Replace it with:
echo '
<span id="logo"><a href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '</a></span>';




Themes\<theme you are using>\css\index.css

Find:#logo {
position: absolute;
top: 5em;
left: 1em;
display: block;
width: 500px;
height: 85px;
cursor: pointer;
background: url(../images/theme/logo.png) no-repeat;
}



Replace it with:
#logo {
position: absolute;
top: 5em;
left: 1em;
display: block;
width: 500px;
height: 85px;
cursor: pointer;
}



Themes\<theme you are using>\Settings.php

Find:
array(
'id' => 'smiley_sets_default',
'label' => $txt['smileys_default_set_for_theme'],
'options' => $context['smiley_sets'],
'type' => 'text',
),



Replace it with:
array(
'id' => 'header_logo_url',
'label' => $txt['header_logo_url'],
'description' => $txt['header_logo_url_desc'],
'type' => 'text',
),
array(
'id' => 'smiley_sets_default',
'label' => $txt['smileys_default_set_for_theme'],
'options' => $context['smiley_sets'],
'type' => 'text',
),
array(
'id' => 'forum_width',
'label' => $txt['forum_width'],
'description' => $txt['forum_width_desc'],
'type' => 'text',
'size' => 8,
),



There is one more field of site slogan, but your theme don't use it at all (in fact most of themes don't use it). That field is used for smf logo shown on the right side in default curve theme.

Do post your feedback here.
Title: Re: Putting section back in admin
Post by: Deezel on February 08, 2011, 12:47:20 PM
Thanks Joker, I will give it a go shortly and post back.
Title: Re: Putting section back in admin
Post by: Deezel on February 08, 2011, 02:52:43 PM
Worked like a charm sir... I thank you very much.
Title: Re: Putting section back in admin
Post by: Joker™ on February 08, 2011, 03:37:37 PM
Your welcome.
Title: Re: Putting section back in admin
Post by: Deezel on February 22, 2011, 03:44:01 PM
Hey Joker.... another one.
Everything i can figure out except the index.template.php
It doesn't have the sections you say to find within it.
attached for your viewing pleasure...lol.

Title: Re: Putting section back in admin
Post by: Joker™ on February 23, 2011, 05:42:54 AM
Quote from: deezel on February 08, 2011, 11:41:24 AM
hxxp://www.pixelmansion.com/index.php?action=downloads;sa=view;down=27
Can you update the link once again?
Title: Re: Putting section back in admin
Post by: Deezel on February 23, 2011, 08:32:26 AM
PM'd you the link, as this theme is not yet ready and we do not want it out in the public until completed. :-X
Title: Re: Putting section back in admin
Post by: Joker™ on February 23, 2011, 11:09:24 AM
Are you sure that this was the theme you have shown me earlier? As the theme I've seen before was color combination of dark blue and black and this one is having completely opposite color combinations.

See you post
Quote from: deezel on February 08, 2011, 11:41:24 AM
it's called Blue Line... it's a new theme by a friend of mine.

And now the theme link you have given me is have theme with different name.

Can you verify these things first that on which theme you want to work on then only I'll be able to help you properly ;).
Title: Re: Putting section back in admin
Post by: Deezel on February 23, 2011, 11:29:33 AM
My apologies mate  :-[ . The theme is called Redemption. All the info you gave me earlier works on the first theme i was doing but not on this new one.
Title: Re: Putting section back in admin
Post by: Joker™ on February 23, 2011, 11:39:59 AM
Quote from: deezel on February 23, 2011, 11:29:33 AM
My apologies mate  :-[ . The theme is called Redemption. All the info you gave me earlier works on the first theme i was doing but not on this new one.
Well tonight I'm bit busy, I'll post the edits here tomorrow morning.
Title: Re: Putting section back in admin
Post by: Deezel on February 23, 2011, 11:56:06 AM
Cheers man, and thanks a bunch!!!!
Title: Re: Putting section back in admin
Post by: Joker™ on February 24, 2011, 06:22:46 AM
Make backup of your files before editing them

Themes\<your theme>\index.template.php

Find:
<a href="'.$scripturl.'" title=""></a>


Replace it with:
<a href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '</a>



Find:
echo '
<div id="wrapper">



Replace it with:
echo !empty($settings['forum_width']) ? '
<div id="wrapper" style="width: ' . $settings['forum_width'] . '">' : '', '



In themes\<your theme>\css\index.css

Find:
#logo a {
position: absolute;
top: 5px;
/* right: 20px;  */
display: block;
width: 500px;
height: 80px;
cursor: pointer;
background: url(../images/theme/logo.png) no-repeat;
}



Replace it with:
#logo a {
position: absolute;
top: 5px;
/* right: 20px;  */
display: block;
width: 500px;
height: 80px;
cursor: pointer;
}



Just see the edits and you will make out how to implement these options in other themes also.
Title: Re: Putting section back in admin
Post by: Deezel on February 24, 2011, 08:23:24 AM
You da man.
Thanks for all your help Joker.
Title: Re: Putting section back in admin
Post by: Deezel on February 24, 2011, 08:42:11 AM
Okay, say i want to set the forum width as 70% by default, but still leaving the option for admin to change if they want to. Can this be done?
Title: Re: Putting section back in admin
Post by: Joker™ on February 24, 2011, 09:14:01 AM
See this code in your theme index.css

div#wrapper
{
width: 960px;
margin: 0 auto;
padding: 0;
}


in width make it

width: 70%;
Title: Re: Putting section back in admin
Post by: Deezel on May 05, 2011, 02:14:10 PM
I forgot to thank you once again Joker. You da man!!!!