We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4310
    • 2,310 Posts
    You shouldn’t have all those backslashes in the snippet, looks like your server has PHP magic quotes set to on.
    The code should look something like this :
    <?php
    $ar_chunks = explode(',',$chunks);
    $ar_chunks = array_unique($ar_chunks);
    
    $output = '';
    
    foreach ($ar_chunks as $chunk) {
      if ($chunk != '') {
        $c = $modx->getChunk($chunk);
        if ($c) $output .= $c;
      }
    }
    
    if ($output != '' && isset($wrapperdiv)) {
      $output = '<div id="'.$wrapperdiv.'">'.$output.'</div>';
    }
    
    return $output;
    ?>
      • 34213
      • 32 Posts
      That’s what I keep trying to put in the snippet but it changes. BUT I can’t find out how to disable magic quotes. I don’t have a php.ini file on my server???
      Any other way to disable magic quotes?
        • 4310
        • 2,310 Posts
        php_value magic_quotes_gpc off

        In your .htaccess file may work, depends on server set-up.
        Or try Google with disable php magic quotes for some other ways.
        Otherwise it’s time to ask your hosting company for a method.
          • 34213
          • 32 Posts
          Tried on my .htaccess file but got a 500 error on my whole website. My host said they did disable them...

          I’ve been searching for probably 3 or 4 hours on how to edit this but nobody knows other ways.

          If I could get all of the php.ini coding i could make my own php.ini file and it should work that way?
            • 4310
            • 2,310 Posts
            Here’s an example php.ini set of instructions http://php.net/manual/en/security.magicquotes.disabling.php
            You should be able to see if it is really off by viewing your PHP Info from the Manager => Reports => System Info => phpinfo() View
              • 34213
              • 32 Posts
              It shows On.
              I put the code in my php.ini file i created and nothing.
              Can you tell the errors by looking at them?
              alsministries.com
                • 4310
                • 2,310 Posts
                It seems to be just the home page, is that using the chunkListParser snippet?
                If you have PHPMyAdmin access you could update the code directly in the database.
                  • 34213
                  • 32 Posts
                  Ya I have access.
                  How can I edit it in there?
                    • 4310
                    • 2,310 Posts
                    Go to the modx_site_snippet table,
                    find the row with chunkListParser in the name column/field,
                    edit that row/record,
                    paste the clean snippet code into the snippet column/field,
                    save
                      • 34213
                      • 32 Posts
                      I can’t find that file anywhere in my database