Exemplo n.º 1
0
	/**
	 *
	 *
	 *
	 */
	function checkAccess($gtree, $gtree_child, $nav, $usernav, $title, $message_register, $message_denied, $icon, $backlink, $action="core.frontend.access", $noMessage=0)
	{
		global $j15, $j16, $smartyvs;
        $c = hwd_vs_Config::get_instance();
		$my = & JFactory::getUser();
		$acl= & JFactory::getACL();
		$usersConfig = & JComponentHelper::getParams( 'com_users' );

		if ($j16)
		{
			// Access check.
			if (!JFactory::getUser()->authorise($action, 'com_hwdvideoshare'))
			{
				if ($noMessage == 1)
				{
					return false;
				}
				else
				{
					JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR'));
					if ($my->id == 0)
					{
						$smartyvs->assign("showconnectionbox", 1);
					}
					hwd_vs_tools::infomessage($nav, $usernav, $title, $message_register, $icon, $backlink);
					return false;
				}
			}
		}
		else
		{
			if (!hwd_vs_access::allowAccess( $gtree, $gtree_child, hwd_vs_access::userGID( $my->id )))
			{
				if ( ($my->id < 1) && (!$usersConfig->get( 'allowUserRegistration' ) == '0' && hwd_vs_access::allowAccess( $c->gtree_upld, 'RECURSE', $acl->get_group_id('Registered','ARO') ) ) )
				{
					if ($noMessage == 1)
					{
						return false;
					}
					else
					{
						if ($my->id == 0)
						{
							$smartyvs->assign("showconnectionbox", 1);
						}
						hwd_vs_tools::infomessage($nav, $usernav, $title, $message_register, $icon, $backlink);
						return false;
					}
				}
				else
				{
					if ($noMessage == 1)
					{
						return false;
					}
					else
					{
						if ($my->id == 0)
						{
							$smartyvs->assign("showconnectionbox", 1);
						}
						hwd_vs_tools::infomessage($nav, $usernav, $title, $message_denied, $icon, $backlink);
						return false;
					}
				}
			}
		}
		return true;
	}
Exemplo n.º 2
0
   /**
    * Edit video details
    */
    function publishVideo()
	{
		global $mainframe, $option, $Itemid;
		$db = & JFactory::getDBO();
		$my = & JFactory::getUser();
		$app = & JFactory::getApplication();

		$video_id	= JRequest::getInt( 'video_id', 0 );
		$publish	= JRequest::getInt( 'publish', 0 );

		// check component access settings and deny those without privileges
		if ($c->access_method == 0) {
			if (!hwd_vs_access::allowAccess( $c->gtree_mdrt, $c->gtree_mdrt_child, hwd_vs_access::userGID( $my->id ))) {
				if ($my->id == 0 || $video_id == 0) {
					return;
				}
			}
		}

		$db->setQuery( "UPDATE #__hwdvidsvideos"
						. "\nSET published =" . intval( $publish )
						. "\n WHERE id = $video_id"
						);
		if (!$db->query()) {
		echo "<script> alert('".$db->getErrorMsg()."'); window.history.go(-1); </script>\n";
		exit();
		}

		switch ( $publish ) {
			case 1:
				$msg = $total ._HWDVIDS_ALERT_ADMIN_VIDPUB." ";
				break;

			case 0:
			default:
				$msg = $total ._HWDVIDS_ALERT_ADMIN_VIDUNPUB." ";
				break;
		}

		$app->enqueueMessage($msg);
		$app->redirect( JURI::root( true ) . '/index.php?option='.$option.'&task=frontpage' );
	}
