Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Senkusha on April 27, 2008, 12:29:52 PM

Title: Paid Subscriptions Sort Order
Post by: Senkusha 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!
Title: Re: Paid Subscriptions Sort Order
Post by: Senkusha on April 29, 2008, 03:55:39 PM
Anything at all?  At least which file would I look in to make the changes myself?
Title: Re: Paid Subscriptions Sort Order
Post by: karlbenson 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.
Title: Re: Paid Subscriptions Sort Order
Post by: Senkusha on April 30, 2008, 03:19:28 PM
Hi, I tried this, but nothing happened. :(
Title: Re: Paid Subscriptions Sort Order
Post by: karlbenson 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.
Title: Re: Paid Subscriptions Sort Order
Post by: Senkusha 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!
Title: Re: Paid Subscriptions Sort Order
Post by: karlbenson 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.
Title: Re: Paid Subscriptions Sort Order
Post by: Senkusha 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?
Title: Re: Paid Subscriptions Sort Order
Post by: karlbenson on May 06, 2008, 06:24:50 PM
i was talking about in the admin area.

Are you referring to in the profile?