Go Back   Pligg CMS Forum > Pligg Development > Modification Tutorials

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-06-2007, 06:06 PM
New Pligger
 
Join Date: Mar 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
digg.com/videos

I have searched and have not found a clear answer to the question of a digg.com/videos mod. Is there such an animal for pligg?

The business model of my community revolves around the voting on of videos submitted my members. If there is such a mod that mirrors the functionallity of digg.com/videos, I would be very very grateful for a link.

Have a wonderful day.

EDIT: I'd pay someone to make this mod possible. Do we have any coders for hire here in the Pligg community? Once finished, I'd be happy to release it to the masses. So, if coded it would be best as a module for release to the community.

Last edited by mhipp; 03-06-2007 at 07:09 PM..
Reply With Quote
  #2 (permalink)  
Old 03-06-2007, 07:29 PM
Constant Pligger
 
Join Date: Apr 2006
Location: USA
Posts: 576
Thanks: 31
Thanked 24 Times in 20 Posts
There is a video mod, im pretty sure its in the mod options when you install pligg.
__________________
God bless,
-en3r0

Torrop.com - Torrent and P2P News
MemeVote.com - Find and vote on Memes
Reply With Quote
  #3 (permalink)  
Old 03-06-2007, 08:24 PM
kbeeveer46's Avatar
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,547
Thanks: 254
Thanked 649 Times in 513 Posts
the current video mod just makes it easier to insert videos but what I think many people want is a small preview like digg has and then clicking it opens up lightbox with the video inside it.
__________________
I accept donations for my time helping users like you on the forum and IRC.
Reply With Quote
  #4 (permalink)  
Old 03-07-2007, 01:06 AM
New Pligger
 
Join Date: Mar 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kbeeveer46 View Post
the current video mod just makes it easier to insert videos but what I think many people want is a small preview like digg has and then clicking it opens up lightbox with the video inside it.
Exactly. To be ideal, it should work like http://www.digg.com/videos
Reply With Quote
  #5 (permalink)  
Old 03-10-2007, 11:53 PM
New Pligger
 
Join Date: Feb 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
If somebody has this function, im willing to pay for it
Reply With Quote
  #6 (permalink)  
Old 03-13-2007, 12:33 PM
New Pligger
 
Join Date: Apr 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Hello.
Check http://theBest.TV. This is my new pligg video site. I just put it up this weekend. Still a work in progress.

I don't have the pictures from the videos but ultimately I don't need then. Check it out and tell me what do you think.

All critics are welcome.

Regards
__________________
http://theBest.TV
Reply With Quote
  #7 (permalink)  
Old 03-14-2007, 03:15 PM
New Pligger
 
Join Date: Dec 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by ioapligg View Post
Hello.
Check http://theBest.TV. This is my new pligg video site. I just put it up this weekend. Still a work in progress.

I don't have the pictures from the videos but ultimately I don't need then. Check it out and tell me what do you think.

All critics are welcome.

Regards
I think it's something similar to your site is what the OP of this post is asking for. I'll also be curious to know if anyone has this mod.
Reply With Quote
  #8 (permalink)  
Old 03-14-2007, 04:57 PM
Casual Pligger
 
Join Date: Oct 2006
Posts: 33
Thanks: 1
Thanked 3 Times in 2 Posts
There is some php for doing getting the thumbnail in drupal here - http://drupal.org/node/74779

Basically, you need to talk to the youtube API, like so:
http://www.youtube.com/api2_rest?met...id=N9RFAl48tgI

That returns a bunch of XML, you just need to find the thumbnail url chunk:
<thumbnail_url>http://sjc-static12.sjc.youtube.com/vi/N9RFAl48tgI/2.jpg</thumbnail_url>

I also need this functionality - at least the thumbnail part of it - so would love it if someone could add it to pligg.
Reply With Quote
  #9 (permalink)  
Old 03-14-2007, 05:43 PM
Casual Pligger
 
Join Date: Oct 2006
Posts: 33
Thanks: 1
Thanked 3 Times in 2 Posts
Well, since no one was answering my pleas for help in the chatroom, I decided to see what I could do with this. So far so good - if you are running php 5:

PHP Code:
<?php 
  
// set the XML file name as a PHP string
  
