Quote:
Originally Posted by mhipp 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.