Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 YouTube - Member_Profile
Skiilz Offline
Member
***
Posts: 198
Joined: Nov 2010
Post: #1
YouTube - Member_Profile
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
1
2
3
4
5
6
7
8
9
10
<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.


[Image: 468x602b.png]
12-03-2010 12:37 AM
Find all posts by this user Quote this message in a reply
Imran Offline
Member
***
Posts: 204
Joined: Apr 2010
Post: #2
RE: YouTube - Member_Profile
Try this;

PHP Code:
1
2
3
4
5
6
7
8
9
10
<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/$memprofile['fid8']"></param>
<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/$memprofile['fid8']" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="212" height="172"></embed>
</object></center>
</div>
<else>
</if>


[Image: logo.png]

[Image: twitter.png]
12-03-2010 02:23 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Skiilz Offline
Member
***
Posts: 198
Joined: Nov 2010
Post: #3
RE: YouTube - Member_Profile
Thank you but it didn't work. :/
I managed to make it work using the code bellow:

HTML Code
1
2
3
4
5
6
7
8
9
10
<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>


[Image: 468x602b.png]
(This post was last modified: 12-03-2010 07:44 AM by Skiilz.)
12-03-2010 07:44 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #4
RE: YouTube - Member_Profile
(12-03-2010 07:44 AM)Skiilz Wrote:  

HTML Code
1
2
3
4
5
6
7
8
9
10
<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....
12-05-2010 06:31 AM
Find all posts by this user Quote this message in a reply
Skiilz Offline
Member
***
Posts: 198
Joined: Nov 2010
Post: #5
RE: YouTube - Member_Profile
What do you mean?

[Image: 468x602b.png]
12-05-2010 10:02 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #6
RE: YouTube - Member_Profile
He means it's fine as long as no-one tries to hack you.

My Blog
12-06-2010 07:58 AM
Find all posts by this user Quote this message in a reply
Skiilz Offline
Member
***
Posts: 198
Joined: Nov 2010
Post: #7
RE: YouTube - Member_Profile
How can fix the issue? Please help Biggrin

[Image: 468x602b.png]
12-06-2010 10:17 PM
Find all posts by this user Quote this message in a reply
Imran Offline
Member
***
Posts: 204
Joined: Apr 2010
Post: #8
RE: YouTube - Member_Profile
Is it not working Skiilz ?

[Image: logo.png]

[Image: twitter.png]
12-07-2010 02:40 AM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #9
RE: YouTube - Member_Profile
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)

My Blog
12-07-2010 08:23 AM
Find all posts by this user Quote this message in a reply
Skiilz Offline
Member
***
Posts: 198
Joined: Nov 2010
Post: #10
RE: YouTube - Member_Profile
(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:
1
2
3
4
5
6
7
8
9
10
<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?


[Image: 468x602b.png]
12-07-2010 09:26 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: