Jump to content

str_replace help


MrNoob

Recommended Posts

Hey PHPFreaks, help requied  :confused:

 

Site:

http://www.blametruthproject.com/home

 

I post a lot of flash videos on my site and they are being forced to the front, so my drop down menus go in behind them which is not exactly ideal.

 

So I found out I can use wmode="transparent" to fix this so I was wondering if someone could take a look at my source and tell me how to implement str_replace, so far I have this

 

This is the code I want to be replaced:

<embed src="[url OF FLASH]"
type="application/x-shockwave-flash" width="480"
height="360" allowscriptaccess="always" allowfullscreen="true">

 

And using str_replace I have:

 

 $subject='type="application/x-shockwave-flash" width="480"'; 
$search='type="application/x-shockwave-flash" '; 
$replace='type="application/x-shockwave-flash" wmode="transparent" '; 
$new_value=str_replace($search,$replace,$subject);  

 

 

So would any of you fine upstanding gentleman care to help a complete PHP noob to implement this into a Wordpress theme?

 

Cheers,

MrNoob

Link to comment
https://forums.phpfreaks.com/topic/171277-str_replace-help/
Share on other sites

Ah yes, well I post almost exclusively flash videos and I already have quite a lot posted and I will be posting a LOT more in the future. The problem is flash videos are the top most thing and I have drop down menus on my site so when I rollover Videos all the dropdown content is hidden by the flash videos.

 

So instead of manually adding

wmode="transparent"

 

into every single <object></object> I'm looking for this str_replace to insert the wmode between type="" and width=""

 

If you need any more info please ask, your help is appreciated.

 

Or if anyone knows any other method to set all flash content on my site to wmode="transparent" that would be appreciated too.

Link to comment
https://forums.phpfreaks.com/topic/171277-str_replace-help/#findComment-903290
Share on other sites

Do you add your videos via a Wordpress plugin of some sort, or do you manually type in the HTML? I'm not too familiar with Wordpress, but if you use a plugin you should be able to change the source code of it somewhere, so it includes the wmode automatically (for new videos, that is).

Link to comment
https://forums.phpfreaks.com/topic/171277-str_replace-help/#findComment-903294
Share on other sites

Do you add your videos via a Wordpress plugin of some sort, or do you manually type in the HTML? I'm not too familiar with Wordpress, but if you use a plugin you should be able to change the source code of it somewhere, so it includes the wmode automatically (for new videos, that is).

 

No I add the embed code manually for each new post, the code comes from a default 'Embed this video' from blip.tv or youtube.com

Link to comment
https://forums.phpfreaks.com/topic/171277-str_replace-help/#findComment-903331
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.