AEGJay Posted October 14, 2016 Posted October 14, 2016 I would like to give users the option to have YouTube video's on their profiles. I have seen there is a few plugins about but non of them seem to work. How would i go about adding this to our Forum ?
opentype Posted October 14, 2016 Posted October 14, 2016 A simple editor field to paste the YouTube URL for automatic embedding works fine. Doesn’t need any plugins.
Andrew Anderson Posted October 30, 2016 Posted October 30, 2016 ooo roleplay's Forums.... XD Yeah, It's quite simple really...I will be using screenshots from my own community for this (rebornroleplay.com). We have it set where only donators/admins can have videos. So, If the person has donated, it will show up for everyone like this; You can customise the sizes yourself in the theme editor. In the Admin cp, Members > Profiles I've added/created "Youtube link" with the description "Please only the reference, such as: dQw4w9WgXcQ if the link is: youtube.com/watch?v=dQw4w9WgXcQ" Obviously, the type is "text". This is where things can get a little bit tricky depending on what forum groups you have, and how many profile fields you've created. For me, the "Youtube link" is the only one i've created, and therefore is profile field 2 (as about me is 1). In your theme, click edit code, and make sure you're on the "template" list, not "CSS". Type Profile in the search box, This is the file you want to edit; Click anywhere in the code on the right, press CTRL + F and find: ->warn_on The whole line will look like: {{if \IPS\Settings::i()->warn_on and !$member->inGroup( explode( ',', \IPS\Settings::i()->warn_protected ) ) and ( \IPS\Member::loggedIn()->modPermission('mod_see_warn') or ( \IPS\Settings::i()->warn_show_own and \IPS\Member::loggedIn()->member_id == $member->member_id ) )}} above this line, you're going to add your version of this: {{foreach $sidebarFields as $group => $fields}} {{if count( $fields )}} <div class='ipsWidget ipsWidget_vertical cProfileSidebarBlock ipsBox ipsSpacer_bottom'> {{if $group != 'core_pfieldgroups_0'}} <h2 class='ipsWidget_title ipsType_reset'>{lang="$group"}</h2> {{endif}} <div class='ipsWidget_inner ipsPad'> <ul class='ipsDataList ipsDataList_reducedSpacing cProfileFields'> {{foreach $fields as $field => $value}} {{if $field=="core_pfield_2"}} <li class='ipsDataItem'> <!-- Medic1 medic 2 cop 1 cop 2 BANNED MEMBER VALIDATING --> {{if $member->group['g_id'] != 22 && $member->group['g_id'] != 21 && $member->group['g_id'] != 20 && $member->group['g_id'] != 19 && $member->group['g_id'] != 5 && $member->group['g_id'] != 3 && $member->group['g_id'] != 1}} <iframe class="ipsDataItem_generic leVideo" height="200" src="https://www.youtube.com/embed/{$value|raw}?autoplay=1" frameborder="0" allowfullscreen></iframe> {{else}} <span class="ipsDataItem_generic">To see this video, the member needs to donate! Coming soon!</span> {{endif}} </li> {{else}} <li class='ipsDataItem'> <span class='ipsDataItem_generic ipsDataItem_size3 ipsType_break'><strong>{lang="$field"}</strong></span> <span class='ipsDataItem_generic'>{$value|raw}</span> </li> {{endif}} {{endforeach}} </ul> </div> </div> {{endif}} {{endforeach}} You'll need to update "{{if $field=="core_pfield_2"}}" to whatever profile field is the youtube video. Then you'll set which forum groups can NOT have a working video in their profile.... this is done by group ID's... You can reverse this to only allow in groups, it depends on how you want it to work. Mine is basically "if the user is NOT in those groups, allow a video." Just remember != means "does not equal" Finally, we want to sort the css out for the video itself, this is quite simple... Save the template, and click on "CSS", and type "Custom" in the search box. the file you want is custom.css and should be a part of all forum themes, Above you can see it in my theme and in the default theme. All you need to do is scroll to the very bottom (depending if you have anything in there) and add: .leVideo { width: 100%; height: 100%; } I hope this helps! @AEGJay
Elena-Viorica Posted November 1, 2016 Posted November 1, 2016 Could someone make a plugin for this, please? And why just YouTube? Why not Vimeo and DailyMotion too?
opentype Posted November 1, 2016 Posted November 1, 2016 7 minutes ago, Elena-Viorica said: Could someone make a plugin for this, please? And why just YouTube? Why not Vimeo and DailyMotion too? Well, … On 10/14/2016 at 10:37 AM, opentype said: A simple editor field to paste the YouTube URL for automatic embedding works fine. Doesn’t need any plugins. Works for Vimeo or anything else IPS embeds by default as well.
Elena-Viorica Posted November 1, 2016 Posted November 1, 2016 I mean in the profile sidebar, like the profile song plugin... It used to exist for IPS 3.
Pete T Posted November 1, 2016 Posted November 1, 2016 1 hour ago, Elena-Viorica said: I mean in the profile sidebar, like the profile song plugin... It used to exist for IPS 3. without testing the above is adding in profile sidebar so little confused what you need.
Elena-Viorica Posted November 1, 2016 Posted November 1, 2016 4 hours ago, IPS Modification said: without testing the above is adding in profile sidebar so little confused what you need. A plugin that does this for all themes, so that I don't have to edit 10 themes myself and have to re-edit them every time a new IPS version is released...
Wonster Posted March 9, 2017 Posted March 9, 2017 Hi, @Andrew Anderson Tested you code and it doesnt work properly It doubles every profile field that I add and the video doesnt show for me as admin. It doesn't show the video not just on my profile, I cant see the videos on others member profile Any advice?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.