Optimised Scriptaculous Module with Thickbox

Register an Account
Reply
 
Thread Tools Display Modes
  #51 (permalink)  
Old 08-31-2007, 09:31 AM
grimusm's Avatar
Casual Pligger
Pligg Version: 9.7
Pligg Template: custom
 
Join Date: Aug 2007
Posts: 51
OK, wasted hours on this and still getting nowhere.

I'm trying to get thumbs to display for the youtube videos.

Currently i have this working fine in a file thumb.php (just a very roughly modded play.php)

Problem is i can't get my head around smarty.

How to include the php along with the story id:

Play does it as (but it is not in an include):
{$my_pligg_base}/play.php?id={$link_id}

I'm trying to include my file and then add the link_id to it.

Looking for something like:
{php}include file='http://www.mysite.com/thumb.php?id={$link_id}'{/php}

Have tried so many variations but nothing can get to work so far.

Any advice would be greatly appreciated.
Reply With Quote
  #52 (permalink)  
Old 09-01-2007, 01:57 AM
New Pligger
 
Join Date: Aug 2007
Posts: 6
hello there how to install scriptaculous in pligg b9.7? i dont see the install button in the module nor the scriptaculous module in the module area.

what seems to be the problem. and can scriptaculous make the image appear in the side of the story or article? and when the image is click the thickbox will make the image appear bigger.
Reply With Quote
  #53 (permalink)  
Old 09-01-2007, 12:21 PM
micxuy's Avatar
Casual Pligger
 
Join Date: May 2007
Posts: 87
Quote:
Originally Posted by grimusm View Post
Not sure if anyone else has had the same problem, but i will tell here just in case someone else has made the same mistake.

Everything looks fine, clicking the link brought up the thickbox but no video was played.

The attached files, play.php needs to have the URL in the form of Google Video.... or YouTube - Broadcast Yourself......

I had tried a few times but no video was displayed, then i saw i had input the URL's with the www.

Just needed to add, to play.php:

Code:
 if (preg_match("/http:\/\/youtube.com\/watch\?v=([0-9a-zA-Z]*)(.*)/i", $url, $matches)) {
        return '<object width="425" height="350">'.
               '<param name="movie" value="http://www.youtube.com/v/'.$matches[1].'" />'.
               '<param name="wmode" value="transparent" />'.
               '<embed src="http://www.youtube.com/v/'.$matches[1].'&autoplay=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350" />'.
               '</object>';
    }
Thank you..but i still have some videos cant not display...well only some for some reasons
Reply With Quote
  #54 (permalink)  
Old 09-03-2007, 09:54 AM
XSP XSP is offline
Casual Pligger
 
Join Date: Jul 2007
Posts: 31
I was finding a similar issue with some of the URLs. For instance I have a youtube video that has an underscore '_' in the id, and the regex in play.php cuts off the url.

For instance:

HTML Code:
http://youtube.com/watch?v=T7z6cK_q5b8
becomes:

HTML Code:
http://youtube.com/watch?v=T7z6cK
I am not a regex guru, but here is my fix. If someone has a better or more efficient way of doing this please correct me.

Open play.php, and change this line:

