コード例 #1
0
            return $this->roles[$id]['classes_r'];
        }
        public function get_edit($id)
        {
            return '<img src="' . $this->root_path . 'images/glyphs/edit.png" alt="' . $this->user->lang('edit_role') . '" title="' . $this->user->lang('edit_role') . '" onclick="editRole(\'' . $id . '\')"/>';
        }
        public function get_memberroles($classid, $addfirstrow = false)
        {
            $whatcanibe = $addfirstrow ? array(0 => '---') : array();
            foreach ($this->roles as $rolearray) {
                if (in_array($classid, $rolearray['classes'])) {
                    $whatcanibe[$rolearray['id']] = $this->roles[$rolearray['id']]['name'];
                }
            }
            return $whatcanibe;
        }
        public function get_roleid2classid($list)
        {
            foreach (explode("|", $list) as $class_id) {
                $output[$class_id] = $this->game->get_name('classes', $class_id);
            }
            $classnames = implode(", ", $output);
            return $classnames ? $classnames : $list;
        }
    }
    //end class
}
//end if class not exists
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_pdh_r_roles', pdh_r_roles::__shortcuts());
}
コード例 #2
0
            $me = $this->get_me();
            $uid = $me['uid'];
            $me = $me['me'];
            redirect($this->fb->getLogoutUrl(), false, true);
        }
        return true;
    }
    /**
     * Autologin
     *
     * @param $arrCookieData The Data ot the Session-Cookies
     * @return bool
     */
    public function autologin($arrCookieData)
    {
        if ($this->get_me()) {
            $me = $this->get_me();
            $uid = $me['uid'];
            $me = $me['me'];
            $userid = $this->pdh->get('user', 'userid_for_authaccount', array($uid));
            if ($userid) {
                $userdata = $this->pdh->get('user', 'data', array($userid));
                return $userdata ? $userdata : false;
            }
        }
        return false;
    }
}
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_login_facebook', login_facebook::$shortcuts);
}
コード例 #3
0
         * Searches the shoutbox module for the search value
         *
         * @param  string  $search  Value to search
         *
         * @returns array
         */
        public function get_search($search)
        {
            // empty search results
            $searchResults = array();
            // loop through the data array and fill search results
            if ($this->data && is_array($this->data)) {
                $arrStatus = $this->user->lang('gr_status');
                foreach ($this->data as $id => $data) {
                    $member = $data['username'];
                    $email = register('encrypt')->decrypt($data['email']);
                    $content = $data['content'];
                    if (strpos($member, $search) !== false || strpos($email, $search) !== false || strpos($content, $search) !== false) {
                        $searchResults[] = array('id' => $this->time->user_date($data['tstamp'], true), 'name' => $data['username'] . '; ' . $this->user->lang('status') . ': ' . $arrStatus[$data['status']], 'link' => $this->root_path . 'plugins/guildrequest/viewrequest.php' . $this->SID . '&amp;id=' . $id);
                    }
                }
            }
            return $searchResults;
        }
    }
    //end class
}
//end if class not exists
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_pdh_r_guildrequest_requests', pdh_r_guildrequest_requests::__shortcuts());
}
コード例 #4
0
    {
        if ($this->config('pk_mybars_headtext')) {
            $this->header = sanitize($this->config('pk_mybars_headtext'));
        }
        $maxbars = $this->config('pk_mybars_bars') ? $this->config('pk_mybars_bars') : 1;
        if ($maxbars > 1) {
            $out = '';
            for ($i = 1; $i <= $maxbars; $i++) {
                $out .= $this->bar_out($i);
            }
            return $out;
        }
        return $this->bar_out();
    }
    public function bar_out($num = 1)
    {
        $value = (int) $this->config('pk_mybars_current' . $num);
        $max = (int) $this->config('pk_mybars_max' . $num);
        $text = (string) $this->config('pk_mybars_title' . $num);
        $tooltip = $this->config('pk_mybars_tooltip' . $num);
        if (empty($tooltip)) {
            return $this->jquery->ProgressBar('mybar_' . uniqid(), $value / $max * 100, $text . ' ' . $value . '/' . $max);
        }
        $name = 'mybar_tt_' . uniqid();
        $positions = array('left1' => array('my' => 'left top', 'at' => 'right center', 'name' => $name), 'left2' => array('my' => 'left bottom', 'at' => 'right center', 'name' => $name), 'middle' => array('name' => $name), 'right' => array('my' => 'right center', 'at' => 'left center', 'name' => $name), 'bottom' => array('my' => 'bottom center', 'at' => 'top center', 'name' => $name));
        return $this->html->ToolTip($tooltip, $this->jquery->ProgressBar('mybar_' . uniqid(), $value / $max * 100, $text . ' ' . $value . '/' . $max), '', $positions[$this->position]);
    }
}
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_mybars_portal', mybars_portal::__shortcuts());
}
コード例 #5
0
 * Began:		2010
 * Date:		$Date: 2012-12-13 18:49:38 +0100 (Thu, 13 Dec 2012) $
 * -----------------------------------------------------------------------
 * @author		$Author: hoofy_leon $
 * @copyright	2006-2011 EQdkp-Plus Developer Team
 * @link		http://eqdkp-plus.com
 * @package		eqdkp-plus
 * @version		$Rev: 12583 $
 * 
 * $Id: infotooltip_feed.php 12583 2012-12-13 17:49:38Z hoofy_leon $
 */
