4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: live@ct on June 30, 2006, 04:53:02 AM

Title: [REQ] Add Video From Google
Post by: live@ct 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!!
Title: Re: [REQ] Add Video From Google
Post by: V@no 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 :(
Title: Re: [REQ] Add Video From Google
Post by: BartAfterDark on July 01, 2006, 12:25:21 PM
You could download the file from google and add it to your site
Title: Re: [REQ] Add Video From Google
Post by: Zyga 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>
Title: Re: [REQ] Add Video From Google
Post by: BartAfterDark 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
Title: Re: [REQ] Add Video From Google
Post by: BartAfterDark on July 01, 2006, 03:08:07 PM
(http://www.bran.dk/google_test.jpg)  :wink:

It works BUT nothing really coded, just used some work arounds :)
Title: Re: [REQ] Add Video From Google
Post by: idijotaz on July 01, 2006, 03:10:14 PM
Can u write all template code?
Title: Re: [REQ] Add Video From Google
Post by: BartAfterDark 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.
Title: Re: [REQ] Add Video From Google
Post by: V@no 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.
Title: Re: [REQ] Add Video From Google
Post by: idijotaz 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:
Title: Re: [REQ] Add Video From Google
Post by: V@no 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
Title: Re: [REQ] Add Video From Google
Post by: idijotaz on July 02, 2006, 11:59:56 AM
Thanks, its working  :D
Title: Re: [REQ] Add Video From Google
Post by: idijotaz 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:
Title: Re: [REQ] Add Video From Google
Post by: BartAfterDark 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 :)
Title: Re: [REQ] Add Video From Google
Post by: V@no 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 ;))
Title: Re: [REQ] Add Video From Google
Post by: live@ct on July 03, 2006, 01:28:34 AM
I made the changes but it showme a file not found in all the gallery images!  8O

what im doing wrong?!
Title: Re: [REQ] Add Video From Google
Post by: V@no on July 03, 2006, 02:12:19 AM
omg...what's wrong with me...I posted a wrong function...post updated, sorry about that.
Title: Re: [REQ] Add Video From Google
Post by: live@ct on July 03, 2006, 08:18:39 AM
v@no

I made the changes but nothing happend the swf or video files didnt show, it show a blanc box

 :?: :?: :?: :?:
Title: Re: [REQ] Add Video From Google
Post by: live@ct on July 04, 2006, 03:43:50 AM
Now I get this error

Template Error: Couldn't open Template ./templates/default/media/.html

Title: Re: [REQ] Add Video From Google
Post by: hyde101 on May 13, 2007, 06:01:22 AM
Now I get this error

Template Error: Couldn't open Template ./templates/default/media/.html



Same problem with mine. It must have something to do with the thumbnail display on index under "new images" since it happes in the thumnail view..
How do we fix it?

EDIT:
OK, I copied swf.html and uploaded a copy as .html  (blank.html) so it works, the home page and thumbs work, however when I click on it, it doesn't display anything. Is there any other way of adding google video to the 4images :(
Title: Re: [REQ] Add Video From Google
Post by: impss on May 13, 2007, 08:54:16 AM
Is there any other way of adding google video to the 4images :(

http://www.4homepages.de/forum/index.php?topic=13557.0
Title: Re: [REQ] Add Video From Google
Post by: hyde101 on May 13, 2007, 05:07:39 PM
Yeah but that's pretty complicated for a simple task. I thought V@no's description above was pretty easy and straight forward, but I assume google changed their structure so now it doesn't let you use the &.swf to use them as flash? :(