Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Julian

    (@julianarnold)

    okay, brilliant, thank you!

    Thread Starter Julian

    (@julianarnold)

    Yep, Mage and Varien are in the list of declared classes, but when I use the last code you wrote above, I get the following error:

    Fatal error: Uncaught exception 'Zend_Controller_Response_Exception' with message 'Cannot send headers; headers already sent in /var/www/vhosts/dialoguebooks.org/subdomains/dev/httpdocs/wp-content/themes/dialogue/header.php, line 20' in /var/www/vhosts/secure.dialoguebooks.org/httpdocs/lib/Zend/Controller/Response/Abstract.php:282 Stack trace: #0 /var/www/vhosts/secure.dialoguebooks.org/httpdocs/lib/Zend/Controller/Response/Abstract.php(115): Zend_Controller_Response_Abstract->canSendHeaders(true) #1 /var/www/vhosts/secure.dialoguebooks.org/httpdocs/app/code/core/Mage/Core/Model/App.php(1151): Zend_Controller_Response_Abstract->setHeader('Content-Type', 'text/html; char...') #2 /var/www/vhosts/secure.dialoguebooks.org/httpdocs/app/code/core/Mage/Core/Model/Cookie.php(93): Mage_Core_Model_App->getResponse() #3 /var/www/vhosts/secure.dialoguebooks.org/httpdocs/app/code/core/Mage/Core/Model/Cookie.php(208): Mage_Core_Model_Cookie->_getResponse() #4 /var/www/vhosts/secure.dialoguebooks.org/httpdocs/app/code/core/Mage/Core/Mod in /var/www/vhosts/secure.dialoguebooks.org/httpdocs/lib/Zend/Controller/Response/Abstract.php on line 282

    Thanks

    Julian

    Thread Starter Julian

    (@julianarnold)

    (the second thing I tried above was in a wordpress template)

    Thread Starter Julian

    (@julianarnold)

    Although when I run:

    <?php
        require_once ( "/var/www/vhosts/secure.dialoguebooks.org/httpdocs/app/Mage.php" );
        Mage::app("default");
        Mage::getSingleton("core/session", array("name" => "frontend"));
    ?>

    I don’t get any output, and when I tried this:

    <?php if(class_exists('Mage')){
    		Mage::getSingleton('core/session', array('name' => 'frontend'));
    	}
    
    if(class_exists('Mage')){
    	$session = Mage::getSingleton("customer/session");
    	$magento_message = "Welcome ";
    	// Generate a personalize greeting
    	if($session->isLoggedIn()){
    		$magento_message .= $session->getCustomer()->getData('firstname').' ';
    		$magento_message .= $session->getCustomer()->getData('lastname').'!';
    	}else{
    		$magento_message .= "Guest!";
    	}
    
    	echo $magento_message;
    }
    ?>

    I just get the ‘Guest!’ message, even though I am logged in with my megnto session.

    Any ideas?

    Thanks

    Julian

    Thread Starter Julian

    (@julianarnold)

    Ah, yes the webadmin was lying to me. Thanks for your help!

    Thread Starter Julian

    (@julianarnold)

    Hmm, I get this message, although safe mode is definitely off:

    Warning: require_once() [function.require-once]: SAFE MODE Restriction in effect. The script whose uid is 10041 is not allowed to access /var/www/vhosts/secure.dialoguebooks.org/httpdocs/app/Mage.php owned by uid 10050 in /var/www/vhosts/dialoguebooks.org/subdomains/dev/httpdocs/mage.php on line 2

    Warning: require_once(/var/www/vhosts/secure.dialoguebooks.org/httpdocs/app/Mage.php) [function.require-once]: failed to open stream: Inappropriate ioctl for device in /var/www/vhosts/dialoguebooks.org/subdomains/dev/httpdocs/mage.php on line 2

    Fatal error: require_once() [function.require]: Failed opening required ‘/var/www/vhosts/secure.dialoguebooks.org/httpdocs/app/Mage.php’ (include_path=’.:’) in /var/www/vhosts/dialoguebooks.org/subdomains/dev/httpdocs/mage.php on line 2

    Thread Starter Julian

    (@julianarnold)

    Hey, thanks for the swift reponse.

    When I echo that I get “/var/www/vhosts/secure.dialoguebooks.org/httpdocs” – when I add the path to Mage.php (making /var/www/vhosts/secure.dialoguebooks.org/httpdocs/app/Mage.php) I get an invalid URL error.

    Is this because the wordpress installation and magento installation are on different file roots on the server? (i.e /var/www/vhosts/secure.dialoguebooks.org/httpdocs/ and /var/www/vhosts/dialoguebooks.org/subdomains/dev/httpdocs/)

    Thanks

    Julian

Viewing 7 replies - 1 through 7 (of 7 total)