Add-on [What Addon?] YouTube Sub Button in Signature

taylor_smith

Well-known member
On a forum I frequent, a custom field allows users to enter their YouTube username. This causes a "Subscribe" button and subscriber counter to be added to their signature. What addon is this? Screenshot and link enclosed.

What addon is this?

Link: http://www.community.tm/
Image:

addon.webp
 
@taylor_smith

Here you go :) I have got this working here: http://motovlog.com/threads/lane-splitting-super-close-call.8643/#post-73633

Guide:

Add YouTube Subscribe Button
Open "Templates" in "Appearance" tab.

Search for "message"

Add the following right above {xen:raw $messageAfterTemplate}

Code:
<br />
<br />
<xen:if is="{$message.customFields.youtube}">
  <div class="g-ytsubscribe" data-channel="{$message.customFields.youtube}" data-layout="full" data-count="default"></div>
</xen:if>


In "Users" tab, click "Custom User Fields" and click "Create new field"

Field ID: youtube
Title: YouTube Channel
Description: Just your YouTube username, not the full link. For example, enter "mcnfreedom" and not "http://www.youtube.com/user/mcnfreedom"

That's it!

How this works: If <script src="https://apis.google.com/js/platform.js"></script> is anywhere in a template, such as the header, that's how it is being displayed.
 
I am new purchaser of XenForo and been loving it so far :)

I have it working "but" issue is that urls will not work for some youtube accounts who have not get 100 subs necessary to make url username. I did all the research and know solution to the problem but dont know what thing I need to change.

Problem is anytime someone enters their username into custom box it sends

Youtube.com/Channel/(What person enters) OR Youtube.com/C/(What person enters)
These both go to same place just showing what could they be written as.

What needs to sent is:

Youtube.com/User/(What person enters)

Does anyone have an idea? I just have to change the url from "/C OR /Channel" to "/User"
 
Last edited:
Back
Top Bottom