Advertisement:

Author Topic: Paid Subscriptions Sort Order  (Read 3470 times)

Offline Senkusha

  • Full Member
  • ***
  • Posts: 625
  • Gender: Male
  • Embrace Your Destiny!
    • Ayeka's Bliss
Paid Subscriptions Sort Order
« on: April 27, 2008, 12:29:52 PM »
Is there an option or bit of code I can use to set the sort order of the Paid Subscriptions?

Thank you!

Offline Senkusha

  • Full Member
  • ***
  • Posts: 625
  • Gender: Male
  • Embrace Your Destiny!
    • Ayeka's Bliss
Re: Paid Subscriptions Sort Order
« Reply #1 on: April 29, 2008, 03:55:39 PM »
Anything at all?  At least which file would I look in to make the changes myself?

Offline karlbenson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,629
  • Gender: Male
    • Criminal Brief UK
Re: Paid Subscriptions Sort Order
« Reply #2 on: April 29, 2008, 06:29:30 PM »
Sources/ManagePaid.php

2.x uses the new createList functions to generate the table, do the sorting etc.
However very few people other than the developers will have used or know how to use them yet.

I believe
At line 237, find
      'base_href' => $scripturl . '?action=admin;area=paidsubscribe;sa=view',
Add After
      'default_sort_col' => 'cost',

Change cost to the name of the column from the same array where you are adding this code.
I believe it will be ascending by default. I'm not sure how to do asc/desc with list options fully.

Offline Senkusha

  • Full Member
  • ***
  • Posts: 625
  • Gender: Male
  • Embrace Your Destiny!
    • Ayeka's Bliss
Re: Paid Subscriptions Sort Order
« Reply #3 on: April 30, 2008, 03:19:28 PM »
Hi, I tried this, but nothing happened. :(

Offline karlbenson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,629
  • Gender: Male
    • Criminal Brief UK
Re: Paid Subscriptions Sort Order
« Reply #4 on: April 30, 2008, 03:47:01 PM »
Oops sorry.  Wrong one. (that does the subscriptions, not the users under the subscriptions).

If you want to do use
      'default_sort_col' => 'name',
Change that to one of the other columns eg start_time
      'default_sort_col' => 'start_time',

Tested and should work.

Offline Senkusha

  • Full Member
  • ***
  • Posts: 625
  • Gender: Male
  • Embrace Your Destiny!
    • Ayeka's Bliss
Re: Paid Subscriptions Sort Order
« Reply #5 on: May 01, 2008, 09:33:44 PM »
Okay, I'll try that once I have more subscribers, but what I really need to work is the first solution, sorting by subscription cost.

Thanks!

Offline karlbenson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,629
  • Gender: Male
    • Criminal Brief UK
Re: Paid Subscriptions Sort Order
« Reply #6 on: May 01, 2008, 09:48:54 PM »
I'm confused.

There are two tables.
1) Lists the various paid subscriptions on offer (Has a column for cost)
index.php?action=admin;area=paidsubscribe;view
As per my first post use that to sort that table by cost.

2) Lists all the users who have purchased one of the offers eg offer 1 (doesn't have a cost column - they all paid the same anyway)
index.php?action=admin;area=paidsubscribe;sa=viewsub;sid=1
As per my second post, you can't sort that table by cost.

Offline Senkusha

  • Full Member
  • ***
  • Posts: 625
  • Gender: Male
  • Embrace Your Destiny!
    • Ayeka's Bliss
Re: Paid Subscriptions Sort Order
« Reply #7 on: May 06, 2008, 06:14:39 PM »
Hi, now it appears to be sorting by the Name.  Um, just to be sure, we are talking about the page where members sign up for subscriptions, right?
« Last Edit: May 06, 2008, 06:17:14 PM by Senkusha »

Offline karlbenson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,629
  • Gender: Male
    • Criminal Brief UK
Re: Paid Subscriptions Sort Order
« Reply #8 on: May 06, 2008, 06:24:50 PM »
i was talking about in the admin area.

Are you referring to in the profile?