Author Topic: [REQ] Add Video From Google  (Read 23700 times)

0 Members and 1 Guest are viewing this topic.

Offline live@ct

  • Sr. Member
  • ****
  • Posts: 348
    • View Profile
[REQ] Add Video From Google
« on: June 30, 2006, 04:53:02 AM »
I like to add videos from google, how can I made the tamplate ?!?!?!

thanks for your help!!
Existen 10 tipos de personas, los que entienden el codigo binario y los que no.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [REQ] Add Video From Google
« Reply #1 on: June 30, 2006, 07:18:46 AM »
There is a problem with google addresses, they are longer then 255 characters, so they might not work in 4images :(
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline BartAfterDark

  • Hero Member
  • *****
  • Posts: 520
    • View Profile
Re: [REQ] Add Video From Google
« Reply #2 on: July 01, 2006, 12:25:21 PM »
You could download the file from google and add it to your site

Offline Zyga

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
Re: [REQ] Add Video From Google
« Reply #3 on: July 01, 2006, 02:11:15 PM »
There is a problem with google addresses, they are longer then 255 characters, so they might not work in 4images :(

there is a way  :idea:
movie id is only several characters long

we need only save movie id to DB and later in code add automaticaly whole embed code with constans width and hight

Quote
<embed style="width:400px; height:326px;" id="VideoPlayback" align="middle" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=-here_movie_id" allowScriptAccess="sameDomain" quality="best" bgcolor="#ffffff" scale="noScale" salign="TL"  FlashVars="playerMode=embedded"> </embed>

Offline BartAfterDark

  • Hero Member
  • *****
  • Posts: 520
    • View Profile
Re: [REQ] Add Video From Google
« Reply #4 on: July 01, 2006, 02:54:21 PM »
There is a problem with google addresses, they are longer then 255 characters, so they might not work in 4images :(

there is a way  :idea:
movie id is only several characters long

we need only save movie id to DB and later in code add automaticaly whole embed code with constans width and hight

Quote
<embed style="width:400px; height:326px;" id="VideoPlayback" align="middle" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=-here_movie_id" allowScriptAccess="sameDomain" quality="best" bgcolor="#ffffff" scale="noScale" salign="TL" FlashVars="playerMode=embedded"> </embed>

you could do something like this:

add google_id to your 4images_images sql table. And add {google_id} where you want to show the ID. The only problem I can't figure out is how to allow {google_id} in the media template

Offline BartAfterDark

  • Hero Member
  • *****
  • Posts: 520
    • View Profile
Re: [REQ] Add Video From Google
« Reply #5 on: July 01, 2006, 03:08:07 PM »
  :wink:

It works BUT nothing really coded, just used some work arounds :)

Offline idijotaz

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • CLON Entertainment
Re: [REQ] Add Video From Google
« Reply #6 on: July 01, 2006, 03:10:14 PM »
Can u write all template code?

Offline BartAfterDark

  • Hero Member
  • *****
  • Posts: 520
    • View Profile
Re: [REQ] Add Video From Google
« Reply #7 on: July 01, 2006, 03:30:56 PM »
It's no template code :(

Open: your theme/details.html
Find {image}
Add before (or after)
Code: [Select]
{if google_id}<embed style="width:400px; height:326px;" id="VideoPlayback" align="middle" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=-{google_id}" allowScriptAccess="sameDomain" quality="best" bgcolor="#ffffff" scale="noScale" salign="TL"  FlashVars="playerMode=embedded"> </embed>{endif google_id}
add:
google_id to your 4images_images (mysql)

Add:
Code: [Select]
$additional_image_fields['google_id'] = array($lang['google_video'], "text", 0);to db_field_definitions.php

Now upload this image http://www.bran.dk/google_video.gif (right click save as) to your 4image site.

When you have done that. Click edit image and add the google ID video in the last field. Click save check if it is working.

You can add some text to your language file, so it says what the field is when you edit the image.

And you could propely also add something to the upload template so you don't have to add the ID via edit.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [REQ] Add Video From Google
« Reply #8 on: July 02, 2006, 02:02:23 AM »
Guys, you dont need to add any fields in the database, just use it as remote image and at the end of the url add: &.swf thats all.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline idijotaz

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • CLON Entertainment
Re: [REQ] Add Video From Google
« Reply #9 on: July 02, 2006, 11:36:22 AM »
Guys, you dont need to add any fields in the database, just use it as remote image and at the end of the url add: &.swf thats all.
Can u explain how to make it and what to change? im bad on english  :roll:

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [REQ] Add Video From Google
« Reply #10 on: July 02, 2006, 11:41:51 AM »
just add it at the end of the google video url, like so: [qcode]http://video.google.com/googleplayer.swf?docId=here_movie_id&.swf[/qcode]
This way 4images will think this is a flash file and will use swf.html template
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline idijotaz

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • CLON Entertainment
Re: [REQ] Add Video From Google
« Reply #11 on: July 02, 2006, 11:59:56 AM »
Thanks, its working  :D

Offline idijotaz

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • CLON Entertainment
Re: [REQ] Add Video From Google
« Reply #12 on: July 02, 2006, 12:27:39 PM »
Just one thing... when im adding thumbnail, it saves "googleplayer.swf?docID=-MOVIE_ID&.jpg" name... and dont show it.  :oops:

Offline BartAfterDark

  • Hero Member
  • *****
  • Posts: 520
    • View Profile
Re: [REQ] Add Video From Google
« Reply #13 on: July 02, 2006, 01:03:00 PM »
well, you could still use my workaround. It does not really slow down the site or anything :)

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [REQ] Add Video From Google
« Reply #14 on: July 02, 2006, 08:31:19 PM »
there are many changes needs to be done...
In includes/functions.php at the end, above closing ?> insert:
Code: [Select]
function _basename($text)
{
  if (stristr(PHP_OS, "WIN")) $text = str_replace("\\", "/", $text);
  $name = substr(strrchr($text,"/"), 1);
  $name = ($name) ? $name : $text;
  ereg("(.+)\?(.+)", $name, $regs);
  return ($regs[1]) ? $regs[1] : $name;
}

Then search for basename in that file, member.php and admin/images.php and replace all instances with _basename (make sure you dont replace the new function _basename to __basename ;))
« Last Edit: July 03, 2006, 02:48:43 AM by V@no »
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)