0
Welcome Guest! Login
0 items Join Now

Totally Stumped, no answers anywhere else

  • Totally Stumped, no answers anywhere else

    Posted 17 years 4 months ago
    • Ok, I've been trying to do this for a while now and no success.

      I'm importing feeds using Feed Gator. It works pretty well except for one thing. When the feeds are put into the content table, they aren't sorted the way I want them to be sorted.

      Is there a way to show items sorted by date in the Content Item Manager?

      I found this at a different site, but it didn't work for me... :(
      open the file administrator/components/com_content/admin.content.php and at about line 150, you replace this code:
      $order = "\n ORDER BY s.title, c.catid, cc.ordering, cc.title, c.ordering";
      with this one:
      / comment out below for backup reasons, then add new line of code
      // $order = "\n ORDER BY s.title, c.catid, cc.ordering, cc.title, c.ordering";
      $order = "\n ORDER BY c.created DESC";

      Does anybody have anything or know how to sort content items by date in the Administration?

      PLEASE, somebody help!
  • Re: Totally Stumped, no answers anywhere else

    Posted 17 years 4 months ago
    • Ok...wow. Murphy's Law. I post, then it works when I added another line.

      I had to do this. Please notice the commented code, that's where the change is.

      However, if there is a more elegant solution to this, please let me know!
      if ( $sectionid == 0 ) {
                // used to show All content items
                $where = array(
                "c.state     >= 0",
                "c.catid     = cc.id",
                "cc.section = s.id",
                "s.scope     = 'content'",
                );
                // comment out below for backup reasons, then add new line of code
                // $order = "\n ORDER BY s.title, c.catid, cc.ordering, cc.title, c.ordering"; 
                $order = "\n ORDER BY c.created DESC";
                $all = 1;
                //$filter = "\n , #__sections AS s WHERE s.id = c.section";
       
                if ($filter_sectionid > 0) {
                     $filter = "\n WHERE cc.section = '" . (int) $filter_sectionid . "'";
                }
                $section->title = 'All Content Items';
                $section->id = 0;
           } else {
                $where = array(
                "c.state     >= 0",
                "c.catid     = cc.id",
                "cc.section = s.id",
                "s.scope     = 'content'",
                "c.sectionid = " . (int) $sectionid
                );
                // comment out below for backup reasons, then add new line of code
                //$order          = "\n ORDER BY cc.ordering, cc.title, c.ordering";
                $order = "\n ORDER BY c.created DESC";
                $all          = NULL;
                $filter      = "\n WHERE cc.section = '" . (int) $sectionid . "'";
                $section     = new mosSection( $database );
                $section->load( (int)$sectionid );
           }

Time to create page: 0.063 seconds