define('EQDKP_INC', true);
$eqdkp_root_path = './../';
$noinit = true;
include $eqdkp_root_path . '/common.php';
registry::add_const('root_path', $eqdkp_root_path);
//init our db-class
registry::load_config();
require $eqdkp_root_path . 'core/dbal/dbal.php';
require_once $eqdkp_root_path . 'core/dbal/' . registry::get_const('dbtype') . '.php';
registry::$aliases['db'] = array('dbal_' . registry::get_const('dbtype'), array(array('open' => true)));
error_reporting(E_ALL);
header('content-type: text/html; charset=UTF-8');
include $eqdkp_root_path . 'infotooltip/infotooltip.class.php';
$itt = registry::register('infotooltip');
$in = registry::register('input');
registry::$aliases['bridge'] = 'bridge_generic';
/* Itemfetching
 * Parameters accepted:
 * 	- name => item_name OR item_ID if game_id = true
 *	- lang => language of item (short version, e.g. 'en', 'de')
コード例 #6
0
    header('HTTP/1.0 404 Not Found');
    exit;
}
class joomla_bridge extends bridge_generic
{
    public $name = "Joomla";
    public $data = array('groups' => array('table' => 'usergroups', 'id' => 'id', 'name' => 'title', 'QUERY' => ''), 'user_group' => array('table' => 'user_usergroup_map', 'group' => 'group_id', 'user' => 'user_id', 'QUERY' => ''), 'user' => array('table' => 'users', 'id' => 'id', 'name' => 'username', 'where' => 'username', 'password' => 'password', 'email' => 'email', 'salt' => '', 'QUERY' => ''));
    public $functions = array('login' => array('callbefore' => '', 'function' => '', 'callafter' => 'joomla_callafter'), 'logout' => '', 'autologin' => '', 'sync' => '');
    //Needed function
    public function check_password($password, $hash, $strSalt = '', $boolUseHash)
    {
        list($strHash, $strSalt) = explode(':', $hash);
        if (md5($password . $strSalt) == $strHash) {
            return true;
        }
        return false;
    }
    public function joomla_callafter($strUsername, $strPassword, $boolAutoLogin, $arrUserdata, $boolLoginResult, $boolUseHash)
    {
        //Is user active?
        if ($boolLoginResult) {
            if ($arrUserdata['block'] != '0') {
                return false;
            }
        }
        return true;
    }
}
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_joomla_bridge', joomla_bridge::$shortcuts);
}
コード例 #7
0
                        return true;
                    }
                case 'RED':
                    if ($gem == 'ORANGE' || $gem == 'PURPLE') {
                        return true;
                    }
                case 'YELLOW':
                    if ($gem == 'ORANGE' || $gem == 'GREEN') {
                        return true;
                    }
            }
            return false;
        }
        private function class_name($class_id)
        {
            if (empty($this->class_names)) {
                $class_names = $this->bnet->getdata('character', 'classes');
                $this->class_names = $class_names['classes'];
            }
            foreach ($this->class_names as $class) {
                if ($class['id'] === $class_id) {
                    return $class['name'];
                }
            }
            return 'unknown';
        }
    }
}
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_armory', armory::$shortcuts);
}
コード例 #8
0
* @link        http://eqdkp-plus.com
* @package     raidlogimport
* @version     $Rev: 5040 $
*
* $Id: rli.class.php 5040 2009-06-09 15:20:27Z hoofy_leon $
*/
if (!defined('EQDKP_INC')) {
    header('HTTP/1.0 Not Found');
    exit;
}
include_once registry::get_const('root_path') . 'maintenance/includes/sql_update_task.class.php';
if (!class_exists('update_raidlogimport_0602')) {
    class update_raidlogimport_0602 extends sql_update_task
    {
        public $author = 'Hoofy';
        public $version = '0.6.0.2';
        public $name = 'Raidlogimport 0.6.0.2 Update';
        public $type = 'plugin_update';
        public $plugin_path = 'raidlogimport';
        private $data = array();
        public function __construct()
        {
            parent::__construct();
            // init language
            $this->langs = array('english' => array('update_raidlogimport_0602' => 'Raidlogimport 0.6.0.2 Update Package', 1 => 'Expand zone-table with new inactive field', 2 => 'Expand boss-table with new inactive field'), 'german' => array('update_raidlogimport_0602' => 'Raidlogimport 0.6.0.2 Update Package', 1 => 'Expand zone-table with new inactive field', 2 => 'Expand boss-table with new inactive field'));
            $this->sqls = array(1 => "ALTER TABLE __raidlogimport_zone ADD `zone_active` INT(1) NOT NULL DEFAULT 1;", 2 => "ALTER TABLE __raidlogimport_boss ADD `boss_active` INT(1) NOT NULL DEFAULT 1;");
        }
    }
}
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_update_raidlogimport_0602', update_raidlogimport_0602::__shortcuts());
コード例 #9
0
        private function detail_twink_css_js()
        {
            if (!$this->dt_cssjs and $this->config->get('pk_detail_twink') and $this->settings['show_detail_twink']) {
                $this->tpl->add_css('.toggle_members { cursor: default; width: 10px; height: 10px; }');
                $this->tpl->add_js("\$('.toggle_members').toggle(function(){\n\t\t\t\t\t\t\t\t\$('.'+\$(this).attr('id')).attr('style', 'display:block;');\n\t\t\t\t\t\t\t\t\$(this).attr('src', '" . $this->root_path . "images/arrows/down_arrow.png');\n\t\t\t\t\t\t\t},function(){\n\t\t\t\t\t\t\t\t\$('.'+\$(this).attr('id')).attr('style', 'display:none;');\n\t\t\t\t\t\t\t\t\$(this).attr('src', '" . $this->root_path . "images/arrows/right_arrow.png');\n\t\t\t\t\t\t\t});", 'docready');
                $this->dt_cssjs = true;
            }
        }
        private function dt_sort_by_name($a, $b)
        {
            return strcmp($this->pdh->get('member', 'name', $a), $this->pdh->get('member', 'name', $b));
        }
        public function get_html_footer_row($footer_text)
        {
            $footer = "<tr>\n\t<th colspan=\"" . (count($this->columns) + 2) . "\" class=\"footer\">";
            if ($footer_text == null) {
                $count = count($this->view_list);
                $footer .= $this->total_count > $count ? sprintf($this->user->lang('hptt_default_part_footcount'), $count, $this->total_count) : sprintf($this->user->lang('hptt_default_footcount'), $count);
            } else {
                $footer .= $footer_text;
            }
            $footer .= "</th>\n</tr>\n";
            return $footer;
        }
    }
    //end class
}
//end if
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_html_pdh_tag_table', html_pdh_tag_table::$shortcuts);
}
コード例 #10
0
            $realms = array();
            // set URL reader options
            $this->puf->checkURL_first = true;
            // loop through all supported realms and get status
            foreach ($this->supported_realm_list as $realmname => $realm) {
                // build realm url(s)
                $status_url_realm = $this->base_status_url . 'dns=' . $realm['ip'] . '&port=' . $realm['port'] . '&style=t1';
                $status_url_login = $this->base_status_url . 'dns=' . $this->login_list[$realm['region']]['ip'] . '&port=' . $this->login_list[$realm['region']]['port'] . '&style=t1';
                // get url content for realm and login
                $url_data_realm = $this->puf->fetch($status_url_realm);
                $url_data_login = $this->puf->fetch($status_url_login);
                if ($url_data_realm && $url_data_login) {
                    // both, login + realm servers have to be online for "online" status
                    if (strstr($url_data_realm, 'online') !== false && strstr($url_data_login, 'online') !== false) {
                        $status = 'up';
                    } else {
                        $status = 'down';
                    }
                } else {
                    $status = 'unknown';
                }
                // add to list of realms
                $realms[$realmname] = $status;
            }
            return $realms;
        }
    }
}
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_rom_realmstatus', rom_realmstatus::__shortcuts());
}
コード例 #11
0
            settype($item_id, 'int');
            $item = array('id' => $item_id);
            if (!$item_id) {
                return null;
            }
            $url = 'www.' . $this->config['game'] . 'database.com/xml/' . $this->av_langs[$lang];
            $item['link'] = $url . "/" . $type . "/xmls/" . $item['id'] . ".xml";
            //get the xml: http://www.aiondatabase.com/xml/$lang_code/items/xmls/$itemid.xml
            $itemxml = $this->puf->fetch($item['link'], array('Cookie: cookieLangId="' . $lang . '";'));
            $itemxml = simplexml_load_string($itemxml);
            $item['name'] = (!is_numeric($itemname) and strlen($itemname) > 0) ? $itemname : trim($itemxml->name);
            //filter baditems
            if (!isset($itemxml->tooltip) or strlen($itemxml->tooltip) < 5) {
                $item['baditem'] = true;
            }
            //build itemhtml
            $html = "<table class='db-tooltip' cellspacing='0'><tr><td class='normal'>";
            $html .= str_replace('"', "'", $itemxml->tooltip);
            $html .= "</td><td class='right'></td></tr><tr><td class='bottomleft'></td><td class='bottomright'></td></table>";
            $template_html = trim(file_get_contents($this->root_path . 'infotooltip/includes/parser/templates/aion_popup.tpl'));
            $item['html'] = str_replace('{ITEM_HTML}', stripslashes($html), $template_html);
            $item['lang'] = $lang;
            $item['icon'] = $itemxml->iconpath;
            $item['color'] = 'aion_q' . $itemxml->quality;
            return $item;
        }
    }
}
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_xxxdatabase', xxxdatabase::$shortcuts);
}
コード例 #12
0
        {
            $item = array('id' => $item_id);
            if (!$item_id) {
                return null;
            }
            $url = 'http://eq2.zam.com/db/tooltip.html?items=' . $item['id'];
            $item['link'] = $url;
            $itemdata = $this->puf->fetch($item['link'], array('Cookie: cookieLangId="' . $lang . '";'));
            if (preg_match('#zamTooltip\\.store\\({\\"icon\\":\\"(.*?)\\",\\"linkColor\\":\\"(.*?)\\",\\"html\\":\\"(.*?)\\",\\"site\\":\\"(.*?)\\",\\"dataType\\":\\"(.*?)\\",\\"name\\":\\"(.*?)\\",\\"id\\":\\"(.*?)\\"#', $itemdata, $matches)) {
                $quality = $matches[2];
                $content = stripslashes(str_replace('\\n', '', $matches[3]));
                if (preg_match('#Icons\\/(.*?).jpg#', stripslashes($matches[1]), $icon_matches)) {
                    $icon = $icon_matches[1];
                }
                $template_html = trim(file_get_contents($this->root_path . 'infotooltip/includes/parser/templates/eq2_popup.tpl'));
                $template_html = str_replace('{ITEM_HTML}', $content, $template_html);
                $item['html'] = $template_html;
                $item['lang'] = $lang;
                $item['icon'] = $icon;
                $item['color'] = $quality;
                $item['name'] = $matches[6];
            } else {
                $item['baditem'] = true;
            }
            return $item;
        }
    }
}
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_eq2_zam', eq2_zam::$shortcuts);
}
コード例 #13
0
         * __dependencies
         * Get module dependencies
         */
        public static function __shortcuts()
        {
            $shortcuts = array('config');
            return array_merge(parent::__shortcuts(), $shortcuts);
        }
        public $author = 'Aderyn';
        public $version = '0.3.4';
        // new version
        public $name = 'Shoutbox 0.3.4 Update';
        public $type = 'plugin_update';
        public $plugin_path = 'shoutbox';
        // important!
        /**
         * Constructor
         */
        public function __construct()
        {
            parent::__construct();
            // init language
            $this->langs = array('english' => array('update_shoutbox_034' => 'Shoutbox 0.3.4 Update Package', 1 => 'Add new permission'), 'german' => array('update_shoutbox_034' => 'Shoutbox 0.3.4 Update Paket', 1 => 'Füge neue Berechtigung hinzu'));
            // init SQL querys
            $this->sqls = array(1 => "INSERT INTO `__auth_options` (`auth_value`, `auth_default`) VALUES ('u_shoutbox_view', 'Y');");
        }
    }
}
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_update_shoutbox_034', update_shoutbox_034::__shortcuts());
}
コード例 #14
0
        }
        if ($dd) {
            return $dd_data;
        }
        return $php_file_tree;
    }
    public function add_css()
    {
        $output = "\n\n\t\t\t.php-file-tree .open {\n\t\t\t\tfont-style: italic;\n\t\t\t}\n\n\t\t\t.php-file-tree .closed {\n\t\t\t\tfont-style: normal;\n\t\t\t}\n\n\t\t\t.php-file-tree .pft-directory {\n\t\t\t\tlist-style-image: url(" . $this->root_path . "images/glyphs/extensions/directory.png);\n\t\t\t}\n\n\t\t\t/* Default file */\n\t\t\t.php-file-tree LI.pft-file { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/file.png); }\n\t\t\t/* Additional file types */\n\t\t\t.php-file-tree LI.ext-3gp { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/film.png); }\n\t\t\t.php-file-tree LI.ext-afp { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/code.png); }\n\t\t\t.php-file-tree LI.ext-afpa { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/code.png); }\n\t\t\t.php-file-tree LI.ext-asp { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/code.png); }\n\t\t\t.php-file-tree LI.ext-aspx { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/code.png); }\n\t\t\t.php-file-tree LI.ext-avi { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/film.png); }\n\t\t\t.php-file-tree LI.ext-bat { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/application.png); }\n\t\t\t.php-file-tree LI.ext-bmp { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/picture.png); }\n\t\t\t.php-file-tree LI.ext-c { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/code.png); }\n\t\t\t.php-file-tree LI.ext-cfm { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/code.png); }\n\t\t\t.php-file-tree LI.ext-cgi { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/code.png); }\n\t\t\t.php-file-tree LI.ext-com { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/application.png); }\n\t\t\t.php-file-tree LI.ext-cpp { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/code.png); }\n\t\t\t.php-file-tree LI.ext-css { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/css.png); }\n\t\t\t.php-file-tree LI.ext-doc { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/doc.png); }\n\t\t\t.php-file-tree LI.ext-exe { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/application.png); }\n\t\t\t.php-file-tree LI.ext-gif { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/picture.png); }\n\t\t\t.php-file-tree LI.ext-fla { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/flash.png); }\n\t\t\t.php-file-tree LI.ext-h { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/code.png); }\n\t\t\t.php-file-tree LI.ext-htm { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/html.png); }\n\t\t\t.php-file-tree LI.ext-html { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/html.png); }\n\t\t\t.php-file-tree LI.ext-jar { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/java.png); }\n\t\t\t.php-file-tree LI.ext-jpg { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/picture.png); }\n\t\t\t.php-file-tree LI.ext-jpeg { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/picture.png); }\n\t\t\t.php-file-tree LI.ext-js { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/script.png); }\n\t\t\t.php-file-tree LI.ext-lasso { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/code.png); }\n\t\t\t.php-file-tree LI.ext-log { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/txt.png); }\n\t\t\t.php-file-tree LI.ext-m4p { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/music.png); }\n\t\t\t.php-file-tree LI.ext-mov { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/film.png); }\n\t\t\t.php-file-tree LI.ext-mp3 { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/music.png); }\n\t\t\t.php-file-tree LI.ext-mp4 { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/film.png); }\n\t\t\t.php-file-tree LI.ext-mpg { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/film.png); }\n\t\t\t.php-file-tree LI.ext-mpeg { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/film.png); }\n\t\t\t.php-file-tree LI.ext-ogg { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/music.png); }\n\t\t\t.php-file-tree LI.ext-pcx { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/picture.png); }\n\t\t\t.php-file-tree LI.ext-pdf { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/pdf.png); }\n\t\t\t.php-file-tree LI.ext-php { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/php.png); }\n\t\t\t.php-file-tree LI.ext-png { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/picture.png); }\n\t\t\t.php-file-tree LI.ext-ppt { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/ppt.png); }\n\t\t\t.php-file-tree LI.ext-psd { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/psd.png); }\n\t\t\t.php-file-tree LI.ext-pl { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/script.png); }\n\t\t\t.php-file-tree LI.ext-py { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/script.png); }\n\t\t\t.php-file-tree LI.ext-rb { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/ruby.png); }\n\t\t\t.php-file-tree LI.ext-rbx { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/ruby.png); }\n\t\t\t.php-file-tree LI.ext-rhtml { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/ruby.png); }\n\t\t\t.php-file-tree LI.ext-rpm { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/linux.png); }\n\t\t\t.php-file-tree LI.ext-ruby { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/ruby.png); }\n\t\t\t.php-file-tree LI.ext-sql { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/db.png); }\n\t\t\t.php-file-tree LI.ext-swf { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/flash.png); }\n\t\t\t.php-file-tree LI.ext-tif { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/picture.png); }\n\t\t\t.php-file-tree LI.ext-tiff { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/picture.png); }\n\t\t\t.php-file-tree LI.ext-txt { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/txt.png); }\n\t\t\t.php-file-tree LI.ext-vb { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/code.png); }\n\t\t\t.php-file-tree LI.ext-wav { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/music.png); }\n\t\t\t.php-file-tree LI.ext-wmv { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/film.png); }\n\t\t\t.php-file-tree LI.ext-xls { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/xls.png); }\n\t\t\t.php-file-tree LI.ext-xml { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/code.png); }\n\t\t\t.php-file-tree LI.ext-zip { list-style-image: url(" . $this->root_path . "images/glyphs/extensions/zip.png); }\n\t\t\t/* You can add millions of these... */\n\t\t";
        return $output;
    }
    public function add_js()
    {
        $output = '$(document).ready( function() {

			// Hide all subfolders at startup
			$(".php-file-tree").find("UL").hide();

			// Expand/collapse on click
			$(".pft-directory a").click( function() {
				$(this).parent().find("UL:first").slideToggle("medium");
				if( $(this).parent().attr(\'className\') == "pft-directory" ) return false;
			});	
		});';
        return $output;
    }
}
//close class
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_uploader', uploader::$shortcuts);
}
コード例 #15
0
if (!defined('EQDKP_INC')) {
    header('HTTP/1.0 404 Not Found');
    exit;
}
class wordofthemoment_portal extends portal_generic
{
    public static function __shortcuts()
    {
        $shortcuts = array('user', 'core', 'config', 'bbcode' => 'bbcode');
        return array_merge(parent::$shortcuts, $shortcuts);
    }
    protected $path = 'wordofthemoment';
    protected $data = array('name' => 'Word of the Moment', 'version' => '2.0.0', 'author' => 'WalleniuM', 'contact' => EQDKP_PROJECT_URL, 'description' => 'Output a randomword or sentence of the moment');
    protected $positions = array('left1', 'left2', 'right', 'middle', 'bottom');
    protected $settings = array('pk_wotd_words' => array('name' => 'pk_wotm_words', 'language' => 'pk_wotm_words', 'property' => 'bbcodeeditor', 'cols' => '30', 'rows' => '20', 'codeinput' => false));
    protected $install = array('autoenable' => '0', 'defaultposition' => 'right', 'defaultnumber' => '7');
    public function output()
    {
        $words = explode(";", $this->config->get('pk_wotm_words'));
        if (count($words) > 0) {
            shuffle($words);
            $myout = $this->bbcode->toHTML($words[0]);
        } else {
            $myout = $this->user->lang('pk_wotm_nobd');
        }
        return $myout;
    }
}
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_wordofthemoment_portal', wordofthemoment_portal::__shortcuts());
}
コード例 #16
0
                    $perm = true;
                    break;
                    //Guests
                //Guests
                case '1':
                    $perm = !$this->user->is_signedin() ? true : false;
                    break;
                    //Logged-Ins
                //Logged-Ins
                case '2':
                    $perm = $this->user->is_signedin() ? true : false;
                    break;
                    //Admins
                //Admins
                case '3':
                    $perm = $this->user->check_auth('a_', false) ? true : false;
                    break;
            }
            return $perm;
        }
        private function parse_links($text)
        {
            return $this->bbcode->parse_shorttags($text, array('server', 'user', 'guild'));
        }
    }
    //end class
}
//end if
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_pdh_r_links', pdh_r_links::__shortcuts());
}
コード例 #17
0
ファイル: ftp_access.class.php プロジェクト: rswiders/core
 public function parse_input()
 {
     $this->ftphost = $this->in->get('ftphost');
     $this->ftpport = $this->in->get('ftpport');
     $this->ftpuser = $this->in->get('ftpuser');
     $this->ftppass = $this->in->get('ftppass');
     $this->ftproot = $this->in->get('ftproot');
     $this->use_ftp = $this->in->get('useftp', 0);
     // If the safe mode is on and the ftp mode is off, kill the cat
     if (ini_get('safe_mode') == '1' && $this->use_ftp != 1) {
         $this->pdl->log('install_error', $this->lang['safemode_ftpmustbeon']);
         return false;
     }
     // If the ftp mode is off, check if the data folder is readable
     if ($this->use_ftp == 0) {
         $phpwriteerror = false;
         // check if the config.php is available
         if (!file_exists($this->root_path . 'config.php')) {
             // try to create the file
             $this->pfh->CheckCreateFile($this->root_path . 'config.php');
             if (!file_exists($this->root_path . 'config.php')) {
                 $this->pdl->log('install_error', $this->lang['plain_config_nofile']);
                 $phpwriteerror = true;
             }
         } elseif (!$this->pfh->is_writable($this->root_path . 'config.php', false)) {
             // check if the config.php is writable, attempt to create it
             $this->pdl->log('install_error', $this->lang['plain_config_nwrite']);
             $phpwriteerror = true;
         }
         // check if the data folder is available
         if (!$this->pfh->CheckCreateFolder($this->root_path . 'data/')) {
             $this->pdl->log('install_error', $this->lang['plain_dataf_na']);
             $phpwriteerror = true;
         } elseif (!$this->pfh->is_writable($this->root_path . 'data/', true)) {
             $this->pdl->log('install_error', $this->lang['plain_dataf_nwrite']);
             $phpwriteerror = true;
         }
         // if one of this is not writeable, die, baby, die!
         if ($phpwriteerror) {
             return false;
         }
     } else {
         // if the ftp handler is on, try to connect..
         $connect = ftp_connect($this->ftphost, $this->ftpport, 5);
         $login = ftp_login($connect, $this->ftpuser, $this->ftppass);
         // connection failed, jump out of the window
         if (!$connect) {
             $this->pdl->log('install_error', $this->lang['ftp_connectionerror'] . '<br />' . $connect);
             return false;
         }
         // try to login, hopefully it should work :)
         if (!$login) {
             $this->pdl->log('install_error', $this->lang['ftp_loginerror']);
             return false;
         }
         // test if the data folder is writable
         if ($this->ftproot == '/') {
             $this->ftproot = '';
         }
         if (strlen($this->ftproot) && substr($this->ftproot, -1) != "/") {
             $this->ftproot .= '/';
         }
         ftp_pasv($connect, true);
         //Go to data-Folder
         if (!ftp_chdir($connect, $this->ftproot . 'data/')) {
             //data-Folder is not available. Is there a core-Folder?
             if (!ftp_chdir($connect, $this->ftproot . 'core/')) {
                 $this->pdl->log('install_error', $this->lang['ftp_datawriteerror']);
                 return false;
             } else {
                 ftp_chdir($connect, '../');
             }
             //Try to create data-Folder
             if (!ftp_mkdir($connect, $this->ftproot . 'data/')) {
                 $this->pdl->log('install_error', $this->lang['plain_dataf_na']);
                 return false;
             }
             ftp_chdir($connect, $this->ftproot . 'data/');
         }
         if (!ftp_put($connect, 'test_file.php', $this->root_path . 'install/index.php', FTP_BINARY)) {
             $this->pdl->log('install_error', $this->lang['ftp_datawriteerror']);
             return false;
         }
         @ftp_delete($connect, 'test_file.php');
         ftp_mkdir($connect, md5('installer'));
         ftp_mkdir($connect, md5('installer') . '/tmp/');
         ftp_chmod($connect, 0777, md5('installer') . '/tmp/');
         //Check now tmp-Folder, because it needs CHMOD 777 for writing the config-file
         if (!file_put_contents($this->root_path . 'data/' . md5('installer') . '/tmp/test_file.php', 'test')) {
             $this->pdl->log('install_error', $this->lang['ftp_tmpinstallwriteerror']);
             return false;
         }
         @ftp_delete($connect, md5('installer') . '/tmp/test_file.php');
         //Everything fine, reinitialise pfh, to use ftp
         registry::add_const('ftphost', $this->ftphost);
         registry::add_const('ftpport', $this->ftpport ? $this->ftpport : 21);
         registry::add_const('ftpuser', $this->ftpuser);
         registry::add_const('ftppass', $this->ftppass);
         registry::add_const('ftproot', $this->ftproot);
         registry::add_const('use_ftp', true);
         $this->pfh->__construct('installer', 'filehandler_ftp');
         if (!file_exists($this->root_path . 'config.php')) {
             $this->pfh->CheckCreateFile($this->root_path . 'config.php');
         }
     }
     $this->configfile_content();
     return true;
 }
コード例 #18
0
    public function ipb3_get_user_groups($intUserID, $arrGroups)
    {
        $query = $this->db->query("SELECT member_group_id, mgroup_others FROM " . $this->prefix . "members WHERE member_id='" . $this->db->escape($intUserID) . "'");
        $result = $this->db->fetch_row($query);
        if (in_array((int) $result['member_group_id'], $arrGroups)) {
            return true;
        }
        $arrAditionalGroups = explode(',', $result['mgroup_others']);
        if (is_array($arrAditionalGroups)) {
            foreach ($arrAditionalGroups as $group) {
                if ($group != '' && in_array((int) $group, $arrGroups)) {
                    return true;
                }
            }
        }
        return false;
    }
    public function ipb3_callafter($strUsername, $strPassword, $boolAutoLogin, $arrUserdata, $boolLoginResult, $boolUseHash)
    {
        //Is user active?
        if ($boolLoginResult) {
            if ($arrUserdata['temp_ban'] != '0' || $arrUserdata['member_banned'] != '0') {
                return false;
            }
        }
        return true;
    }
}
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_ipb3_bridge', ipb3_bridge::$shortcuts);
}
コード例 #19
0
 public static function init($root_path, $lite = false)
 {
     try {
         self::$const['scriptstart'] = microtime(true);
         self::$const['root_path'] = $root_path;
         self::$const['lite_mode'] = $lite;
         self::load_config();
         // switch to userdefined error handler class
         set_error_handler(array(registry::register('plus_debug_logger'), 'myErrorHandler'), intval(ini_get("error_reporting")));
         register_shutdown_function(array(registry::register('plus_debug_logger'), "catch_fatals"));
         // User Levels
         define('ANONYMOUS', -1);
         define('USER', 0);
         define('CRONJOB', -2);
         //DBAL
         if (self::$const['dbtype'] == "mysql") {
             self::$const['dbtype'] = "mysqli";
         }
         include_once self::get_const('root_path') . 'libraries/dbal/dbal.class.php';
         require_once self::get_const('root_path') . 'libraries/dbal/' . self::$const['dbtype'] . '.dbal.class.php';
         self::$aliases['db'] = array('dbal_' . self::$const['dbtype'], array(array('open' => true)));
         registry::register('input');
         registry::register('config');
         self::set_debug_level();
         include_once self::$const['root_path'] . 'core/core.functions.php';
         registry::register('environment');
         if (!registry::register('config')->get('server_path')) {
             self::fix_server_path();
         }
         self::$const['server_path'] = registry::register('config')->get('server_path');
         self::$const['controller_path'] = self::$const['server_path'] . (!intval(registry::register('config')->get('seo_remove_index')) ? 'index.php/' : '');
         self::$const['controller_path_plain'] = !intval(registry::register('config')->get('seo_remove_index')) ? 'index.php/' : '';
         //Auth/User
         require self::$const['root_path'] . 'core/auth.class.php';
         $auth_method = 'auth_' . (registry::register('config')->get('auth_method') != '' ? registry::register('config')->get('auth_method') : 'db');
         require_once self::get_const('root_path') . 'core/auth/' . $auth_method . '.class.php';
         self::$aliases['user'] = $auth_method;
         registry::fetch('user')->start();
         registry::fetch('user')->setup(registry::register('input')->get('lang', ''), registry::register('input')->get('style', 0));
         self::set_timezone();
         define('USER_INITIALIZED', true);
         if (!defined('MAINTENANCE_MODE')) {
             //Maintenance mode redirect for non admins
             if (registry::register('config')->get('pk_maintenance_mode') && !registry::fetch('user')->check_auth('a_', false) && !defined('NO_MMODE_REDIRECT')) {
                 redirect('maintenance/maintenance.php' . self::get_const('SID'), false, false, false);
             }
             //Maintenance Modus for admins
             $task_hash = registry::register('mmtaskmanager')->get_task_hash();
             //redirect if there are necessary tasks or errors from pfh
             if (!registry::register('config')->get('pk_known_task_hash') || registry::register('config')->get('pk_known_task_hash') !== $task_hash) {
                 registry::register('config')->set('pk_known_task_hash', $task_hash);
                 registry::register('mmtaskmanager')->init_tasks();
                 if (registry::register('mmtaskmanager')->status['necessary_tasks']) {
                     registry::register('config')->set('pk_maintenance_mode', true);
                     if (!defined('NO_MMODE_REDIRECT')) {
                         redirect('maintenance/index.php' . self::get_const('SID'), false, false, false);
                     }
                 }
             }
             //activate and redirect to mmode if pfh-errors exist|
             if (count(registry::register('file_handler')->get_errors()) > 0) {
                 registry::register('config')->set('pk_maintenance_mode', true);
                 if (!defined('NO_MMODE_REDIRECT')) {
                     redirect('maintenance/index.php' . self::get_const('SID'), false, false, false);
                 }
             }
             //check if version in config needs update (no db update existing, since no task necessary at this point)
             if (!defined('NO_MMODE_REDIRECT') && !registry::register('config')->get('pk_maintenance_mode')) {
                 if (version_compare(registry::register('config')->get('plus_version'), VERSION_INT, '<')) {
                     registry::register('config')->set('plus_version', VERSION_INT);
                 }
             }
         }
         // Set the locale
         setlocale(LC_ALL, registry::register('config')->get('default_locale'));
         setlocale(LC_NUMERIC, "en_EN", "en", "eng");
         // Populate the admin menu if we're in an admin page, they have admin permissions
         if (defined('IN_ADMIN') && IN_ADMIN === true) {
             if (registry::fetch('user')->check_auth('a_', false)) {
                 registry::register('admin_index');
             }
         }
         if (!$lite) {
             //Get Info about mobile/desktop
             if (registry::register('input')->exists('toggleResponsive')) {
                 $arrAllowed = array('mobile', 'desktop');
                 $strView = registry::register('input')->get('toggleResponsive');
                 if (in_array($strView, $arrAllowed)) {
                     set_cookie('resp', $strView, time() + 3600 * 24 * 30);
                     registry::add_const('mobile_view', $strView == 'mobile' ? true : false);
                 }
             } elseif (registry::register('input')->getEQdkpCookie('resp', '') == 'desktop') {
                 registry::add_const('mobile_view', false);
             } else {
                 registry::add_const('mobile_view', true);
             }
             //initiate PDH
             $strPageLayout = registry::register('config')->get('eqdkp_layout') ? registry::register('config')->get('eqdkp_layout') : 'normal';
             $strPageLayout = registry::register('config')->get('mobile_pagelayout') && strlen(registry::register('config')->get('mobile_pagelayout')) && registry::register('environment')->agent->mobile && registry::get_const('mobile_view') ? registry::register('config')->get('mobile_pagelayout') : $strPageLayout;
             registry::register('plus_datahandler')->init_eqdkp_layout($strPageLayout);
             registry::register('portal');
             registry::register('timekeeper')->handle_crons();
             //EQdkp Tour
             if (registry::fetch('user')->check_auth('a_', false)) {
                 registry::register('tour')->init();
             }
             include_once self::$const['root_path'] . 'core/page_generic.class.php';
             registry::register('jquery');
         }
         //Restore Permissions
         if (registry::register('input')->get('mode', '') == 'rstperms') {
             registry::fetch('user')->restore_permissions();
             redirect('', false, false, false);
         }
     } catch (DBALException $e) {
         registry::register('plus_debug_logger')->catch_dbal_exception($e);
     }
     // maybe find a more elegant solution later on
     self::load_html_fields();
 }
