31
jayjay
Re: Youtube HotLink Gallery
  • 2007/9/5 12:14

  • jayjay

  • Not too shy to talk

  • Posts: 175

  • Since: 2003/9/10


@MacDo
I have changed the 'top' block to show screenshots of videos.

Add this in xoopstube_block_new.html:

<li><a href="<{$xoops_url}>/modules/<{$videoload.dirname}>/singlevideo.php?cid=<{$videoload.cid}>&lid=<{$videoload.id}>"><{$videoload.title}>a> (<{$videoload.date}>)[color=FF0000]<br><img src="http://img.youtube.com/vi/<{$videoload.url}>/default.jpg"width="120" height="90" hspace="7" vspace="3" border="0" align="left" />[/color]li>


Add this in xoopstube_top.php:
$result $xoopsDB -> query"SELECT lid, cid, title, [color=FF0000]url,[/color] date, hits FROM " $xoopsDB -> prefix'xoopstube_videos' ) . " WHERE published > 0 AND published <= " time() . " AND (expired = 0 OR expired > " time() . ") AND offline = 0 ORDER BY " $options[0] . " DESC"$options[1], );


And before $videoload['dirname']:

$videoload['url'] = $myrow['url'];


Maybe you could make people choose in module options:
- auto-thumbnails through our above hacks
- manual screenshots the old-fashioned way

This could be done with a new admin option and a smarty if-else statement in blocks (if manual else auto).

I myself think that few people will use manual screenshots if they discover the simplicity of this thumbnail concept

32
McDonald
Re: Youtube HotLink Gallery
  • 2007/9/5 12:21

  • McDonald

  • Home away from home

  • Posts: 1072

  • Since: 2005/8/15


Maybe I'll will make it 4 blocks: 2x with text links and 2x with thumb links.

...and maybe some users can this themself also



PS. keep in mind that this module was made for personal use only, and might therefor still contain some uncontrolable bugs.

33
jayjay
Re: Youtube HotLink Gallery
  • 2007/9/5 12:24

  • jayjay

  • Not too shy to talk

  • Posts: 175

  • Since: 2003/9/10


Quote:

McDonald wrote:
Maybe I'll will make it 4 blocks: 2x with text links and 2x with thumb links.

...and maybe some users can this themself also



PS. keep in mind that this module was made for personal use only, and might therefor still contain some uncontrolable bugs.


Great idea!

It's a great little module and I hope you keep maintaining it. I haven't found any bugs until now

34
McDonald
Re: Youtube HotLink Gallery
  • 2007/9/5 21:07

  • McDonald

  • Home away from home

  • Posts: 1072

  • Since: 2005/8/15


Hello elbeer,

There are some typos in the file submit.php.
I am working on an updated version that includes this bugfix and has some other changes (see jayjay's posts).

In the mean time I'll would suggest you'll replace the submit.php with this one:
/**
 * $Id: submit.php
 * Module: XoopsTube
 * Version: v1.0.0
 * Licence: GNU
 */

include 'header.php';
include 
XOOPS_ROOT_PATH '/header.php';
include 
XOOPS_ROOT_PATH '/class/xoopsformloader.php';

$mytree = new XoopsTree$xoopsDB -> prefix'xoopstube_cat' ), 'cid''pid' );
global 
$xtubemyts$xoopsModuleConfig;

$cid xtube_cleanRequestVars$_REQUEST'cid');
$lid xtube_cleanRequestVars$_REQUEST'lid');

if ( 
false == checkgroups$cid'XTubeSubPerm' ) )
{
    
redirect_header"index.php"1_MD_XTUBE_NOPERMISSIONTOPOST );
    exit();


if ( 
true == checkgroups$cid'XTubeSubPerm' ) )
{
    if ( 
xtube_cleanRequestVars$_REQUEST'submit') )
    {
        if ( 
false == checkgroups$cid'XTubeSubPerm' ) )
        {
            
redirect_header"index.php"1_MD_XTUBE_NOPERMISSIONTOPOST );
            exit();
        } 

        
$submitter = ( is_object$xoopsUser ) && !empty( $xoopsUser ) ) ? $xoopsUser -> getVar'uid' ) : 0;
        
$forumid xtube_cleanRequestVars$_REQUEST'forumid');
        