PHP Code:
if (preg_match("/http:\/\/youtube.com\/watch\?v=([0-9a-zA-Z-]*)(.*)/i"$url$matches)) { 
to this:

PHP Code:
if (preg_match("/http:\/\/youtube.com\/watch\?v=([0-9a-zA-Z-_-]*)(.*)/i"$url$matches)) { 
Reply With Quote
  #55 (permalink)  
Old 10-05-2007, 10:34 AM
New Pligger
 
Join Date: Mar 2007
Posts: 22
I am using plig 9.8.2
Everything is good except for the close link. It does not close the video. Any ideas?
Also in the installation.txt there are no any changes in the submit_step_1.tpl. So i can click video and the link_type become 1

Last edited by blackpr; 10-05-2007 at 12:17 PM.
Reply With Quote
  #56 (permalink)  
Old 10-05-2007, 02:13 PM
New Pligger
 
Join Date: Mar 2007
Posts: 22
Hello,
I have made a hack and i want to share it with you.
If you want to have a thumbnail of the youtube video instead of a standard image follow the next steps:
Open the /libs/link.php file:
add in the function read below the
Code:
$this->link_field15=$link->link_field15;
these two lines:
Code:
$youtubevide=explode("=", $this->url= $link->link_url);
$this->yt=$youtubevide[1];
In the same file add below
Code:
$smarty->assign('story_status', $this->status);
the line
Code:
	$smarty->assign('yt_vid_id',  $this->yt);
Now in the template file that you have the
Code:
{if $story_type eq "1"}
<a class="thickbox" href="{$my_pligg_base}/play.php?id={$link_id}&height=425&width=450" title="View the Video file {$title_short}">
<img src="{$my_pligg_base}/path/to/video/image/video.jpg" width="80" height="64" border="0" alt="" /></a>
{/if}
change to
Code:
{if $story_type eq "1"}
<a class="thickbox" href="{$my_pligg_base}/play.php?id={$link_id}&height=425&width=450" title="View the Video file {$title_short}">
<img src="http://img.youtube.com/vi/{$yt_vid_id}/2.jpg" width="80" height="64" border="0" alt="" /></a>
{/if}
Reply With Quote
  #57 (permalink)  
Old 10-06-2007, 02:25 PM
New Pligger
 
Join Date: Mar 2007
Posts: 22
I can not give a live demo because i made this localhost.
I attached a capture image
Attached Thumbnails
Optimised Scriptaculous Module with Thickbox-youtube.jpg  
Reply With Quote
  #58 (permalink)  
Old 11-04-2007, 05:59 PM
Casual Pligger
Pligg Version: 9.6
Pligg Template: yget, molli
 
Join Date: Jul 2007
Posts: 29
Send a message via MSN to sadegazoz
a few questions about adding video to my site
1- i need video files in another place like http://www.mysite.com/video or in a subdomain like http://video.mysite.com to post them apart from my news links page.
2- i want users to upload videos in videos submit pages.
what should i do?
do i need to add another Mysql database?
do i have to upload main submit.php and all other files like yget template and etc to this video file in a different place?
should i use thickbox to add videos to my site?
if someone can help me, i will be appreciated.
thanks
Reply With Quote
  #59 (permalink)  
Old 12-17-2007, 11:12 PM
micxuy's Avatar
Casual Pligger
 
Join Date: May 2007
Posts: 87
The Videos page doesnt work well.

Well if the main page only has one 1 video, then when you access to yoursite.com.videos it will show only 1 video in the main page, other videos on other pages will not show.

So it means like:
Main page - page 1 - 1 video - 9 news
Videos page - page 1 - 1 video

Main page - page 2 - 9 videos - 1 new
Videos page(still) - page 1 - 1 video but page 2 - 9 videos

Is there any way to fix so when you access to videos page it will show all the videos, not depends on the main page has how many?

Thank you
Reply With Quote
  #60 (permalink)  
Old 01-02-2008, 01:11 AM
grimusm's Avatar
Casual Pligger
Pligg Version: 9.7
Pligg Template: custom
 
Join Date: Aug 2007
Posts: 51
Quote:
Originally Posted by micxuy View Post
The Videos page doesnt work well.

Well if the main page only has one 1 video, then when you access to yoursite.com.videos it will show only 1 video in the main page, other videos on other pages will not show.

So it means like:
Main page - page 1 - 1 video - 9 news
Videos page - page 1 - 1 video

Main page - page 2 - 9 videos - 1 new
Videos page(still) - page 1 - 1 video but page 2 - 9 videos

Is there any way to fix so when you access to videos page it will show all the videos, not depends on the main page has how many?

Thank you
I have just noticed the above too, before i read your post. I will have a look into it see if there is anything i can do to fix it.

EDIT: Have managed to make all the video's display in order from date published (ignoring the actual page number)

open 'videos.php'

find:
Code:
if(!isset($_REQUEST['search'])){$search->orderBy = "link_published_date DESC";}
replace with:
Code:
if(!isset($_REQUEST['search'])){$search->orderBy = "link_type DESC,link_published_date DESC";}
Only thing is the pagination displays for (all articles) not just (video pages) - therefore may be many empty pages. I will look to see if i can fix this too.

EDIT: (probably won't have time to look at this - haven't had any luck so far - /libs/html1.php is where the pagination is located. I guess justs needs to count only $link_type = 1 for videos.php pages. Not sure how to do this though.)


Also on another note, does anyone know if it is possible to include an EVB or other vote button on the video thickbox? (like in digg.com videos)

Last edited by grimusm; 01-02-2008 at 02:57 AM. Reason: Added: make all the video's display in order from date published (ignoring the actual page number)
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Upload Module (File and Image Attachment) Yankidank Free Modules 268 02-03-2012 12:19 PM
Fixes to Profile Extra Fields Module v0.2 and Extended Profile Module v0.1 redwine Questions and Comments 11 12-20-2010 04:18 PM
Help Installing Thickbox for Upload module aguillen Questions and Comments 1 06-26-2009 02:19 AM
[MOD] Thickbox Module for Pligg cent Questions and Comments 35 11-19-2008 10:54 AM
Lightbox Thickbox Scriptaculous jbquery revolver Questions and Comments 3 04-18-2007 01:54 PM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development