Hi,
I'm using Videoflow which is a Joomla Component and would like it to re-direct the user to a certain page after a successful video upload. I'm very new to all this and am trying to do it myself but I keep getting:
Parse error: syntax error, unexpected T_IF on line 1387
function saveRemote()
{
if(!JRequest::checkToken() && !JRequest::checkToken('get')) JExit( 'Invalid Token' );
global $vparams;
$task = JRequest::getCmd('task');
$status = $this->runTool('createResp');
if ($task == 'saveRemote' || $task == 'saveFlash') $status->task = 'upload';
$post = JRequest::get('post');
$user = JFactory::getUser($post['userid']);
if (version_compare(JVERSION, '1.6.0', 'ge')) {
$auth = $user->getAuthorisedGroups();
if (in_array(8, $auth) || in_array(7, $auth)) $usertype = 'Administrator';
} else {
$usertype = $user->usertype;
}
if (!$vparams->useradd && ($usertype != 'Super Administrator' && $usertype != 'Administrator')) {
$status->message = JText::_('COM_VIDEOFLOW_ERROR_PERM_ADD');
$status->type = 'error';
$status->task = 'status';
return $status;
}
if ($task == 'saveFlash') {
$pubset = $vparams->autopubups;
} else {
$pubset = $vparams->autopubadds;
}
if (!$pubset && ($usertype != 'Super Administrator' && $usertype != 'Administrator')) {
$post['published'] = 0;
}
$file = JRequest::getVar ('file');
$title = JRequest::getString ('title');
if (empty ($title)) {
$status->message = JText::_('COM_VIDEOFLOW_ERROR_TITLE');
return $status;
}
if ($task == 'saveRemote') {
$db = JFactory::getDBO();
$query = 'SELECT * FROM #__vflow_data WHERE file ='.$db->quote($file).
' OR title LIKE '.$db->quote ('%'.$db->getEscaped ($title, true).'%',false );
$db-> setQuery($query);
$media = $db->loadObject();
if (!empty($media)) {
$status->message = "\"$title\" ".JText::_('COM_VIDEOFLOW_EXISTS')."<a href='".
JRoute::_(JURI::root().'index.php?option=com_videoflow&task=add&id='.$media->id)."'> ".
JText::_('COM_VIDEOFLOW_NOTICE_ADD_TO_LIST')."</a>";
return $status;
}
}
include_once (JPATH_COMPONENT_SITE.DS.'helpers'.DS.'videoflow_file_manager.php');
if ($ret = VideoflowFileManager::saveRemoteFile($post)) {
$status->status = true;
$status->id = $ret;
$status->message = "\"$title\" ".JText::_('COM_VIDEOFLOW_SAVED');
JRoute::_(JURI::root().'index.php?option=com_users&view=login'.
if (!$pubset && ($usertype != 'Super Administrator' && $usertype != 'Administrator')) {
$status->message = "\"$title\" ".JText::_("COM_VIDEOFLOW_ADMIN_APPROVAL");
}
$status->type = 'message';
}
return $status;
}
I've added the
JRoute::_(JURI::root().'index.php?option=com_users&view=login'.
at the bottom of the code which is the only difference from the original working .php file.
I hope that's enough to go on, hope you can help.
Thanks