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
    NewsListing Version 6.4.2
    STABLE RELEASE
      • 33114
      • 518 Posts
      I have 6.4.2 and get this error when changing anything in templates (or newslisting snippet calls)
      Fatal error: Cannot redeclare customsort() (previously declared in /home/prsound/public_html/manager/includes/document.parser.class.inc.php(691) : eval()'d code:145) in /home/prsound/public_html/assets/snippets/newslisting/functions.php on line 60

      then I refresh the page and everything goes ok... but not in IE:(


      http://www.promosound.org/afisha (see the first news item in the left got stuck to the edge for no obvious reason)


      what is this error anyways?
      Thanks
        http://modx.ru - российская поддержка MODx
        http://newscup.ru - экспериментальный проект
        http://yentsun.com - персональный сайт
        • 18397
        • 3,250 Posts
        Try replacing

        include($filevalue);
        


        with

        include_once($filevalue);
        
          • 33114
          • 518 Posts
          Quote from: Mark at Apr 30, 2006, 11:44 PM

          Try replacing

          include($filevalue);
          


          with

          include_once($filevalue);
          



          done but... problem persists ... as I noticed - there’s no include of the functions.php in the code huh
          $files['language'] = "assets/snippets/newslisting/lang/$language.inc.php";
          $files['functions'] = "assets/snippets/newslisting/functions.php";
          
          foreach ($files as $filename => $filevalue) {
          	if (file_exists($filevalue) && $filename != "language") {
          	   include_once($filevalue);
          	} else if(file_exists($filevalue) &&  $filename == "language") {
          		include_once($filevalue);
          	} else if($filename == "language") {
          		return "Language file does not exist Please check: ".$filevalue;
          	  } else {
          		return $filevalue.$_lang['file_does_not_exist'];
          	}
          }
          - this is the only passage where "include" is met
            http://modx.ru - российская поддержка MODx
            http://newscup.ru - экспериментальный проект
            http://yentsun.com - персональный сайт
            • 18397
            • 3,250 Posts
            Can you provide both calls?

            I am unable to duplicate the symtoms you describe on any of my testing servers.
              • 19777
              • 35 Posts
              Hi Mark,

              Thanks for the update, however, it still doesn’t seem to address the problem I was describing earlier - i.e wanting HTML output in the following way:

               	
              <div class="left">
              <h2><a href="SomePermalink" title="Permanent link to this article">Article 1</a></h2>
              <p class="author">Category 1 | Author | Date</p>
              <p>Some summary. <a href="#" title="Permanent link to this article">More</a></p>
              </div>
              
              <div class="right">
              <h2><a href="SomePermalink" title="Permanent link to this article">Article 2</a></h2>
              <p class="author">Category 2 | Author | Date</p>
              <p>Some summary. <a href="#" title="Permanent link to this article">More</a></p>
              </div>
              
              <br style="clear: both;" />
              
              <div class="left">
              <h2><a href="SomePermalink" title="Permanent link to this article">Article 3</a></h2>
              <p class="author">Category 1 | Author | Date</p>
              <p>Some summary. <a href="#" title="Permanent link to this article">More</a></p>
              </div>
              
              <div class="right">
              <h2><a href="SomePermalink" title="Permanent link to this article">Article 4</a></h2>
              <p class="author">Category 2 | Author | Date</p>
              <p>Some summary. <a href="#" title="Permanent link to this article">More</a></p>
              </div>
              
              <br style="clear: both;" />
              
              etc.


              It seems the First, Last and Alt chunks work nicely if you have a vertical column of summaries with one post per row. However, I’m trying to make a column of summaries that have two listings in each row (as in the HTML code above). In essence, I’d like to assign a chunk for each row and assign the first summary to the left, the second summary to the right, on the next row I’d assign the third article to the left and the fourth article to the right (so on and so forth), rather than the First, Last and Alt options.

              I tried the current method when i have 5 articles in the archive, it renders First, Alt, Last, Alt, Last, instead of my intended Left, Right, Left, Right, Left.

              How best to go about this? Am I being clear?

              Cheers

              Mark
                • 18397
                • 3,250 Posts
                Here is an example I put together a while back:

                http://modxdev.net/NewsListingFloats.html
                • I’ve used NewsListing for the "main menu", with floats:



                  .hmnSplash{
                  width:185px;
                  float:left;
                  margin:0 7px 0 0;
                  padding:0;
                  border:1px solid #cacaca;
                  }


                  .hmnListing{
                  width:375px;
                  height:470px;
                  float:left;
                  margin:0 7px 7px 0;
                  padding:0;
                  border:1px solid #cacaca;
                  text-align:center;
                  }


                    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
                    • 19777
                    • 35 Posts
                    thanks Mark!

                    Great Snippet.
                      • 18397
                      • 3,250 Posts
                      You are most welcome!

                      Thank you for the kind words.