PHP Classes

Changing sample.csv

Recommend this page to a friend!

      Thesaurus tooltip  >  All threads  >  Changing sample.csv  >  (Un) Subscribe thread alerts  
Subject:Changing sample.csv
Summary:Is it possible to have a script output the ads?
Messages:4
Author:Tim Wilton
Date:2007-07-06 12:29:34
Update:2007-07-07 06:33:35
 

  1. Changing sample.csv   Reply   Report abuse  
Picture of Tim Wilton Tim Wilton - 2007-07-06 12:29:35
I've been trying to get a script to output the equivalent of what is present in the sample.csv file, but hit a brick wall. Even a simple script that outputs the exact contents of the oringinal csv file gives me nothing.

Can you help, please?
Thanks

  2. Re: Changing sample.csv   Reply   Report abuse  
Picture of Dmitry Sheiko Dmitry Sheiko - 2007-07-06 13:37:05 - In reply to message 1 from Tim Wilton
Take the last version of Thesaurus. I've added db_controller.php. You can use MySQL DB as data source for terms

  3. Re: Changing sample.csv   Reply   Report abuse  
Picture of Tim Wilton Tim Wilton - 2007-07-06 14:14:26 - In reply to message 2 from Dmitry Sheiko
Thanks.

I have a script that outputs in the same format as sample.csv, but for some reason it doesn't get loaded into controller.php.




  4. Re: Changing sample.csv   Reply   Report abuse  
Picture of Dmitry Sheiko Dmitry Sheiko - 2007-07-07 06:33:36 - In reply to message 3 from Tim Wilton
Use this utility to trace what is wrong in your case:

if (!function_exists('toLog')) {
/**
* Get var dump as a string
*
* @param $Var
* @return boolean
*/
function print_r_log($Var) {
ob_start();
print_r($Var);
$ret_str = ob_get_contents();
ob_end_clean();
return $ret_str;
}

/**
* Retrieve all different elements
*
* @param $Message
* @return boolean
*/
function toLog( $Message=false, $Method="w", $FileName="error.log" ) {
if(is_array($Message) or is_object($Message)) $Message = print_r_log($Message);
$fp=fopen("{$FileName}", $Method);
if($FileName=="error.log")
fwrite($fp, "LOG ".date("Y-m-d H:i:s").":\r\n".$Message."\r\n" );
else
fwrite($fp, $Message );
fclose($fp);
return true;
}
}

Place in the suspicious places toLog($your_veruable_or_array,"a"); and check in error.log what you really have in that stages of script processing