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
    Mad props go to Ryan for writing 99.9% of it!
      • 25663 MODX Staff
      • 12,272 Posts
      And now the intro’s updated too... as soon as we clarify credit or rewrite some small portions of code, we can release it in the wild. We don’t want another bunch of whiners like with the Maxigallery situation a few weeks ago. (I say we rewrite... tongue)

      In the meantime, please test away.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 6726
        • 7,075 Posts
        The intro is way cool, great job ! I just love it, it rocks !!!

        Not to mention the snippet itself (which sadly I have been unable to test yet... a quick read through the doc already had me excited though grin )
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l'outil id
          • 18397
          • 3,250 Posts
          Ok after checking the Etomite legacy code I have found 3 things that are still very clearly based off their code:

          1. Splitter- we use the exact code from NewsListingRev03. I don’t know what we can do about that other than PM him and ask. Who wants to do it?

          2. We share $sorDir variable name. Not a big deal

          3. Archives based on kastor’s snippet. Got an alternate solution thanks to Ryan’s link. Will impliment when I get home.
            • 33337
            • 3,975 Posts
            Very nice intro ! it rocks! grin
              Zaigham R - MODX Professional | Skype | Email | Twitter

              Digging the interwebs for #MODX gems and bringing it to you. modx.link
              • 25663 MODX Staff
              • 12,272 Posts
              I’d do it mark, but I no longer have an account there...
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 18397
                • 3,250 Posts
                Ok, one more quick test version.

                Added JSON formatting [thanks Adam smiley] and fixed a few bugs. I also changed the last variable names for the archives (internal variables, not parameters) so that the archives script no-longer resemble any Etomite code.

                Just for referance here is the code that generates the archives:

                <?php
                
                	function generateArchive($archiveText, $archivePlaceholder, $stop, $total, $resource, $dateFormatType, $dateFormat, $archiveDateType, $tplArch, $debug) {
                		global $modx;
                		$lastCategory = "";
                		$archivehtml = "";
                		$archiveHTML .= "<h3>$archiveText</h3><div id=\"ditto_archivelist\"><ul>";
                		
                		for ($i = $stop; $i < $total; $i++) {
                				$dateArray = getdate($resource[$i][$dateFormatType]);
                				$category = strftime("%B %Y", $resource[$i][$dateFormatType]);
                				$subCategory = $dateArray['mon'];
                				if ($subCategory != $lastCategory) {
                					if ($lastCategory != "") {
                						$archiveHTML .= '</ul></li>';
                					}
                					$archiveHTML .= '<li><span class="ditto_month">'.$category.'</span><ul>';
                				}
                				$archiveHTML .= "<li class=\"ditto_archpost\">";
                				$archiveHTML .= $this->render($resource, $i, "archive", $archiveDateType, $tplArch, $dateFormat, $debug);
                				$archiveHTML .= "</li>";
                				$lastCategory  = $subCategory;
                		
                		}
                		$archiveHTML .= "</ul></li></ul></div>";
                		
                		if ($archivePlaceholder == 1) {
                		$modx->setPlaceholder('archive', $archiveHTML);
                		} else { return $archiveHTML; }
                	}
                
                ?php>
                


                And the Etomite code is available here: http://etomite.org/browsesnippets.html?int_snipid=162&lst_category=8 (remember to copy and paste)

                Unless anyone objects, I plan to release this tomorrow afternoon.
                  • 6726
                  • 7,075 Posts
                  Great !

                  When you do, don’t forget to update this signature of yours Mark wink
                  I guess it’ll be Ditto Guru now grin !
                    .: COO - Commerce Guys - Community Driven Innovation :.


                    MODx est l&#39;outil id
                    • 2762
                    • 1,198 Posts
                    Quote from: davidm at May 12, 2006, 02:21 AM

                    Great !

                    When you do, don’t forget to update this signature of yours Mark wink
                    I guess it’ll be Ditto Guru now grin !

                    grin grin
                      Free MODx Graphic resources and Templates www.tattoocms.it
                      -----------------------------------------------------

                      MODx IT  www.modx.it
                      -----------------------------------------------------

                      bubuna.com - Web & Multimedia Design
                      • 22303 MODX Staff
                      • 10,725 Posts
                      And a reminder, please don’t link to Etomite snippets directly from this forum.