TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 05-24-2009, 02:56 PM   #1 (permalink)
The Visitor
 
Join Date: May 2009
Posts: 2
Thanks: 0
Stahlblau is on a distinguished road
Help Replacing dynamically generated content

Hi.

There are some embedded videos. On a certain template file i'd like to display the videos in a different size. 300x225 -> 600x400

Here's an example where the changes have to be done:

PHP Code:
<div class="entry"

<
span class="vvqbox vvqvimeo" style="width:300px;height:225px;"><span id="vvq-35-vimeo-1"><ahref="http://www.vimeo.com/3846698">http://www.vimeo.com/3846698</a></span></span> 

<script type="text/javascript"
    
swfobject.embedSWF("http://www.vimeo.com/moogaloop.swf""vvq-35-vimeo-1""300""225""9"vvqexpressinstall, { "wmode""opaque""allowfullscreen""true""server""www.vimeo.com""clip_id""3846698""show_portrait""0""show_title""0""show_byline""0""fullscreen""1""color""FFFFFF" }, vvqparamsvvqattributes); 
</script> 

</div> 
The problem is, that everything between <div class="entry"> and </div> is allways different.

I guess the theory is like this:

1. Search between <div class="entry"> and </div> for 300 and 225
2. Replace every 300 with 600 and every 225 with 400.

I stumbled accross preg_replace and str_replace etc., read the manuals, read tons of other articles and stuff, but did not came up with a sollution.

Im absolutely new to php and only familiar with html and css.
Please help! :)

Thank you!
Stahlblau is offline  
Reply With Quote
Old 05-24-2009, 03:08 PM   #2 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Quote:
Originally Posted by Stahlblau View Post
Hi.

There are some embedded videos. On a certain template file i'd like to display the videos in a different size. 300x225 -> 600x400

Here's an example where the changes have to be done:

PHP Code:
<div class="entry"

<
span class="vvqbox vvqvimeo" style="width:300px;height:225px;"><span id="vvq-35-vimeo-1"><ahref="http://www.vimeo.com/3846698">http://www.vimeo.com/3846698</a></span></span> 

<script type="text/javascript"
    
swfobject.embedSWF("http://www.vimeo.com/moogaloop.swf""vvq-35-vimeo-1""300""225""9"vvqexpressinstall, { "wmode""opaque""allowfullscreen""true""server""www.vimeo.com""clip_id""3846698""show_portrait""0""show_title""0""show_byline""0""fullscreen""1""color""FFFFFF" }, vvqparamsvvqattributes); 
</script> 

</div> 
The problem is, that everything between <div class="entry"> and </div> is allways different.

I guess the theory is like this:

1. Search between <div class="entry"> and </div> for 300 and 225
2. Replace every 300 with 600 and every 225 with 400.

I stumbled accross preg_replace and str_replace etc., read the manuals, read tons of other articles and stuff, but did not came up with a sollution.

Im absolutely new to php and only familiar with html and css.
Please help! :)

Thank you!
Just make them variables.

width:300px;height:225px


width:${width}px;height:${height}px
allworknoplay is offline  
Reply With Quote
Old 05-24-2009, 03:19 PM   #3 (permalink)
The Visitor
 
Join Date: May 2009
Posts: 2
Thanks: 0
Stahlblau is on a distinguished road
Default

Thanks :) but i do not get it. :(

Do you mean, that i should change the code inside the div?
I can't do that since it's generated automatically, that's why i search for a way to change the values afterwards.
Stahlblau is offline  
Reply With Quote
Old 05-24-2009, 03:25 PM   #4 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Quote:
Originally Posted by Stahlblau View Post
Thanks :) but i do not get it. :(

Do you mean, that i should change the code inside the div?
I can't do that since it's generated automatically, that's why i search for a way to change the values afterwards.
Oh I see, then it sounds like you'll have to create a custom function to look for those attributes...
allworknoplay is offline  
Reply With Quote
Old 06-01-2009, 07:03 PM   #5 (permalink)
The Frequenter
 
ReSpawN's Avatar
 
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
ReSpawN is on a distinguished road
Default

How do you even know when the side should be different. If each pageload is the same or different, can't you just pass the correct size onto 2 variables and echo them there?

Else, I advise Javascript if it has to be loaded when a user performs an action.
__________________
"Life is a bitch, take that bitch on a ride"
Send a message via MSN to ReSpawN
ReSpawN is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to search the content of txt file meshi Absolute Beginners 11 11-01-2007 04:43 PM


All times are GMT. The time now is 09:52 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design