Historic campaigns

Development information and discussion about EDK.
Post Reply
Eek
Someday Author
Posts: 73
Joined: Fri Dec 17, 2010 00:20

Historic campaigns

Post by Eek »

I've hacked our killboard to show previous campaigns that have passed their end date and are "closed"

I use campaigns to track our efficiency over the past 6 quarters and different periods in our corp's history. It's just fun to be able to look who was the topscorer when in a certain alliance or period in our past.

Every so often this functionality breaks when updating the killboard and my hack has other drawbacks. (like errors generated)

It would be awesome if each campaing had the option to be shown among the active campaings, even if it is past it's end date.

Example; http://www.demonic-retribution.com/
User avatar
Salvoxia
Developer
Posts: 1598
Joined: Wed Feb 22, 2012 12:11

Re: Historic campaigns

Post by Salvoxia »

Hi,

I'm interested in how your hack looks at a code level. Would you care to post it? :)

Best Regards,
Salvoxia
anchorhead
Someday Author
Posts: 95
Joined: Thu May 16, 2013 12:48

Re: Historic campaigns

Post by anchorhead »

Hello,

You have do others modifications, Salvoxia can you keep Shiptype close isk losse and colour also :) ? It could be an option.
Eek
Someday Author
Posts: 73
Joined: Fri Dec 17, 2010 00:20

Re: Historic campaigns

Post by Eek »

I'm the worst at documenting my changes, every time my hacks break after an update, i have to reinvent my hack..

Anyway.. doing a compare between clean files and my files i find the following changes to get me my historic contract/campaign list:

In common\includes\class.contractlist.php:

Code: Select all

$sql .= " order by ctr_ended, ctr_started desc";
change to:

Code: Select all

$sql .= " order by ctr_name";
So my contract are sorted by name (i use numbers in the name to get them ordered)

In common\home.php:

Code: Select all

// Display campaigns, if any.
	if (Killboard::hasCampaigns(true) &&
			$this->isCurrentPeriod()) {
		$html = "<div class='kb-campaigns-header'>Active campaigns</div>";
		$list = new ContractList();
		$list->setActive("yes");
		$list->setCampaigns(true);
		$table = new ContractListTable($list);
		$html .= $table->generate();
		return $html;
change to:

Code: Select all

// Display campaigns, if any.
	if (Killboard::hasCampaigns(true) &&
			$this->isCurrentPeriod()) {
		$html = "<div class='kb-campaigns-header'>Campaigns</div>";
		$list = new ContractList();
		$list->setCampaigns(true);
		$table = new ContractListTable($list);
		$html .= $table->generate();
		return $html;
I think that should be it. Also, after modifying you sometimes need to clear your browser cache to see the effect.

The change/hack i did to display kill/loss isk values with a color based on it's value is a bit more extensive and maybe more suited for another topic if needed.
Eek
Someday Author
Posts: 73
Joined: Fri Dec 17, 2010 00:20

Re: Historic campaigns

Post by Eek »

I do get about 10-15 of these errors (in cache/error.log) every day and I thought they are related to my campaign modificatation:

Code: Select all

PHP 2016-03-31 02:43:52 512:  SQL error (You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by 3, 2, 1 -- get corps & alliances for contract' at line 1 in /root/common/includes/class.dbcachedquery.php on line 377
PHP 2016-03-31 05:25:11 512:  SQL error (You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by 3, 2, 1 -- get corps & alliances for contract' at line 1 in /root/common/includes/class.dbcachedquery.php on line 377
PHP 2016-03-31 07:35:03 512:  SQL error (You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by 3, 2, 1 -- get corps & alliances for contract' at line 1 in /root/common/includes/class.dbcachedquery.php on line 377
Could this be related?
User avatar
Salvoxia
Developer
Posts: 1598
Joined: Wed Feb 22, 2012 12:11

Re: Historic campaigns

Post by Salvoxia »

Hi,

I took a look at the code and I'm really not sure how this error could occur. Do you somtimes see that error when browsing the killboard as well?

Best Regards,
Salvoxia
Eek
Someday Author
Posts: 73
Joined: Fri Dec 17, 2010 00:20

Re: Historic campaigns

Post by Eek »

My KB had all kinds of permission issues due to wrong file owner/group that I've now solved. Since then a lot of errors have disappeared, along with this one.

I guess it was not related after all
Eek
Someday Author
Posts: 73
Joined: Fri Dec 17, 2010 00:20

Re: Historic campaigns

Post by Eek »

I've just been troubleshooting something else and it turns out my change to home.php gives me a problem with the page counter??

Im being haunted by a "[ Page: 1 2 ]" page counter, where it should count up to 16 for this month:

http://www.demonic-retribution.com/?a=home

If I click "Kills, Losses or All Kills" in the Navigation menu, a 2nd page counter appears that seems to be correct.

Any idea why removing "$list->setActive("yes");" from home.php gives me a 2nd page counter that actually doesn't seem to do anything?

Also, kinda offtopic; why not make the page counter for "All Kills" appear on the default start page? (if combined kills and losses is on)
User avatar
Salvoxia
Developer
Posts: 1598
Joined: Wed Feb 22, 2012 12:11

Re: Historic campaigns

Post by Salvoxia »

By removing the filter for showing active campaigns only, the table holding the campaigns grows to more than 10 entries. The table creates the paginator itself, if it has more than 10 entries (see common/includes/class.contractlisttable.php, line 272).
This of course only works correctly in the campaigns view and not on the home page.
Eek
Someday Author
Posts: 73
Joined: Fri Dec 17, 2010 00:20

Re: Historic campaigns

Post by Eek »

Ahhhh.. that makes alot of sense.

Changed the value to 16 and now my pagesplitter is gone.. Thx alot!
Post Reply