News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Need help importing gfx from website into forum plz

Started by blunt, December 24, 2004, 06:09:59 PM

Previous topic - Next topic

blunt

Hi all.   :)

My problem is this - I want to integrate my website into the forum (~loosely), by using the website banner and the navigation buttons below it (like it is on my website) and putting them on the forum.

I've done it before on vBulletin, and it was easy - on SMF I'm having a nightmare with it.  Ended up crashing the whole site last night (at least for me - I couldn't get in again until I changed the main index template back to how it was).

I couldn't find any html that seemed to place the banner (I've already got the banner showing no probs) - I was going to use this as a reference point to place the nav buttons.  In the end, I just put the button table at the top of the body and pasted the rollover script into the head.

Tried viewing it, and I got a white page, saying parse error - unexpected < at line 74, so I take it there's some kind of PHP code that I missed out?

Also, is it OK to use javascript rollovers on a PHP page?  Or should I do away with the rollovers and just use simple buttons?

Thanks in advance for any help :)

BTW, the forum URL is http://www.cafedoom.com/forum/index.php and the website is obviously http://www.cafedoom.com

[Unknown]


blunt

Thanks for the link - I'll try to find out where I've been going wrong.  Every time I try to add anything to that damn template I get a parse error - it's driving me crazy :(

Grudge

