Jump to content

Recommended Posts

Posted

I am learning SMF and would like to add links to the header section of the default (babylon) theme for SMF.

 

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.

 

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.

 

Perhaps you have a better idea on how I can accomplish this same thing with SMF?

 

Thank You

Posted

Alright, now this is assuming you know a bit about HTML and the like...

 

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="', $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.

Posted
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="', $settings['images_url'], ", and add "<a href=yourlinkhere>" before and "</a>" after.

 

"Template Parse error

It seems something has gone sour on the forum with the template system. "

 

Original Code

><img src="', $settings['header_logo_url'], '" style="margin: 4px;" alt="', $context['forum_name'], '" />';

 

Altered Code

><a href="http://www.mydomain.ext/index.htm"><img src="', $settings['header_logo_url'], '" style="margin: 4px;" alt="', $context['forum_name'], '" />'</a>;

 

I've looked at other examples in the php file and this looks similar.

Posted

I've looked at the view source of working pages.

I was able to get the graphic on the right to link as expected, doing the same thing you suggested on another line.

 

This one line with the header_logo is giving the error.

Posted

Pow! That did it. The apostrophe in the correct position.

 

Thank You Aaron for giving me the correct answer and Thank You to Steve for sorting out my syntax error!

Posted

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.

 

Thank You for all the effort!

Posted

Correct Code

><a href="http://www.mydomain.ext/index.htm"><img src="', $settings['header_logo_url'], '" style="margin: 4px;" alt="', $context['forum_name'], '" /></a>';

 

Bad Code

><a href="http://www.mydomain.ext/index.htm"><img src="', $settings['header_logo_url'], '" style="margin: 4px;" alt="', $context['forum_name'], '" />'</a>;

 

One little tick ' placement (at the end) makes all the difference.

Posted (edited)

My first program was a pong game, back in 1984.

I could not figure out why the paddle would appear to punch a hole in the wall when it touched the right wall.

I spent 5 days working on it and finally got it working properly.

 

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.

 

Had there been forums back then like the ones here at TCH, that entire exercise might have only taken me one a day.

 

I really appreciate the help and the resource!

Edited by Kevan

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...