$offline xtube_cleanRequestVars$_REQUEST'offline');
//        $urlrating = xtube_cleanRequestVars( $_REQUEST, 'urlrating', 6 );
        
$notifypub xtube_cleanRequestVars$_REQUEST'notifypub');
        
$approve xtube_cleanRequestVars$_REQUEST'approve');
        
$url $xtubemyts -> addslashesltrim($_POST["url"]) );
        
$title $xtubemyts -> addslashesltrim$_REQUEST["title"] ) );
        
$descriptionb $xtubemyts -> addslashesltrim$_REQUEST["descriptionb"] ) );
        
$time $xtubemyts -> addslashesltrim$_REQUEST["time"] ) );
        
$keywords $xtubemyts -> addslashesltrim$_REQUEST["keywords"] ) );
        
$date time();
        
$publishdate 0;
        
$ipaddress $_SERVER['REMOTE_ADDR'];

        if ( 
$lid == )
        {
            
$status 0;
            
$publishdate 0;
            
$message _MD_XTUBE_THANKSFORINFO;
            if ( 
true == checkgroups$cid'XTubeAutoApp' ) )
            {
                
$publishdate time();
                
$status 1;
                
$message _MD_XTUBE_ISAPPROVED;
            } 
            
$sql "INSERT INTO " $xoopsDB -> prefix'xoopstube_videos' ) . "    (lid, cid, title, url, submitter, status, date, hits, rating, votes, comments, forumid, published, expired, offline, description, ipaddress, notifypub, urlrating, time, keywords) ";
            
$sql .= " VALUES     ('', $cid, '$title', '$url', '$submitter', '$status', '$date', 0, 0, 0, 0, '$forumid', '$publishdate', 0, '$offline', '$descriptionb', '$ipaddress', '$notifypub', '$urlrating', '$time', '$keywords')";
            if ( !
$result $xoopsDB -> query$sql ) )
            {
                
$_error $xoopsDB -> error() . " : " $xoopsDB -> errno();
                
XoopsErrorHandler_HandleErrorE_USER_WARNING$_error__FILE____LINE__ );
            } 
            
$newid $xoopsDB -> getInsertId();

            
/**
             * Notify of new link (anywhere) and new link in category
             */
            
$notification_handler = &xoops_gethandler'notification' );

            
$tags = array();
            
$tags['VIDEO_NAME'] = $title;
            
$tags['VIDEO_URL'] = XOOPS_URL '/modules/' $xoopsModule -> getVar'dirname' ) . '/singlevideo.php?cid=' $cid '&lid=' $newid;
            
            
$sql "SELECT title FROM " $xoopsDB -> prefix'xoopstube_cat' ) . " WHERE cid=" $cid;
            
$result $xoopsDB -> query$sql );
            
$row $xoopsDB -> fetchArray$result );

            
$tags['CATEGORY_NAME'] = $row['title'];
            
$tags['CATEGORY_URL'] = XOOPS_URL '/modules/' $xoopsModule -> getVar'dirname' ) . '/viewcat.php?cid=' $cid;
            if ( 
true == checkgroups$cid'XTubeAutoApp' ) )
            {
                
$notification_handler -> triggerEvent'global'0'new_video'$tags );
                
$notification_handler -> triggerEvent'category'$cid'new_video'$tags );
                
redirect_header'index.php'2_MD_XTUBE_ISAPPROVED );
            } 
            else
            {
                
$tags['WAITINGFILES_URL'] = XOOPS_URL '/modules/' $xoopsModule -> getVar'dirname' ) . '/admin/newvideos.php';
                
$notification_handler -> triggerEvent'global'0'video_submit'$tags );
                
$notification_handler -> triggerEvent'category'$cid'video_submit'$tags );
                if ( 
$notifypub )
                {
                    include_once 
XOOPS_ROOT_PATH '/include/notification_constants.php';
                    
$notification_handler -> subscribe'video'$newid'approve'XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE );
                } 
                
redirect_header'index.php'2_MD_XTUBE_THANKSFORINFO );
            } 
        } 
        else
        {
            if ( 
true == checkgroups$cid'XTubeAutoApp' ) || $approve == )
            {
                
$updated time();
                
$sql "UPDATE " $xoopsDB -> prefix'xoopstube_videos' ) . " SET cid=$cid, title='$title', url='$url', updated='$updated', offline='$offline', description='$descriptionb', ipaddress='$ipaddress', notifypub='$notifypub', urlrating='$urlrating', time='$time', keywords='$keywords' WHERE lid =" $lid;
                if ( !
$result $xoopsDB -> query$sql ) )
                {
                    
$_error $xoopsDB -> error() . " : " $xoopsDB -> errno();
                    
XoopsErrorHandler_HandleErrorE_USER_WARNING$_error__FILE____LINE__ );
                } 

                
