Modding The Smf Default Theme

admin

Administrator
Staff member
I am learning SMF and would like to add links to the header section of the default (babylon) theme for SMF.<br /><br />I have the graphic I want but it's not a link. The link would take users back to the main site from the forum.<br /><br />For an example of what I am looking for, check out the top of this page. The TotalChoiceHosting graphic is a link to the main forum index. Below that is a link to the main hosting page.<br /><br />Perhaps you have a better idea on how I can accomplish this same thing with SMF?<br /><br />Thank You<!--content-->
Give me a moment, I'm digging through source files right now...<!--content-->
Alright, now this is assuming you know a bit about HTML and the like...<br /><br />Open "index.template.php" and find "<body>';"... Shortly below that is the section that begins the header at the top. Find where it starts "<img src=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"', $settings['images_url'], ", and add "<a href=yourlinkhere>" before and "</a>" after. That should take care of it for you. Let us know if that does the trick or not.<!--content-->
<!--quoteo(post=178547:date=May 10 2006, 12:04 AM:name=cajunman4life)--><div class='quotetop'>QUOTE(cajunman4life @ May 10 2006, 12:04 AM) <a href="http://www.totalchoicehosting.com/forums/index.php?act=findpost&pid=178547"><img src='http://www.totalchoicehosting.com/forums/style_images/1/post_snapback.gif' alt='*' border='0' /></a></div><div class='quotemain'><!--quotec-->Open "index.template.php" and find "<body>';"... Shortly below that is the section that begins the header at the top. Find where it starts "<img src=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"', $settings['images_url'], ", and add "<a href=yourlinkhere>" before and "</a>" after.<!--QuoteEnd--></div><!--QuoteEEnd--><br /><br />"Template Parse error<br />It seems something has gone sour on the forum with the template system. "<br /><br />Original Code<br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><img src=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"', $settings['header_logo_url'], '" style="margin: 4px;" alt="', $context['forum_name'], '" />';<!--c2--></div><!--ec2--><br /><br />Altered Code<br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><a href=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"http://www.mydomain.ext/index.htm"><img src="', $settings['header_logo_url'], '" style="margin: 4px;" alt="', $context['forum_name'], '" />'</a>;<!--c2--></div><!--ec2--><br /><br />I've looked at other examples in the php file and this looks similar.<!--content-->
Hmm... strange... give me a bit<!--content-->
I've looked at the view source of working pages.<br />I was able to get the graphic on the right to link as expected, doing the same thing you suggested on another line.<br /><br />This one line with the header_logo is giving the error.<!--content-->
Just a quick look, I see that this:<br /><br />'</a>;<br /><br />should be this:<br /></a>';<br /><br />That may not be the whole problem, though.<!--content-->
Pow! That did it. The apostrophe in the correct position.<br /><br />Thank You Aaron for giving me the correct answer and Thank You to Steve for sorting out my syntax error!<!--content-->
Odd based on this comment: // This part is the logo and forum name. You should be able to change this to whatever you want...<br /><br />So technically you should be able to do anything here. Just out of curiosity, try this:<br /><br /><a href=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"http://www.yourdomain.ext/index.htm" <b>/</b>> (notice the trailing slash...) See if that makes a difference.<!--content-->
Odd indeed. Turns out to be my lack of PHP knowledge that caused the problem. Including the </a> in the echo statement ' ' did the trick.<br /><br />Thank You for all the effort!<!--content-->
Correct Code<br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><a href=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"http://www.mydomain.ext/index.htm"><img src="', $settings['header_logo_url'], '" style="margin: 4px;" alt="', $context['forum_name'], '" /></a>';<!--c2--></div><!--ec2--><br /><br />Bad Code<br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><a href=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"http://www.mydomain.ext/index.htm"><img src="', $settings['header_logo_url'], '" style="margin: 4px;" alt="', $context['forum_name'], '" />'</a>;<!--c2--></div><!--ec2--><br /><br />One little tick ' placement (at the end) makes all the difference.<!--content-->
Ahh... I missed that <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /><br /><br />As a programmer, I'll agree that one small mistake will throw the whole thing off. You gotta be really careful <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /><br /><br />Glad to hear it got worked out for you <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
My first program was a pong game, back in 1984.<br />I could not figure out why the paddle would appear to punch a hole in the wall when it touched the right wall.<br />I spent 5 days working on it and finally got it working properly.<br /><br />Then, because I had made many changes with each edit, I tried to go back and figure out just what single edit made the difference. It turned out to be a missing semi-colon after a print statement but it took me a MONTH to figure that out. Normally, since then, I watch out for those tiny but powerful things. I have done very little, if any, programming since 1998 though.<br /><br />Had there been forums back then like the ones here at TCH, that entire exercise might have only taken me one a day.<br /><br />I really appreciate the help and the resource!<!--content-->
I mae so many little mistakes, I look for those first....that's how I got lucky finding yours <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /><br />I'm no programmer....just a hacker.<!--content-->
Anytime we can be of help <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> just let us know<!--content-->
 
Back
Top