...

View Full Version : Characters remove {}



yamenshahin
11-06-2008, 02:37 PM
Hi
i get this error alot


The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


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

An invalid character was found in text content. Error processing resource 'http://www.myaboutall.com/sitemap1.xml'. Line 5...

<loc>http://www.myaboutall.com/Article/How-To-Increase-you
I think the erro come from the title of this article

http://www.myaboutall.com/Article/How-To-Increase-you-re-Adsense-Revenue-----You-re-Newsletter/19763
Here you will find the error

http://www.myaboutall.com/sitemap1.xml

Also the same error here

http://www.myaboutall.com/sitemap3.xml
http://www.myaboutall.com/sitemap4.xml
etc..

I use the following script to clear my site from weird character

<?php

/*
ARTICLE DASHBOARD ARTICLE TABLE REPAIR SCRIPT

Some articles have unrecognizable characters in them. This
results in broken XML sitemap pages and readers who are
annoyed with unreadable text. Please use this script to
fix those unreadable characters.

PLEASE BACKUP YOUR ARTICLE DATABASE TABLE BEFORE EXECUTING
THIS SCRIPT.

When you are finished doing the yoursite_articles table,
then put this file in the same directory as you have your
copy of Article Dashboard. Then simply load this file into
your browser.

The script will show you a running list of the articles
it fixed.

Provided by Bill Platt as a courtesy,
http://www.StewartConsultants.com


Because Article Dashboard is not an Open Source application,
it is more difficult to repair these issues when articles are added
to your database. So, I recommend that you run this script once
per week or once per day, to fix the articles in your database on
a regular basis.

I have my copy running on Cron once every 24 hours:

GET http://www.articles4reprint.com/fix_weird_characters_AD_sites.php > /dev/null 2>&1
*/



include("setup.php");

$link = mysql_connect($dbhost, $dbuser, $dbpasswd)or die ("Could not connect to mysql because ".mysql_error());
mysql_select_db($dbname)or die ("Could not select database because ".mysql_error());

$fix_count=0;


$query1 = "SELECT * FROM ".$table_prefix."articles ORDER BY `article_id` asc ";
$result1 = mysql_query($query1) or die(mysql_error());
while ($row1 = mysql_fetch_array($result1))
{
$counter=0;

$article_id = $row1[article_id];
$article_title1 = $row1[article_title];
$article_sum1 = $row1[article_sum];
$article_body1 = $row1[article_body];
$article_res1 = $row1[article_res];
$article_key1 = $row1[article_key];

$article_title2 = convert_smart_quotes($article_title1);
$article_sum2 = convert_smart_quotes($article_sum1);
$article_body2 = convert_smart_quotes($article_body1);
$article_res2 = convert_smart_quotes($article_res1);
$article_key2 = convert_smart_quotes($article_key1);

$article_title2 = trim($article_title2);

if (strlen($article_title1) != strlen($article_title2))
{
$counter++;
}

if (strlen($article_sum1) != strlen($article_sum2))
{
$counter++;
}

if (strlen($article_body1) != strlen($article_body2))
{
$counter++;
}

if (strlen($article_res1) != strlen($article_res2))
{
$counter++;
}

if (strlen($article_key1) != strlen($article_key2))
{
$counter++;
}

if ($counter > 0)
{
$article_title2 = addslashes($article_title2);
$article_sum2 = addslashes($article_sum2);
$article_body2 = addslashes($article_body2);
$article_res2 = addslashes($article_res2);
$article_key2 = addslashes($article_key2);

$sql = "UPDATE ".$table_prefix."articles" . " SET `article_title` = '$article_title2', `article_sum` = '$article_sum2', `article_body` = '$article_body2', `article_res` = '$article_res2', `article_key` = '$article_key2' WHERE `article_id` = '$article_id' ";

mysql_query($sql) or die(mysql_error());
echo "<B>Article # " . $article_id . " Updated</B> - " . $article_title1 . "<br>";
$fix_count++;
}


}


echo "<br><font color=#B00000><B>" . $fix_count . "</B></font><br><br>";









function convert_smart_quotes($string)
{
$find[] = '“'; // left side double smart quote
$find[] = '”'; // right side double smart quote
$find[] = '‘'; // left side single smart quote
$find[] = '’'; // right side single smart quote
$find[] = '�'; // left side single smart quote
$find[] = '�'; // right side single smart quote
$find[] = '…'; // elipsis
$find[] = '—'; // em dash
$find[] = '–'; // en dash
$find[] = ''; // en dash

$find[] = ''; // trademark
$find[] = ''; // copyright
$find[] = ''; // elipsis
$find[] = ''; // one quarter
$find[] = ''; // one half
$find[] = ''; // three quarters
$find[] = ' & '; // space ampersand space


$replace[] = '"';
$replace[] = '"';
$replace[] = "'";
$replace[] = "'";
$replace[] = "'";
$replace[] = "'";
$replace[] = "...";
$replace[] = "-";
$replace[] = "-";
$replace[] = "-";

$replace[] = "(tm)";
$replace[] = "(c)";
$replace[] = "...";
$replace[] = "1/4";
$replace[] = "1/2";
$replace[] = "3/4";
$replace[] = " and ";

return str_replace($find, $replace, $string);
}



exit;

?>

how i can remove this character {}

pkshukla24
06-04-2009, 02:56 PM
I tried this script but every time I get the message as under...

MySQL client ran out of memory

Can you help in fixing the issue.

Regards.

Prashant

oesxyl
06-04-2009, 03:39 PM
I tried this script but every time I get the message as under...

MySQL client ran out of memory

Can you help in fixing the issue.

Regards.

Prashant
from xml point of view that files are invalid, replace "'" with "&apos;".

best regards



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum