Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/09/2008, 14:58
djfritzz
 
Fecha de Ingreso: abril-2006
Mensajes: 12
Antigüedad: 18 años
Puntos: 0
Couldn't create new file - Check your paths and filename!

Hola,

Ahora me aparece este error


Couldn't create new file - Check your paths and filename!


Cual filename?????

paths es la ruta (Creo) que la tengo asi:

/home/comercio/public_html/sitemap.xml

o es asi:

/path/to/public_html/


este es el archivo.

De antemano gracias por la ayuda

<?


define ('IN_ADMIN', 1);

if (!$manual_cron || IN_ADMIN == 1)
{
include_once ('../includes/global.php');
$parent_dir = '../';
}
else
{
$parent_dir = '';
}

ini_set('max_execution_time',0); // No more timeouts
ignore_user_abort(1); // No more timeouts

include_once ($parent_dir . 'includes/class_formchecker.php');
include_once ($parent_dir . 'includes/class_custom_field.php');
include_once ($parent_dir . 'includes/class_user.php');
include_once ($parent_dir . 'includes/class_fees.php');
include_once ($parent_dir . 'includes/class_shop.php');
include_once ($parent_dir . 'includes/class_item.php');
include_once ($parent_dir . 'includes/functions_item.php');
include_once ($parent_dir . 'includes/class_messaging.php');

### Get Configuration Data

$config = $db->get_sql_row("SELECT * FROM probid_sitemap_setts WHERE id='1'");

$post = 0;
$filename = $config['filename'];
$path = $config['path'];

$xmlfile = $config['path']."/home/comercio/public_html/sitemap.xml";

if (is_file($path.$filename) AND ($post==0)) {
unlink($path.$filename);
}

$a = $db->query("SELECT * FROM probid_auctions WHERE active=1 AND approved=1 AND closed=0 AND deleted=0 ORDER BY auction_id DESC");
while ($data = $db->fetch_array($a)) {

$id = $data['auction_id'];
$link = $setts['site_path'];

$storelink = $link."shop.php?user_id=";
$auctionlink = $link."auction_details.php?auction_id=";
$classlink = $link."wanted_details.php?wanted_ad_id=";
$owner = $data['owner_id'];

$OutFile=$path.$filename;

if ($post==0) {
$output="<?xml version='1.0' encoding='UTF-8'?>\r\n<urlset xmlns='http://www.google.com/schemas/sitemap/0.84'>\r\n <url>\r\n <loc>$link</loc>\r\n <priority>0.5</priority>\r\n <changefreq>daily</changefreq>\r\n </url>\r\n";
}

if ($post==1) {
$output=" <url>\r\n <loc>$auctionlink$id</loc>\r\n <priority>0.5</priority>\r\n <changefreq>daily</changefreq>\r\n </url>\r\n";
}

$fp = fopen($OutFile, "a") or die("Couldn't create new file - Check your paths and filename!");
$numBytes = fwrite($fp, $output);
fclose($fp);
$counter = $counter + 1;
$post = 1;
}

if ($post==1) {
$query = $db->query("SELECT * FROM " . DB_PREFIX . "users WHERE shop_nb_items > '0' AND shop_active='1' AND active='1' order by username DESC");
while ($store=mysql_fetch_array($query)) {
$username = $store['user_id'];
$output=" <url>\r\n <loc>$storelink$username</loc>\r\n <priority>0.5</priority>\r\n <changefreq>daily</changefreq>\r\n </url>\r\n";

$fp = fopen($OutFile, "a") or die("Couldn't create new file - Check your paths and filename!");
$numBytes = fwrite($fp, $output);
fclose($fp);
$acounter = $acounter + 1;
$post = 1;
}
}


if ($post==1) {
$getCats = $db->query("SELECT * FROM probid_categories WHERE hidden=0 AND user_id=0 ORDER BY order_id,name");
while ($data=mysql_fetch_array($getCats)) {
$path = $setts['site_path'];
if ($data['parent_id']>0) {
$catLink=$path."categories.php?parent_id=".$data['category_id'];
} else {
$catLink=$path."categories.php?parent_id=".$data['category_id'];
}
$output=" <url>\r\n <loc>$catLink</loc>\r\n <priority>0.5</priority>\r\n <changefreq>daily</changefreq>\r\n </url>\r\n";

$fp = fopen($OutFile, "a") or die("Couldn't create new file - Check your paths and filename!");
$numBytes = fwrite($fp, $output);
fclose($fp);
$acounter = $acounter + 1;
$post = 1;
}
}

if ($post==1) {
$auctions = $db->query("SELECT * FROM probid_wanted_ads WHERE active=1 AND closed=0 AND deleted!=1 ORDER BY wanted_ad_id ASC");
while ($data=mysql_fetch_array($auctions)) {

$id = $data['wanted_ad_id'];

$output=" <url>\r\n <loc>$classlink$id</loc>\r\n <priority>0.5</priority>\r\n <changefreq>daily</changefreq>\r\n </url>\r\n";

$fp = fopen($OutFile, "a") or die("Couldn't create new file - Check your paths and filename!");
$numBytes = fwrite($fp, $output);
fclose($fp);
$bcounter = $bcounter + 1;
$post = 1;
}
}


$output = "</urlset>\r\n";
$fp = fopen($OutFile, "a") or die("Couldn't create new file - Check your paths and filename!");
$numBytes = fwrite($fp, $output);
fclose($fp);
$counter = $counter + 1;
$post = 1;

?>