$youtube_XML "http://www.youtube.com/api2_rest?method=youtube.videos.get_details&dev_id=xxxxxxxxxxxx&video_id=N9RFAl48tgI"
  
// load the XML file 
  
$xml = @simplexml_load_file($youtube_XML) or die ("no file loaded") ; 
  
// assign the video thumb element to a string
  
$video_thumb $xml->video_details->thumbnail_url;
  echo 
"<img src=" $video_thumb " />";
?>
the simplexml function makes working with the xml very easy, but is ONLY in php 5.

Copy and paste that into a php file - adding your own youtube developer API ID - and it will return a thumbnail. Now I just need to put it in a module or something. Which brings me back to the question I posted here - passing php variables to my tpl file.
Reply With Quote
The Following User Says Thank You to cruci For This Useful Post:
  #10 (permalink)  
Old 03-19-2007, 01:41 AM
Constant Pligger
 
Join Date: Mar 2006
Posts: 575
Thanks: 14
Thanked 126 Times in 61 Posts
Quote:
Originally Posted by mhipp View Post
I have searched and have not found a clear answer to the question of a digg.com/videos mod. Is there such an animal for pligg?

The business model of my community revolves around the voting on of videos submitted my members. If there is such a mod that mirrors the functionallity of digg.com/videos, I would be very very grateful for a link.

Have a wonderful day.

EDIT: I'd pay someone to make this mod possible. Do we have any coders for hire here in the Pligg community? Once finished, I'd be happy to release it to the masses. So, if coded it would be best as a module for release to the community.
I tried doing a basic copy of the videos section of digg here. If you click on the video area of the top story at the moment (LOTR), the video should open in a thickbox (light weight version of lightbox). I'll add some basic pointers for what i did:

1.) Edited the 1st step submission template to include radio buttons - article or video. Then added an extra db column to pligg_links (link_type) and edited the store and read functions in libs/link.php to ensure that the value of the radio buttons was recorded / selected in the database. If video was selected, the value was 1, otherwise 0. Added link_type as a smarty variable in the same file.

2.) Edited link_summary.tpl using my newly created {$link_type eq 1} varaible to differentiate posts with videos in, and posts without. So if the value comes back as 1, a small video area with play button is displayed.

3.) Created a file called play.php to the root directory. I added an example below, and it needs the link id appended to the url to work:

Code:
<?php

include('libs/dbconnect.php');

$connect_video = @mysql_connect(EZSQL_DB_HOST, EZSQL_DB_USER, EZSQL_DB_PASSWORD);
$database_video = @mysql_select_db(EZSQL_DB_NAME, $connect_video);

$id = mysql_real_escape_string(strip_tags($_GET['id']));
$play_query = mysql_query("SELECT link_votes,link_url FROM pligg_links WHERE link_id=\"$id\" AND (link_status='published' OR link_status='queued') AND link_type='1' LIMIT 1");
$play = mysql_fetch_array($play_query);
$play_url = $play['link_url'];
$votes = $play['link_votes'];

$close = @mysql_close($connect_video);
 
?>

<div>
<center>
<object width="425" height="350">
<param name="movie" value="<?php echo $play_url ?>"></param>
<param name="wmode" value="transparent"></param>
<embed src="<?php echo $play_url ?>" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed>
</object>
<br /><br />
<b>Total Votes for this Video:</b> <?php echo $votes ?>
</center>
</div>
4.) Uploaded thickbox, and added the css and js files to the pligg.tpl template. Created a link to play the video (play.php) which included link id, height and width (eg. play.php?id={$link_id}&height=400&width=400), and gave it the attribute class="thickbox". When a user clicks on the link, the video will open in a digg-like window.

5.) Copied the index.php and upcoming.php and renamed to video.php and video-upcoming.php, and did the same with corresponding template files. Created a copy of (and renamed) libs/link_summary.php and edited to only show stories with a link type of 1 - just a simple condition like if($link->type == 1). Then edited the video templates with the renamed files, and that was that.

Demo: http://news.oioplus.com

That's just a basic outline, i'm sure someone can take it and improve upon it.
__________________


Last edited by Simon; 03-19-2007 at 01:47 AM..
Reply With Quote
The Following 9 Users Say Thank You to Simon For This Useful Post:
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Search Engine Friendly URLs by vBSEO 3.2.0