News:

Wondering if this will always be free?  See why free is better.

Main Menu

Paid Subscriptions Sort Order

Started by Senkusha, April 27, 2008, 12:29:52 PM

Previous topic - Next topic

Senkusha

Is there an option or bit of code I can use to set the sort order of the Paid Subscriptions?

Thank you!
--Senkusha
The Anime Brigade
Anime-style Role Playing Games and Discussion.
(SMF v. 2.1.4, PHP v. 8.0)

Senkusha

Anything at all?  At least which file would I look in to make the changes myself?
--Senkusha
The Anime Brigade
Anime-style Role Playing Games and Discussion.
(SMF v. 2.1.4, PHP v. 8.0)

karlbenson

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.

Senkusha

Hi, I tried this, but nothing happened. :(
--Senkusha
The Anime Brigade
Anime-style Role Playing Games and Discussion.
(SMF v. 2.1.4, PHP v. 8.0)

karlbenson

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.

Senkusha

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!
--Senkusha
The Anime Brigade
Anime-style Role Playing Games and Discussion.
(SMF v. 2.1.4, PHP v. 8.0)

karlbenson

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.

Senkusha

#7
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?
--Senkusha
The Anime Brigade
Anime-style Role Playing Games and Discussion.
(SMF v. 2.1.4, PHP v. 8.0)

karlbenson

i was talking about in the admin area.

Are you referring to in the profile?

Advertisement: