Jump to content


Sorting by order they're added in the ACP


5 replies to this topic

#1 Lincoln

    Newbie

  • Members
  • 3 posts

Posted 12 April 2011 - 04:08 PM

Hello,

Is it possible to modify the awards system to sort the awards by order they're added (or sorted) to the ACP and not by order that they're awarded?

Edit: Talking about sorting in the signature bloc.

#2 peaderfi

    Administrator

  • Owner
  • 164 posts

Posted 13 April 2011 - 02:25 PM

It currently would require a file edit and would apply to all users

#3 Lincoln

    Newbie

  • Members
  • 3 posts

Posted 13 April 2011 - 02:29 PM

Yep that's exactly what I want :)

What file do I need to edit?

#4 peaderfi

    Administrator

  • Owner
  • 164 posts

Posted 13 April 2011 - 07:09 PM

Sure open up /admin/applications_addon/other/awards/xml/hooks/TopicViewHook.xml

find (there are two instances, one on line 41 and one on line 134)
									'order'		=> 't.awarded_date DESC',

replace with
									'order'		=> 'c.awards_cat_pos ASC, p.awards_pos ASC',

find (there are two instances, one on line 44 and one on line 137)
										array(
											'select'=> 'p.awards_img_url, p.awards_cat_id, p.awards_name',
											'from'	=> array( 'awards' => 'p' ),
											'where'	=> "p.awards_id=t.awards_id",
											'type'	=> 'left',
										),

add after
										array(
											'select'=> 'c.awards_cat_pos',
											'from'	=> array( 'awards_cat' => 'c' ),
											'where'	=> "p.awards_cat_id=c.awards_cat_id",
											'type'	=> 'left',
										),

Save & upload

Open /admin/applications_addon/other/awards/extensions/profileTabs/awards.php

find (on line 51)
									'order'		=> 'f.awards_cat_pos ASC, p.awarded_date DESC',

replace with
									'order'		=> 'f.awards_cat_pos ASC, t.awards_pos ASC',

Save & upload

Go to your ACP > System > Manage Hooks page and click "Reimport all application hooks" and everything should then work the way you want it.


Note this hasn't been tested

#5 Lincoln

    Newbie

  • Members
  • 3 posts

Posted 13 April 2011 - 10:38 PM

Awesome, that worked great thanks!

One last question, is it possible to have it stop stacking awards on the bottom after say 5 and put the new ones on the top? Instead it's reading somewhere around 10 and putting 10 on top and the left over on the bottom. Also if it's possible to change the spacing size :)

#6 peaderfi

    Administrator

  • Owner
  • 164 posts

Posted 20 April 2011 - 07:26 AM

Currently that isn't possible





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users