hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : Magento mySQL/php problem with plugin
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

Magento mySQL/php problem with plugin

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 11-06-2011, 01:58 PM
PCHeroes PCHeroes is offline
Newbie
 
Join Date: Apr 2009
Posts: 19

Magento mySQL/php problem with plugin


Hope this is the right forum for this, appologies if its not.

I installed a magento plugin to show business hours on a CMS page but the 2nd part of the plugin that shows your full weeks opening hours doesnt work. I'm running a local install of magento 1.6.1 and this plugin hasnt been updated since 1.4 but what its doing is really just pulling values from the DB so I'm thinking its just some small error/change in the code

The php/mysql kills the magento page, it basically is blank.

Can anyone see any mistakes in the code that may cause this ? I think this is a very useful plugin and would love to get it working and post back up the working code for anyone who may also want to use it.

PHP Code:
 <?php
date_default_timezone_set
(Mage::getStoreConfig('businesshours/general/timezone'));
$days=array('sun','mon','tue','wed','thu','fri','sat');
$start=date("w",time());
$j=0;
for(
$i=0+$start;$i<=6+$start;$i++){
  
$dow[$j]=$days[$i%7];
  
$j++;
}
foreach(
$dow as $day) {
${
$day.'_open'}  = Mage::getStoreConfig('businesshours/general/'.$day.'_open');
${
$day.'_close'} = Mage::getStoreConfig('businesshours/general/'.$day.'_close');
}
?>

<div class="fullschedule">

<div id="header">
<?php echo "<strong>".$this->__('Business Hours')."</strong>\n" ?>
</div>

<div id="schedule">
<?php
foreach($dow as $day) {
  switch(
$day) {
    case 
'mon': echo $this->__('Monday');
              break;
    case 
'tue': echo $this->__('Tuesday');
              break;
    case 
'wed': echo $this->__('Wednesday');
              break;
    case 
'thu': echo $this->__('Thursday');
              break;
    case 
'fri': echo $this->__('Friday');
              break;
    case 
'sat': echo $this->__('Saturday');
              break;
    case 
'sun': echo $this->__('Sunday');
  }
  if(${
$day.'_open'} != '') {
    
$result=$this->getIsClosed(date('Y-m-d',time()+60*60*24));
    if(
$result[0])
      echo 
": ".$this->_('CLOSED')."<br>\n";
    else
      echo 
": ".${$day.'_open'}.$this->__(' to ').${$day.'_close'}."<br>\n";
  } else {
    echo 
": ".$this->_('CLOSED')."<br>\n";
  }
}
?>
</div>

</div>

__________________
PC Heroes
Find links to all the best Opensource Software
http://www.pcheroes.org

Reply With Quote


Sponsored Links
  #2  
Old 11-09-2011, 01:46 AM
T-Junk T-Junk is offline
Junior Guru
 
Join Date: May 2011
Location: UT,US
Posts: 197
If the PHP is what is making the page blank, then it should be leaving errors. You can check your logs or put this line of PHP into your script:
PHP Code:
<?php
ini_set
('display_errors'1); 
ini_set('log_errors'1); 
ini_set('error_log'dirname(__FILE__) . '/error_log.txt'); 
error_reporting(E_ALL);
?>
That should tell you on what line the error occurs, which will help you track down the problem. Good luck!

__________________
This Geeks Blog Site | | Need moral support? Got it HERE!!!

Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP/MySQL Wordpress Plugin Developer apnicsolutions Employment / Job Offers 0 09-10-2011 04:30 AM
PHP/MySQL Wordpress Plugin Developer apnicsolutions Employment / Job Offers 1 09-07-2011 02:56 PM
Need IonCuber Installed on server. + Magento Plugin RingMastA Systems Management Requests 4 05-25-2011 04:10 AM
Magento Expert, PHP MYSQL, one time job. Taba-Promos Employment / Job Offers 3 09-24-2010 12:51 AM

Related posts from TheWhir.com
Title Type Date Posted
Ecommerce Platform Magento Improves Scalability with Magento Enterprise 1.13 Release Web Hosting News 2013-04-11 13:36:18
Ecommerce Platform Magento Launches Web Hosting Partnership Program Web Hosting News 2012-10-17 11:02:10
Web Host PEER 1 Partners with Ecommerce Firm iMegaMedia Web Hosting News 2011-10-11 20:23:24
Web Host PEER 1 Provides Managed Hosting for Magento Storefront Web Hosting News 2011-09-20 15:50:17
eBay Acquires Open Source E-commerce Platform Magento Web Hosting News 2011-06-06 20:56:29


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?