Hey guys, I;m willing to add one custom video to the user profile and m trying to so by using the Template Conditionals Plugin.
Here are the steps I did:
- Added one custom profile field called YouTube video (FID8) the user will imput ONLY the Video ID.
Here is my issue: (Template: Member_Profile)
How do I parse the field to make the url show the video?
HTML Code
<if $mybb->user['fid8'] != '' then>
<div id="YouTube" class="tab_content">
<center><object width="212" height="172">
<param name="movie" value="http://www.youtube.com/v/$mybb->user['fid8']"></param>
<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/$mybb->user['fid8']" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="212" height="172"></embed>
</object></center>
</div>
<else>
</if>
|
The http://www.youtube.com/v/$mybb->user['fid8'] will not work.
Thank you.
Thank you but it didn't work. :/
I managed to make it work using the code bellow:
HTML Code
<if $mybb->user['fid8'] != '' then>
<div id="YouTube" class="tab_content">
<center><object width="480" height="385">
<param name="movie" value="http://www.youtube.com/v/{$userfields['fid8']}"></param>
<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/{$userfields['fid8']}" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed>
</object></center>
</div>
<else>
</if>
|
(12-03-2010 07:44 AM)Skiilz Wrote: [ -> ]
HTML Code
<if $mybb->user['fid8'] != '' then>
<div id="YouTube" class="tab_content">
<center><object width="480" height="385">
<param name="movie" value="http://www.youtube.com/v/{$userfields['fid8']}"></param>
<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/{$userfields['fid8']}" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed>
</object></center>
</div>
<else>
</if>
|
I think it is better to sanitise it a bit....
He means it's fine as long as no-one tries to hack you.
How can fix the issue? Please help
Well, I'm not sure if this is intention, but you're mixing $mybb->user['fid8'] and $userfields['fid8']
Secondly, $userfields['fid8'] is never gone through htmlspecialchars
(and please don't ask what "htmlspecialchars" is - if you care, you can Google it)
(12-07-2010 02:40 AM)Imran Wrote: [ -> ]Is it not working Skiilz ?
It is but zing said that I need to change this code to fix issues.
(12-07-2010 08:23 AM)ZiNgA BuRgA Wrote: [ -> ]Well, I'm not sure if this is intention, but you're mixing $mybb->user['fid8'] and $userfields['fid8']
Secondly, $userfields['fid8'] is never gone through htmlspecialchars
(and please don't ask what "htmlspecialchars" is - if you care, you can Google it)
It's not intentional. I forgot to change the $mybb->user['fid8'] to $userfields['fid8'].
Here is the code I have on my board...
Code:
<if $userfields['fid8'] != '' then>
<div id="YouTube" class="tab_content">
<center><object width="480" height="385">
<param name="movie" value="http://www.youtube.com/v/{$userfields['fid8']}"></param>
<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/{$userfields['fid8']}" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed>
</object></center>
</div>
<else>
</if>
|
DO I need to change anything to fix the issue?