[EDK4/EDK3] Advanced Search v2.7.3 [UPDATED]

Discuss/Upload mods to the EVE-Dev Killboard.
User avatar
kazhkaz
Greenhorn
Posts: 29
Joined: Sat Jun 14, 2008 20:24
Location: Terra Nova
Contact:

Re: [EDK4/EDK3] Advanced Search v2.7.1 [UPDATED]

Post by kazhkaz » Sun Dec 23, 2012 01:25

Thank you, Senya, for the typo found.

Actually, the original intention was to use the ISO date format, with dashes, but then i ran into difficulty processing such date when ranges were involved, since it was hard to tell with dash separates what, so i moved to periods for separators but forgot to amend the description.

Also I am sorry for the long responce times, I haven't been working on any EDK-related stuff lately and haven't been monitoring the forum for a while, if you need some fix in a hurry, try PMing me instead.
Advanced Search - when regular one just doesn't cut it! - now compatible with EDK 4! (who stole my original thread?)
Image

Redhouse
Greenhorn
Posts: 39
Joined: Sun Mar 18, 2012 17:12

Comment count problem

Post by Redhouse » Thu Dec 19, 2013 00:56

I have installed this and noticed that comment count leads to some errors. To be sure it wasn't particular to my own board I dragged up some other boards using advanced_search and found they also return the same error. eg:
http://kb.back-to-yarrr.de/?a=search&p=adv_search
http://www.amarr-empire.net/killboard/? ... adv_search
http://kelts.dyndns.org/?a=search&p=adv_search

the following error is from the back to yarr board (not mine), but is the same error:

Code: Select all

WARNING [2] implode() [function.implode]: Invalid arguments passed
Error on line 357 in file /www/htdocs/v037438/B2Y/Killboard/mods/advanced_search/class.advkilllist.php
PHP 5.2.12-nmm4 (Linux), EDK 4.0.4 (Crucible)
File: /www/htdocs/v037438/B2Y/Killboard/mods/advanced_search/class.advkilllist.php, line: 357, function: implode
File: /www/htdocs/v037438/B2Y/Killboard/mods/advanced_search/class.search.php, line: 115, class: AdvKillList, function: setCommentCount
File: /www/htdocs/v037438/B2Y/Killboard/common/includes/class.pageassembly.php, line: 80, function: call_user_func_array
File: /www/htdocs/v037438/B2Y/Killboard/common/includes/class.pageassembly.php, line: 37, class: pageAssembly, function: call
File: /www/htdocs/v037438/B2Y/Killboard/common/search.php, line: 164, class: pageAssembly, function: assemble
File: /www/htdocs/v037438/B2Y/Killboard/common/index.php, line: 293, function: include
File: /www/htdocs/v037438/B2Y/Killboard/index.php, line: 27, function: include

