Advertisement:

Author Topic: Need help updating "Sorted Package Manager Listing" for SMF 2.1  (Read 542 times)

Offline live627

  • Developer
  • SMF Hero
  • *
  • Posts: 5,568
  • Gender: Male
    • live627 on Facebook
    • live627 on GitHub
    • live627 on LinkedIn
    • @live627 on Twitter
    • livemods
Need help updating "Sorted Package Manager Listing" for SMF 2.1
« on: December 02, 2018, 03:59:12 AM »
I am trying to update Sorted Package Manager Listing for SMF 2.1 and have it mostly functional. It sorts based on install/uninstall status, but limits listings to one mod each.

If I remove

Code: [Select]
elseif (isset($sort_id[$packageInfo['state']]))
{
$sort_id[$packageInfo['state']]++;
$packages[$packageInfo['state']][strtolower($packageInfo[$sort])] = md5($package);
$context['available_' . $packageInfo['state']][md5($package)] = $packageInfo;
}

all mods become visibly listed.

I'm having great difficulty understanding the relevant code in Packages.php, let alone figure out what is wrong with my code.

Help please?

[Attachment removed]
« Last Edit: December 02, 2018, 06:06:44 PM by live627 »
Try not to become a man of success, but rather try to become a man of value.
- Albert Einstein

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 70,549
    • StoryBB/StoryBB on GitHub
Re: Need help updating "Sorted Package Manager Listing" for SMF 2.1
« Reply #1 on: December 02, 2018, 06:04:46 AM »
Wouldn’t you just sort by time installed (unless that got removed when I wasn’t looking?)
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 50,414
Re: Need help updating "Sorted Package Manager Listing" for SMF 2.1
« Reply #2 on: December 02, 2018, 06:07:36 AM »
Wouldn’t you just sort by time installed (unless that got removed when I wasn’t looking?)

it has not been removed.

Offline live627

  • Developer
  • SMF Hero
  • *
  • Posts: 5,568
  • Gender: Male
    • live627 on Facebook
    • live627 on GitHub
    • live627 on LinkedIn
    • @live627 on Twitter
    • livemods
Re: Need help updating "Sorted Package Manager Listing" for SMF 2.1
« Reply #3 on: December 02, 2018, 10:25:59 AM »
I want a table for each status, similar to how the avatar packs are separated.
Try not to become a man of success, but rather try to become a man of value.
- Albert Einstein

Offline live627

  • Developer
  • SMF Hero
  • *
  • Posts: 5,568
  • Gender: Male
    • live627 on Facebook
    • live627 on GitHub
    • live627 on LinkedIn
    • @live627 on Twitter
    • livemods
Re: Need help updating "Sorted Package Manager Listing" for SMF 2.1
« Reply #4 on: December 02, 2018, 06:08:10 PM »
I resolved my issue.
Try not to become a man of success, but rather try to become a man of value.
- Albert Einstein