$notification_handler = &xoops_gethandler'notification' );
                
$tags = array();
                
$tags['VIDEO_NAME'] = $title;
                
$tags['VIDEO_URL'] = XOOPS_URL '/modules/' $xoopsModule -> getVar'dirname' ) . '/singlevideo.php?cid=' $cid '&lid=' $lid;
                
$sql "SELECT title FROM " $xoopsDB -> prefix'xoopstube_cat' ) . " WHERE cid=" $cid;
                
$result $xoopsDB -> query$sql );
                
$row $xoopsDB -> fetchArray$result );
                
$tags['CATEGORY_NAME'] = $row['title'];
                
$tags['CATEGORY_URL'] = XOOPS_URL '/modules/' $xoopsModule -> getVar'dirname' ) . '/viewcat.php?cid=' $cid;

                
$notification_handler -> triggerEvent'global'0'new_video'$tags );
                
$notification_handler -> triggerEvent'category'$cid'new_video'$tags );
                
$_message _MD_XTUBE_ISAPPROVED;
            } 
            else
            {
                
$modifysubmitter $xoopsUser -> uid();
                
$requestid $modifysubmitter;
                
$requestdate time();
                
$updated xtube_cleanRequestVars$_REQUEST'up_dated'time() );
                
$sql "INSERT INTO " $xoopsDB -> prefix'xoopstube_mod' ) . " (requestid, lid, cid, title, url, forumid, description, modifysubmitter, requestdate)";
                
$sql .= " VALUES ('', $lid$cid, '$title', '$url', '$forumid', '$descriptionb', '$urlrating' '$modifysubmitter', '$requestdate')";
                if ( !
$result $xoopsDB -> query$sql ) )
                {
                    
$_error $xoopsDB -> error() . " : " $xoopsDB -> errno();
                    
XoopsErrorHandler_HandleErrorE_USER_WARNING$_error__FILE____LINE__ );
                } 

                
$tags = array();
                
$tags['MODIFYREPORTS_URL'] = XOOPS_URL '/modules/' $xoopsModule -> getVar'dirname' ) . '/admin/index.php?op=listModReq';
                
$notification_handler = &xoops_gethandler'notification' );
                
$notification_handler -> triggerEvent'global'0'video_modify'$tags );

                
$tags['WAITINGFILES_URL'] = XOOPS_URL '/modules/' $xoopsModule -> getVar'dirname' ) . '/admin/index.php?op=listNewvideos';
                
$notification_handler -> triggerEvent'global'0'video_submit'$tags );
                
$notification_handler -> triggerEvent'category'$cid'video_submit'$tags );
                if ( 
$notifypub )
                {
                    include_once 
XOOPS_ROOT_PATH '/include/notification_constants.php';
                    
$notification_handler -> subscribe'video'$newid'approve'XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE );
                }
                
$_message _MD_XTUBE_THANKSFORINFO;
            }
            
redirect_header"index.php"2$_message );
        }
    }
    else
    {
        global 
$xoopsModuleConfig;

        
$approve xtube_cleanRequestVars$_REQUEST'approve');
        
/*
        * Show disclaimer
        */
        
if ( $xoopsModuleConfig['showdisclaimer'] && !isset( $_GET['agree'] ) && $approve == )
        {
            echo 
"xtube_imageheader() . "
n";
            echo 
"

_MD_XTUBE_DISCLAIMERAGREEMENT "

n"
;
            echo 
"
$xtubemyts -> displayTarea$xoopsModuleConfig['disclaimer'], 1111) . "
n"
;
            echo 
"n";
            echo 
"_MD_XTUBE_DOYOUAGREE "n";
            echo 
"submit.php?agree=1"' class='formButton' value='" _MD_XTUBE_AGREE "' alt='" _MD_XTUBE_AGREE "' />n";
            echo 
" n";
            echo 
"index.php"' class='formButton' value='" _CANCEL "' alt='" _CANCEL "' />n";
            echo 