WARNING [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 ')) GROUP BY kills.kll_id ORDER BY kll_timestamp DESC' at line 48
Error on line 49 in file /www/htdocs/v037438/B2Y/Killboard/common/includes/class.dbnormalquery.php
PHP 5.2.12-nmm4 (Linux), EDK 4.0.4 (Crucible)
File: /www/htdocs/v037438/B2Y/Killboard/common/includes/class.dbnormalquery.php, line: 49, function: trigger_error
File: /www/htdocs/v037438/B2Y/Killboard/mods/advanced_search/class.advkilllist.php, line: 534, class: DBNormalQuery, function: execute
File: /www/htdocs/v037438/B2Y/Killboard/mods/advanced_search/class.advkilllist.php, line: 674, class: AdvKillList, function: execQuery
File: /www/htdocs/v037438/B2Y/Killboard/mods/advanced_search/class.search.php, line: 219, class: AdvKillList, function: getCount
File: /www/htdocs/v037438/B2Y/Killboard/common/includes/class.pageassembly.php, line: 80, function: call_user_func_array
File: /www/htdocs/v037438/B2Y/Killboard/common/includes/class.pageassembly.php, line: 37, class: pageAssembly, function: call
File: /www/htdocs/v037438/B2Y/Killboard/common/search.php, line: 164, class: pageAssembly, function: assemble
File: /www/htdocs/v037438/B2Y/Killboard/common/index.php, line: 293, function: include
File: /www/htdocs/v037438/B2Y/Killboard/index.php, line: 27, function: include
The error arises when entering any numeric value in the comment count field and clicking search.

If someone were able to diagnose this and post a fix it would be much appreciated as after browsing the code it appears to be beyond me.
Thanks.

User avatar
Salvoxia
Developer
Posts: 1531
Joined: Wed Feb 22, 2012 12:11

Re: [EDK4/EDK3] Advanced Search v2.7.2 [UPDATED]

Post by Salvoxia » Thu Dec 19, 2013 08:35

Hi,

without having a killboard with this mod installed and with just having looked over the code I'd say it's a copy&paste error in class.advkilllist.php.
If you feel lucky you can try the following:
open mods/advanced_search/class.advkilllist.php and find the following lines of code (around line 355)

Code: Select all

// construct partial filter from value list
		if (count($comments) > 0)
			$where[] = "ind_cnt IN (".implode(", ", $involved).")";
[/code]

and replace it with

Code: Select all

// construct partial filter from value list
		if (count($comments) > 0)
			$where[] = "ind_cnt IN (".implode(", ", $comments).")";
You'll also notice the wrong error message when trying to enter a non-numeric value for comment count stating you entered it for "Involved count".

Rergards,
Salvoxia

Redhouse
Greenhorn
Posts: 39
Joined: Sun Mar 18, 2012 17:12

Re: [EDK4/EDK3] Advanced Search v2.7.2 [UPDATED]

Post by Redhouse » Thu Dec 19, 2013 20:21

Thanks for the reply.
I did notice something looked wrong (and the error text was also a giveaway to a copy paste error), and just followed your small change but it did not work.

I looked into it a bit further, I don't really do php or mysql but hack it every so often for the kb.
It seemed to me that the sql query wasn't pulling a count of comments per kill_id. 'com_count' didn't seem to be declared anywhere other than where it's used as a comparisson either. I looked around learned a bit more about sql and seemed to have found a solution. It was helpful to decompose the SQL query from 407-453 (original file) to understand what was being made available.

the key changes were:
Line 351 old

Code: Select all

$this->errors[] = "Non-numeric symbol found in field \"Involved Count\", in \"".$val."\"";
Line 351 new

Code: Select all

$this->errors[] = "Non-numeric symbol found in field \"Comment Count\", in \"".$val."\""; //rm
Line 357 old

Code: Select all

$where[] = "ind_cnt IN (".implode(", ", $involved).")";
Line 357 new

Code: Select all

$where[] = "com_count IN (".implode(", ", $comments).")";   //rm
Line 362 old

Code: Select all

$this->errors[] = "No numeric entries found in field \"Involved Count\"";
Line 362 new

Code: Select all

$this->errors[] = "No numeric entries found in field \"Comment Count\"";  //rm
Line 437 old

Code: Select all

count(distinct com.id) as 'Comments'
Line 437 new

Code: Select all

com_count as 'Comments'
Line 453 old

Code: Select all

LEFT JOIN kb3_comments com ON ( kills.kll_id = com.kll_id )";
Line 453 new

Code: Select all

LEFT JOIN (SELECT kll_id AS com_kll_id, count( * ) AS com_count FROM kb3_comments GROUP BY com_kll_id ) AS comtemp ON com_kll_id = kll_id";

This seems to work, which is great, but being a complete novice I could have done something not so efficiently.
If someone can 'proof read' this and give any tips it would be appreciated.

User avatar
Salvoxia
Developer
Posts: 1531
Joined: Wed Feb 22, 2012 12:11

Re: [EDK4/EDK3] Advanced Search v2.7.2 [UPDATED]

Post by Salvoxia » Mon Dec 23, 2013 18:35

TBH.. if it works - great.
I wouldn't mind performance that much, since it's only executed when someone is doing a search - not every second page load or sth.
I also looked at the code and the original author also pointed out, that the queries might not be optimized.

User avatar
Salvoxia
Developer
Posts: 1531
Joined: Wed Feb 22, 2012 12:11

Re: [EDK4/EDK3] Advanced Search v2.7.2 [UPDATED]

Post by Salvoxia » Sun Dec 28, 2014 01:48

Hi all,

I created a version of this mod for EDK4 that includes all the fixes from Redhouse's post above and enhances compatibility with other mods (like the Highlight Capitals mod).
I called this version 2.7.2 Fix 1 and you can download it here:
advanced_search_edk4_272fix1.zip
Advanced Search for EDK4 v2.7.2 Fix 1
(12.59 KiB) Downloaded 242 times
Regards,
Salvoxia

User avatar
prometh
Advanced
Posts: 170
Joined: Thu Aug 09, 2012 19:25
Contact:

Re: [EDK4/EDK3] Advanced Search v2.7.2 [UPDATED]

Post by prometh » Fri Jan 22, 2016 17:32

Hi all,

I have one issue with this mod and I hope one of you has an idea...
One of my board is styled in a way so i want to use ship images of a different size (64px) I know how to change this in general (even though i have to redo the changes eventually after an update) but the search result of this mod is always showing 32px images which are then scaled up and look quite ugly. (try here if you want https://bloc.ga/kb/?a=search&p=adv_search )
I looked through the code but i have absolutely no idea where the search result page gets the information from what image size to use...

Bests,
Snitch

User avatar
Salvoxia
Developer
Posts: 1531
Joined: Wed Feb 22, 2012 12:11

Re: [EDK4/EDK3] Advanced Search v2.7.2 [UPDATED]

Post by Salvoxia » Fri Jan 22, 2016 18:58

Hi,

it seems this killboard is either using a modified version of the EVE+ Theme or one of the mods is responsible for that.
The default image size in the EVE+ theme is 32pixels. The reason why the images on the front page look better is these images are 64x64 pixels in size.
The image size is controlled in the class common/includes/class.killlisttable.php around lin 89

Code: Select all

$kll['victimshipimage'] = $kill->getVictimShipImage(32);
However, this class often gets overridden by mods (Highlight Capitals, Cynocloak, Fleet Battles,...).
So my guess is that the kill list table on the front page is created by modded class, but the Advanced Search mod uses the default class.

Hope this helps!

Best
Regards,
Salvoxia

User avatar
prometh
Advanced
Posts: 170
Joined: Thu Aug 09, 2012 19:25
Contact:

Re: [EDK4/EDK3] Advanced Search v2.7.2 [UPDATED]

Post by prometh » Fri Jan 22, 2016 23:26

Thanks, it was the fleet battles mod overwriting that one.


Image

User avatar
Salvoxia
Developer
Posts: 1531
Joined: Wed Feb 22, 2012 12:11

Re: [EDK4/EDK3] Advanced Search v2.7.3 [UPDATED]

Post by Salvoxia » Thu Feb 18, 2016 20:02

Updated the opnening post with the current maintenance release for compatibility with PHP7.

Post Reply

Return to “Modding”

Who is online

Users browsing this forum: No registered users and 30 guests