Exemple #1
0
 public static function run()
 {
     global $xajax;
     if (isset($xajax)) {
         if (get_class($xajax) == 'xajax') {
             // we're good to go, set up our asynchronous callback
             $xuf = new xajaxUserFunction(array('ajcron', 'ajcron', 'xajax_req'), null);
             $xajax->register(XAJAX_FUNCTION, $xuf);
             // fastest way to check wether we have to run or not
             if (config::get('ajcron_nextrun') < time()) {
                 // we need to run
                 mod_xajax::xajax();
                 $xajax->configure('waitCursor', false);
                 event::register('page_assembleheader', 'ajcron::insertHTML');
             }
         }
     }
 }
Exemple #2
0
<?php

$modInfo['known_members']['name'] = "scout";
$modInfo['known_members']['abstract'] = "Allow individuals to opt-in to killmails, for purposes of scouting or logistics.";
$modInfo['known_members']['about'] = "https://github.com/jjlupa/edk-mods/tree/master/scout";
// The docs say you can use this to replace the core class.  But as soon as I do that, it gives me errors.  Easier for now
// to copy the changes into commong/include, and everything just works.
//
// edkloader::register('Kill', dirname(FILE).'/class.kill.php' );
event::register("killDetail_assembling", "ScoutMod::renderScoutsList");
class ScoutMod
{
    function renderScoutsList($page)
    {
        require_once 'class.scout.php';
        $page->addBehind("involved", "ScoutMod::listScouts");
    }
    function listScouts($page)
    {
        $scouts = new Scouts($page->kll_id);
        $confirmDelete = false;
        $error = '';
        if (isset($_POST['scoutsubmit'])) {
            $pw = false;
            if (!config::get('scouts_pw') || $page->page->isAdmin()) {
                $pw = true;
            }
            if ($_POST['password'] == config::get("scouts_password") || $pw) {
                if ($_POST['scoutname'] == '') {
                    $error = 'Error: No pilot name specified.';
                } else {
Exemple #3
0
<?php

/**
 * @package EDK
 */
$modInfo['forum_post']['name'] = "Forum Post";
$modInfo['forum_post']['abstract'] = "Adds a link to contracts and kill_related that gives a summary of the results.";
$modInfo['forum_post']['about'] = "Core distribution mod.";
event::register("contractDetail_context_assembling", "forumPost::addContractMenu");
event::register("killRelated_assembling", "forumPost::addRelatedMenu");
/**
 * @package EDK
 */
class forumPost
{
    public static function addContractMenu($object)
    {
        $object->addMenuItem("link", "Forum Summary", "javascript:sndReq('index.php?a=forum_post&amp;ctr_id=" . $object->ctr_id . "');ReverseContentDisplay('popup')");
    }
    public static function addRelatedMenu($object)
    {
        $object->addMenuItem("link", "Forum Summary", "javascript:sndReq('index.php?a=forum_post&amp;kll_id=" . $object->kll_id . "');ReverseContentDisplay('popup')");
    }
}
Exemple #4
0
$modInfo['highlight_capitals']['abstract'] = "highlights (Super)Capital kills/losses in killlisttables";
$modInfo['highlight_capitals']['about'] = "by <a href=\"http://gate.eveonline.com/Profile/Salvoxia\">Salvoxia</a>";
// register for adding a highlight class to every kill
event::register("killlist_table_kill", "highlight_capitals::modify");
// register for home page assembling for CSS injection and template replacement
event::register("home_assembling", "highlight_capitals::handler");
// register for corp detail assembling for CSS injection and template replacement
event::register("corpDetail_assembling", "highlight_capitals::handler");
// register for alliance detail assembling for CSS injection and template replacement
event::register("allianceDetail_assembling", "highlight_capitals::handler");
// register for pilot detail assembling for CSS injection and template replacement
event::register("pilotDetail_assembling", "highlight_capitals::handler");
// register for contract detail assembling for CSS injection and template replacement
event::register("contractDetail_assembling", "highlight_capitals::handler");
// register for system detail assembling for CSS injection and template replacement
event::register("systemdetail_assembling", "highlight_capitals::handler");
class highlight_capitals
{
    private static $capitals = array(19, 27, 20, 29, 34, 39);
    private static $superCapitals = array(26, 28);
    /**
     * adds the highlight parameter with the highlight class name to each kill
     * @param array $kill
     * @return array
     */
    public static function modify(&$kill)
    {
        $shipClassId = self::getShipClassIDByName($kill["victimshipclass"]);
        if (in_array($shipClassId, self::$capitals)) {
            $kill["highlight"] = "kl-capital-highlight";
        } elseif (in_array($shipClassId, self::$superCapitals)) {
Exemple #5
0
// We need URL support to match the queries
using('lepton.web.url');
using('s2s.request');
using('s2s.response');
class S2SRequestHandler
{
    static function request($event, $data)
    {
        $qurl = $data['uri'];
        if (url($qurl)->like('/^\\/sts-rpc[\\/]?/')) {
            using('s2s.request');
            $cmd = request::get('cmd');
            $req = new S2SRequest(S2SRequest::RT_HTTP, $cmd, request::getAll());
            $res = new S2SResponse(S2SRequest::RT_HTTP, $cmd);
            $cmdp = explode('.', $cmd);
            $mod = $cmdp[0];
            $modc = $mod . 'S2SEndpoint';
            if (class_exists($modc)) {
                $ci = new $modc();
                $rd = $ci->invoke($req, $res);
                var_dump($rd);
            } else {
                printf("Bad endpoint");
            }
            return true;
        }
        return false;
    }
}
event::register('lepton.mvc.routing.pre', new EventHandler('S2SRequestHandler', 'request'));
Exemple #6
0
<?php

require_once "mods/advanced_search/class.search.php";
event::register("search_assembling", "AdvSearch::replace");
$modInfo['advanced_search']['name'] = "Advanced Search";
$modInfo['advanced_search']['abstract'] = "Adds many different custom search criterea to a custom search dialogue, creates links for sharing search result";
$modInfo['advanced_search']['about'] = "Version " . ADV_SRCH_VERSION . " by <b>Sonya Rayner</b>, fixed by <b>Redhouse</b>, enhanced for better compatibility by <b>Salvoxia</b>";
Exemple #7
0
<?php

$modInfo['known_members']['name'] = "Known Members";
$modInfo['known_members']['abstract'] = "Add an option for a list of known members to the corp details page.";
$modInfo['known_members']['about'] = "Core distribution mod.";
event::register('corpDetail_assembling', 'known_members::addView');
event::register('corpDetail_context_assembling', 'known_members::addMenu');
/**
 * @package EDK
 */
class known_members
{
    /**
     * Add a view to the corp detail page
     * @param pCorpDetail $home 
     */
    public static function addView($home)
    {
        $home->addView('known_members', array('known_members', 'view'));
    }
    /**
     * Add a menu item to the corp detail page.
     * @param pCorpDetail $home 
     */
    public static function addMenu($home)
    {
        $args = array();
        $args[] = array('a', 'corp_detail', true);
        $args[] = array('crp_id', $home->crp_id, true);
        $args[] = array('view', "known_members", true);
        $home->addMenuItem("link", "Known Members", edkURI::build($args));
Exemple #8
0
<?php

class GoogleAnalytics
{
    function onHeader($event, $data)
    {
        if (config::get('ganalytics.account') == NULL) {
            logger::err("No Google Analytics account key set in configuration");
            return;
        }
        printf("<script type=\"text/javascript\">");
        printf("var _gaq = _gaq || [];");
        printf("_gaq.push(['_setAccount', '%s']);", config::get('ganalytics.account'));
        printf("_gaq.push(['_setDomainName', '%s']);", request::getDomain());
        printf("_gaq.push(['_trackPageview']);");
        printf("</script>");
        printf("<script type=\"text/javascript\"> (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();  </script>");
    }
}
using('lepton.mvc.document');
event::register(document::EVENT_HEADER, new EventHandler('GoogleAnalytics', 'onHeader'));
Exemple #9
0
     * @see https://github.com/evekb/evedev-kb/blob/master/common/includes/class.page.php
     */
    public static function add_head(&$page)
    {
        if (isset(self::$opt['head']) && !empty(self::$opt['head'])) {
            foreach (self::$opt['head'] as $head) {
                $page->addHeader($head);
            }
        }
    }
    /**
     * Adds code in <body>.
     *
     * @param Page &$page object of class Page
     *
     * @return none
     * @see https://github.com/evekb/evedev-kb/blob/master/common/includes/class.page.php
     */
    public static function add_body(&$page)
    {
        if (isset(self::$opt['body']) && !empty(self::$opt['body'])) {
            foreach (self::$opt['body'] as $body) {
                $page->addBody($body);
            }
        }
    }
}
IncCC::init();
event::register('page_assembleheader', 'IncCC::add_head');
event::register('page_assemblebody', 'IncCC::add_body');
<?php

define('MOST_EXP_TOPLIST_VERSION', 1.1);
$modInfo['most_expensive_toplist']['name'] = "Most Expensive Toplist v" . MOST_EXP_TOPLIST_VERSION;
$modInfo['most_expensive_toplist']['abstract'] = "Adds alltime/monthly toplists for most expensive kills/losses to corp/alliance detail view";
$modInfo['most_expensive_toplist']['about'] = "by <a href=\"http://gate.eveonline.com/Profile/Salvoxia\">Salvoxia</a>";
// hooks for alliance detail page
event::register('allianceDetail_assembling', 'MostExpensiveToplist::initAlliance');
event::register('allianceDetail_context_assembling', 'MostExpensiveToplist::initContextAlliance');
// hooks for corp detail page
event::register('corpDetail_assembling', 'MostExpensiveToplist::initCorp');
event::register('corpDetail_context_assembling', 'MostExpensiveToplist::initContextCorp');
class MostExpensiveToplist
{
    /**
     * callback for injecting our custom views to the corp detail page
     * @param \pCorpDetail the corp detail page
     */
    public static function initCorp($corporationDetail)
    {
        $corporationDetail->addView('expensive_kills', 'MostExpensiveToplist::killListCorp');
        $corporationDetail->addView('expensive_losses', 'MostExpensiveToplist::killListCorp');
    }
    /**
     * callback for injecting our custom menu options into the corp detail context menu
     * @param \pCorpDetail the corp detail page
     */
    public static function initContextCorp($corporationDetail)
    {
        $corporationDetail->addBehind("menuSetup", 'MostExpensiveToplist::menuSetupMostExpToplistCorp');
    }
<?php

/*
 * $Date$
 * $Revision$
 * $HeadURL$
 */
$modInfo['killcharts']['name'] = "killcharts by vasco di (V3.0)";
$modInfo['killcharts']['abstract'] = "Adds a graph of recent kills/losses to front page.";
$modInfo['killcharts']['about'] = "<a href='http://eve-id.net/forum/viewtopic.php?f=505&t=16828'>EveDev forum page</a><br>";
$modInfo['killcharts']['about'] .= "<a href='http://code.google.com/p/evedev-kb-mod-killcharts/'>Google Code</a><br/>";
$modInfo['killcharts']['about'] .= "<a href='http://www.rgraph.net' target='_blank'>Utilises the RGraph javascript charts library</a>";
include_once 'class.killchart.php';
event::register('home_assembling', 'kgraph::add');
class kgraph
{
    public static function add($home)
    {
        $home->addBehind("contracts", "kgraph::generate");
    }
    function generate()
    {
        $killchart = new KillChart();
        $html = $killchart->generate();
        return $html;
    }
    //$days = 25;					//No of days to chart: mod_killcharts_days
    function daysToTrend()
    {
        $html = '';
        if (isset($_POST['option_mod_killcharts_days'])) {
Exemple #12
0
<?php

require_once '../classes/event.php';
require_once '../classes/log.php';
// register the new event and do what needs to be done
event::register('USER_REGISTRATION', function ($args = array()) {
    // do whatever you want here
});
// initiate the event
event::fire('USER_REGISTRATION');
Exemple #13
0
<?php

using('lepton.web.url');
class LdwpManager
{
    function request($event, $data)
    {
        $qurl = $data['uri'];
        if (url($qurl)->like('/^\\/ldwp-webxml\\//')) {
            view::load('base:/dist/ldwp/dynamic/manager.php');
            return true;
        }
        return false;
    }
}
event::register('lepton.mvc.routing.pre', new EventHandler('LdwpManager', 'request'));
Exemple #14
0
<?php

require_once 'event.class.php';
// dummy user data entered on registration
$userInfo = array('id' => '1', 'username' => 'kingy', 'password' => '12345');
// register the new event and do what needs to be done
event::register('USER_REGISTRATION', function ($args = array()) {
    /* do whatever you want here
     * insert new registration log for $userInfo[id] etc
     */
});
// initiate the event
event::fire('USER_REGISTRATION', $userInfo);
Exemple #15
0
        $msg = 'You can\'t just leave your comment empty, nobody can read it.';
        return;
    }
    if (strlen($content) <= 3) {
        $msg = 'Your comment should ideally be over 4 characters long...';
        return;
    }
    /* is this hack... shit? */
    if (empty($table)) {
        $msg = 'You need to include the table';
        return;
    }
    switch ($table) {
        case 1:
            $table = tbl_blog;
            break;
        case 2:
            $table = tbl_goals;
            break;
    }
    event::register('COMMENT_POST', function ($args = array()) {
        /*
        	We want to give a badge to every user who posts heaps...
        */
    });
    $add = $comments->add($userid, $pageid, $table, $content);
    if (!empty($add)) {
        event::fire('COMMENT_POST');
        $msg = 'Thank you for adding your comment ' . $_SESSION['username'];
    }
}
Exemple #16
0
<?php

$modInfo['mail_forward']['name'] = "Mail Forwarder";
$modInfo['mail_forward']['abstract'] = "Forward all posted mails to another board.";
$modInfo['mail_forward']['about'] = "Core distribution mod.";
event::register('killmail_added', 'post_forward::handler');
event::register('killmail_imported', 'import_forward::importhandler');
/**
 * @package EDK
 */
class post_forward
{
    public static function handler($object)
    {
        if (config::get('forward_active') == false) {
            return;
        }
        $req = new http_request(config::get('forward_site') . '?a=post');
        $req->set_postform('password', config::get('forward_pass'));
        $req->set_postform('killmail', stripslashes($_POST['killmail']));
        $req->request();
    }
}
class import_forward
{
    public static function importhandler($object)
    {
        if (config::get('forward_active') == false) {
            return;
        }
        require_once 'common/includes/class.http.php';
<?php

$modInfo['bannerPic']['name'] = "bannerPic by vasco di (V2.01)";
$modInfo['bannerPic']['abstract'] = "Puts latest kill into kb and/or forum banner.";
$modInfo['bannerPic']['about'] = "<a href='http://eve-id.net/forum/viewtopic.php?f=505&t=17007'>EveDev forum page</a><br>";
$modInfo['bannerPic']['about'] .= "<a href='http://code.google.com/p/evedev-kb-mod-bannerpic/'>Google Code</a>";
include_once 'class.bannerpic.php';
event::register('home_assembling', 'banner::replace');
class banner
{
    function replace()
    {
        if (Config::get('mod_bannerpic_bannerreplace') == 1) {
            $banner = new BannerPic();
            $banner->generate();
        }
    }
    function basePic()
    {
        $html = '';
        if (isset($_POST['option_mod_bannerpic_basepic'])) {
            Config::set('mod_bannerpic_basepic', $_POST['option_mod_bannerpic_basepic']);
        }
        $basepic = 'mods/bannerPic/base.jpg';
        Config::get('mod_bannerpic_basepic') == null ? Config::set('mod_bannerpic_basepic', $basepic) : ($basepic = Config::get('mod_bannerpic_basepic'));
        $html = "<input type='text' id='option_mod_bannerpic_basepic' name='option_mod_bannerpic_basepic' value='{$basepic}' size='" . strlen($basepic) . "' />";
        return $html;
    }
    function vicPicLeft()
    {
        $html = '';
Exemple #18
0
<?php

/**
 * @package EDK
 */
$modInfo['rss_feed']['name'] = "RSS Feed";
$modInfo['rss_feed']['abstract'] = "Generates an RSS feed for most recent kills or losses.";
$modInfo['rss_feed']['about'] = "Core distribution mod.";
event::register('home_assembling', 'rss_feed::handler');
/**
 * @package EDK
 */
class rss_feed
{
    public static function handler(&$home)
    {
        $home->addBehind("start", "rss_feed::addRSS");
    }
    public static function addRSS($home)
    {
        $home->page->addHeader('<link rel="alternate" type="application/rss+xml" title="Watched Kills" href="?a=rss&amp;kills" />');
        $home->page->addHeader('<link rel="alternate" type="application/rss+xml" title="Watched Losses" href="?a=rss&amp;losses" />');
    }
}
Exemple #19
0
    }
    if (strlen($remove) != 0) {
        $msg = 'Remove the text to continue';
        return;
    }
    if ($pass1 != $pass2) {
        $msg = 'Both passwords must be the same';
        return;
    }
    if (strlen($email) > 250) {
        $msg = 'Email address must be under 250 characters';
        return;
    }
    event::register('USER_REGISTRATION', function ($args = array()) {
        if ($_SERVER['HTTP_REFERER'] != 'http://lifelitup.com/register.php') {
            // can't really do much here until the site is live... but it's an example nevertheless.
        }
        // give person a badge for registering etc
    });
    $register = $auth->register($email, $pass1);
    if ($register == true) {
        $msg = 'You have registered';
        event::fire('USER_REGISTRATION');
        return;
    } else {
        $msg = 'Registration has failed';
        return;
    }
}
if (isset($_POST['forgotSubmit'])) {
    $op = $_POST['op'];
    if ($op !== 'forgot') {
Exemple #20
0
<?php

/*
 * @package EDK
 */
$modInfo['signature_generator']['name'] = "Signature Generator";
$modInfo['signature_generator']['abstract'] = "Generates signature images showing most kill information by a pilot.";
$modInfo['signature_generator']['about'] = "Core distribution mod.";
event::register("pilotDetail_context_assembling", "signature::addSig");
/**
 * @package EDK
 */
class signature
{
    public static function addSig($home)
    {
        $home->addBefore("menu", "signature::menuOptions");
    }
    public static function menuOptions($home)
    {
        $home->addMenuItem("caption", "Signature");
        $home->addMenuItem("link", "Link", "?a=sig_list&amp;i=" . $home->pilot->getID());
    }
}
Exemple #21
0
<?php

/**
 * @package EDK
 */
require_once 'common/xajax/xajax_core/xajax.inc.php';
$xajax = new xajax();
event::register('page_assembleheader', 'edk_xajax::insertHTML');
// if mods depend on xajax they can register to xajax_initialised
// it gets called after all mods have been initialized
//event::register('smarty_displayindex', 'edk_xajax::lateProcess');
//event::register('page_assembleheader', 'edk_xajax::lateProcess');
event::register('mods_initialised', 'edk_xajax::lateProcess');
//event::register('page_initialisation', 'edk_xajax::lateProcess');
$uri = html_entity_decode(edkURI::build(edkURI::parseURI()));
if (strpos($uri, "?") === false) {
    $uri .= "?xajax=1";
} else {
    $uri .= "&xajax=1";
}
$xajax->configure('requestURI', $uri);
/**
 * @package EDK
 */
class edk_xajax
{
    public static function xajax()
    {
        global $xajax_enable;
        $xajax_enable = true;
    }
$modInfo['ship_tool_kb']['name'] = "Ship Display Tool";
$modInfo['ship_tool_kb']['abstract'] = "Displays Ship stats on the kill detials page";
$modInfo['ship_tool_kb']['about'] = "by Spark's";
//require_once('common/includes/class.kill.php');
//require_once('common/includes/class.killsummarytable.php');
//require_once('common/includes/class.pilot.php');
//require_once('common/includes/class.corp.php');
//require_once('common/includes/class.alliance.php');
//$kll_id = intval($_GET['kll_id']);
$operation = true;
include "fitting.class.php";
include 'class.shipstats.php';
include 'class.shipEffects.php';
event::register("killDetail_assembling", "fittingTools::addFitting");
event::register("killDetail_context_assembling", "fittingTools::RemoveContextFinalBlowTopDamage");
class fittingTools
{
    public static $shipStats;
    public static $speedV = 1;
    public static $speedB = 1;
    public static $sigRadius = 1;
    public static $shieldHpRed = 1;
    public static $structure = 1;
    public static $emArmor = 1;
    public static $thArmor = 1;
    public static $kiArmor = 1;
    public static $exArmor = 1;
    public static $emShield = 1;
    public static $thShield = 1;
    public static $kiShield = 1;