Warning: Function split() is deprecated in ..../global.php(29) : eval()'d code on line 31
Jomsocial Video Integration - Page 4
Page 4 of 4 FirstFirst ... 234
Results 31 to 34 of 34

Thread: Jomsocial Video Integration

  1. Red face The Solution

    Hello Everyone,

    I've updated Jomsocial's old Seyret plugin to work with jomsocial 1.8 for my site and because of the kind person that I am , I decided to share the code with you all.

    And yes, It works. You can see it in action here http://www.xamfm.com/community/my-xamid/liam.html

    First download their old seyret plugin for jomsocial from their website (from the add-ons area) and install the old plugin in your joomla (and activate it). You should now see the famous "Seyret is not installed" error on your jomsocial profile pages

    On your computer, extract the downloaded plugin en open the file "seyret.php"

    Copy paste the code below into that file and save it (So replace the old code!!).


    Code:
    <?php
    
    /**
     * @copyright (C) 2008 by Slashes & Dots Sdn Bhd - All rights reserved!
     * @license http://www.azrul.com Copyrighted Commercial Software
     */
    
    // no direct access
    defined('_JEXEC') or die('Restricted access');
    
    require_once( JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'core.php');
    
    if(!class_exists('plgCommunitySeyret'))
    {
    	class plgCommunitySeyret extends CApplications
    	{
    		var $name 		= "Seyret Video Application";
    		var $_name		= 'seyret';
    		var $_path		= '';
    		var $_user		= '';
    		var $_my		= '';
    	
    	    function plgCommunitySeyret(& $subject, $config)
    	    {
    	    	$this->_path	= JPATH_BASE . DS . 'administrator' . DS . 'components' . DS . 'com_seyret';
    	    	$this->_user	= CFactory::getRequestUser();
    			$this->_my		= CFactory::getUser();
    	
    			parent::__construct($subject, $config);
    	    }
    	
    		function onProfileDisplay()
    		{
    		
    			//Load language
    			JPlugin::loadLanguage('plg_seyret', JPATH_ADMINISTRATOR);
    			
    			// Attach CSS
    			$document	=& JFactory::getDocument();
    			$css		= JURI::base() . 'plugins/community/seyret/style.css';
    			$document->addStyleSheet($css);
    			
    			if( !file_exists( $_SERVER{'DOCUMENT_ROOT'} . "/components/com_seyret/seyret.php" ) ){
    				$exist = 0;
    				$videos = "";
    			}else{
    				$exist = 1;
    				$videos	= $this->_getVideos();
    			}
    			
    			$mainframe =& JFactory::getApplication();
    			$caching = $this->params->get('cache', 1);		
    			if($caching)
    			{
    				$caching = $mainframe->getCfg('caching');
    			}
    			
    			$cache =& JFactory::getCache('plgCommunitySeyret');
    			$cache->setCaching($caching);
    			$callback = array('plgCommunitySeyret', '_getSeyretHTML');
    			$content = $cache->call($callback, $this->_user->id, $this->_user->getDisplayName(), $exist, $videos);
    			
    			return $content; 		
    		}
    		
    		function _getSeyretHTML($userid, $username, $exist, $videos){
    			ob_start();
    	
    			// Test if seyret really exists on this environment.
    			if(!$exist)
    			{
    			?>
    				<div class="icon-nopost">
    		            <img src="<?php echo JURI::base(); ?>components/com_community/assets/error.gif" alt="" />
    		        </div>
    		        <div class="content-nopost">
    		            <?php echo JText::_('PLG_SEYRET NOT INSTALLED'); ?>
    		        </div>
    			<?php
    			}
    			else
    			{
    	?>
    			<div id="community-seyret-wrap">
    			    <?php if ( $videos ) : ?>
    			    <ul class="list">
    					<?php foreach( $videos as $video ): ?>
    	
    					<li>
    					    <div class="thumb">
    					        <a href="<?php echo JRoute::_('index.php?option=com_seyret&view=video&id=' . $video->id); ?>"><img src="<?php echo !empty( $video->videothumbnail ) ? $video->videothumbnail : JURI::base() . 'components/com_seyret/localplayer/nothumbnail.png' ;?>" width="90" alt=""/>
    					    </div>
    					    
    					    <div class="details">
    							<div class="title">
    								<a href="<?php echo JRoute::_('index.php?option=com_seyret&view=video&id=' . $video->id); ?>">
    									<?php echo $video->videotitle;?>
    								</a>
    							</div>
    	
    							<div class="comment">
    								<?php echo('DURATION'); ?>: <?php echo $video->duration; ?>
    							</div>
    	
    							<div class="hits">
    								<?php echo JText::_('PLG_SEYRET HITS'); ?>: <?php echo $video->hits;?>
    							</div>
    							
    							<div class="hits">
    								<?php echo('COMMENTS'); ?>: <?php echo $video->commentcount;?>
    							</div>
    
    						</div>
    						<div style="clear: both;"></div>
    					</li>
    					<?php endforeach; ?>
    	
    					<li style="padding: 5px;">
    				        <div class="showall">
    							<a href="<?php echo JRoute::_('index.php?option=com_seyret&task=uservideoslist&userid=' . $userid ); ?>">
    								<?php echo JText::_( 'Show All' ); ?>
    								<a href="<?php echo JRoute::_('index.php?option=com_seyret&view=editvideo'); ?>" >
    								<?php echo JText::_( ' Add Video' ); ?>
    							</a>
    						</div>
    				    </li>
    			    </ul>
    	
    				<?php else : ?>
    	
    				<div class="icon-nopost">
    		            <img src="<?php echo JURI::base(); ?>plugins/community/seyret/favicon.png" alt="" />
    		        </div>
    		        <div class="content-nopost">
    		            <?php echo $username . ' ' . JText::_('PLG_SEYRET NO VIDEO');?>
    		            <a href="<?php echo JRoute::_('index.php?option=com_seyret&view=editvideo'); ?>" >
    								<?php echo JText::_( ' Add Video' ); ?>
    							</a>
    		        </div>
    			    
    			    <?php endif; ?>
    			</div>
    	<?php
    			}
    	
    			$content	= ob_get_contents();
    			ob_end_clean();
    			return $content;
    			
    		}
    		
    	
    		/**
    		 * Returns the list of videos and its properties for the specific browsed user
    		 *
    		 * @access private
    		 *
    		 * returns	Array	An array of object list
    		 **/
    		function _getVideos()
    		{
    			$db		=& JFactory::getDBO();
    			$sort	= $this->params->get('sort', 'DESC');
    			$limit	= $this->params->get('count', '10');
    	
    			$query	= 'SELECT * FROM ' . $db->nameQuote( '#__seyret_video' ) . ' '
    					. 'WHERE ' . $db->nameQuote( 'addedby' ) . '=' . $db->Quote( $this->_user->id ) . ' '
    					. 'AND ' . $db->nameQuote( 'published' ) . '=' . $db->Quote( '1' ) . ' '
    					. 'ORDER BY ' . $db->nameQuote( 'addeddate' ) . ' ' . $sort . ' ' 
    					. 'LIMIT 0,' . $limit;
    			$db->setQuery( $query );
    	
    			$result = $db->loadObjectList();
    	
    			return $result;
    		}
    	}

    Now all you need to do is upload the file "seyret.php" onto your website. The directory should be "plugins/community/"

    Enjoy!

  2. Default

    Hi Xam, did you know how to integrate also the seyret on JomSocial Activity Stream ...?

  3. Default

    Hi all..

    @Xam, thanks for your kindness and sharing this code with us
    This is still working fine even with JS2.2.5v, there is just one little thing you have to add to your code -
    and that is closing tag @ the end } , otherwise you may receive error on site. That is what I get..

    Add closing tag at the end of code, so it looks like this
    PHP Code:

    return $result;
            }
        }

    Making it working with activity stream would be even more ++ for this plugin..

    Ty
    Joolmaholic design team.
    veni vidi vici.. Versuz HD

  4. Default

    Integration with the activity stream shouldn't be to hard I think, as jomsocial already provides the code for integration.
    But my guess is that a different script has to edited for that. Something like the last script called when a video is added.

    I haven't looked into the coding for seyret in months and it's not likely that I will as I've jumped ship to hwd. Sorry
    Last edited by xam; 18th November 2011 at 05:07.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •