[RESOLVED] Help with re-direct
Results 1 to 3 of 3

Thread: [RESOLVED] Help with re-direct

  1. #1
    Junior Member
    Join Date
    May 2013
    Posts
    2

    resolved [RESOLVED] Help with re-direct

    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
    PHP Code:
     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 ($titletrue).'%',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
    PHP Code:
    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

  2. #2
    Senior Member Derokorian's Avatar
    Join Date
    Apr 2011
    Location
    Denver
    Posts
    1,740
    I think you need a semi colon instead of a period at the end of that line, as it is the parser is looking to concatenate but instead it encounters the keyword if.
    Sadly, nobody codes for anyone on this forum. People taste your dishes and tell you what is missing, but they don't cook for you. ~anoopmail
    I'd rather be a comma, then a full stop.
    User Authentication in PHP with MySQLi - Don't forget to mark threads resolved - MySQL(i) warning

  3. #3
    Pedantic Curmudgeon Weedpacket's Avatar
    Join Date
    Aug 2002
    Location
    General Systems Vehicle "Thrilled To Be Here"
    Posts
    21,771
    THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER
    FAQs! FAQs! FAQs! Most forums have them!
    Search - Debugging 101 - Collected Solutions - General Guidelines - Getting help at all

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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