コード例 #20
0
            $message .= $function != "" ? '<b>Function:</b> ' . $function . '<br />' : '';
            $message .= '<b>Style-Code:</b> ' . $this->style_code . '<br />';
            $message .= '<b>Template:</b> ' . $this->template . '<br />';
            $message .= '<b>Handler:</b> ' . $handle . '<br />';
            $this->display_error($title, $message);
            $this->error_message = true;
        }
    }
    private function display_error($title, $message)
    {
        $this->set_template('maintenance', 'maintenance');
        $this->set_filenames(array('body' => 'template_error.html'));
        $this->assign_vars(array('ERROR_TITLE' => $title, 'ERROR_MESSAGE' => $message, 'TYEAR' => date('Y')));
        $this->display('body');
        exit;
    }
    // strip all php tags
    private function strip_tags_php(&$code)
    {
        $code = preg_replace(array("#<([\\?%])=?.*?>#s", "#<\\?php(?:\r\n?|[ \n\t]).*?\\?>#s"), '', $code);
    }
    public function __destruct()
    {
        $this->_data = array();
        $this->states = array();
        parent::__destruct();
    }
}
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_template', template::$shortcuts);
}
コード例 #21
0
ファイル: logs.class.php プロジェクト: ubick/lorekeepers.org
        $this->pluginname = $name;
    }
    public function add($tag, $value, $admin_action = true, $plugin = '', $result = 1, $userid = false, $process_hooks = 1)
    {
        $plugin = $plugin != '' ? $plugin : $this->pluginname;
        $this->pdh->put('logs', 'add_log', array($tag, $value, $admin_action, $plugin, $result, $userid));
        if ($process_hooks) {
            $this->pdh->process_hook_queue();
        }
    }
    // Language Replacement
    public function lang_replace($variable)
    {
        preg_match("/\\{L_(.+)\\}/", $variable, $to_replace);
        if (isset($to_replace[1]) && $this->user->lang(strtolower($to_replace[1]))) {
            $variable = str_replace('{L_' . $to_replace[1] . '}', $this->user->lang(strtolower($to_replace[1])), $variable);
        }
        preg_match("/\\{LA_(.+)\\[(.+)\\]\\}/", $variable, $to_replace);
        if (isset($to_replace[1]) && $this->user->lang(strtolower($to_replace[1]))) {
            $variable = str_replace($to_replace[0], $this->user->lang(array(strtolower($to_replace[1]), strtolower($to_replace[2]))), $variable);
        }
        preg_match("/\\{D_(.+)\\}/", $variable, $to_replace);
        if (isset($to_replace[1])) {
            $variable = str_replace('{D_' . $to_replace[1] . '}', $this->time->user_date($to_replace[1], true), $variable);
        }
        return $variable;
    }
}
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_logs', logs::$shortcuts);
}
コード例 #22
0
         * __dependencies
         * Get module dependencies
         */
        public static function __shortcuts()
        {
            $shortcuts = array('config');
            return array_merge(parent::__shortcuts(), $shortcuts);
        }
        public $author = 'GodMod';
        public $version = '0.1.3';
        // new version
        public $name = 'Guildrequest 0.1.3 Update';
        public $type = 'plugin_update';
        public $plugin_path = 'guildrequest';
        // important!
        /**
         * Constructor
         */
        public function __construct()
        {
            parent::__construct();
            // init language
            $this->langs = array('english' => array('update_guildrequest_013' => 'GuildRequest 0.1.3 Update Package', 1 => 'Add help field'), 'german' => array('update_guildrequest_013' => 'GuildRequest 0.1.3 Update Paket', 1 => 'Füge Hilfe-Feld hinzu'));
            // init SQL querys
            $this->sqls = array(1 => "ALTER TABLE `__guildrequest_fields` ADD COLUMN `help` TEXT COLLATE utf8_bin NULL;");
        }
    }
}
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_update_guildrequest_013', update_guildrequest_013::__shortcuts());
}
コード例 #23
0
ファイル: viewitem.php プロジェクト: ubick/lorekeepers.org
        }
        $counter = sizeof($item_ids);
        //default now col
        $colspan = $this->config->get('infotooltip_use') ? 1 : 0;
        #Itemhistory Diagram
        if ($this->config->get('pk_itemhistory_dia')) {
            $colspan++;
        }
        //Comments
        $comm_settings = array('attach_id' => md5(stripslashes($item_name)), 'page' => 'items');
        $this->comments->SetVars($comm_settings);
        $COMMENT = $this->config->get('pk_enable_comments') == 1 ? $this->comments->Show() : '';
        //init infotooltip
        infotooltip_js();
        $hptt_page_settings = $this->pdh->get_page_settings('viewitem', 'hptt_viewitem_buyerslist');
        $hptt = $this->get_hptt($hptt_page_settings, $item_ids, $item_ids, array('%raid_link_url%' => 'viewraid.php', '%raid_link_url_suffix%' => ''), $this->url_id);
        //linechart data
        if ($this->config->get('pk_itemhistory_dia')) {
            $a_items = array();
            foreach ($item_ids as $item_id) {
                $a_items[] = array('name' => $this->time->date("Y-m-d H:i:s", $this->pdh->get('item', 'date', array($item_id))), 'value' => $this->pdh->get('item', 'value', array($item_id)));
            }
        }
        $this->tpl->assign_vars(array('ITEM_STATS' => $this->pdh->get('item', 'itt_itemname', array($this->url_id, 0, 1)), 'ITEM_CHART' => $this->config->get('pk_itemhistory_dia') && count($a_items) > 1 ? $this->jquery->LineChart('item_chart', $a_items, '', 200, 500, '', false, true, 'date') : '', 'ITEM_MODEL' => isset($model3d) ? $model3d : false, 'COMMENT' => $COMMENT, 'SHOW_ITEMSTATS' => $this->config->get('infotooltip_use') ? true : false, 'SHOW_ITEMHISTORYA' => $this->config->get('pk_itemhistory_dia') == 1 ? true : false, 'SHOW_COLSPAN' => $colspan, 'BUYERS_TABLE' => $hptt->get_html_table($sort, '&amp;i=' . $this->url_id, 0, 100, sprintf($this->user->lang('viewitem_footcount'), $counter)), 'L_PURCHASE_HISTORY_FOR' => sprintf($this->user->lang('purchase_history_for'), stripslashes($item_name))));
        $this->core->set_vars(array('page_title' => sprintf($this->user->lang('viewitem_title'), stripslashes($item_name)), 'template_file' => 'viewitem.html', 'display' => true));
    }
}
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_viewitem', viewitem::__shortcuts());
}
registry::register('viewitem');
コード例 #24
0
 * @package		eqdkp-plus
 * @version		$Rev: 11830 $
 *
 * $Id: check_session.php 11830 2012-06-22 18:20:07Z godmod $
 */
if (!defined('EQDKP_INC')) {
    die('Do not access this file directly.');
}
if (!class_exists('exchange_check_session')) {
    class exchange_check_session extends gen_class
    {
        public static $shortcuts = array('user');
        public function post_check_session($params, $body)
        {
            $xml = simplexml_load_string($body);
            $status = 0;
            if ($xml && $xml->sid) {
                $result = $this->user->check_session($xml->sid);
                if ($result != ANONYMOUS) {
                    $status = 1;
                } else {
                    $status = 0;
                }
            }
            return array('valid' => $result);
        }
    }
}
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_exchange_check_session', exchange_check_session::$shortcuts);
}
コード例 #25
0
                $log_action = array('{L_ID}' => $item_id, '{L_NAME}' => $old['name'], '{L_BUYERS}' => $old['buyer'], '{L_RAID_ID}' => $old['raid_id'], '{L_ITEMPOOL}' => $old['itempool'], '{L_VALUE}' => $old['value']);
                $this->log_insert('action_item_deleted', $log_action);
                $this->pdh->enqueue_hook('item_update', $item_id);
                return true;
            }
            return false;
        }
        public function delete_itemsofraid($raid_id)
        {
            $items = $this->pdh->get('item', 'itemsofraid', array($raid_id));
            if (count($items) < 1) {
                return true;
            }
            $this->db->query("DELETE FROM __items WHERE item_id IN ('" . implode("', '", $items) . "');");
            $log_action = array('{L_ID}' => implode(', ', $items), '{L_RAID_ID}' => $raid_id);
            $this->log_insert('action_itemsofraid_deleted', $log_action);
            $this->pdh->enqueue_hook('item_update', $items);
            return true;
        }
        public function reset()
        {
            $this->db->query("TRUNCATE TABLE __items;");
            $this->pdh->enqueue_hook('item_update');
        }
    }
    //end class
}
//end if
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_pdh_w_item', pdh_w_item::__shortcuts());
}
コード例 #26
0
                            $outHtml .= '<input type="hidden" name="sb_usermember_id" value="' . key($members) . '"/>' . current($members);
                        }
                    }
                }
            }
            return $outHtml;
        }
        /**
         * getArchiveLink
         * get the archive link text
         *
         * @return  string
         */
        private function getArchiveLink()
        {
            $html = '<table width="100%" border="0" cellspacing="1" cellpadding="2" class="colorswitch">
                 <tr>
                   <td class="menu">
                     <div class="center">
                       <input type="button" class="liteoption bi_archive" value="' . $this->user->lang('sb_archive') . '" onclick="window.location.href=\'' . $this->root_path . 'plugins/shoutbox/archive.php' . $this->SID . '\'"/>
                     </div>
                   </td>
                 </tr>
               </table>';
            return $html;
        }
    }
}
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_sb_vertical', sb_vertical::__shortcuts());
}
コード例 #27
0
ファイル: email.php プロジェクト: ubick/lorekeepers.org
                    $this->mail->SetOptions($options);
                    $status = $this->mail->SendMail($this->pdh->get('user', 'email', array($user_id)), $this->user->data['user_email'], $this->in->get('subject'), $this->in->get('body'));
                    if ($status) {
                        $this->core->message($this->user->lang('adduser_send_mail_suc'), $this->user->lang('success'), 'green', true);
                        $this->tpl->add_js("jQuery.FrameDialog.closeDialog();");
                    } else {
                        $this->core->message($this->user->lang('error_email_send'), $this->user->lang('error'), 'red');
                    }
                } else {
                    $this->core->message($this->user->lang('fv_invalid_email'), $this->user->lang('error'), 'red');
                }
            } else {
                message_die($this->user->lang('noauth'), $this->user->lang('noauth_default_title'), 'access_denied');
            }
        }
    }
    public function display()
    {
        $user_id = $this->in->get('user', 0);
        if ($user_id < 1) {
            $this->core->message($this->user->lang('error_user_not_found'), $this->user->lang('error'), 'red');
        } else {
            $this->tpl->assign_vars(array('USER_ID' => $user_id, 'USERNAME' => $this->pdh->get('user', 'name', array($user_id)), 'BODY' => $this->in->get('body', ''), 'SUBJECT' => $this->in->get('subject', '')));
        }
        $this->core->set_vars(array('page_title' => $this->user->lang('adduser_send_mail'), 'template_file' => 'email.html', 'header_format' => 'simple', 'display' => true));
    }
}
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_email', email::__shortcuts());
}
registry::register('email');
コード例 #28
0
        /**
         * get_search
         * Searches the shoutbox module for the search value
         *
         * @param  string  $search  Value to search
         *
         * @returns array
         */
        public function get_search($search)
        {
            // empty search results
            $searchResults = array();
            // loop through the data array and fill search results
            if ($this->data && is_array($this->data)) {
                foreach ($this->data as $shoutbox_id => $data) {
                    $member = $this->get_usermembername($shoutbox_id);
                    $text = $this->get_text($shoutbox_id);
                    if (strpos($text, $search) !== false || strpos($member, $search) !== false) {
                        $searchResults[] = array('id' => $this->get_html_date($shoutbox_id, true) . '<br/>' . $this->get_html_usermembername($shoutbox_id), 'name' => $this->get_html_text($shoutbox_id), 'link' => $this->root_path . 'plugins/shoutbox/archive.php' . $this->SID . '&amp;id=' . $shoutbox_id);
                    }
                }
            }
            return $searchResults;
        }
    }
    //end class
}
//end if class not exists
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_pdh_r_shoutbox', pdh_r_shoutbox::__shortcuts());
}
コード例 #29
0
    }
    private function birthday_sortdate($timestamp)
    {
        $today = $this->time->getdate();
        $birthday = $this->time->getdate($timestamp);
        // Ok.. this is tricky: if the birthday month is < now, change year+1!
        if ($birthday['mon'] > $today['mon'] || $birthday['mon'] == $today['mon'] && $birthday['mday'] >= $today['mday']) {
            $year = $today['year'];
        } else {
            $year = $today['year'] + 1;
        }
        return $this->time->mktime(0, 0, 0, $birthday['mon'], $birthday['mday'], $year);
    }
    private function birthday_istoday($timestamp)
    {
        $birthday = $this->time->getdate($timestamp);
        $today = $this->time->getdate();
        if ($birthday['mon'] == $today['mon'] && $today['mday'] == $birthday['mday']) {
            return 1;
        } else {
            return 0;
        }
    }
    public function reset()
    {
        $this->pdc->del_prefix('portal.modul.birthday');
    }
}
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_birthday_portal', birthday_portal::__shortcuts());
}
コード例 #30
0
            }
        }
        public function get_memberships($user_id)
        {
            if (isset($this->user_memberships[$user_id]) && is_array($this->user_memberships[$user_id])) {
                return array_keys($this->user_memberships[$user_id]);
            } elseif ($user_id == ANONYMOUS) {
                return array(0 => 1);
            } else {
                return array();
            }
        }
        public function get_memberships_status($user_id)
        {
            if (is_array($this->user_memberships[$user_id])) {
                return $this->user_memberships[$user_id];
            } else {
                return array();
            }
        }
        public function get_groupcount($group_id)
        {
            return isset($this->user_groups_users[$group_id]) ? count($this->user_groups_users[$group_id]) : 0;
        }
    }
    //end class
}
//end if
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_pdh_r_user_groups_users', pdh_r_user_groups_users::__shortcuts());
}