Dynamic Systems Portal: Sphinx  |  Sphinx 1.1  |  Themes  |  Topic: Converting an SMF theme to Sphinx...
Pages: [1]   Go Down
Print
Author Topic: Converting an SMF theme to Sphinx...  (Read 15820 times)
Oldiesmann
Premium Member
*
Offline Offline

Posts: 80



« on: June 01, 2007, 01:07:16 PM »

Can someone give me some instructions for converting an existing SMF theme to Sphinx?

I have been looking into the possibility of adding a portal to my Archie Comics board. I was initially set on using TinyPortal, but now that I think about it, I think Sphinx would be a better option:

Guestbook
Built-in link management system (my users seem to like the idea of a links system)
More flexibility
Custom pages are separate from articles
Article submission page is based on the default post screen, so it would be more familiar to my users

The thing is, I don't want to lose the DilberMC theme that I'm currently using. If I can convert it to Sphinx, then I can keep the current theme while still using Sphinx.
Logged

The Oldiesmann

Luke
Administrator
*
Offline Offline

Posts: 633



WWW
« Reply #1 on: June 01, 2007, 02:37:26 PM »

// Looks at your current theme....

In a nutshell, all you truly need are 2 things. Block calls, where appropriate, and the dsp() function in the footer to convert any theme, plus the css and portal templates of course.

Here's where it would add to those:

Collapsible block areas, custom portal footer, additional bridges.

Every theme will be quite different, and each can have different approaches. So this would be a basic guideline, really.

Overall, though, one would need to look at several things first.

1) Where do I want blocks to be in this theme?

2) How should I modify, if need be, the current html layout to support this, and still remain cross browser compliant?

I won't lie, but the quickest method would be to use a table. Yes, it's dirty, and I personally hate tables for layouts.

But, by default, the main content of SMF is placed in one that is 100% in width. This could be modified to provide for a two or three column design, or what ever by simply adding in a cell (td) before and after the main cell where the changing content takes place.

By changing content, I mean what is controlled outside of the default main_above and main_below template functions. So, you would add a td in the above for left blocks, and one in below for right blocks.

Then you can put top and bottom blocks in a div right before the closing of main above, and right at the beginning of main below.


Then again, you could probably get away with just adding divs which float left and right of the forum output as well.

Individual design and layout will pretty much depend on the individual theme, and users preferences as to how and where they want to place their blocks.

Then again, here's another approach.

You could make a new template file, called portal.template.php .

In this file, you could have a portal_above, and portal_below function.

Modifying the theme's "theme_info.xml" file to look like this:
Code:
<layers>main,potal</layers>
<!-- Templates to load on startup.  Default is "index". -->
<templates>index,portal</templates>
<!-- Base this theme off another?  Default is blank, or no.  It could be "default". -->
<based-on></based-on>
</theme-info>

In your portal template, in the above function, you can add left blocks, and then top blocks. In the below function, add bottom blocks, and right blocks.

Then, after the right blocks, add in the dsp() function, and let the main_below finish out the page.


Or, you could make the portal layers/template come first, and move all the header stuff from main_above and footer stuff from main_below over to the portal above/below.

Then, of course, you have the collapsible stuff, and bridge checks if need be as well.

So, the decision is basically left up to the end user really, and how they want their site to look.

The bare minimum that is needed is the dsp() function in the footer, that's it. Of course you won't have blocks.

From there, you can modify the HTML as needed to support blocks, and then make the calls to the block area you want to call.

At a minimum, the block call needs to be (minus the php tags):
Code:
<?php
if (!empty($context['blocks']['left']) && is_array($context['blocks']['left'])) {
 // if there are left blocks to display, check for collapse and show/hide
echo Blocks('left');
}
?>


Then, of course, you will want blocks to match your theme. You may need to modify the block templates, but maybe not.

You will need to modify the css though, most likely.

To do this, you can open up the default/style_sphinx.css file, and depending on how you do your templates, either just copy this file to your modified theme (and add a call to it right after then call to style.css in the head of the documents html) or simply paste it in at the end of the style.css file. Which you do, is up to you. In Sphinx 1.1, we've split the files, so that there is a separation as to the portal specific css information so that users know what styles are portal specific, etc.

From there, if you need to modify a portal specific template, you can add just the templates you need to modify into your theme.

Also, as a note, you will need to copy over the images/articles and images/news files, to your new theme as well. There are a few in image/icons as well to be copied over. Off the top of my head I can think of edit_trash.png, edit.png, off.gif, and on.gif, but for some reason I think there might be one or two more.

A quick comparison of the dir contents of the theme being modified against the default theme should help. As each theme is different, situations and circumstances will vary.

I'm sure this is a lot to swallow at one time, but that's the basics of it.

To review,

- Add the dsp() function to the footer area.

