Advertisement:

Author Topic: Modding SMF a bit to add/change some things??  (Read 2224 times)

Offline newbi462

  • Newbie
  • *
  • Posts: 7
Modding SMF a bit to add/change some things??
« on: February 26, 2012, 06:20:50 PM »
OK, I would basicaly like to mod SMF somewhat...

nothing to major, basically just want to change the doc type to HTML5 instead of XHTML 1.0 Transitional and make the needed changes to code base to be full validation compliant.

Also want to mod the way the CSS sheet include is generated so I can incorporate features the rest of my site uses like changing the style sheet based on test criteria...

I can write the CSS style sheets to use by just going though the form code, but honestly having a bit of trouble finding the files that generate this stuff.

Wondering if some one can help point me in the right direction? to the right files that control the elements HEAD and prehead section of SMF?

...

Also need to modify the content of \<div id="main_menu"\> to include other things from my site...

....

And the \<div id="header"\> to change the integration a bit.

.....

Good thing is this is all open source so as long ans someone can help me find the files it should be no big deal to get this done... but finding them seems to be a bit difficult, so hoping some one who knows what files they are can give me a hand in pointing me in the correct direction.

Thanks in advance
« Last Edit: February 26, 2012, 06:45:27 PM by newbi462 »

Offline Ricky.

  • Customizer
  • SMF Hero
  • *
  • Posts: 4,026
    • Indian Linux Forums
Re: Modding SMF a bit to add/change some things??
« Reply #1 on: February 27, 2012, 01:15:42 AM »
You can start with Themes/default/index.template.php and Themes/default/css/index.css .

If you are using some other theme then replace 'default' with theme name or the folder used by theme, this you can see in Admin --> Configuration --> current theme, there you can check its path.

Start with two above mentioned files, hopefully you will get all you are looking for.

Good Luck!

Offline newbi462

  • Newbie
  • *
  • Posts: 7
Re: Modding SMF a bit to add/change some things??
« Reply #2 on: February 27, 2012, 03:18:07 AM »
Thank You

Themes/default/index.template.php

Seems to be the file I was looking for. Will start on the mods and see if it is the only one. I needed but seems to have the full HTML generation, and that is what I need to regroup what areas are in what areas and add my dynamic generation scripts to the way that code gets output. Basically on my site whole sections go away and what files drive them change depending on how you access it. And that is not a feature of stock SMF where you have 3-6 themes and what not. Hopefully after I get this built in there is a way to push the mod up stream so it can be built in to the GUI for other users who want the same type of config.

Buy will probably take me a bit to play with this to get it fully right.

Again thank you.

Offline newbi462

  • Newbie
  • *
  • Posts: 7
Re: Modding SMF a bit to add/change some things??
« Reply #3 on: February 27, 2012, 03:55:50 AM »
um one bit I think I need one more file for

<div id="main_menu">

$button['title'] I am not seeing the main $button funtion is this calling a table or a php file? either way which one if any one knows as having 2 home buttons is just confusing for people

I try modifying :
'title' => $txt['home'],
line 3894 of the /Sources/Subs.php file but all that changes is the buttion/link becomes blank

So it seems it needs to me changed somewhere else
« Last Edit: February 27, 2012, 04:15:41 AM by newbi462 »

Offline тнє נя.

  • Semi-Newbie
  • *
  • Posts: 66
Re: Modding SMF a bit to add/change some things??
« Reply #4 on: February 29, 2012, 02:07:42 PM »
Hello newbi462!

SMF utilizes a language string array ($txt) for language strings, so they are easy to modify, and even easier to translate so SMF can be distributed in many different languages rather than using inline text-strings.

$txt['home'] is a text-string variable defined in ~./Themes/default/languages/index.english.php, assuming you're using English, and not some other language, or UTF-8, even. You can modify the output of $txt['home'] in that file, it'll look like $txt['home'] = 'Home'; which means output "Home" whenever $txt['home'] is called in the PHP, in this case, it's used for the 'home' button title variable.

Or you can just modify the string itself in Subs.php, line 3894 (as you said) could be changed to something like: 'title' => 'This is the new title', making it a string, rather than a variable.

Offline newbi462

  • Newbie
  • *
  • Posts: 7
Re: Modding SMF a bit to add/change some things??
« Reply #5 on: March 02, 2012, 01:44:05 AM »
Um where would the array be so I can change it properly, as when I try and do the to string like that the array still takes over. So instead of worry about changing it every where would be better to just change the source array that way I know it will work right on all pages, and like you say can all get all languages

Offline тнє נя.

  • Semi-Newbie
  • *
  • Posts: 66
Re: Modding SMF a bit to add/change some things??
« Reply #6 on: March 02, 2012, 08:59:09 AM »
Read my post again. Start of the second paragraph.