Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Nov 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Characters remove {}

    Hi
    i get this error alot

    Code:
    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/Ho...wsletter/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 Code:
    <?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 {}

  • #2
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    I need your help...

    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

  • #3
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by pkshukla24 View Post
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •