Tuesday, February 21, 2006

how to fix Warning: extract(): First argument should be an array

Re: [maxbear] Error using different template [In reply to] Can't Post

--------------------------------------------------------------------------------

It looks like the error is happening on this line:

--------------------------------------------------------------------------------
Code
--------------------------------------------------------------------------------

extract($TPL_GLOBALS[$template_set]);

--------------------------------------------------------------------------------


Which from the previous few lines, should only error if you don't have a globals.txt. You should be able to fix it by either creating an empty globals.txt file, or by changing the above line to:

--------------------------------------------------------------------------------
Code
--------------------------------------------------------------------------------

if (isset($TPL_GLOBALS[$template_set])) {
extract($TPL_GLOBALS[$template_set]); }
-------------------------------------------------------------------------------

in aboutsaigon/includes/templates.php

function fetch($file = null) {
global $INFO;
if(!$file) $file = $this->file;
if (isset($this->vars)) { // fix the warning
extract($this->vars);
}
ob_start();
include($INFO['templateFolder'].$file.$INFO['templateType']);
$contents = ob_get_contents();
ob_end_clean();
return $contents;
}
}

Wednesday, February 08, 2006

You can almost learn anything

You can learn C++/VB/Java there is a lot information on the internet, first thing you have to search the right document the one that you can read and understand and best practice for exercise that works then download and go step by step learn and practice it. The key important it must have the right document. If you are not satisfy with the documents find another one. You can almost learn anything in the internet as long as you have a fast internet.