OUTL4W
01-07-2014, 11:00 PM
Thought I would share this lil mod that will show if specific Twitch users are offline or online. This should work on all vb versions if using vbadvance. This will work with vbadvance and in the sidebar block of vb4...haven't tested in sidebar anywhere (https://vborg.vbsupport.ru/showthread.php?t=283307&highlight=sidebar+everywhere) or Everywhere Sidebar (https://vborg.vbsupport.ru/showthread.php?t=233871&highlight=sidebar+everywhere) mod's. For Sidebar blocks this will show whose online and when clicking link will either take you to their twitch channel or if using Vbadvance will take you to that page where channel is embedded.
1st upload folder within attached zip file to your root dir.
for sidebar in vb4x:
>acp>Forums & Moderators>forums blocks manager>add block>Custom HTML/PHP
click "continue"
Title: whatever you want
Cache time: 1
Display Order: your preference
Content Type: HTML
use this if you want to direct to Twitch.tv channel:
Content: <a href="http://www.twitch.tv/channelname"><strong><span style="color: red;">Member name</span></strong></a> <img src="http://www.yourdomainname/status/twitch.php?stream=channelname">
<br>
if wanting to add more members simply copy & paste the code and change text in red to suit your needs.
Clicking link will direct user to Twitch.tv page to watch channel.
that's it....but if using DBTech Twitch TV integration (https://vborg.vbsupport.ru/showthread.php?t=303105) then use this code:
<a href="http://www.yourdomainname.com/twitch.php"><strong><span style="color: red;">Member name</span></strong></a> <img src="http://www.yourdomainname/status/twitch.php?stream=channelname
<br>
but if using Vbadvance (http://www.vbadvanced.com/products.php?do=productinfo&productid=4) then continue....this is written as if you already have working knowledge of vbadvance and what to do once modules are created. If not I will do my best to answer any questions you might have.
use this if using vbadvance where channel will be embedded:
Content: <a href="http://www.domainname/cmps_index.php?page=pagename"><strong><span style="color: #ff0000;">Member name</strong></span></a><img src="http://www.domainname/status/twitch.php?stream=channelname"><p style="float:right;"></p>
<br>
Clicking link will direct user to vbadvance page to watch embedded channel.
and if wanting to add more members simply copy & paste the code and change text in red to suit your needs.
Embedding channel in Vbadvance:
acp>vBa CMPS>add module>[HTML Code Module]
Module Title: Member's Name
Active: yes
CSS Templates to Include: leave blank
Module Content:
<object type="application/x-shockwave-flash" id="live_embed_player_flash" data="http://www.twitch.tv/widgets/live_embed_player.swf?channel=channelname" bgcolor="#000000" height="335" width="375"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><param name="allowNetworking" value="all"><param name="movie" value="http://www.twitch.tv/widgets/live_embed_player.swf"><param name="flashvars" value="hostname=www.twitch.tv&channel=channelname&auto_play=true&start_volume=25"></object><iframe id="chat_embed" src="http://twitch.tv/chat/embed?channel=channelname&popout_chat=true" frameborder="0" height="335" scrolling="no" width="350"></iframe><br><br><div style="text-align: center;"><strong><span style="color: #c00000;"><a href="http://www.twitch.tv/channelname">FOLLOW ME</a></span></strong></div>
Use Module Wrapper Template: yes
Alternative Module Wrapper Template: Leave blank
Module Link: Leave blank
Title Row Colspan: 0
Form Code: Leave blank
Wrap a Table Around Content: no
Collapse Module by Default: yes
Usergroup Permissions:
click the usergroups you wish to have access to this module.
if not wanting to include chat window then delete blue text and enlarge the height & width of video window to your preference. This will also add a link below the video window to goto member's channel and click the "follow button".
While on Vbadvance page where channels are embedded...if you want to add a module showing whose online/offline since all the embedded module's will be collapsed by default, if not all the channels will auto-play. So by keeping them collapsed and adding a module showing whose online will streamline the process:
if wanting to also have a module on the Vbadvance page where channels are embedded:
acp>vBa CMPS>add module>[HTML Code Module]
Module Title: Streams Online/Offline
Active: yes
CSS Templates to Include: leave blank
Module Content: <a href="http://www.twitch.tv/channelname"><strong><span style="color: red;">Member name</span></strong></a> <img src="http://www.yourdomainname/status/twitch.php?stream=channelname">
<br>
Use Module Wrapper Template: yes
Alternative Module Wrapper Template: Leave blank
Module Link: Leave blank
Title Row Colspan: 0
Form Code: Leave blank
Wrap a Table Around Content: no
Collapse Module by Default: no
Usergroup Permissions:
click the usergroups you wish to have access to this module.
example here (http://www.dmclanforum.com/cmps_index.php?page=streams1) for Vbadvanced page. (Twitcher's)
example here (http://www.dmclanforum.com/forum.php) for VB4 sideblock in the sidebar.(Live Stream's)
Please Mark as Installed and thank you.....
09/16/2014: update 1.1
since the link is dead to justin.TV, updated the twitch.php file with the info from post#7 (https://vborg.vbsupport.ru/showpost.php?p=2514718&postcount=7) thanks @Dave
If you want to show a stream status in member's postbit (legacy) then you'll need to do a template change....
vb3x:
find
if condition="$post['age']"><div>$vbphrase[age]: $post[age]</div></if>
<div>
add after or where ever you like:
<!-- stream status -->
<div style="color:yourchoice; font-weight: bold;">
<if condition="$post['fieldx']">Stream:<a href="http://www.twitch.tv/$post[fieldx]" target="_blank"><img src="http://www.your_domain_name.com/status/twitch.php?stream=$post[fieldx]"></a></if>
</div>
<!-- end stream status -->
__________________________________________________ ____________________________________
vb4x
find:
<vb:if condition="$post['age']"><dt>{vb:rawphrase age}</dt> <dd>{vb:raw post.age}</dd></vb:if>
add after or where ever you like:
<!-- stream status -->
<div style="color:yourchoice; font-weight: bold;">
<vb:if condition="$post['fieldx']">Stream:<a href="http://www.twitch.tv/$post[fieldx]" target="_blank"><img src="http://www.your_domain_name.com/status/twitch.php?stream={vb:raw post.fieldx}"></a></vb:if>
</div>
<!-- end stream status -->
then when user is online....you will be able to click "online" and will take you to their channel.
1st upload folder within attached zip file to your root dir.
for sidebar in vb4x:
>acp>Forums & Moderators>forums blocks manager>add block>Custom HTML/PHP
click "continue"
Title: whatever you want
Cache time: 1
Display Order: your preference
Content Type: HTML
use this if you want to direct to Twitch.tv channel:
Content: <a href="http://www.twitch.tv/channelname"><strong><span style="color: red;">Member name</span></strong></a> <img src="http://www.yourdomainname/status/twitch.php?stream=channelname">
<br>
if wanting to add more members simply copy & paste the code and change text in red to suit your needs.
Clicking link will direct user to Twitch.tv page to watch channel.
that's it....but if using DBTech Twitch TV integration (https://vborg.vbsupport.ru/showthread.php?t=303105) then use this code:
<a href="http://www.yourdomainname.com/twitch.php"><strong><span style="color: red;">Member name</span></strong></a> <img src="http://www.yourdomainname/status/twitch.php?stream=channelname
<br>
but if using Vbadvance (http://www.vbadvanced.com/products.php?do=productinfo&productid=4) then continue....this is written as if you already have working knowledge of vbadvance and what to do once modules are created. If not I will do my best to answer any questions you might have.
use this if using vbadvance where channel will be embedded:
Content: <a href="http://www.domainname/cmps_index.php?page=pagename"><strong><span style="color: #ff0000;">Member name</strong></span></a><img src="http://www.domainname/status/twitch.php?stream=channelname"><p style="float:right;"></p>
<br>
Clicking link will direct user to vbadvance page to watch embedded channel.
and if wanting to add more members simply copy & paste the code and change text in red to suit your needs.
Embedding channel in Vbadvance:
acp>vBa CMPS>add module>[HTML Code Module]
Module Title: Member's Name
Active: yes
CSS Templates to Include: leave blank
Module Content:
<object type="application/x-shockwave-flash" id="live_embed_player_flash" data="http://www.twitch.tv/widgets/live_embed_player.swf?channel=channelname" bgcolor="#000000" height="335" width="375"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><param name="allowNetworking" value="all"><param name="movie" value="http://www.twitch.tv/widgets/live_embed_player.swf"><param name="flashvars" value="hostname=www.twitch.tv&channel=channelname&auto_play=true&start_volume=25"></object><iframe id="chat_embed" src="http://twitch.tv/chat/embed?channel=channelname&popout_chat=true" frameborder="0" height="335" scrolling="no" width="350"></iframe><br><br><div style="text-align: center;"><strong><span style="color: #c00000;"><a href="http://www.twitch.tv/channelname">FOLLOW ME</a></span></strong></div>
Use Module Wrapper Template: yes
Alternative Module Wrapper Template: Leave blank
Module Link: Leave blank
Title Row Colspan: 0
Form Code: Leave blank
Wrap a Table Around Content: no
Collapse Module by Default: yes
Usergroup Permissions:
click the usergroups you wish to have access to this module.
if not wanting to include chat window then delete blue text and enlarge the height & width of video window to your preference. This will also add a link below the video window to goto member's channel and click the "follow button".
While on Vbadvance page where channels are embedded...if you want to add a module showing whose online/offline since all the embedded module's will be collapsed by default, if not all the channels will auto-play. So by keeping them collapsed and adding a module showing whose online will streamline the process:
if wanting to also have a module on the Vbadvance page where channels are embedded:
acp>vBa CMPS>add module>[HTML Code Module]
Module Title: Streams Online/Offline
Active: yes
CSS Templates to Include: leave blank
Module Content: <a href="http://www.twitch.tv/channelname"><strong><span style="color: red;">Member name</span></strong></a> <img src="http://www.yourdomainname/status/twitch.php?stream=channelname">
<br>
Use Module Wrapper Template: yes
Alternative Module Wrapper Template: Leave blank
Module Link: Leave blank
Title Row Colspan: 0
Form Code: Leave blank
Wrap a Table Around Content: no
Collapse Module by Default: no
Usergroup Permissions:
click the usergroups you wish to have access to this module.
example here (http://www.dmclanforum.com/cmps_index.php?page=streams1) for Vbadvanced page. (Twitcher's)
example here (http://www.dmclanforum.com/forum.php) for VB4 sideblock in the sidebar.(Live Stream's)
Please Mark as Installed and thank you.....
09/16/2014: update 1.1
since the link is dead to justin.TV, updated the twitch.php file with the info from post#7 (https://vborg.vbsupport.ru/showpost.php?p=2514718&postcount=7) thanks @Dave
If you want to show a stream status in member's postbit (legacy) then you'll need to do a template change....
vb3x:
find
if condition="$post['age']"><div>$vbphrase[age]: $post[age]</div></if>
<div>
add after or where ever you like:
<!-- stream status -->
<div style="color:yourchoice; font-weight: bold;">
<if condition="$post['fieldx']">Stream:<a href="http://www.twitch.tv/$post[fieldx]" target="_blank"><img src="http://www.your_domain_name.com/status/twitch.php?stream=$post[fieldx]"></a></if>
</div>
<!-- end stream status -->
__________________________________________________ ____________________________________
vb4x
find:
<vb:if condition="$post['age']"><dt>{vb:rawphrase age}</dt> <dd>{vb:raw post.age}</dd></vb:if>
add after or where ever you like:
<!-- stream status -->
<div style="color:yourchoice; font-weight: bold;">
<vb:if condition="$post['fieldx']">Stream:<a href="http://www.twitch.tv/$post[fieldx]" target="_blank"><img src="http://www.your_domain_name.com/status/twitch.php?stream={vb:raw post.fieldx}"></a></vb:if>
</div>
<!-- end stream status -->
then when user is online....you will be able to click "online" and will take you to their channel.