Exemplo n.º 3
0
    /**
     *
     */
    function editVideoInfo($row)
    {
    	global $mainframe, $Itemid, $smartyvs, $Itemid;
        $c = hwd_vs_Config::get_instance();
		$my = & JFactory::getUser();

		// load the menu name
		jimport( 'joomla.application.menu' );
		$menu   = &JMenu::getInstance('site');
		$mparams = &$menu->getParams($Itemid);
		$mparams_pt	= $mparams->get( 'page_title', '');

		jimport( 'joomla.document.document' );
		$doc = & JFactory::getDocument();

		$active = &$menu->getActive();

		if (!empty($mparams_pt)) {
			$metatitle = $mparams_pt;
		} else if (!empty($active->name)) {
			$metatitle = $active->name;
		} else {
			$metatitle = _HWDVIDS_META_DEFAULT;
		}

		$referrer = JRequest::getVar( 'url', '' );

        // decode
        $meta_title = html_entity_decode($row->title);
        // set the page/meta title
        $doc->setTitle( $metatitle." - "._HWDVIDS_META_EVIDS." - ".$meta_title );
        $doc->setMetaData( 'title' , $metatitle." - "._HWDVIDS_META_EVIDS." - ".$meta_title );
		hwd_vs_tools::generateActiveLink(1);
		hwd_vs_javascript::checkuploadform();
		hwd_vs_tools::generateBreadcrumbs();

			$smartyvs->assign("thumbnail", hwd_vs_tools::generateVideoThumbnailLink($row->id, $row->video_id, $row->video_type, $row->thumbnail, 0, null, null, null));
			$smartyvs->assign("title", stripslashes($row->title));

			if (!hwd_vs_access::allowAccess( $c->gtree_edtr, $c->gtree_edtr_child, hwd_vs_access::userGID( $my->id )))
			{
				$smartyvs->assign( "description", stripslashes($row->description) );
			}
			else
			{
				$editor      =& JFactory::getEditor();
				$smartyvs->assign( "description", $editor->display("description",stripslashes($row->description),350,250,40,20,1) );
				$smartyvs->assign( "print_wysiwyg", 1 );
			}

			$smartyvs->assign("tags", stripslashes($row->tags));
			$smartyvs->assign("rowid", $row->id);
			$smartyvs->assign("rowuid", $row->user_id);
			$smartyvs->assign("print_sharingoptions", 1);
			$smartyvs->assign("form_save_video", JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$Itemid."&task=savevideo"));
			$smartyvs->assign("referrer", $referrer);

				if ($row->public_private == "registered")
				{
					$smartyvs->assign("so1p", "");
					$smartyvs->assign("so1r", " selected=\"selected\"");
					$smartyvs->assign("so1m", "");
					$smartyvs->assign("so1w", "");
					$smartyvs->assign("so1value", "registered");
				}
				else if ($row->public_private == "public")
				{
					$smartyvs->assign("so1p", " selected=\"selected\"");
					$smartyvs->assign("so1r", "");
					$smartyvs->assign("so1m", "");
					$smartyvs->assign("so1w", "");
					$smartyvs->assign("so1value", "public");
				}
				else if ($row->public_private == "me")
				{
					$smartyvs->assign("so1p", "");
					$smartyvs->assign("so1r", "");
					$smartyvs->assign("so1m", " selected=\"selected\"");
					$smartyvs->assign("so1w", "");
					$smartyvs->assign("so1value", "me");
				}
				else if ($row->public_private == "password")
				{
					$smartyvs->assign("so1p", "");
					$smartyvs->assign("so1r", "");
					$smartyvs->assign("so1m", "");
					$smartyvs->assign("so1w", " selected=\"selected\"");
					$smartyvs->assign("so1value", "password");
				}


				if ($row->allow_comments == 0) {
					$smartyvs->assign("so21", "");
					$smartyvs->assign("so20", " selected=\"selected\"");
					$smartyvs->assign("so2value", "0");
				} else if ($row->allow_comments == 1) {
					$smartyvs->assign("so21", " selected=\"selected\"");
					$smartyvs->assign("so20", "");
					$smartyvs->assign("so2value", "1");
				}
				if ($row->allow_embedding == 0) {
					$smartyvs->assign("so31", "");
					$smartyvs->assign("so30", " selected=\"selected\"");
					$smartyvs->assign("so3value", "0");
				} else if ($row->allow_embedding == 1) {
					$smartyvs->assign("so31", " selected=\"selected\"");
					$smartyvs->assign("so30", "");
					$smartyvs->assign("so3value", "1");
				}
				if ($row->allow_ratings == 0) {
					$smartyvs->assign("so41", "");
					$smartyvs->assign("so40", " selected=\"selected\"");
					$smartyvs->assign("so4value", "0");
				} else if ($row->allow_ratings == 1) {
					$smartyvs->assign("so41", " selected=\"selected\"");
					$smartyvs->assign("so40", "");
					$smartyvs->assign("so4value", "1");
				}

			$smartyvs->assign("categoryselect", $categoryselectlist = hwd_vs_tools::categoryList(_HWDVIDS_INFO_CHOOSECAT, $row->category_id, _HWDVIDS_INFO_NOCATS, 1) );


		$smartyvs->display('video_edit.tpl');
		return;
    }
Exemplo n.º 4
0
    /**
     * Query SQL for all accessible category data
     *
     * @return       Nothing
     */
    function downloadFile()
    {
        global $mainframe, $limitstart;
		$c = hwd_vs_Config::get_instance();
		$db = & JFactory::getDBO();
		$my = & JFactory::getUser();
		$acl= & JFactory::getACL();
		$usersConfig = &JComponentHelper::getParams( 'com_users' );

		//$currentSession = JSession::getInstance('none',array());
		//$currentSession->destroy();

		$evp = JRequest::getCmd( 'evp', 0 );
		$file = JRequest::getCmd( 'file', 0 );
		$deliver = JRequest::getCmd( 'deliver', 0 );
		$media = JRequest::getCmd( 'media', 0 );
		$fix = JRequest::getCmd( 'fix', 0 );
		$streamer = JRequest::getCmd( 'streamer', 'off' );
		$quality = JRequest::getCmd( 'quality', 'hd' );
		$pushDownload = false;
		$showError = false;

		// get video details
		$db->SetQuery( 'SELECT * FROM #__hwdvidsvideos WHERE id = '.(int)$file );
		$db->Query();
		$row = $db->loadObject();

        $db->SetQuery( 'SELECT count(*) FROM #__hwdvidsantileech WHERE expiration = "'.$evp.'"' );
        $result = $db->loadResult();
		if ($result > 0 || $c->use_protection == 0 || $row->allow_embedding == "1")
		{
			$location = hwd_vs_tools::generateVideoLocations( $row, $quality );
			$location['ext'] = "flv";

			$db->SetQuery( 'SELECT `count` FROM #__hwdvidsantileech WHERE expiration = "'.$evp.'"' );
			$count = $db->loadResult();

			if ($row->allow_embedding == 1 && $c->showvebc == 1)
			{
				$pushDownload = true;
			}
			else if ($count < $c->protection_level)
			{
				$newCount = $count+1;
				$db->SetQuery( "UPDATE #__hwdvidsantileech SET `count` = $newCount WHERE expiration = \"".$evp."\"" );
				$db->Query();

				if ($deliver !== "player")
				{
					if (!hwd_vs_access::allowAccess( $c->gtree_dnld, $c->gtree_dnld_child, hwd_vs_access::userGID( $my->id )))
					{
						$pushDownload = false;
					}
					else
					{
						$pushDownload = true;
					}
				}
				else if ($deliver == "player")
				{
					$pushDownload = true;
				}
			}
			else
			{
				$showError = true;
			}

			if ($deliver == "downloadoriginal" || $deliver == "original")
			{
				if ($handle = opendir(JPATH_SITE.DS.'hwdvideos'.DS.'uploads'.DS.'originals'))
				{
					$url = '';

					while (false !== ($file = readdir($handle)))
					{
						list($filename_noext, $filename_ext) = @split('\.', basename($file));

						if ($filename_noext == $row->video_id)
						{
							$location['url']  = JURI::root().'hwdvideos/uploads/originals/'.$file;
							$location['path'] = JPATH_SITE.DS.'hwdvideos'.DS.'uploads'.DS.'originals'.DS.$file;
							$location['ext'] = $filename_ext;
						}
					}

					closedir($handle);
				}
			}
			else if ($deliver == "flv")
			{
				if (file_exists(JPATH_SITE.DS."hwdvideos".DS."uploads".DS.$row->video_id.".flv"))
				{
					$location['url']  = JURI::root()."hwdvideos/uploads/".$row->video_id.".flv";
					$location['path'] = JPATH_SITE.DS."hwdvideos".DS."uploads".DS.$row->video_id.".flv";
					$location['ext'] = "flv";
				}
			}
			else if ($deliver == "h264")
			{
				if (file_exists(JPATH_SITE.DS."hwdvideos".DS."uploads".DS.$row->video_id.".mp4"))
				{
					$location['url']  = JURI::root()."hwdvideos/uploads/".$row->video_id.".mp4";
					$location['path'] = JPATH_SITE.DS."hwdvideos".DS."uploads".DS.$row->video_id.".mp4";
					$location['ext'] = "mp4";
				}
			}
			else if ($deliver == "ipod340")
			{
				if (file_exists(JPATH_SITE.DS."hwdvideos".DS."uploads".DS.$row->video_id.".ipod320.mp4"))
				{
					$location['url']  = JURI::root()."hwdvideos/uploads/".$row->video_id.".ipod320.mp4";
					$location['path'] = JPATH_SITE.DS."hwdvideos".DS."uploads".DS.$row->video_id.".ipod320.mp4";
					$location['ext'] = "ipod320.mp4";
				}
			}
			else if ($deliver == "ipod640")
			{
				if (file_exists(JPATH_SITE.DS."hwdvideos".DS."uploads".DS.$row->video_id.".ipod640.mp4"))
				{
					$location['url']  = JURI::root()."hwdvideos/uploads/".$row->video_id.".ipod640.mp4";
					$location['path'] = JPATH_SITE.DS."hwdvideos".DS."uploads".DS.$row->video_id.".ipod320.mp4";
					$location['ext'] = "ipod640.mp4";
				}
			}

			if ($pushDownload)
			{
				if (headers_sent($filename, $linenum) || $row->video_type == "seyret" || $row->video_type == "remote")
				{
					$mainframe->redirect( $location['url'] );
				}
				else if ($deliver == "player")
				{
					header('Location: '.$location['url']);
					exit;
				}
				else
				{
					// Transfer file in chunks to preserve memory on the server
					$fn = basename($location['path']);

					$title = str_replace(" ", "-", $row->title);
					$title = preg_replace("/[^a-zA-Z0-9s-]/", "", $title);

					if (!empty($title)) {
						$ftitle = $title.".".$location['ext'];
					} else {
						$ftitle = $fn;
					}

					header('Content-Type: application/octet-stream');
					header("Content-Disposition: attachment; filename=\"$ftitle\"");
					header('Content-Length: '.filesize($location['path']));
					@hwd_vs_tools::readfile_chunked($location['path'], true);
					exit;
				}
			}
		}

		if ($count > $c->protection_level)
		{
			$db->SetQuery("DELETE FROM #__hwdvidsantileech WHERE expiration = \"$evp\"");
			$db->Query();
		}

		$showError = true;

		$hwdvsItemid = hwd_vs_tools::generateValidItemid();

		$msg = "You do not have access to this file using the requested method.";
		$mainframe->enqueueMessage($msg);
		$mainframe->redirect( JURI::root()."index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=viewvideo&video_id=".$row->id );

    }