"
n";
            include 
XOOPS_ROOT_PATH '/footer.php';
            exit();
        }
        echo 
"xtube_imageheader() . "
n";
        echo 
"
_MD_XTUBE_SUB_SNEWMNAMEDESC "
nn"
;

        
$sql "SELECT * FROM " $xoopsDB -> prefix'xoopstube_videos' ) . " WHERE lid=" intval$lid );
        
$video_array $xoopsDB -> fetchArray$xoopsDB -> query$sql ) );

        
$lid $video_array['lid'] ? $video_array['lid'] : 0;
        
$cid $video_array['cid'] ? $video_array['cid'] : 0;
        
$title $video_array['title'] ? $xtubemyts -> htmlSpecialCharsStrip$video_array['title'] ) : '';
        
$url $video_array['url'] ? $xtubemyts -> htmlSpecialCharsStrip$video_array['url'] ) : '';
        
$publisher $video_array['publisher'] ? $xtubemyts -> htmlSpecialCharsStrip$video_array['publisher'] ) : '';
        
$screenshot $video_array['screenshot'] ? $xtubemyts -> htmlSpecialCharsStrip$video_array['screenshot'] ) : '';
        
$descriptionb $video_array['description'] ? $xtubemyts -> htmlSpecialCharsStrip$video_array['description'] ) : '';
        
$published $video_array['published'] ? $video_array['published'] : 0;
        
$expired $video_array['expired'] ? $video_array['expired'] : 0;
        
$updated $video_array['updated'] ? $video_array['updated'] : 0;
        
$offline $video_array['offline'] ? $video_array['offline'] : 0;
        
$forumid $video_array['forumid'] ? $video_array['forumid'] : 0;
        
$ipaddress $video_array['ipaddress'] ? $video_array['ipaddress'] : 0;
        
$notifypub $video_array['notifypub'] ? $video_array['notifypub'] : 0;
        
$urlrating $video_array['urlrating'] ? $video_array['urlrating'] : 1;
        
$time $video_array['time'] ? $xtubemyts -> htmlSpecialCharsStrip$video_array['time'] ) : '00:00';
        
$keywords $video_array['keywords'] ? $xtubemyts -> htmlSpecialCharsStrip$video_array['keywords'] ) : '';

         
$sform = new XoopsThemeForm_MD_XTUBE_SUBMITCATHEAD"storyform"xoops_getenv'PHP_SELF' ) );
        
$sform -> setExtra'enctype="multipart/form-data"' );
        
$sform -> addElement( new XoopsFormText_MD_XTUBE_FILETITLE'title'50255$title ), true );
        
$sform -> addElement( new XoopsFormText_MD_XTUBE_DLURL'url'50255$url ), true );
        
$mytree = new XoopsTree$xoopsDB -> prefix'xoopstube_cat' ), 'cid''pid' );

        
$submitcats = array();
        
$sql "SELECT * FROM " $xoopsDB -> prefix'xoopstube_cat' ) . " ORDER BY title";
        
$result $xoopsDB -> query$sql );
        while ( 
$myrow $xoopsDB -> fetchArray$result ) )
        {
            if ( 
true == checkgroups$myrow['cid'], 'XTubeSubPerm' ) )
            {
                
$submitcats[$myrow['cid']] = $myrow['title'];
            } 
        }

        
$sform -> addElement( new XoopsFormText_MD_XTUBE_TIME'time'55$time ), false);

        
ob_start();
            
$mytree -> makeMySelBox'title''title'$cid);
            
$sform -> addElement( new XoopsFormLabel_MD_XTUBE_CATEGORYCob_get_contents() ) );
        
ob_end_clean();

// Link description form
        
$editor=xtube_getWysiwygForm_MD_XTUBE_DESCRIPTIONC'descriptionb'$descriptionb1050'');
        
$sform->addElement($editor,false);
//    $sform -> addElement( new XoopsFormDhtmlTextArea( _MD_XTUBE_DESCRIPTIONC, 'descriptionb', $descriptionb, 20, 70), true);

// Keywords
        
$sform -> addElement( new XoopsFormText_MD_XTUBE_KEYWORDS'keywords'70128$keywords ), false);
        
$sform -> insertBreaksprintf_MD_XTUBE_KEYWORDS_NOTE ), "even" );
        
        
$option_tray = new XoopsFormElementTray_MD_XTUBE_OPTIONS');

        if ( !
$approve )
        {
            
$notify_checkbox = new XoopsFormCheckBox'''notifypub' );
            
$notify_checkbox -> addOption1_MD_XTUBE_NOTIFYAPPROVE );
            
$option_tray -> addElement$notify_checkbox );
        }
        else
        {
            
$sform -> addElement( new XoopsFormHidden'notifypub') );
        } 

        if ( 
true == checkgroups$cid'XTubeAppPerm' ) && $lid )
        {
            
$approve_checkbox = new XoopsFormCheckBox'''approve'$approve );
            
$approve_checkbox -> addOption1_MD_XTUBE_APPROVE );
            
$option_tray -> addElement$approve_checkbox );
        } 
        else if ( 
true == checkgroups$cid'XTubeAutoApp' ) )
        {
            
$sform -> addElement( new XoopsFormHidden'approve') );
        } 
        else
        {
            
$sform -> addElement( new XoopsFormHidden'approve') );
        } 
        
$sform -> addElement$option_tray );
        
$button_tray = new XoopsFormElementTray'''' );
        
$button_tray -> addElement( new XoopsFormButton'''submit'_SUBMIT'submit' ) );
        
$button_tray -> addElement( new XoopsFormHidden'lid'$lid ) );
        
$sform -> addElement$button_tray );
        
$sform -> display();
        include 
XOOPS_ROOT_PATH '/footer.php';
    } 

else
{
    
redirect_header'index.php'2_MD_XTUBE_NOPERMISSIONTOPOST );
    exit();


?>

35
elbeer
Re: Youtube HotLink Gallery
  • 2007/9/6 10:20

  • elbeer

  • Just popping in

  • Posts: 68

  • Since: 2007/8/26


Job sorted thanks very much

36
McDonald
Re: Youtube HotLink Gallery
  • 2007/9/7 11:56

  • McDonald

  • Home away from home

  • Posts: 1072

  • Since: 2005/8/15


XoopsTube has been updated to version 1.0.1 RC.

- It has 2 new blocks showing the thumbs of the videoclips.
- The thumbs don't have to be uploaded anymore to the server. They are now taken directly from YouTube. When a thumb isn't showing up the entered code is wrong or the video has been removed from YouTube.
- Preferences menu has been simplified
- Plugin for GIJOE's Waiting module
- A few bugfixes

Read the readme.txt in modules/xoopstube/ very well!!


XoopsTube 1.0.1 RC can be downloaded from McDonalds Store.

A live version of XoopsTube can be seen here.


A few screenshots (click to enlarge):

Resized Image
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Resized Image
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Resized Image

37
svaha
Re: Youtube HotLink Gallery
  • 2007/9/7 17:25

  • svaha

  • Just can't stay away

  • Posts: 896

  • Since: 2003/8/2 2


Thanks for this module Ron.
I'm testing it right now on amevita.eu
I was wondering, now it's not possible to choose 'weight' as a way for sorting the video's, did you left this out on purpose?

38
McDonald
Re: Youtube HotLink Gallery
  • 2007/9/7 19:15

  • McDonald

  • Home away from home

  • Posts: 1072

  • Since: 2005/8/15


Quote:

svaha wrote:

I was wondering, now it's not possible to choose 'weight' as a way for sorting the video's, did you left this out on purpose?


Ehhh, it has never been possible to sort the videos by weight, because 'weight' doesn't exsist for the videos. Resized Image
It's a typo in xoops_version.php and I will correct this tomorrow.

EDIT: the bug has been fixed and corrected files are ready for download. Resized Image

39
svaha
Re: Youtube HotLink Gallery
  • 2007/9/8 17:57

  • svaha

  • Just can't stay away

  • Posts: 896

  • Since: 2003/8/2 2


Thanks for the quick reply Ron, I will sort by date.
Anyway, great module.

40
McDonald
Re: Youtube HotLink Gallery
  • 2007/9/8 18:53

  • McDonald

  • Home away from home

  • Posts: 1072

  • Since: 2005/8/15


Thanks svaha,

I am working on an update which include some fixes in the template files and social bookmarks per video.
The social bookmarks itself work except that I am getting a Smarty warning when updating the module.

Login

Who's Online

242 user(s) are online (159 user(s) are browsing Support Forums)


Members: 0


Guests: 242


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits