473,503 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help with Joomla 1.5.2

19 New Member
Hi I am trying to learn Joomla - a tool for web development using php.My problem is I keep getting warnings such as

Warning: strtotime() [function.strtotime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Pacific/Auckland' for '12.0/no DST' instead in C:\xampp\htdocs\joomla15\libraries\joomla\utilitie s\date.php on line 56

I tried changing the code

Expand|Select|Wrap|Line Numbers
  1. function __construct($date = 'now', $tzOffset = 0)
  2.  {        
  3.    if ($date == 'now' || empty($date))    
  4.     {
  5.       $this->_date = strtotime(gmdate("M d Y H:i:s", time()));            
  6.      return;
  7.    } 
  8.    :
  9.    : //more code  
  10.  }

to

Expand|Select|Wrap|Line Numbers
  1. function __construct($date = 'now', $tzOffset = 0)
  2.  {
  3.   if ($date == 'now' || empty($date))
  4.    {
  5.     $this->_date = date_default_timezone_set('Pacific/Fiji');            
  6.     return;
  7.    }
  8.    :
  9.    :  //more code 
  10.  }
Before changing the code, I got the home page as I had designed, together with the warnings but now I get a blank page.I can't even view my home page.Can someone familiar with Joomla help me please...

Thanks
Sep 19 '10 #1
3 1458
Rizladonovich
13 New Member
date_default_timezone_set returns a boolean value (check man page). In other words; your statement set $this->date to TRUE if success or FALSE if failure.

The "best way" (could of course depend on special cases in code) is to set it in php.ini.

If not set it "early" in the code, so that you are sure it is set before any time function are used.

So: do _not_ change line 5, but add definition of timezone _before_ that line is executed...

I.e.:

date_default_timezone_set('Pacific/Fiji'); could be added in another file executed before the one you have your posted code or:

Expand|Select|Wrap|Line Numbers
  1.  
  2. /* HERE */
  3.  
  4. function __construct($date = 'now', $tzOffset = 0)
  5.  {        
  6.    /* or HERE */
  7.    if ($date == 'now' || empty($date))    
  8.     {
  9.      /* or HERE */
  10.       $this->_date = strtotime(gmdate("M d Y H:i:s", time()));            
  11.      return;
  12.    } 
  13.    :
  14.    : //more code  
  15.  }
  16.  
Sep 19 '10 #2
nlal
19 New Member
According to this posting
http://forum.joomla.org/viewtopic.php?p=2149186
The construct function actually has two underscore
function __construct()
and removing an underscore solves the problem.
This is true.But the problem remains that I can no longer view the page I designed
Sep 19 '10 #3
Rizladonovich
13 New Member
> ...
> The construct function actually has two underscore
> function __construct()
> and removing an underscore solves the problem.
> This is true.But the problem remains that I can no longer view the page I designed
> ...

That sounds very strange.

Construct should have two underscores if it is supposed to be a class construct.

ref: http://www.php.net/manual/en/language.oop5.decon.php
Sep 19 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
12204
by: i_vincent | last post by:
Hi all, Newbie Python programmer here, so please be patient. I have spent all day googling for an answer to my problem, but everything I try fails to work (or works from the Interpreter with a...
0
1691
by: Adam Haskell | last post by:
Ok heres the situation: We have a linked server from SQL 2000 to a foxpro dbf. In our test enviroment we had the Foxpro and SQL server on the same machine. The linked worked perfect. Now we are...
1
2638
by: Srinivasa Ra via .NET 247 | last post by:
(Type your message here) I am writing an application that does lot of read/write's withcomputer's serial port. The application as a whole is workingfine. Current Approach: I have a Timer that...
25
1890
by: Mark | last post by:
I'm just starting out in an introductory ASP.Net course, and am trying to run a simple program but keeping getting an error. I'm running XP, have installed Internet Information Services (5.1) ,...
1
1542
by: Arvind P Rangan | last post by:
Hi, I have created a class library which i need to use in my ASPX file. when i say: Dim mylib As TestLib = new TestLib() it gives me an error saying type required. How do we use a class...
0
282
by: saravanan_article | last post by:
Hi I am newbie to C#, i am using C# 2005 and DataGridView in my Application. The problem is described here I am using DataGrid and I placed some Headers like Column1,Column2,Column3.... What i...
2
1444
by: manisha.patravali | last post by:
Hello, First let me explain the scenario where i m using this requirement. We are Using CustomAppWizard and designing a wizard .One of the wizard pages will Insert Composite controls as many as...
2
1744
by: Andrew | last post by:
Hi, I am trying to write a program to solve roots using the Newtonian method of roots, and I am recieving several errors which I cannot figure out... if anyone could give me a point in the right...
8
9143
by: rdabane | last post by:
I'm trying to perform following type of operation from inside a python script. 1. Open an application shell (basically a tcl ) 2. Run some commands on that shell and get outputs from each command...
0
1055
by: P.K Sahu | last post by:
hello there, i'm new to web service but i have a difficulty to understand web services. See, I created the webservice through the default template of visual studio & " hello world" but that does...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7353
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7011
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7468
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5596
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3170
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
401
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.