News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Adding swf

Started by The -L-, November 17, 2009, 07:05:12 PM

Previous topic - Next topic

The -L-

Hello..i kinda need some help with adding SWF right below my nav bar...(centered) i edited index.template.php and put in embed code but all i get is errors...can anyone help?

Thanks ;)

The -L-


hadesflames

What errors do you get?

The -L-

Well... i get errors like somethings wrong with index.template.php...

Well its just cause i don't know how to insert
<table align="center">
  <tr>
    <td><embed src="path to swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="400" height="350"></embed>
    </object></td>
  </tr>
</table>

in index.template.php the way it should work....:/
can you help me out?

hadesflames

have you tried using the Global Headers and Footers mod and just adding this

<div style="text-align: center;"><embed src="path to swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="400" height="350"></embed></div>

to it?

http://custom.simplemachines.org/mods/index.php?mod=351

The -L-

hmmm nice addon...ill use it...but cant just html code be inserted into php file?

hadesflames

if you added it outside of an echo, it will not work. so If it's outside of an echo it should look like this:
echo '<table align="center">
  <tr>
    <td><embed src="path to swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="400" height="350"></embed>
    </object></td>
  </tr>
</table>';


I recommended the global headers and footers mod because it makes it easier to add/remove code to your headers and footers than having to manually edit the template files.

edit: I just noticed you have a closing </object> tag, but no opening <object> tag. Perhaps that might be causing some problems?

The -L-

Okay you know better than me anyway. I will use this mod,if i get any problems ill ask here.. ;)

Thanks

hadesflames

All right, be sure to post back with the results =]

The -L-

This addon is really great and its sure that ill use it...but its not doing exactly what i wanted to do...look at picture...this is some swf file i found online for test...its not really right below the nav bar how i want it to be...:/
I suposed something like this thats why i wanted to insert a piece of code...



hadesflames

In that case try inserting the following:

echo '<div style="text-align: center;"><embed src="path to swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="400" height="350"></embed></div>';

I don't see the need to use a table if when you can use div to align it to the center. Make sure you don't place that code inside a current echo. If you want to place it in an echo then remove the echo ' and '; parts

The -L-

Here is my index.template.php can you please tell me in what line to insert the code you gave me...?

hadesflames

search for:

<div class="cat-alt-bot"></div>
',theme_linktree(),'


should be lines 272 - 273

replace with:

<div class="cat-alt-bot"></div>
<div style="text-align: center;"><object type="application/x-shockwave-flash" style="width:XXpx; height:XXpx;" data="Path_to_Swf" /></div>
',theme_linktree(),'


make sure to change the path and the width + height to appropriate settings.

The -L-

^^ Thanks,it works perfect.
I pronounce this topic: Solved! :D

Thanks ;)

hadesflames

Glad I could be of some help ^^

Advertisement: