[MOD] Stats and SSO mod

Discuss/Upload mods to the EVE-Dev Killboard.
User avatar
prometh
Advanced
Posts: 170
Joined: Thu Aug 09, 2012 19:25
Contact:

[MOD] Stats and SSO mod

Post by prometh »

Hi all,

I was working on a mod to show some extended stats for a while. It adds a SSO login to the Killboard which is used for various purposes. It also replaces the eve_sso mod for comments if you happen to have that one installed.

Edit: Starting from EDK 4.2.27 this Mod requires no Core file changes.
The actual mod can be downloaded here:

https://bitbucket.org/snitchashor/stats ... bb784b.zip (rename folder to 'statsmod')

Version history:
v0.52
- no longer breaking item value updates (thanks Edd Reynolds)

v0.51
- minor css fixes
- fixed ship classes

v0.4 (16/11/2)
- more fixes related to simple urls
- fixes if Request header is not set

v0.3 (16/10/28)
- css fixes
- fixed solar system links
- fixed redirects after commenting

v0.2 (16/10/25)
- Fixed some static declarations
- Hopefully fixed simple / non-simple url behaviour

v0.1 (16/10/06)
- Working SSO login
- SSO to post comments (adds avatars to comments)
- CREST auth to fetch personal kills (character for now)
- Save Fitting to your character via CREST
- Show Pilot stats (Favorite ships and systems)
- Show your stats against other pilots

Incompatibilities / Dependencies:

- This mod needs php5.5+ with php_curl
- This mod needs to be registered as an eve developers application (for SSO and CREST) which can only be done using an account that has a valid subscription.
- The eve_sso mod needs to be disabled but its functionality is incorporated
- The rank mod seems to be messing with the stats summaries, which breaks the general filters for ship classes and potentially also this mod
- Prior to EDK 4.2.27 it requires the following, I'm linking the files from Salvoxias repo here:
in common/:
https://raw.githubusercontent.com/evekb ... logout.php
and in common/includes/:
https://raw.githubusercontent.com/evekb ... .cache.php
https://raw.githubusercontent.com/evekb ... ession.php

Current limitations:

- Caching is disabled for logged on users which might affect traffic
- Building up the Pilot details pages may be slower depending on database size and performance

Credits:

Salvoxia for quite some discussion and the core file changes
twostep for the original SSO comments mod
Yogi Berimor for the php CREST implementation and The League of Extraordinary Packages for the oauth2 client it is based on

Screenshots:
settings
settings
statsmod1.jpg (108.7 KiB) Viewed 21468 times
login box
login box
statsmod2.jpg (27.41 KiB) Viewed 21470 times
comments
comments
statsmod3.jpg (34.86 KiB) Viewed 21470 times
Happy testing.

Please post feedback either here or ingame to Snitch Ashor.

Cheers,
Snitch
Last edited by prometh on Tue Jul 18, 2017 16:46, edited 17 times in total.
User avatar
prometh
Advanced
Posts: 170
Joined: Thu Aug 09, 2012 19:25
Contact:

Re: [MOD] Stats and SSO mod

Post by prometh »

Some more pics:
statsmod5.jpg
statsmod5.jpg (104.23 KiB) Viewed 21469 times
statsmod4.jpg
statsmod4.jpg (23.61 KiB) Viewed 21469 times
User avatar
Rounon Dax
Greenhorn
Posts: 21
Joined: Sat Jul 11, 2015 17:15

Re: [MOD] Stats and SSO mod

Post by Rounon Dax »

After installing and setting it up on my test system the following is displayed at teh start page:
DEPRECATED [8192] Non-static method statsmod::display() should not be called statically
Error on line 80 in file /home/ppfeufer/public_html/eve-killboard/common/includes/class.pageassembly.php
PHP 7.0.11-pl2-gentoo (Linux), EDK 4.2.27.0 (YC-118-9 1.0)
File: /home/ppfeufer/public_html/eve-killboard/common/includes/class.pageassembly.php, line: 80, class: EDKError, function: handler
File: /home/ppfeufer/public_html/eve-killboard/common/includes/class.pageassembly.php, line: 44, class: pageAssembly, function: call
File: /home/ppfeufer/public_html/eve-killboard/common/home.php, line: 866, class: pageAssembly, function: assemble
File: /home/ppfeufer/public_html/eve-killboard/common/index.php, line: 323, function: include
File: /home/ppfeufer/public_html/eve-killboard/index.php, line: 28, function: include
After clicking the SSO Login Button I get this message and nothing else happens:
Database error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-100) list left join kb3_comments com ON (list.kll_id = com.kll_id AND (com.site' at line 21
SQL: SELECT list.* , count(distinct com.id) as comments FROM (SELECT kll.kll_id, kll.kll_timestamp, kll.kll_external_id, mdn.itemID, mdn.itemName, plt.plt_name, crp.crp_name, crp.crp_id, ali.all_name, ali.all_id, kll.kll_system_id, kll.kll_ship_id, kll.kll_dmgtaken, kll.kll_victim_id, plt.plt_externalid, kll.kll_crp_id, kll.kll_points, kll.kll_isk_loss, shp.shp_class, shp.shp_id, scl.scl_id, scl.scl_class, scl.scl_value, sys.sys_id, sys.sys_name, sys.sys_sec, fbplt.plt_name as fbplt_name, fbplt.plt_id as fbplt_id, fbplt.plt_externalid as fbplt_externalid, fbcrp.crp_name as fbcrp_name, fbali.all_name as fball_name, fbcrp.crp_id as fbcrp_id, fbali.all_id as fball_id FROM ((SELECT kll.* FROM kb3_kills kll INNER JOIN kb3_inv_crp inc ON inc.inc_kll_id = kll.kll_id WHERE inc.inc_crp_id IN (1 ) AND inc.inc_timestamp >= '2016-10-01 00:00:00' AND inc.inc_timestamp <= '2016-10-31 23:59:00' order by inc.inc_timestamp desc ) UNION (SELECT kll.* FROM kb3_kills kll WHERE ( kll.kll_crp_id in ( 1 ) ) AND kll.kll_timestamp >= '2016-10-01 00:00:00' AND kll.kll_timestamp <= '2016-10-31 23:59:00' order by kll.kll_timestamp desc ) ) kll STRAIGHT_JOIN kb3_pilots plt ON ( plt.plt_id = kll.kll_victim_id ) STRAIGHT_JOIN kb3_corps crp ON ( crp.crp_id = kll.kll_crp_id ) STRAIGHT_JOIN kb3_alliances ali ON ( ali.all_id = kll.kll_all_id ) STRAIGHT_JOIN kb3_pilots fbplt ON ( fbplt.plt_id = kll.kll_fb_plt_id ) STRAIGHT_JOIN kb3_inv_detail fb ON ( fb.ind_kll_id = kll.kll_id AND fb.ind_plt_id = kll.kll_fb_plt_id ) STRAIGHT_JOIN kb3_corps fbcrp ON ( fbcrp.crp_id = fb.ind_crp_id ) STRAIGHT_JOIN kb3_alliances fbali ON ( fbali.all_id = fb.ind_all_id ) LEFT JOIN kb3_mapdenormalize mdn ON (kll.kll_location = mdn.itemID) STRAIGHT_JOIN kb3_systems sys ON ( sys.sys_id = kll.kll_system_id ) STRAIGHT_JOIN kb3_ships shp ON ( shp.shp_id = kll.kll_ship_id ) STRAIGHT_JOIN kb3_ship_classes scl ON ( scl.scl_id = shp.shp_class ) order by kll.kll_timestamp desc limit 100 OFFSET -100) list left join kb3_comments com ON (list.kll_id = com.kll_id AND (com.site = "dev-kb" OR com.site IS NULL)) group by list.kll_id order by kll_timestamp desc /* kill list */
ERROR [256] SQL error (You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-100) list left join kb3_comments com ON (list.kll_id = com.kll_id AND (com.site' at line 21
Error on line 46 in file /home/ppfeufer/public_html/eve-killboard/common/includes/class.dbnormalquery.php
PHP 7.0.11-pl2-gentoo (Linux), EDK 4.2.27.0 (YC-118-9 1.0)
File: /home/ppfeufer/public_html/eve-killboard/common/includes/class.dbnormalquery.php, line: 46, function: trigger_error
File: /home/ppfeufer/public_html/eve-killboard/common/includes/class.killlist.php, line: 610, class: DBNormalQuery, function: execute
File: /home/ppfeufer/public_html/eve-killboard/common/includes/class.killlist.php, line: 1008, class: KillList, function: execQuery
File: /home/ppfeufer/public_html/eve-killboard/common/home.php, line: 245, class: KillList, function: getCount
File: /home/ppfeufer/public_html/eve-killboard/common/includes/class.pageassembly.php, line: 70, class: pHome, function: killList
File: /home/ppfeufer/public_html/eve-killboard/common/includes/class.pageassembly.php, line: 37, class: pageAssembly, function: call
File: /home/ppfeufer/public_html/eve-killboard/common/home.php, line: 861, class: pageAssembly, function: assemble
File: /home/ppfeufer/public_html/eve-killboard/common/index.php, line: 323, function: include
File: /home/ppfeufer/public_html/eve-killboard/index.php, line: 28, function: include
User avatar
Rounon Dax
Greenhorn
Posts: 21
Joined: Sat Jul 11, 2015 17:15

Re: [MOD] Stats and SSO mod

Post by Rounon Dax »

This seems to be an issue with the generated URI:

What is been generated:
killboard.link/?a=sso_login/?method=login&page=

How it should look like:
killboard.link/?a=sso_login&method=login&page=

If I change it manually in my browsers address bar, it works.
Same issue with the logout button.

?a=sso_login/?method=logout&page=
vs.
?a=sso_login&method=logout&page=
User avatar
Rounon Dax
Greenhorn
Posts: 21
Joined: Sat Jul 11, 2015 17:15

Re: [MOD] Stats and SSO mod

Post by Rounon Dax »

Found the issue:
You should check against config::get("cfg_pathinfo") to determine if simple URLs are active or not.
With config::get("cfg_pathinfo") == '1' it works with your code, otherwise it has to be a different URL generated.

What I am saying is, something like this for example. (An that if-statement has to be everywhere, where you generate the URL for SSO usage)

Code: Select all

if(config::get("cfg_pathinfo") == '1') {
	$loginBox->addOption("caption", "<form method=post action=".edkURI::page('sso_login/?method=login&page='.$_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].rtrim($_SERVER['REQUEST_URI'], '/'))."><div style='padding-top: 5px;'><center><input type='image' src='".config::get("cfg_kbhost")."/mods/statsmod/img/logineve.png' style='width: 160px; margin: 0px; padding: 0px; border: none'></center></div></form>");
} else {
	$loginBox->addOption("caption", "<form method=post action=".edkURI::page('sso_login&method=login&page='.$_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].rtrim($_SERVER['REQUEST_URI'], '/'))."><div style='padding-top: 5px;'><center><input type='image' src='".config::get("cfg_kbhost")."/mods/statsmod/img/logineve.png' style='width: 160px; margin: 0px; padding: 0px; border: none'></center></div></form>");
}
User avatar
prometh
Advanced
Posts: 170
Joined: Thu Aug 09, 2012 19:25
Contact:

Re: [MOD] Stats and SSO mod

Post by prometh »

Thanks for that, I didn't test a lot without simple urls. The static declaration warning should be easy to fix.

Edit: Hopefully fixed it. OP updated with newer version (0.2)
Explorus
Greenhorn
Posts: 22
Joined: Thu Oct 18, 2012 08:20

Re: [MOD] Stats and SSO mod

Post by Explorus »

I have problem, pilot stats view broken
Image

borad: http://galaxy-spiritus.com

UPDATE: I fix problem, in file class.ssopilotstats.php add comment //$html .= "</table></div>"; and other //$html .= "</table></div>"; after Favorite Ships in the last 30 days and Favorite Ships all time
User avatar
prometh
Advanced
Posts: 170
Joined: Thu Aug 09, 2012 19:25
Contact:

Re: [MOD] Stats and SSO mod

Post by prometh »

Ooops sorry had that fixed already just didnt create a new version, just download the master from bitbucket, heres the changes:

https://bitbucket.org/snitchashor/stats ... 4944b375d5
Explorus
Greenhorn
Posts: 22
Joined: Thu Oct 18, 2012 08:20

Re: [MOD] Stats and SSO mod

Post by Explorus »

can you fix link on system in personal stats?
Link not working http://galaxy-spiritus.com/?a=system_detail&id=30001002 (no valid id supplied) need to use 'sys_id' not only 'id'

After post comment i has "No kill id specified." and link "http://galaxy-spiritus.com/?a=kill_detail&kll_id=34585" need remove "amp;" in link.
User avatar
prometh
Advanced
Posts: 170
Joined: Thu Aug 09, 2012 19:25
Contact:

Re: [MOD] Stats and SSO mod

Post by prometh »

Explorus wrote: Thu Oct 27, 2016 18:31 can you fix link on system in personal stats?
Link not working http://galaxy-spiritus.com/?a=system_detail&id=30001002 (no valid id supplied) need to use 'sys_id' not only 'id'

After post comment i has "No kill id specified." and link "http://galaxy-spiritus.com/?a=kill_detail&kll_id=34585" need remove "amp;" in link.
Should be fixed in this one.
Post Reply