- Edit html to support blocks, and call them from the desired spot.

- Add collapsible block area supporting code (look at the default theme for it), and the settings from the top of the default index.template for them.

- Tweak/modify css, and portal templates as needed.

- If needing bridge functions, check against the default index.template for where/how we call the bridge information.

Logged

I've been talking to the main computer... (and?)   It hates me.

"10 frames? Heh, that's for Quakers."

Oldiesmann
Premium Member
*
Offline Offline

Posts: 80



« Reply #2 on: June 01, 2007, 04:42:13 PM »

I just want the blocks to be displayed the way they are in the normal Sphinx theme.

Here's an example of Tinyportal using the DilberMC theme...

http://test.oldiesmann.us/archie/index.php

The only templates that DilberMC modifies are BoardIndex.template .php, index.template.php, MessageIndex.templa te.php and Settings.template.p hp.

The theme can be downloaded at http://custom.simplemachines.org/themes/index.php?lemma=80

The user info thing in the center of the page doesn't have to be there - I like what you guys have done with the user info, and there's plenty of room to do that in DilberMC, so moving it to the upper right-hand corner is always an option.
Logged

The Oldiesmann
Luke
Administrator
*
Offline Offline

Posts: 633



WWW
« Reply #3 on: June 01, 2007, 05:16:28 PM »

Pretty much then, based on what you're offering in comparison, would be adding a column to the left and right of the main forum output.

A td in the main_above, and one in the main_below, that would hold the left/right blocks, etc.

If you want to get a jump on it... check the premium downloads area. The theme you're referencing is pretty much just a re-styled SMF default, and there just happens to be a test theme in the premium area that simply adds the portal to the SMF default theme.

You could use that index.template, and you'd be pretty much good to go.

Granted, that doesn't help with other themes, but that would fix you up and get you started in the right direction. Add in some css tweaks, and you'll be good.
Logged

I've been talking to the main computer... (and?)   It hates me.

"10 frames? Heh, that's for Quakers."

Luke
Administrator
*
Offline Offline

Posts: 633



WWW
« Reply #4 on: June 01, 2007, 05:18:41 PM »

Let me rephrase that. It should at least get you started, and provide a close representation on what to add in for blocks, in terms of html and placement.

Logged

I've been talking to the main computer... (and?)   It hates me.

"10 frames? Heh, that's for Quakers."

Oldiesmann
Premium Member
*
Offline Offline

Posts: 80



« Reply #5 on: June 03, 2007, 03:53:29 PM »

So far so good... Still have some tweaking to do, but it looks nice Smiley

http://test.oldiesmann.us