Quote from: blunt on December 25, 2004, 07:13:34 PM
Thanks for the link - I'll try to find out where I've been going wrong.  Every time I try to add anything to that damn template I get a parse error - it's driving me crazy :(
This is *almost* always caused by single quotes ('). Whenever you insert any code using single quotes into a php template in SMF escape it with a slash (\). So "I'm a little teapot" becomes "I\'m a little teapot".

This isn't guaranteed to work but if you're putting code in a sensible place (Within existing html) it should solve your problem. Otherwise post the lines it throws an error up from and I'm sure we will try to assist
I'm only a half geek really...

blunt

#4
It does keep saying that on the error page, but I can't see any single quotes left in the code - I tried taking bits away until I was left with bare html (took out the rollover script) and it still happens.  Tried adding (echo ') and then pasting it in, tried it without (echo '), tried using span, div, table, allsorts - nothing works.

Just wondering - could it be the (_self) bit in the target?

Here's the code I've been trying to enter -

// Add buttons

<table width="780" align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>

<a href="http://www.cafedoom.com/index.html" target="_self"
onmouseover="changeImages('f2_onyx_tabs_01', 'images/f2_onyx_tabs_01-over.jpg'); return true;"
onmouseout="changeImages('f2_onyx_tabs_01', 'images/f2_onyx_tabs_01.jpg');return true;">
<img name="f2_onyx_tabs_01" src="images/f2_onyx_tabs_01.jpg" width="119" height="41" border="0" alt=""></a></td>
<td>
<a href="http://www.cafedoom.com/tales.html" target="_self"
onmouseover="changeImages('f2_onyx_tabs_02', 'images/f2_onyx_tabs_02-f2_onyx_tab.jpg'); return true;"
onmouseout="changeImages('f2_onyx_tabs_02', 'images/f2_onyx_tabs_02.jpg');return true;">
<img name="f2_onyx_tabs_02" SRC="images/f2_onyx_tabs_02.jpg" width="138" height="41" border="0" ALT=""></a></td>
<td>
<a href="http://www.cafedoom.com/art.html" target="_self"
onmouseover="changeImages('f2_onyx_tabs_03', 'images/f2_onyx_tabs_03-f2_onyx_tab.jpg'); return true;"
onmouseout="changeImages('f2_onyx_tabs_03', 'images/f2_onyx_tabs_03.jpg');return true;">
<img name="f2_onyx_tabs_03" SRC="images/f2_onyx_tabs_03.jpg" width="159" height="41" border="0" ALT=""></a></td>
<td>

<a href="http://www.cafedoom.com/fun.html" target="_self"
onmouseover="changeImages('f2_onyx_tabs_04', 'images/f2_onyx_tabs_04-f2_onyx_tab.jpg'); return true;"
onmouseout="changeImages('f2_onyx_tabs_04', 'images/f2_onyx_tabs_04.jpg');return true;">
<img name="f2_onyx_tabs_04" SRC="images/f2_onyx_tabs_04.jpg" width="91" height="41" border="0" ALT=""></a></td>
<td>
<a href="http://www.cafedoom.com/forum/index.php?"
onmouseover="changeImages('f2_onyx_tabs_05', 'images/f2_onyx_tabs_05-f2_onyx_tab.jpg'); return true;"
onmouseout="changeImages('f2_onyx_tabs_05', 'images/f2_onyx_tabs_05.jpg');return true;">
<img name="f2_onyx_tabs_05" SRC="images/f2_onyx_tabs_05.jpg" width="138" height="41" border="0" ALT=""></a></td>
<td>
<a href="http://www.bsmuv.com/radio_chat.html" target="new window"
onmouseover="changeImages('f2_onyx_tabs_06', 'images/f2_onyx_tabs_06-f2_onyx_tab.jpg'); return true;"
onmouseout="changeImages('f2_onyx_tabs_06', 'images/f2_onyx_tabs_06.jpg');return true;">
<img name="f2_onyx_tabs_06" SRC="images/f2_onyx_tabs_06.jpg" width="135" height="41" border="0" ALT=""></a></td>
</tr>

</table>


I've tried adding it in various ways, in and around the place where you see the asterisks in the code below -

<body>';

// Because of the way width/padding are calculated, we have to tell Internet Explorer 4 and 5 that the content should be 100% wide. (or else it will assume about 108%!)
echo '
<div id="headerarea" style="padding: 12px 30px 4px 30px;', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' : '', '">';

// The logo and the three info boxes
echo '
<table cellspacing="0" cellpadding="0" border="0" align="center" width="100%" style="position: relative;">
<tr>
<td colspan="2" valign="bottom" style="padding: 5px; white-space: nowrap;">';

// This part is the logo and forum name.  You should be able to change this to whatever you want...
echo '
<img src="', $settings['images_url'], '/smflogo.gif" width="250" style="float: right;" alt="" />
<span style="font-family: Georgia, sans-serif; font-size: xx-large;">', $context['forum_name'], '</span>';




******HERE******




echo '
</td>
</tr>

<tr id="upshrinkHeader"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
<td valign="top">
<div class="headertitles" style="margin-right: 5px; position: relative;"><img src="', $settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="position: relative; margin-right: 5px; background-image: url(', $settings['images_url'], '/box_bg.gif);">
<img src="', $settings['images_url'], '/', $context['user']['language'], '/userinfo.gif" style="position: absolute; left: ', $context['browser']['is_ie5'] || $context['browser']['is_ie4'] ? '0' : '-1px', '; top: -16px; clear: both;" alt="" />
<table width="99%" cellpadding="0" cellspacing="5" border="0"><tr>';

if (!empty($context['user']['avatar']))
echo '<td valign="middle">', $context['user']['avatar']['image'], '</td>';

echo '<td width="100%" valign="top" class="smalltext" style="font-family: verdana, arial, sans-serif;">';


Thanks for the help, Grudge  :)

[Unknown]

It's the ' quotes in the javascript.

Have you tried my separate file.php method?  E.g. add it to "blah.php" and then include that file?

-[Unknown]

blunt

Quote from: [Unknown] on December 26, 2004, 03:54:08 AM
It's the ' quotes in the javascript.

Have you tried my separate file.php method?  E.g. add it to "blah.php" and then include that file?

-[Unknown]

It can't be 'only' that - like I said above; I tried adding the button table without any javascript, and I still got the same parse error.  That's why I was wondering if it was maybe the underscores _ in the image names, etc.  Even if I get rid of all the js, I still get the error.

No, I haven't tried the separate file method yet, but if I'm getting a parse error with the html code on this template, won't it be the same if I import it from a different one?

Jerry

it would be a problem with '. In your scripts you need to have \' instead.

If your html code isnt alreading in an echo ''; it needs to be in one ;)


- Jerry
Find me on:
Facebook
Twitter
PlanetSMF

"If all you look for is the negative in things, you will never see the positive."

blunt

Even if I just add (<span></span>) I get the same error - I think my forum is just totally screwed.  I keep getting stupid errors, and I can't figure it out.  Now my server seems to be playing up, and I can't even get into my forum to edit the template.  I'm about ready to....

Advertisement: