Magento Forum

How do add random banner in header? 
 
mas-ter
Jr. Member
 
Total Posts:  13
Joined:  2008-07-01
 

Hi all,
how do add a random banner in header.phtml? I add php code for random image, but when i refresh my home page there is a magento error:
“There has been an error processing your request
Warning: opendir(/skin/frontend/default/default/images/media/banner/) [function.opendir]: failed to open dir: No such file or directory in /app/design/frontend/default/default/template/page/html/header.phtml on line 45
Trace:
0 /app/design/frontend/default/default/template/page/html/header.phtml(45): mageCoreErrorHandler(2, ‘opendir(/skin/f...’, ‘/p...’, 45, Array)
#1 /app/code/core/Mage/Core/Block/Template.php(131): include(’/home/marchel/p...’)
#2 /app/code/core/Mage/Core/Block/Template.php(163): Mage_Core_Block_Template->fetchView(’/skin/frontend/...’)
#3 /app/code/core/Mage/Core/Block/Template.php(180): Mage_Core_Block_Template->renderView(’frontend/default/de...’)
#4 /app/code/core/Mage/Core/Block/Abstract.php(554): Mage_Core_Block_Template->_toHtml()
#5 /app/code/core/Mage/Core/Block/Abstract.php(431): Mage_Core_Block_Abstract->toHtml()
#6 /app/code/core/Mage/Core/Block/Abstract.php(408): Mage_Core_Block_Abstract->_getChildHtml()
#7 /app/design/frontend/default/default/template/page/2columns-right.phtml(35): Mage_Core_Block_Abstract->getChildHtml(’header’, true)
#8 /app/code/core/Mage/Core/Block/Template.php(131): include(’/home/marchel/p...’)
#9 /app/code/core/Mage/Core/Block/Template.php(163): Mage_Core_Block_Template->fetchView(’header’)
#10 /app/code/core/Mage/Core/Block/Template.php(180): Mage_Core_Block_Template->renderView(’frontend/default/de...’)
#11 /app/code/core/Mage/Core/Block/Abstract.php(554): Mage_Core_Block_Template->_toHtml()
#12 /app/code/core/Mage/Core/Model/Layout.php(505): Mage_Core_Block_Abstract->toHtml()
#13 /app/code/core/Mage/Core/Controller/Varien/Action.php(319): Mage_Core_Model_Layout->getOutput()
#14 /app/code/core/Mage/Cms/Helper/Page.php(77): Mage_Core_Controller_Varien_Action->renderLayout()
#15 /app/code/core/Mage/Cms/controllers/IndexController.php(26): Mage_Cms_Helper_Page->renderPage()
#16 /app/code/core/Mage/Core/Controller/Varien/Action.php(342): Mage_Cms_IndexController->indexAction(Object(Mage_Cms_IndexController), ‘home’)
#17 /app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(159): Mage_Core_Controller_Varien_Action->dispatch()
#18 /app/code/core/Mage/Core/Controller/Varien/Front.php(146): Mage_Core_Controller_Varien_Router_Standard->match(’index’)
#19 /app/Mage.php(427): Mage_Core_Controller_Varien_Front->dispatch(Object(Mage_Core_Controller_Request_Http))
#20 /index.php(40): Mage::run()
#21 {main}

Tanks for any help

 
Magento Community Magento Community
Magento Community
Magento Community
 
mas-ter
Jr. Member
 
Total Posts:  13
Joined:  2008-07-01
 

Please......help me.....i’m alone in this forum?

 
Magento Community Magento Community
Magento Community
Magento Community
 
bozmac
Jr. Member
 
Total Posts:  18
Joined:  2008-06-17
 

Integrate OpenAds instead so you only mess with the header template and not with the PHP code. No offense but it seems you really don’t know what you’re doing. If you use the External Invocation via JavaScript, you’ll get what you need and with better reporting to boot.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top