Exemplo n.º 5
0
    /**
     * Outputs frontpage HTML
     *
     * @return       Nothing
     */
    function grabAjaxPlayer()
	{
		global $Itemid, $smartyvs, $hwdvs_selectv, $hwdvs_joinv, $mainframe, $hwdvsAjaxPlayer;

		header('Content-type: text/html; charset=utf-8');

		$c = hwd_vs_Config::get_instance();
		$db = & JFactory::getDBO();
		$my = & JFactory::getUser();
		$acl= & JFactory::getACL();
		$usersConfig = &JComponentHelper::getParams( 'com_users' );

		$video_id = JRequest::getInt( 'video_id', 0 );
		$template = JRequest::getVar( 'template', '' );
		$showdetails = JRequest::getInt( 'showdetails', '1' );
		$width = JRequest::getInt( 'width', null );
		$height = JRequest::getInt( 'height', null );
		$quality = JRequest::getWord( 'quality', 'hd' );
		$autostart = JRequest::getInt( 'autostart', null );
		$hwdvsAjaxPlayer = true;

		if (!hwd_vs_access::allowAccess( $c->gtree_plyr, $c->gtree_plyr_child, hwd_vs_access::userGID( $my->id ))) {
			if ( ($my->id < 1) && (!$usersConfig->get( 'allowUserRegistration' ) == '0' && hwd_vs_access::allowAccess( $c->gtree_upld, 'RECURSE', $acl->get_group_id('Registered','ARO') ) ) ) {
				hwd_vs_tools::infomessage(1, 0, _HWDVIDS_TITLE_NOACCESS, _HWDVIDS_ALERT_REGISTERFORPLYR, "exclamation.png", 0, 0);
				exit;
			} else {
				hwd_vs_tools::infomessage(1, 0, _HWDVIDS_TITLE_NOACCESS, _HWDVIDS_ALERT_PLYR_NOT_AUTHORIZED, "exclamation.png", 0, 0);
				exit;
			}
		}

        $where = ' WHERE video.id = '.$video_id;

		$query = "SELECT".$hwdvs_selectv." FROM #__hwdvidsvideos AS video ".$hwdvs_joinv." ".$where;
        $db->SetQuery($query);
        $row = $db->loadObject();

		if (!hwd_vs_tools::validateVideoAccess($row))
		{
			exit;
		}

		hwd_vs_tools::logViewing($row->id);
		require_once(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_hwdvideoshare'.DS.'libraries'.DS.'maintenance_recount.class.php');

		if ($showdetails == 1) {
			$smartyvs->assign("showdetails", 1);
		}

		$videoplayer = hwd_vs_tools::generateVideoDetails($row, $width, $height, null, $Itemid, null, null, $autostart);
		$smartyvs->assign("videoplayer", $videoplayer);
		hwd_vs_javascript::ajaxRate($row);

		if (empty($template) || $template == '') {
			$html = $smartyvs->fetch('plug_jomsocial_ajax.tpl');
		} else if ($template == 'playeronly') {
			$html = $videoplayer->player;
		} else {
			$html = $smartyvs->fetch($template.'.tpl');
		}

		print $html;
		exit;
	}
Exemplo n.º 6
0
    /**
     * Grants or prevents access based on group id
     *
     * @param int    $accessgroupid  the group id to check against
     * @param string $recurse  the switch for recursive access check
     * @param int    $usersgroupid  the user's group id
     * @return       True or false
     */
	function frontend()
	{
		global $smartyvs, $print_ulink, $print_glink, $hwdvsTemplateOverride, $hwdvsItemid, $isModerator;

		$c = hwd_vs_Config::get_instance();
		$db = & JFactory::getDBO();
		$my = & JFactory::getUser();
		$acl= & JFactory::getACL();
		$usersConfig = &JComponentHelper::getParams( 'com_users' );

		require_once(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_hwdvideoshare'.DS.'helpers'.DS.'access.php');
		require_once(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_hwdvideoshare'.DS.'helpers'.DS.'initialise.php');

		$smartyvs->assign("JURL", JURI::root( true ));
		$smartyvs->assign("HWDVSURL", JURI::root( true )."/index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid);
		$smartyvs->assign("Itemid", $hwdvsItemid );

		$searchterm = Jrequest::getVar( 'pattern', _HWDVIDS_SEARCHBAR );
		$smartyvs->assign("form_search", JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=search"));
		$smartyvs->assign("form_tp", JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=addconfirm"));
		$smartyvs->assign("form_upload", JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=upload"));
		$smartyvs->assign("searchinput", "<input type=\"text\" name=\"pattern\" value=\"".$searchterm."\" class=\"inputbox\" onchange=\"document.adminForm.submit();\"  onblur=\"if(this.value=='') this.value='"._HWDVIDS_SEARCHBAR."';\" onfocus=\"if(this.value=='"._HWDVIDS_SEARCHBAR."') this.value='';\"/>");

		// define config variables
		if ($c->diable_nav_videos == 0 || $c->diable_nav_catego == 0 || $c->diable_nav_groups == 0 || $c->diable_nav_upload == 0) { $smartyvs->assign("print_nav", 1); }
		if ($c->diable_nav_search == 0) { $smartyvs->assign("print_search", 1); }
		if ($my->id && $c->diable_nav_user == 0 && ($c->diable_nav_user1 == 0 || $c->diable_nav_user2 == 0 || $c->diable_nav_user3 == 0 || $c->diable_nav_user4 == 0 || $c->diable_nav_user5 == 0)) { $smartyvs->assign("print_usernav", 1); }
		if ($c->diable_nav_videos == 0) { $smartyvs->assign("print_vlink", 1); $smartyvs->assign("vlink", "<a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=frontpage")."\">"._HWDVIDS_NAV_VIDEOS."</a>"); }
		if ($c->diable_nav_catego == 0) { $smartyvs->assign("print_clink", 1); $smartyvs->assign("clink", "<a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=categories")."\">"._HWDVIDS_NAV_CATEGORIES."</a>"); }
		if (hwd_vs_access::allowAccess( $c->gtree_grup, $c->gtree_grup_child, hwd_vs_access::userGID( $my->id )))
		{
			if ($c->diable_nav_groups == 0)
			{
				$smartyvs->assign("print_glink", 1);
				$smartyvs->assign("glink", "<a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=groups")."\">"._HWDVIDS_NAV_GROUPS."</a>");
				$print_glink = true;
			}
		}
 		if ($c->diable_nav_upload == 0)
		{
			$smartyvs->assign("print_ulink", 1);
			$smartyvs->assign("ulink", "<a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=upload")."\">"._HWDVIDS_NAV_UPLOAD."</a>");
			$print_ulink = true;

		}
		else if ($c->diable_nav_upload == 2)
		{
			if (hwd_vs_access::allowAccess( $c->gtree_upld, $c->gtree_upld_child, hwd_vs_access::userGID( $my->id )) || hwd_vs_access::allowAccess( $c->gtree_ultp, $c->gtree_ultp_child, hwd_vs_access::userGID( $my->id )))
			{
				$smartyvs->assign("print_ulink", 1);
				$smartyvs->assign("ulink", "<a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=upload")."\">"._HWDVIDS_NAV_UPLOAD."</a>");
				$print_ulink = true;
				$smartyvs->assign("print_nav", 1);
			}
		}

		if ($c->diable_nav_user1 == 0) { $smartyvs->assign("yv", "&nbsp;<a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=viewChannel&user_id=".$my->id."&sort=uploads")."\">"._HWDVIDS_NAV_YOURVIDS."</a>&nbsp;"); }
		if ($c->diable_nav_user2 == 0) { $smartyvs->assign("yf", "&nbsp;<a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=viewChannel&user_id=".$my->id."&sort=favourites")."\">"._HWDVIDS_NAV_YOURFAVS."</a>&nbsp;"); }
		if ($c->diable_nav_groups == 0 && $c->diable_nav_user3 == 0) { $smartyvs->assign("yg", "&nbsp;<a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=viewChannel&user_id=".$my->id."&sort=groups")."\">"._HWDVIDS_NAV_YOURGROUPS."</a>&nbsp;"); }
		if ($c->diable_nav_groups == 0 && $c->diable_nav_user4 == 0) { $smartyvs->assign("ym", "&nbsp;<a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=viewChannel&user_id=".$my->id."&sort=memberships")."\">"._HWDVIDS_NAV_YOURMEMBERSHIPS."</a>&nbsp;"); }
		if ($c->diable_nav_groups == 0 && $c->diable_nav_user5 == 0) { $smartyvs->assign("cg", "&nbsp;<a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=creategroup")."\">"._HWDVIDS_NAV_CREATEGROUP."</a>&nbsp;"); }

		if ($c->disable_nav_playlist == 0) { $smartyvs->assign("cp", "&nbsp;<a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=createPlaylist")."\">"._HWDVIDS_NAV_CREATEPL."</a>&nbsp;"); }
		if ($c->disable_nav_playlist == 0) { $smartyvs->assign("yp", "&nbsp;<a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=viewChannel&user_id=".$my->id."&sort=playlists")."\">"._HWDVIDS_NAV_YOURPL."</a>&nbsp;"); }
		if ($c->disable_nav_channel == 0) { $smartyvs->assign("yc", "&nbsp;<a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=viewChannel&user_id=".$my->id)."\">"._HWDVIDS_NAV_YOURCHANNEL."</a>&nbsp;"); }

		if ($c->showcredit == 1) { $smartyvs->assign("sc", "1"); $smartyvs->assign("cl", hwd_vs_templates::copyright_FE()); }

		$smartyvs->assign("help_link", "<a href=\"http://documentation.hwdmediashare.co.uk/wiki/Category:HwdVideoShare_User%27s_Manual\" target=\"_blank\">Help</a>");
		$smartyvs->assign("personalise_link", "<a href=\"http://documentation.hwdmediashare.co.uk/wiki/Category:HwdVideoShare_User%27s_Manual\">Personalise</a>");

		if ($c->fporder == "recent")
		{
			$smartyvs->assign("fpheader", _HWDVIDS_TITLE_RECENTUPLOADS);
			$smartyvs->assign("fpempty", _HWDVIDS_INFO_NRV);
		}
		else if ($c->fporder == "popular")
		{
			$smartyvs->assign("fpheader", _HWDVIDS_TITLE_POPULARVIDEOS);
			$smartyvs->assign("fpempty", _HWDVIDS_INFO_NVTD);
		}
		else if ($c->fporder == "viewed")
		{
			$smartyvs->assign("fpheader", _HWDVIDS_TITLE_MOSTVIEWEDVIDS);
			$smartyvs->assign("fpempty", _HWDVIDS_INFO_NVTD);
		}

		$smartyvs->assign("usershare1", $c->usershare1);
		$smartyvs->assign("usershare2", $c->usershare2);
		$smartyvs->assign("usershare3", $c->usershare3);
		$smartyvs->assign("usershare4", $c->usershare4);

		if ($c->usershare1 == 1 || $c->usershare2 == 1 || $c->usershare3 == 1 || $c->usershare4 == 1)
		{
			$smartyvs->assign("print_sharing", 1);
		}

		if ($c->shareoption1 == 0)
		{
			$smartyvs->assign("so1p", "");
			$smartyvs->assign("so1r", " selected=\"selected\"");
			$smartyvs->assign("so1m", "");
			$smartyvs->assign("so1w", "");
			$smartyvs->assign("so1value", "registered");
		}
		else if ($c->shareoption1 == 1)
		{
			$smartyvs->assign("so1p", " selected=\"selected\"");
			$smartyvs->assign("so1r", "");
			$smartyvs->assign("so1m", "");
			$smartyvs->assign("so1w", "");
			$smartyvs->assign("so1value", "public");
		}
		else if ($c->shareoption1 == 2)
		{
			$smartyvs->assign("so1p", "");
			$smartyvs->assign("so1r", "");
			$smartyvs->assign("so1m", " selected=\"selected\"");
			$smartyvs->assign("so1w", "");
			$smartyvs->assign("so1value", "me");
		}
		else if ($c->shareoption1 == 3)
		{
			$smartyvs->assign("so1p", "");
			$smartyvs->assign("so1r", "");
			$smartyvs->assign("so1m", "");
			$smartyvs->assign("so1w", " selected=\"selected\"");
			$smartyvs->assign("so1value", "password");
		}

		if ($c->shareoption2 == 0)
		{
			$smartyvs->assign("so21", "");
			$smartyvs->assign("so20", " selected=\"selected\"");
			$smartyvs->assign("so2value", "0");
		}
		else if ($c->shareoption2 == 1)
		{
			$smartyvs->assign("so21", " selected=\"selected\"");
			$smartyvs->assign("so20", "");
			$smartyvs->assign("so2value", "1");
		}

		if ($c->shareoption3 == 0)
		{
			$smartyvs->assign("so31", "");
			$smartyvs->assign("so30", " selected=\"selected\"");
			$smartyvs->assign("so3value", "0");
		}
		else if ($c->shareoption3 == 1)
		{
			$smartyvs->assign("so31", " selected=\"selected\"");
			$smartyvs->assign("so30", "");
			$smartyvs->assign("so3value", "1");
		}

		if ($c->shareoption4 == 0)
		{
			$smartyvs->assign("so41", "");
			$smartyvs->assign("so40", " selected=\"selected\"");
			$smartyvs->assign("so4value", "0");
		}
		else if ($c->shareoption4 == 1)
		{
			$smartyvs->assign("so41", " selected=\"selected\"");
			$smartyvs->assign("so40", "");
			$smartyvs->assign("so4value", "1");
		}

		$smartyvs->assign("categoryselect", hwd_vs_tools::categoryList(_HWDVIDS_INFO_CHOOSECAT, 0, _HWDVIDS_INFO_NOCATS, 1));

		$smartyvs->assign("rss_recent", JRoute::_("index.php?Itemid=".$hwdvsItemid."&option=com_hwdvideoshare&task=rss&feed=recent"));

		if ($isModerator)
		{
			$smartyvs->assign("print_moderation", 1);
			$smartyvs->assign("pending", "&nbsp;<a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=pending")."\">"._HWDVIDS_MODPA."</a>&nbsp;");
			$smartyvs->assign("reportedvideos", "&nbsp;<a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=reportedvideos")."\">"._HWDVIDS_MODRV."</a>&nbsp;");
			$smartyvs->assign("reportedgroups", "&nbsp;<a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=reportedgroups")."\">"._HWDVIDS_MODRG."</a>&nbsp;");
		}

		jimport( 'joomla.application.menu' );
		$menu   = &JMenu::getInstance('site');
		$mparams = &$menu->getParams($hwdvsItemid);

		$smartyvs->assign("pageclass_sfx", $mparams->get( 'pageclass_sfx', ''));
		$smartyvs->assign("page_title", $mparams->get( 'page_title', ''));
		$smartyvs->assign("show_page_title", $mparams->get( 'show_page_title', ''));

		if ($c->cbint == "1")
		{
			$smartyvs->assign("url_register", JRoute::_("index.php?Itemid=".$hwdvsItemid."&option=com_comprofiler&task=registers"));
			$smartyvs->assign("url_reset", JRoute::_("index.php?Itemid=".$hwdvsItemid."&option=com_comprofiler&task=lostPassword"));
			$smartyvs->assign("url_remind", JRoute::_("index.php?Itemid=".$hwdvsItemid."&option=com_comprofiler&task=lostPassword"));
		}
		else
		{
			$smartyvs->assign("url_register", JRoute::_("index.php?Itemid=".$hwdvsItemid."&option=com_user&view=register"));
			$smartyvs->assign("url_reset", JRoute::_("index.php?Itemid=".$hwdvsItemid."&option=com_user&view=reset"));
			$smartyvs->assign("url_remind", JRoute::_("index.php?Itemid=".$hwdvsItemid."&option=com_user&view=remind"));
		}

        ////
        // here you can call any Joomla module positions you like and insert them into the hwdVideoShare template system
        ////
		//
		//  $document = &JFactory::getDocument();
		//  $renderer = $document->loadRenderer('modules');
		//  $options = array('style' => 'xhtml');
		//  $position = 'left';
		//  $smartyvs->assign("modules_left", $renderer->render($position, $options, null));
		//  // now you can use the {$modules_left} tag in any template file to display this module position in hwdVideoShare
		//

		if (!isset($hwdvsTemplateOverride['show_thumbnail'])) { $hwdvsTemplateOverride['show_thumbnail'] = 1; }
		if (!isset($hwdvsTemplateOverride['show_title'])) { $hwdvsTemplateOverride['show_title'] = 1; }
		if (!isset($hwdvsTemplateOverride['show_views'])) { $hwdvsTemplateOverride['show_views'] = 1; }
		if (!isset($hwdvsTemplateOverride['show_category'])) { $hwdvsTemplateOverride['show_category'] = 1; }
		if (!isset($hwdvsTemplateOverride['show_rating'])) { $hwdvsTemplateOverride['show_rating'] = 1; }
		if (!isset($hwdvsTemplateOverride['show_uploader'])) { $hwdvsTemplateOverride['show_uploader'] = 1; }
		if (!isset($hwdvsTemplateOverride['show_description'])) { $hwdvsTemplateOverride['show_description'] = 0; }
		if (!isset($hwdvsTemplateOverride['show_duration'])) { $hwdvsTemplateOverride['show_duration'] = 0; }
		if (!isset($hwdvsTemplateOverride['show_upload_date'])) { $hwdvsTemplateOverride['show_upload_date'] = 0; }
		if (!isset($hwdvsTemplateOverride['show_avatar'])) { $hwdvsTemplateOverride['show_avatar'] = 1; }
		if (!isset($hwdvsTemplateOverride['show_comments'])) { $hwdvsTemplateOverride['show_comments'] = 0; }
		if (!isset($hwdvsTemplateOverride['show_tags'])) { $hwdvsTemplateOverride['show_tags'] = 0; }
		if (!isset($hwdvsTemplateOverride['show_timesince'])) { $hwdvsTemplateOverride['show_timesince'] = 0; }

		// LEGACY
		$smartyvs->assign("mosConfig_live_site", JURI::root( true ));
		$smartyvs->assign("link_home", JURI::root( true ));
		$smartyvs->assign("link_home_hwd_vs", JURI::root( true )."/index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid);
		$smartyvs->assign("thumbwidth", $c->thumbwidth);
	}
Exemplo n.º 7
0
	function generatePostDescription($description=null)
	{
		$c = hwd_vs_Config::get_instance();
		$my = & JFactory::getUser();

		if (empty($description))
		{
			if (!hwd_vs_access::allowAccess( $c->gtree_edtr, $c->gtree_edtr_child, hwd_vs_access::userGID( $my->id )))
			{
				$description = Jrequest::getVar( 'description', _HWDVIDS_UNKNOWN );
			}
			else
			{
				$requestarray = JRequest::get( 'default', 2 );
				$description = trim(@$requestarray['description']);
			}
		}
		$description = stripslashes($description);
		$description = stripslashes($description);
		$description = hwdEncoding::charset_decode_utf_8($description);
		$description = hwdEncoding::charset_encode_utf_8($description);
		$description = htmlspecialchars_decode($description);
		$description = addslashes($description);

		return $description;
	}