We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18397
    • 3,250 Posts
    Also, do you have register_globals turned on or off?
      • 24278
      • 165 Posts
      I have register_globals turned OFF

      UPDATE
      I upgraded to NL 6.4.2 and the problem seems to be solved... but I haven’t been able to do extensive testing. Will report later on this.

      -raavi
        • 33114
        • 518 Posts
        ... oops! while upgrading to 0.9.2 - NL downgraded to 4.4 - that made "Cannot redeclare customsort()" go away but made the problem described in my latest post. now, having upgraded NL to 6.4.2 - "Cannot redeclare customsort()" again appears and the pagination problem disappeared.

        :(

        currently trying to test on my local server, to see if this "Cannot redeclare customsort()" is server-dependent
          http://modx.ru - российская поддержка MODx
          http://newscup.ru - экспериментальный проект
          http://yentsun.com - персональный сайт
          • 18397
          • 3,250 Posts
          Please let me know what you find on your local server.

          Also, try to simple NewsListing calls without any paramters other than startID. If you don’t see the error. Add the paramters back until you find the one that is broken.
            • 33114
            • 518 Posts
            Quote from: Mark at May 03, 2006, 12:32 AM

            Please let me know what you find on your local server.

            Also, try to simple NewsListing calls without any paramters other than startID. If you don’t see the error. Add the paramters back until you find the one that is broken.

            home server test - OK! no error
            well, this is obviously server-dependent

            also - on production server (promosound.org) - the error appears when NL called without any parameters except startID

            attached is phpinfo of the prod server
              http://modx.ru - российская поддержка MODx
              http://newscup.ru - экспериментальный проект
              http://yentsun.com - персональный сайт
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Here’s a Dutch translation of the language file:
              <?php
              
              /**
               * Filename:       assets/snippets/newslisting/lang/dutch.inc.php
               * Function:       Dutch language file for NewsListing.
               * Author:         The MODx Project
               * Date:           2006/04/09
               * Version:        6.4.1
               * MODx version:   0.9.5
               * Translated:     2006/05/01 by Carolien Fijt
              */
              
              // NOTE: New language keys should added at the bottom of this page
              
              $_lang['file_does_not_exist'] = "Bestaat niet. Check het bestand.";
              
              $_lang['default_template'] = '
                  <div class="nl_summaryPost">
                      <h3><a href="[~[+id+]~]">[+title+]</a></h3>
                      <div>[+summary+]</div>
                      <p>[+link+]</p>
                      <div style="text-align:right;">door <strong>[+author+]</strong> op [+date+]</div>
                  </div>
              ';
              
              $_lang['blank_tpl'] = "Uw sjabloon voor NewsListing is leeg of u heeft een typefout gemaakt in de chunk naam, check alstublieft";
              
              $_lang['missing_placeholders_tpl'] = 'Uw NewsListing sjabloon mist placeholders, check hieronder uw sjabloon: <br /><br /><hr /><br /><br />';
              
              $_lang['missing_placeholders_tpl_2'] = '<br /><br /><hr /><br />';
              
              $_lang['default_splitter'] = "<!-- splitter -->";
              
              $_lang['more_text'] = "Meer hierover...";
              
              $_lang['no_entries'] = '<p>Geen ingangen gevonden.</p>';
              
              $_lang['date_format'] = "%d-%b-%y %H:%M";
              
              $_lang['older_items'] = "Oudere Items";
              
              $_lang['prev'] = "< Vorige";
              
              $_lang['next'] = "Volgende >";
              
              $_lang['button_splitter'] = "|";
              
              $_lang['default_copyright'] = "[(site_name)] 2006";	
              
              $_lang['rss_lang'] = "en";
              
              $_lang['api_method'] = "Gebruikt de API Methode (gaat akkoord met alles, behalve pub_date, unpub_date, editedon, deletedon, and multilevel) <br />";
              
              $_lang['GetAllSubDocs_method'] = "Gebruikt de GetAllSubDocs Methode (gaat akkoord voor alle mogelijkheden, maar is een beetje langzamer) <br />";
              
              $_lang['debug_summarized'] = "Nummer dat samengevat moet worden (nrposts/count):";
              
              $_lang['debug_returned'] = "<br />Totaal aantal dat geretourneerd moet zijn:";
              
              $_lang['debug_retrieved_from_db'] = "Totaaltelling in db:";
              
              $_lang['debug_sort_by'] = "Sorteer op (sortby):";
              
              $_lang['debug_sort_dir'] = "Sorteer richting (sortdir):";
              
              $_lang['debug_start_at'] = "Start bij";
              
              $_lang['debug_stop_at'] = "en stop bij";
              
              $_lang['debug_out_of'] = "zonder";
              
              $_lang['debug_document_data'] = "Document Data for";
              ?>
              
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 33688
                • 54 Posts
                ...and here’s a Swedish translation of the language file for NewsListing snippet. smiley

                The only thing pending is the exact meaning of the penultimate clause [debug_out_of] . ’Out of’ can have at least six different meanings in the target language, so for the sake of clarity it would be good if someone could just put the phrase in context, please.
                <?php
                
                /**
                 * Filename:       assets/snippets/newslisting/lang/swedish.inc.php
                 * Function:       Swedish language file for NewsListing.
                 * Author:         The MODx Project
                 * Date:           2006/04/09
                 * Version:        6.4.1
                 * MODx version:   0.9.5
                 * Translated:     2006/05/03 by Mats Wall
                */
                
                // NOTE: New language keys should added at the bottom of this page
                
                $_lang['file_does_not_exist'] = " existerar inte. Kontrollera filen.";
                
                $_lang['default_template'] = '
                    <div class="nl_summaryPost">
                        <h3><a href="[~[+id+]~]">[+title+]</a></h3>
                        <div>[+summary+]</div>
                        <p>[+link+]</p>
                        <div style="text-align:right;">av <strong>[+author+]</strong> den [+date+]</div>
                    </div>
                ';
                
                $_lang['blank_tpl'] = "Mallen för NewsListing är tom, eller också är namnet på kodstycket felstavat. Var vänlig kontrollera.";
                
                $_lang['missing_placeholders_tpl'] = 'Mallen för NewsListing saknar platshållare. Kontrollera mallen här nedan: <br /><br /><hr /><br /><br />';
                
                $_lang['missing_placeholders_tpl_2'] = '<br /><br /><hr /><br />';
                
                $_lang['default_splitter'] = "<!-- splitter -->";
                
                $_lang['more_text'] = "Läs mer...";
                
                $_lang['no_entries'] = '<p>Hittade inga poster.</p>';
                
                $_lang['date_format'] = "%d %b %Y %H:%M";
                
                $_lang['older_items'] = "Tidigare poster";
                
                $_lang['prev'] = "< Föregående";
                
                $_lang['next'] = "Nästa >";
                
                $_lang['button_splitter'] = "|";
                
                $_lang['default_copyright'] = "[(site_name)] 2006";	
                
                $_lang['rss_lang'] = "en";
                
                $_lang['api_method'] = "Använder metoden API (tar med allt utom pub_date, unpub_date, editedon, deletedon, och multilevel) <br />";
                
                $_lang['GetAllSubDocs_method'] = "Använder metoden GetAllSubDocs (tar med allt som är möjligt men är något långsammare) <br />";
                
                $_lang['debug_summarized'] = "Antal som ska summeras (nrposts/count):";
                
                $_lang['debug_returned'] = "<br />Totalt antal som ska returneras:";
                
                $_lang['debug_retrieved_from_db'] = "Totalt räknade i db:";
                
                $_lang['debug_sort_by'] = "Sortera efter (sortby):";
                
                $_lang['debug_sort_dir'] = "Sorteringsording (sortdir):";
                
                $_lang['debug_start_at'] = "Börja vid";
                
                $_lang['debug_stop_at'] = "och sluta vid";
                
                $_lang['debug_out_of'] = "utav";
                
                $_lang['debug_document_data'] = "Dokumentdata för";
                ?>
                
                  • 33114
                  • 518 Posts
                  AT LAST!! I found the reason for that "Cannot redeclare" thingy. Again it is CHUNKS sad
                  Call me stupido but I use chunks widely and put into them this and that.

                  For example: I have about 6 templates, which are mostly identical except for couple of strings. I put the top part of the code into the {{TOP}} and the code after non-identical part into {{BOTTOM}} chunk. Finally I have 6 templates of the following kind:
                  {{TOP}}
                  ...non-identical strings of code...
                  {{BOTTOM}}
                  so when you need to change something you have no need to change all of 6 templates - just the {{TOP}} {{BOTTOM}} chunks.
                  (Don’t know...maybe there’s another way on opimizing my case).
                  Now here comes the first bug - when your head tags are in a chunk - meta keywords won’t work!

                  And for the latest case. I have a TV that represents the content of my left column wich can be different for each page. The values are like this:
                  News=={{news_list}}||Advertisement=={{ad_list}}||Events=={{event_list}}
                  In my {{news_list}} chunk I’m calling [!NewsListing!]. Alas, this is causing the "Cannot redeclare customsort thing" until the page is cached. When I call NL directly in the template - everything is just fine. A more strange thing this is server-dependent.

                  I would miss my dearest chunks if I had to get rid of them *sob*


                  Updated: I have no words. It just started to work normally. NO errors. Great.
                    http://modx.ru - российская поддержка MODx
                    http://newscup.ru - экспериментальный проект
                    http://yentsun.com - персональный сайт
                    • 18397
                    • 3,250 Posts
                    Glad it started working normally!

                    Quote from: mjarecki at May 01, 2006, 01:38 AM

                    I’m also wondering if it’s possible to use Newslisting to create a summary list of all pages written by a particular author? So that I can have an author home page that lists all articles written by that author.

                    And is it possible to assign multiple categories to articles and then have Newslisting type summary list based on a specific category?

                    Again, in Textpattern (sorry to go on about this, but still getting my head around modX) it is simply a case of typing <txp:article_custom category="photos" offset="0" limit="2" listform="excerptlist" /> or <txp:article_custom author="John" offset="0" limit="2" listform="excerptlist" /> inside a template and an article list by category or author is created.

                    Cheers

                    mark j



                    Are you referring to the way it was done in the MODx blog?
                      • 33114
                      • 518 Posts
                      2Mark: yeah me happy too. You’ve done a great work with this snippet! Guess you should rename it into something more global, not just ’NewsListing’ but ’Output’ or ’List’ smiley

                      Thanks and Cheers
                        http://modx.ru - российская поддержка MODx
                        http://newscup.ru - экспериментальный проект
                        http://yentsun.com - персональный сайт