Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

PHP/XML Help

Well, here's the deal.  I have an smf forum, but I am not using the default template, so any mods I attempt to add that are meant to alter the template don't work.  Unfortunately, I am unfamiliar with PHP or XML, so I cannot edit it myself.

As such, there are two things that I need help with:

1) I need someone who can edit mods to work with the template I am using. (If you are willing to edit mods, please PM me.  Right now I need more help with the next point.)

2) I would greatly appreciate it if someone could show me how to add a nav button to the left of "help."  The nav button should display the image "faq.gif" and link to http://www.abyss.ulmb.com/faq.html.

Here's a link to my site: My site

Here is a link to the template that I am using: Template

The nav bar is located in index.template.php I believe.  I'm sorry, but that's all I could figure out on my own.  I tried to edit it myself, but I got a parse error.

Thanks in advance for any help you are willing to offer me!
 
The menu is the function template_menu() under index.template.php.  Find that.  Then find the 'help' button.  Copy all the stuff to do with the help button.  Search for 'help.gif'.  The second instance of that, change it to faq.gif.  This will give you the menu button.

As for mods, they should be template-independent; all the smf mods I've used have been at least.

What mods are you using?
 

___

Sponsor

I don't know how smf implements mods and templates, but the standard way to do it would be to fix up the template to support the mod, not vice-versa.  Most likely the mod expects to have a spot somewhere in the template from which it will be called to place itself.  Like, it might expect that there's a div called "monkeys_here" from which template_monkeys() is called, and it might hook into that.  So a standard template would have a spot that looks like this:
Code:
<div id="monkeys_here">
<?php echo template_monkeys(); ?>
</div>

and your template is lacking that particular container.  If you install the default template, you can find the name of the <div> or whatever container it's in by viewing the page source; then you just find the corrosponding <div> in the original template.php, copy and paste it into your template.php in an appropriate location and modify the template's css (do you know css?).

I don't know if that makes any sense at all, but I hope it sets you on the write path to hacking it all together.
 
Well, as it turns out, I am completely incapable of adding a simple button.  I actually just switched themes because the old one was not especially suited for what I'm trying to do.  Here's the new theme: http://custom.simplemachines.org/themes ... ?lemma=107

Anyway, I tried to do what you guys said, but it all ended in a parse error.  I them switched to the new theme above.  I tried to add a button the that, but failed miserably.  I could link to a different place, but when it came to making a button, I could only make duplicates (in appearance).

I know this is a request, but I learn from example.  Could someone please code a button that says "Donations" and link to www.paypal.com?&nbsp; Of course, you would need graphics matching the buttons already there, but they are fairly easy to make. 
Please tell me which folders the graphics should be in so that I know how to do it myself next time.

Thanks a lot.


EDIT: I searched the web and found a tutorial.  Apparently there are multiple files that need to be edited.  I'll try it again on, my own.
 
Sweet!  It works!  There was only one problem.  For some reason the nav option that I input was not appearing.  I spent about an hour trying to figure out why.  Typo.  That was it, a typo.  I accidently spelled "donations" as "dontations." 

Well, anyway, it works.
 

___

Sponsor

Typos, the bane of programmers everywhere.  One of the reasons I love PHP actually is that it's pretty intelligent about helping you narrow down syntax errors; in C on GCC compilers (at least in the mid 90s), you could spend an hour tracing back from the first time it noticed a problem till you actually found what was causing the error.  I remember particularly a piece of code where I missed a } about 1200 lines before GCC spit out an error.  Took me FOREVER to find it. : (  Anyway.  Grats :D
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top