Author Topic: Turn Off the Lights Mod  (Read 2242 times)

0 Members and 1 Guest are viewing this topic.

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
Turn Off the Lights Mod
« on: June 29, 2009, 11:55:14 PM »

I don't have any Daily Motion and Google videos on my site, could someone test this script for me? Thanks to Jeff I now know that this Mod works for YouTube, Google Video, and DailyMotion.


Turn Off the Lights Mod

Based off the Janko At Warp Speed Turn off the Lights Code:
http://www.jankoatwarpspeed.com/examples/TurnOffTheLights/

Ported to PHP Director by: FireDart

Works in these Browsers
FireFox 3.0.11
Opera 9.64
Safari 4
Google Chrome 2.0.172.33
IE 8
IE 7

Instructions:

1) Download the "turn_off_lights.zip" (or "turn_off_lights.7z" You need 7-Zip to extract) & Upload the "turn_off_lights" folder to your root(or where PHP Director is installed)

2) Place this code in your <head></head> Tags(Should be located in the header.tpl file)
Code: [Select]
<link href="turn_off_lights/style.css" rel="stylesheet" type="text/css" />

3) Place this at the bottom of your template but before the </body> and </html> Tags(Should be located in the "footer.tpl" file)
Code: [Select]
<div id="shadow"></div>

4) Place this code were you want the "Turn off the lights" Text & icon to go:
Code: [Select]
<script type="text/javascript" src="turn_off_lights/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="turn_off_lights/turn_off_lights.js"></script>
<a class="lightSwitcher" href="#">Turn off the lights</a>

NOTE: Step 4 you should look at the "viewvid.tpl" file. If your lazy and don't want to go thought the code just replace everything you see in the viewvid.tpl file with this:
Code: [Select]
{include file="header.tpl"}
{section name=video loop=$video}
<div align='center'>
{if $reject eq "1"}
{$LAN_26}
{/if}
<h2>{$video[video].name}</h2>
<script type="text/javascript" src="turn_off_lights/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="turn_off_lights/turn_off_lights.js"></script>
<p><b>{$LAN_36}:</b> {$video[video].creator} | <a class="lightSwitcher" href="#">Turn off the lights</a></p>
{include file="players.tpl"}<br />
{rating_bar units='5' id=$video[video].id}
<strong>{$LAN_35}:</strong>
<br />
<div id='description'>{$video[video].description}</div>
<br />
<b>{$LAN_32}: </b>{$video[video].views}
{/section}
</div>
{include file="footer.tpl"}

If you use this method it means you have not altered the viewvid.tpl file for any other reason.


5) THIS IS VERY IMPORTANT Replace the player.tpl file with this:
Code: [Select]
{if $vidtype eq "YouTube"}

<object width="425" height="350"><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/{if $video[video].file eq ""}{$videoid}{else}{$video[video].file}{/if}&autoplay=1" type="application/x-shockwave-flash" width="425" height="350"></embed></object>

{elseif $vidtype eq "GoogleVideo"}

<embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId={if $video[video].file eq ""}{$videoid}{else}{$video[video].file}{/if}" flashvars=""> </embed>

{elseif $vidtype eq "dailymotion"}

<div><object width="425" height="335"><param name="movie" value="http://www.dailymotion.com/swf/{if $video[video].file eq ""}{$videoid}{else}{$video[video].file}{/if}"></param><param name="allowfullscreen" value="true"></param><embed src="http://www.dailymotion.com/swf/{if $video[video].file eq ""}{$videoid}{else}{$video[video].file}{/if}" type="application/x-shockwave-flash" width="425" height="334" allowfullscreen="true"></embed></object></div>

{else}
This video type is currently unsuppotred
{/if}
I am guessing you have not changed anything in the plater.tpl file if you do this!
What does the above do? It makes all Youtube videos hover over the shadow rather then under it!

Download Here:
http://www.box.net/shared/iipbxxbsyu

Have Fun Turning Off the Lights!
-FireDart
« Last Edit: September 05, 2009, 12:56:23 PM by FireDart »

Offline Jeff

  • Global Moderator
  • Sr phpd Member
  • *****
  • Posts: 359
  • Karma: 5
  • Need help? Feel free to ask.
    • View Profile
Re: Turn Off the Lights Mod
« Reply #1 on: June 30, 2009, 03:05:51 AM »
I couldnt seem to get it to work correctly.... might be my lazyness... i dont know lol but i kinda gave up on it...

Although its a GREAT idea.... and if someone can show me it working then ill put it back on my site but ya...

great find and thank you for porting it for us

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
Re: Turn Off the Lights Mod
« Reply #2 on: June 30, 2009, 03:09:16 AM »
Here is a demo:
http://www.firedartonline.com/projects/phpdirector/

It's a Kayak Fishing Site for one of my clients.

Maybe providing a screenshot or a description of what is not working could help me help you?

-FireDart
« Last Edit: July 05, 2009, 10:20:32 PM by FireDart »

Offline Jeff

  • Global Moderator
  • Sr phpd Member
  • *****
  • Posts: 359
  • Karma: 5
  • Need help? Feel free to ask.
    • View Profile
Re: Turn Off the Lights Mod
« Reply #3 on: June 30, 2009, 03:11:46 AM »
ok... going to go eat.. then im going to try again :-P

Offline Jeff

  • Global Moderator
  • Sr phpd Member
  • *****
  • Posts: 359
  • Karma: 5
  • Need help? Feel free to ask.
    • View Profile
Re: Turn Off the Lights Mod
« Reply #4 on: June 30, 2009, 03:43:19 AM »
ok nvm.... it works fine... and with all three types of videos (youtube, Daily, and Google)

Thanks again

Offline naxtra

  • Full phpd Member
  • ***
  • Posts: 74
  • Karma: 1
    • View Profile
Re: Turn Off the Lights Mod
« Reply #5 on: June 30, 2009, 06:49:15 AM »
 8) mod...

thx for sharing

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
Re: Turn Off the Lights Mod
« Reply #6 on: June 30, 2009, 02:07:49 PM »
No Problem.

Offline dani001

  • Newbie
  • *
  • Posts: 17
  • Karma: 0
    • View Profile
Re: Turn Off the Lights Mod
« Reply #7 on: January 12, 2010, 02:47:33 PM »
Download Links are Not Working ...

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
Re: Turn Off the Lights Mod
« Reply #8 on: January 12, 2010, 08:33:09 PM »
Try this link:
http://www.box.net/shared/iipbxxbsyu

Note: This version is nNot Compatible with Version .30(Comes with V. 30 default thought)