Datahopa

General Category => General Discussion => Topic started by: sybershot on May 09, 2012, 21:15:11 PM

Title: smf and tiny portal header
Post by: sybershot on May 09, 2012, 21:15:11 PM
I'm hoping sometime this week or next to start changing the header, within smf and tiny portal.
I have a couple question though before I begin.

to change the header throughout smf and tiny portal, do I only have to make the change to the index.php?
also I want to change the word home to blog, within the headers menu, pretty much same question, do I only have to make the change within index.php?

I also tried to change the root folders name from forum to portal, but that through an error. It was a while ago when I tried, and Sorry did not mark down the error.
I would like to change the name of the folder from forum to portal or something similar, seeing that the home page is actually a blog not a forum. However I don't want to have to reinstall in-order to do this. Any suggestions I could try to accomplish this?

Title: Re: smf and tiny portal header
Post by: Freddy on May 09, 2012, 21:35:40 PM
You don't really want to be changing index.php if you mean the one in the forum root, the one that holds settings and such like.

Also you don't want to edit the default theme, because if bad goes to worse, then at least you would still be able to run the forum in some state.

If you want to customise it, then you should be looking at making a copy of the default theme and edit that.

The headers and such are in a theme's index.template.php file.

QuoteI also tried to change the root folders name from forum to portal

Yes that will screw things up because all the path names will be wrong.

Here's a tool that may help, though I have not done it myself for this particular problem.

http://wiki.simplemachines.org/smf/Repair_settings.php (http://wiki.simplemachines.org/smf/Repair_settings.php)

Try changing the folder name again and then drop that in the root (next to index.php in other words).

Then navigate to the repair_settings.php and you should be able to work out what to do from there.

At this stage, since you are really only beginning, it's probably just as easy to reinstall to the folder name you actually want it in.

TinyPortal needs no editing in itself; it will just use the templates of whatever theme you have selected to use.
Title: Re: smf and tiny portal header
Post by: Freddy on May 09, 2012, 21:47:18 PM
Just a little more info on creating your new theme, which will start out as a copy of the default...

You need to navigate like this :

admin->configuration->Themes and Layout

Scroll down and you will see something like this attached image.

Just drop the name of your new theme in there and hit install.

Then look in your forum folder and navigate to themes, you should then see a new folder/theme in there which you can alter to your hearts content.

[attachment deleted by admin]
Title: Re: smf and tiny portal header
Post by: Freddy on May 09, 2012, 21:54:13 PM
Quotealso I want to change the word home to blog

Sorry missed that part.  Yes this is pretty easy.  SMF uses a system of text strings that are defined in a separate file to the main template.  It's just a matter of finding the entry for 'home' to 'blog'.  I'll catch up with you on that, you have enough to do already :)
Title: Re: smf and tiny portal header
Post by: sybershot on May 09, 2012, 22:49:51 PM
Thanks Freddy for the wisdom, I was just going to mod the original theme. I'll heed your warning and make a theme from the original.
True I could start over, but I am not that familiar with phpmyadmin to re-install the database. I don't want to loose the posts placed within my forum by others. I guess I could live with the url as is, for I tried fix it tools in the past and if it messes up there is usually no way to revert back leaving only option to re-install.   << sorry for the run on sentence.
QuoteSorry missed that part.  Yes this is pretty easy.  SMF uses a system of text strings that are defined in a separate file to the main template.  It's just a matter of finding the entry for 'home' to 'blog'.  I'll catch up with you on that, you have enough to do already Smiley
No rush as I'm not sure if I can start this week or not. I probably will not be able to start till next week by the looks of things.
I have a pretty good idea of how I want the forum to look, I think it is going to be a daunting task though. To give a bit of insight of what I want to create is to use as little boxed content as possible, meaning no borders on all four sides. I would like to create an open type look. It will be a very fun project :D
Title: Re: smf and tiny portal header
Post by: Freddy on May 09, 2012, 23:09:15 PM
No problem, Data and me have a lot of experience with this set up so I think I can speak for him in saying - just ask.

Since you have some posts already, there is another option for you.  Install a second SMF to the folder of your choice.  Then export the existing forum database either in phpmyadmin (I prefer that) or from the SMF admin section.  Then wipe the database on this second/new forum and import the one you just saved.

And then use the repair_settings on the 'new' forum to finish things up.

When you export you would have to make sure you export data and structure.

Can get messy though, but there's nothing to lose really as if it didn't work then it's oh well you tried, not Oh my God what have I done.

But if you are new to phpmyadmin then you would probably settle for what you have.
Title: Re: smf and tiny portal header
Post by: sybershot on May 09, 2012, 23:21:18 PM
That's a very ingenious way to go about it  :thumbsup: :thumbsup: I might just have to give that a try :D
Title: Re: smf and tiny portal header
Post by: Data on May 09, 2012, 23:39:53 PM
To be fair I think Freddy is much more knowledgeable about this topic than I am, but if I can help at any time I will jump in.

Glad to see you haven't given up on SMF Syber.
Title: Re: smf and tiny portal header
Post by: sybershot on May 10, 2012, 14:05:30 PM
I have not given up, I think I was just overwhelmed the day I posted I was going to get rid of it. I also did not have a clear insight of how the total website was going to be. Still not clear atm either  :P I do have a couple Ideas up my sleeve, I have just have to fully think things through.



Title: Re: smf and tiny portal header
Post by: Freddy on May 10, 2012, 14:21:18 PM
Yes it all takes a lot of thought  :o

Going back to the 'home' button.

Assuming we want to proceed the non destructive way, and that my memory is working today, here is what you need to do.

1. Look in the Themes directory and then find the file at default->languages->index.english.php

The index.english.php holds a lot of the strings, but mainly it's where the one we are interested in lives.

2. Make a copy of index.english.php and drop it on your desktop or somewhere.

3. Open up this copy and scroll down to around line 92, or search the file for 'home'.

4. This is the line in question :

$txt['home'] = 'Home';

5. Pretty obviously you just need to redefine that how you want...blog I think it was...

$txt['home'] = 'Blog';

6. OK so now you have a customised language file and this needs to live in the new theme you will be customising.  Therefore find your new theme directory and I think there should be a 'languages' folder all ready for it - if not just make one (same directory structure as default).  Drop the new php language file in there and it will override the one that will still be in the default theme.

Note that this is basically the way to work when ever you want to override something in the default theme.  If SMF finds a file in your selected theme it will use that in preference to the matching file name in the default theme.  This saves a lot of effort because you only have to code things that are new.

That's the best way to go about it.  This way you will always know that any of your modifications will only be in your custom theme.
Title: Re: smf and tiny portal header
Post by: sybershot on May 10, 2012, 16:12:44 PM
Thanks again Freddy  :thumbsup: :thumbsup:

QuoteNote that this is basically the way to work when ever you want to override something in the default theme.  If SMF finds a file in your selected theme it will use that in preference to the matching file name in the default theme.  This saves a lot of effort because you only have to code things that are new.

That's sweet, It also takes a load of my fingers, The last forum I Themed I had to make changes to every file. took over 2 months of hard labor. my fingers still feel the pain from all the typing  :P