Import website from one server to the other

Hey guys,
Im new to writing php codes. I can read, and edit them …
So recently I installed a Joomal based website onto my hosting account, I got some errors, you can see them on:
http://testadminsite.affixy.com/music.test/

And then I installed it on a free host where the site worked.

So basically I wanted to know if there was any way that I can see the website under my original domain, but the website is hosted somewhere else.

Currently I am using Iframe but that is not quite doing the trick.
http://bands.affixy.com/

The way I prefer is something like an import command, or an adjustable iframe according to your browser.

Any possible? please write them down,

Thanks :smiley:

Well, I would guess that your hosting company as set the timezone options. So, the error you are getting:

Warning: strftime() [function.strftime]: 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 'Asia/Karachi' for 'PKT/5.0/no DST' instead in /home/affixy/public_html/testadminsite/music.test/libraries/joomla/utilities/date.php on line 250
Means that you need to go the the music.test/libraries/joomla/utilities/date.php and just change the strftime functions to the date.timezone versions. That should not be too hard to do. You can post that code in date.php if you need help with it.

As far as using an iFrame, some servers will not let you copy form other servers. But, I have down it on a lot of sites and it seems to work for me. You can load the iFrame in the actual tags or dynamically if you need to change pages.

I suggest you look at the date.php file and see if you can fix that first. Let us know if you need more help.

Ether that, or use an htaccess file to pre-set the default timezone using ini_set(). i’ve had to do that before with other settings as a work around for a few things. Its not foolproof, but its one way around that issue.

Hey guys, thanks for the replies.

Here is the code in date.php ,
[php]<?php
/**

  • @version $Id: date.php 10827 2008-08-27 23:10:15Z charlvn $
  • @package Joomla.Framework
  • @subpackage Utilities
  • @copyright Copyright © 2005 - 2008 Open Source Matters. All rights reserved.
  • @license GNU/GPL, see LICENSE.php
  • Joomla! is free software. This version may have been modified pursuant
  • to the GNU General Public License, and as distributed it includes or
  • is derivative of works licensed under the GNU General Public License or
  • other free or open source software licenses.
  • See COPYRIGHT.php for copyright notices and details.
    */

// Check to ensure this file is within the rest of the framework
defined(‘JPATH_BASE’) or die();

/**

  • JDate is a class that stores a date

  • @package Joomla.Framework

  • @subpackage Utilities

  • @since 1.5
    /
    class JDate extends JObject
    {
    /
    *

    • Unix timestamp
    • @var int|boolean
    • @access protected
      */
      var $_date = false;

    /**

    • Time offset (in seconds)
    • @var string
    • @access protected
      */
      var $_offset = 0;

    /**

    • Creates a new instance of JDate representing a given date.

    • Accepts RFC 822, ISO 8601 date formats as well as unix time stamps.

    • If not specified, the current date and time is used.

    • @param mixed $date optional the date this JDate will represent.

    • @param int $tzOffset optional the timezone $date is from
      */
      function __construct($date = ‘now’, $tzOffset = 0)
      {
      if ($date == ‘now’ || empty($date))
      {
      $this->_date = strtotime(gmdate(“M d Y H:i:s”, time()));
      return;
      }

      $tzOffset *= 3600;
      if (is_numeric($date))
      {
      $this->_date = $date - $tzOffset;
      return;
      }

      if (preg_match(’~(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s+)?(\d{1,2})\s+([a-zA-Z]{3})\s+(\d{4})\s+(\d{2}):(\d{2}):(\d{2})\s+(.*)~i’,$date,$matches))
      {
      $months = Array(
      ‘jan’ => 1, ‘feb’ => 2, ‘mar’ => 3, ‘apr’ => 4,
      ‘may’ => 5, ‘jun’ => 6, ‘jul’ => 7, ‘aug’ => 8,
      ‘sep’ => 9, ‘oct’ => 10, ‘nov’ => 11, ‘dec’ => 12
      );
      $matches[2] = strtolower($matches[2]);
      if (! isset($months[$matches[2]])) {
      return;
      }
      $this->_date = mktime(
      $matches[4], $matches[5], $matches[6],
      $months[$matches[2]], $matches[1], $matches[3]
      );
      if ($this->_date === false) {
      return;
      }

       if ($matches[7][0] == '+') {
       	$tzOffset = 3600 * substr($matches[7], 1, 2)
       		+ 60 * substr($matches[7], -2);
       } elseif ($matches[7][0] == '-') {
       	$tzOffset = -3600 * substr($matches[7], 1, 2)
       		- 60 * substr($matches[7], -2);
       } else {
       	if (strlen($matches[7]) == 1) {
       		$oneHour = 3600;
       		$ord = ord($matches[7]);
       		if ($ord < ord('M')) {
       			$tzOffset = (ord('A') - $ord - 1) * $oneHour;
       		} elseif ($ord >= ord('M') && $matches[7] != 'Z') {
       			$tzOffset = ($ord - ord('M')) * $oneHour;
       		} elseif ($matches[7] == 'Z') {
       			$tzOffset = 0;
       		}
       	}
       	switch ($matches[7]) {
       		case 'UT':
       		case 'GMT': $tzOffset = 0;
       	}
       }
       $this->_date -= $tzOffset;
       return;
      

      }
      if (preg_match(’~(\d{4})-(\d{2})-(\d{2})T\s:(\d{2}):(\d{2})(.*)~’, $date, $matches))
      {
      $this->_date = mktime(
      $matches[4], $matches[5], $matches[6],
      $matches[2], $matches[3], $matches[1]
      );
      if ($this->_date == false) {
      return;
      }
      if (isset($matches[7][0])) {
      if ($matches[7][0] == ‘+’ || $matches[7][0] == ‘-’) {
      $tzOffset = 60 * (
      substr($matches[7], 0, 3) * 60 + substr($matches[7], -2)
      );
      } elseif ($matches[7] == ‘Z’) {
      $tzOffset = 0;
      }
      }
      $this->_date -= $tzOffset;
      return;
      }
      $this->_date = (strtotime($date) == -1) ? false : strtotime($date);
      if ($this->_date) {
      $this->_date -= $tzOffset;
      }
      }

    /**

    • Set the date offset (in hours)
    • @access public
    • @param float The offset in hours
      */
      function setOffset($offset) {
      $this->_offset = 3600 * $offset;
      }

    /**

    • Get the date offset (in hours)
    • @access public
    • @return integer
      */
      function getOffset() {
      return ((float) $this->_offset) / 3600.0;
      }

    /**

    • Gets the date as an RFC 822 date.
    • @return a date in RFC 822 format
    • @link http://www.ietf.org/rfc/rfc2822.txt?number=2822 IETF RFC 2822
    • (replaces RFC 822)
      */
      function toRFC822($local = false)
      {
      $date = ($local) ? $this->_date + $this->_offset : $this->_date;
      $date = ($this->_date !== false) ? date(‘D, d M Y H:i:s’, $date).’ +0000’ : null;
      return $date;
      }

    /**

    • Gets the date as an ISO 8601 date.
    • @return a date in ISO 8601 (RFC 3339) format
    • @link http://www.ietf.org/rfc/rfc3339.txt?number=3339 IETF RFC 3339
      */
      function toISO8601($local = false)
      {
      $date = ($local) ? $this->_date + $this->_offset : $this->_date;
      $offset = $this->getOffset();
      $offset = ($local && $this->_offset) ? sprintf("%+03d:%02d", $offset, abs(($offset-intval($offset))*60) ) : ‘Z’;
      $date = ($this->_date !== false) ? date(‘Y-m-d\TH:i:s’, $date).$offset : null;
      return $date;
      }

    /**

    • Gets the date as in MySQL datetime format
    • @return a date in MySQL datetime format
    • @link http://dev.mysql.com/doc/refman/4.1/en/datetime.html MySQL DATETIME
    • format
      */
      function toMySQL($local = false)
      {
      $date = ($local) ? $this->_date + $this->_offset : $this->_date;
      $date = ($this->_date !== false) ? date(‘Y-m-d H:i:s’, $date) : null;
      return $date;
      }

    /**

    • Gets the date as UNIX time stamp.
    • @return a date as a unix time stamp
      */
      function toUnix($local = false)
      {
      $date = null;
      if ($this->_date !== false) {
      $date = ($local) ? $this->_date + $this->_offset : $this->_date;
      }
      return $date;
      }

    /**

    • Gets the date in a specific format

    • Returns a string formatted according to the given format. Month and weekday names and

    • other language dependent strings respect the current locale

    • @param string $format The date format specification string (see {@link PHP_MANUAL#strftime})

    • @return a date in a specific format
      */
      function toFormat($format = ‘%Y-%m-%d %H:%M:%S’)
      {
      $date = ($this->_date !== false) ? $this->_strftime($format, $this->_date + $this->_offset) : null;

      return $date;
      }

    /**

    • Translates needed strings in for JDate::toFormat (see {@link PHP_MANUAL#strftime})
    • @access protected
    • @param string $format The date format specification string (see {@link PHP_MANUAL#strftime})
    • @param int $time Unix timestamp
    • @return string a date in the specified format
      */
      function _strftime($format, $time)
      {
      if(strpos($format, ‘%a’) !== false)
      $format = str_replace(’%a’, $this->_dayToString(date(‘w’, $time), true), $format);
      if(strpos($format, ‘%A’) !== false)
      $format = str_replace(’%A’, $this->_dayToString(date(‘w’, $time)), $format);
      if(strpos($format, ‘%b’) !== false)
      $format = str_replace(’%b’, $this->_monthToString(date(‘n’, $time), true), $format);
      if(strpos($format, ‘%B’) !== false)
      $format = str_replace(’%B’, $this->_monthToString(date(‘n’, $time)), $format);
      $date = strftime($format, $time);
      return $date;
      }

    /**

    • Translates month number to string
    • @access protected
    • @param int $month The numeric month of the year
    • @param bool $abbr Return the abreviated month string?
    • @return string month string
      */
      function monthToString($month, $abbr = false)
      {
      switch ($month)
      {
      case 1: return $abbr ? JText::
      (‘JANUARY_SHORT’) : JText::(‘JANUARY’);
      case 2: return $abbr ? JText::
      (‘FEBRUARY_SHORT’) : JText::(‘FEBRUARY’);
      case 3: return $abbr ? JText::
      (‘MARCH_SHORT’) : JText::(‘MARCH’);
      case 4: return $abbr ? JText::
      (‘APRIL_SHORT’) : JText::(‘APRIL’);
      case 5: return $abbr ? JText::
      (‘MAY_SHORT’) : JText::(‘MAY’);
      case 6: return $abbr ? JText::
      (‘JUNE_SHORT’) : JText::(‘JUNE’);
      case 7: return $abbr ? JText::
      (‘JULY_SHORT’) : JText::(‘JULY’);
      case 8: return $abbr ? JText::
      (‘AUGUST_SHORT’) : JText::(‘AUGUST’);
      case 9: return $abbr ? JText::
      (‘SEPTEMBER_SHORT’) : JText::(‘SEPTEMBER’);
      case 10: return $abbr ? JText::
      (‘OCTOBER_SHORT’) : JText::(‘OCTOBER’);
      case 11: return $abbr ? JText::
      (‘NOVEMBER_SHORT’) : JText::(‘NOVEMBER’);
      case 12: return $abbr ? JText::
      (‘DECEMBER_SHORT’) : JText::_(‘DECEMBER’);
      }
      }

    /**

    • Translates day of week number to string
    • @access protected
    • @param int $day The numeric day of the week
    • @param bool $abbr Return the abreviated day string?
    • @return string day string
      */
      function dayToString($day, $abbr = false)
      {
      switch ($day)
      {
      case 0: return $abbr ? JText::
      (‘SUN’) : JText::(‘SUNDAY’);
      case 1: return $abbr ? JText::
      (‘MON’) : JText::(‘MONDAY’);
      case 2: return $abbr ? JText::
      (‘TUE’) : JText::(‘TUESDAY’);
      case 3: return $abbr ? JText::
      (‘WED’) : JText::(‘WEDNESDAY’);
      case 4: return $abbr ? JText::
      (‘THU’) : JText::(‘THURSDAY’);
      case 5: return $abbr ? JText::
      (‘FRI’) : JText::(‘FRIDAY’);
      case 6: return $abbr ? JText::
      (‘SAT’) : JText::_(‘SATURDAY’);
      }
      }

}
[/php]

Please tell me what to edit here.

Thanks

Sponsor our Newsletter | Privacy Policy | Terms of Service