Go Back   Pligg CMS Forum > Pligg Development > Modification Tutorials

Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 03-22-2007, 10:56 AM
Casual Pligger
 
Join Date: Mar 2007
Location: NY
Posts: 51
Thanks: 6
Thanked 1 Time in 1 Post
Good Job Simon!

Thank you Simon! That code was brilliant!

I was wondering if it was okay with you for me to expand on to that code. Digg.com also has the digg button within the pop up video playing window. I think I can figure out how to add that in there as well to make it resemble Digg.com's video feature more.

With your permission of course.
Reply With Quote
The Following User Says Thank You to mryder For This Useful Post:
  #12 (permalink)  
Old 03-22-2007, 11:01 AM
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
Very cool feature. One more thing I've saved to look at this weekend :P
__________________
I accept donations for my time helping users like you on the forum and IRC.
Reply With Quote
  #13 (permalink)  
Old 03-22-2007, 12:00 PM
New Pligger
 
Join Date: Mar 2007
Posts: 4
Thanks: 0
Thanked 1 Time in 1 Post
Smile Could you share the code here

What you just describe is great, but it will be more helpful if you share the codes here. That way someone else can pick it up for further development. I look forward t the complete files. great work.
Reply With Quote
The Following User Says Thank You to timusa For This Useful Post:
  #14 (permalink)  
Old 03-23-2007, 10:34 AM
Constant Pligger
 
Join Date: Mar 2006
Posts: 575
Thanks: 14
Thanked 126 Times in 61 Posts
Quote:
Originally Posted by mryder View Post
Thank you Simon! That code was brilliant!

I was wondering if it was okay with you for me to expand on to that code. Digg.com also has the digg button within the pop up video playing window. I think I can figure out how to add that in there as well to make it resemble Digg.com's video feature more.

With your permission of course.
Go right ahead - I don't have time to make much progress on it, so I was hoping someone else would take it up.

I was thinking the final goal should be "media" in general, not just limited to videos....music files and images can easily be included too. Take a look at bandbuzz for example (not based on pligg) for an example of how to deal with music.
__________________


Last edited by Simon; 03-23-2007 at 02:18 PM..
Reply With Quote
  #15 (permalink)  
Old 03-23-2007, 04:57 PM
Constant Pligger
 
Join Date: Mar 2006
Posts: 575
Thanks: 14
Thanked 126 Times in 61 Posts
While I was at it, I added in the ability to display other types of media files (image and music), using this mediaplayer as a start.

Demo here. Play.php becomes something like:

Code:
<?php

include('config.php');

$id = mysql_real_escape_string(strip_tags($_GET['id']));
$play_query = mysql_query("SELECT link_votes,link_url,link_type FROM " . table_links . " WHERE link_id=\"$id\" AND (link_status='published' OR link_status='queued') AND link_type!='0' LIMIT 1");
$play_array = mysql_fetch_array($play_query);
$play = $play_array['link_url'];
$votes = $play_array['link_votes'];
$type = $play_array['link_type'];
 
?>

<?php if($type == 1) { ?>
<div>
<center>
<object width="425" height="350">
<param name="movie" value="<?php echo $play ?>" />
<param name="wmode" value="transparent" />
<embed src="<?php echo $play ?>&autoplay=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350" />
</object>
<br /><br />
<b>Total Votes for this Video File:</b> <?php echo $votes ?>
</center>
</div>
<?php } ?>

<?php if($type == 2) { ?>
<div style="margin-top:15px">
<center>
<object width="425" height="350">
<embed src="/flash/mediaplayer.swf" flashvars="file=<?php echo $play ?>&autostart=true" width="425" height="350" quality="high" type="application/x-shockwave-flash" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
<br /><br />
<b>Total Votes for this Media File:</b> <?php echo $votes ?>
</center>
</div>
<?php } ?>
For those of you looking for the "finished" files, there is no point releasing anything until it has been refined a little. The beauty of opensource is that we can collaborate on things and then release something really good. What I currently have looks bad (no nice looking previews etc) and has nothing like url checks to make sure the correct urls are entered. The reason I outlined some initial instructions on the 1st page was to hopefully get a couple of people (coders) interested in taking it further.
__________________


Last edited by Simon; 03-23-2007 at 10:17 PM..
Reply With Quote
  #16 (permalink)  
Old 03-26-2007, 07:08 AM
Casual Pligger
 
Join Date: Sep 2006
Posts: 49
Thanks: 16
Thanked 2 Times in 2 Posts
Thank you Simon for this mod !
Can you tell us how do you made your video link to display only the video stories here : http://news.oioplus.com/videos/ ?
Thanks
Reply With Quote
  #17 (permalink)  
Old 03-26-2007, 11:34 AM
Constant Pligger
 
Join Date: Mar 2006
Posts: 575
Thanks: 14
Thanked 126 Times in 61 Posts
I have put together a short tutorial, with some modified files (although others you will have to modify yourself when following the instructions), to allow people to add this kind of video submission functionality.

Remember: this isn't finished, since there are elements like url checking missing, and it has only been tested with youtube videos. Any further modifications you would like to make are fine. I will not be developing this further, as I have no time to.

Latest download package here.
__________________


Last edited by Simon; 04-19-2007 at 09:44 AM..
Reply With Quote
  #18 (permalink)  
Old 03-26-2007, 12:38 PM
New Pligger
 
Join Date: Mar 2007
Posts: 21
Thanks: 3
Thanked 0 Times in 0 Posts
I am getting an damaged .zip file.....
Reply With Quote
  #19 (permalink)  
Old 03-26-2007, 12:51 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
I think the permissions are messed up for attachments on the server. I'll notify yank so we can get this fixed.
__________________
I accept donations for my time helping users like you on the forum and IRC.
Reply With Quote
  #20 (permalink)  
Old 03-27-2007, 12:46 AM
Casual Pligger
 
Join Date: Mar 2007
Location: NY
Posts: 51
Thanks: 6
Thanked 1 Time in 1 Post
Quote:
Originally Posted by Simon View Post
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.

Simon, can you or someone else break this down for me. I am really not a coder at all. I'm pretty amateur, still learning.
Reply With Quote
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