(Note: the default light blue color is the only one that will work at the moment - I'll add stylesheets for the other colors once I get the default color working).
Logged

The Oldiesmann
Luke
Administrator
*
Offline Offline

Posts: 633



WWW
« Reply #6 on: June 03, 2007, 05:03:59 PM »

Definitely getting there. Cheesy

Themes are always a "work in progress"... Wink
Logged

I've been talking to the main computer... (and?)   It hates me.

"10 frames? Heh, that's for Quakers."


Oldiesmann
Premium Member
*
Offline Offline

Posts: 80



« Reply #7 on: June 03, 2007, 05:26:17 PM »

Yeah, after about an hour and a half of tweaking, I'm finally getting things to look the way I want them...

CSS changes:
Changed blockhead and blockcontent classes
Removed leftblock, centercontent and rightblock background color so everything will look nicer

Template changes:
Added "tborder" class to the leftblock and rightblock divs
Added padding to the block contents
Changed left- and rightblock header classes to titlebg
Changed left- and rightblock content classes to windowbg
Removed bottom menu

Still playing with the menu some. Trying to see if I can get the tab menu to look like the standard DilberMC menu. If not, I'll remove it and replace it with the standard SMF menu Smiley
Logged

The Oldiesmann
Luke
Administrator
*
Offline Offline

Posts: 633



WWW
« Reply #8 on: June 03, 2007, 06:49:04 PM »

Menu:

It's all about the menu templates. Cheesy
Logged

I've been talking to the main computer... (and?)   It hates me.

"10 frames? Heh, that's for Quakers."

Oldiesmann
Premium Member
*
Offline Offline

Posts: 80



« Reply #9 on: June 03, 2007, 08:14:15 PM »

Got the menu layout fixed...

Also fixed the portal copyright Wink
Logged

The Oldiesmann
Luke
Administrator
*
Offline Offline

Posts: 633



WWW
« Reply #10 on: June 03, 2007, 10:46:21 PM »

Now you're cookin with gas.
Logged

I've been talking to the main computer... (and?)   It hates me.

"10 frames? Heh, that's for Quakers."

Oldiesmann
Premium Member
*
Offline Offline

Posts: 80



« Reply #11 on: June 05, 2007, 03:27:17 PM »

I'm going to go ahead and use Sphinx since I got the theme issue out of the way.

Still working out some things related to the seo4smf mod, but I'm not planning to put the portal up until this weekend, so I've got time to take care of that Smiley
Logged

The Oldiesmann
Luke
Administrator
*
Offline Offline

Posts: 633



WWW
« Reply #12 on: June 05, 2007, 04:04:11 PM »

Sure is lookin pretty over there. Wink

/aside:
  Thankfully I've got a new keyboard coming this afternoon.
  All this copying and pasting in spaces is killing me!  LOL
Logged

I've been talking to the main computer... (and?)   It hates me.

"10 frames? Heh, that's for Quakers."

Quality dedicated servers, starting at only $75!

Oldiesmann
Premium Member
*
Offline Offline

Posts: 80



« Reply #13 on: June 05, 2007, 06:58:46 PM »

If you're on Windows... (note these are XP instructions): Start -> All Programs -> Accessories -> Accessibility

Click "On Screen Keyboard"

Wink

Hmmm... You must have the Akismet mod installed here. My post got flagged as spam Undecided
Logged

The Oldiesmann
Luke
Administrator
*
Offline Offline

Posts: 633



WWW
« Reply #14 on: June 05, 2007, 08:36:16 PM »

If you're on Windows...

You should know by now I'm windows (and virus, spyware, malware, adware, and trouble) free. Cheesy

I love my Mac, and won't accept it any other way.

Good ol' Uncle Steve sent me a brand new one overnight, without hassle. Cheesy

Working like a champ now. fast, comfy, works... and it's "perty" too. Wink


Hmmm... You must have the Akismet mod installed here. My post got flagged as spam Undecided

Yep, and thus far I'm not impressed with the mod, either.

It's flagging stuff that my blog wouldn't, and letting through stuff that would be blocked on my blog.

!impressed one bit.

Logged

I've been talking to the main computer... (and?)   It hates me.

"10 frames? Heh, that's for Quakers."

Oldiesmann
Premium Member
*
Offline Offline

Posts: 80



« Reply #15 on: June 07, 2007, 03:17:31 PM »

You should know by now I'm windows (and virus, spyware, malware, adware, and trouble) free. Cheesy

I love my Mac, and won't accept it any other way.

Good ol' Uncle Steve sent me a brand new one overnight, without hassle. Cheesy

Working like a champ now. fast, comfy, works... and it's "perty" too. Wink


Yep, and thus far I'm not impressed with the mod, either.

It's flagging stuff that my blog wouldn't, and letting through stuff that would be blocked on my blog.

!impressed one bit.



Nice Smiley

If I could afford one, I'd love to have one of those nice Intel-powered Macbooks.

I'm pretty sure there's a similar feature in Mac OS X, but I'd have to be sitting in front of a Mac to tell you how to do it as I don't use them much (we've got them at school, but I generally use Windows as that's what I'm more familiar with).
Logged

The Oldiesmann
Luke
Administrator
*
Offline Offline

Posts: 633



WWW
« Reply #16 on: June 07, 2007, 06:19:10 PM »

Well, I'll be ordering a new Macbook Pro here in the next couple of weeks. I'll let you know how it comes out. Wink

Anyway, it's a moot point now, since "Uncle Steve" happily shipped me a new one overnight (so it arrived Tuesday).

But yes, that's what I used to troubleshoot to make sure it wasn't on the machine side. However, using it was more annoying than pasting in spaces. I did remap my tab key to produce a space, but FF didn't recognize the remapped key at all.

Logged

I've been talking to the main computer... (and?)   It hates me.

"10 frames? Heh, that's for Quakers."

Oldiesmann
Premium Member
*
Offline Offline

Posts: 80



« Reply #17 on: June 08, 2007, 10:32:09 AM »

Well, I'll be ordering a new Macbook Pro here in the next couple of weeks. I'll let you know how it comes out. Wink

Anyway, it's a moot point now, since "Uncle Steve" happily shipped me a new one overnight (so it arrived Tuesday).

But yes, that's what I used to troubleshoot to make sure it wasn't on the machine side. However, using it was more annoying than pasting in spaces. I did remap my tab key to produce a space, but FF didn't recognize the remapped key at all.



Nice Smiley

Well, I'm off to begin my upgrade to Sphinx Smiley
Logged

The Oldiesmann
alextt
Newbie

Offline Offline

Posts: 1


« Reply #18 on: October 17, 2008, 05:31:51 AM »

Now you're cookin with gas.
why is gas? use solar.. Tongue
Logged
Pages: [1]   Go Up
Print
Dynamic Systems Portal: Sphinx  |  Sphinx 1.1  |  Themes  |  Topic: Converting an SMF theme to Sphinx...
Jump to: