/** * Vouchers plugin initialization functions. */ function vouchers_init() { // register a library of helper functions elgg_register_library('elgg:vouchers', elgg_get_plugins_path() . 'vouchers/lib/vouchers.php'); // Register subtype run_function_once('vouchers_manager_run_once_subtypes'); // Register entity_type for search elgg_register_entity_type('object', Voucher::SUBTYPE); // Site navigation $item = new ElggMenuItem('vouchers', elgg_echo('vouchers:menu'), 'vouchers/all'); elgg_register_menu_item('site', $item); // Extend CSS elgg_extend_view('css/elgg', 'vouchers/css'); elgg_register_css('vouchers_tooltip_css', '//code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css'); // Extend js elgg_register_js('vouchersjs', elgg_get_site_url() . 'mod/vouchers/assets/vouchers.js'); elgg_register_js('vouchers_tooltip_js', '//code.jquery.com/ui/1.11.1/jquery-ui.js'); // Register a page handler, so we can have nice URLs elgg_register_page_handler('vouchers', 'vouchers_page_handler'); // Register a URL handler for voucher $release = get_version(true); // Register a URL handler for agora if ($release < 1.9) { // version 1.8 elgg_register_entity_url_handler('object', 'vouchers', 'voucher_url'); } else { // use this since Elgg 1.9 elgg_register_plugin_hook_handler('entity:url', 'object', 'vouchers_set_url'); } // Register menu item to an ownerblock elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'vouchers_owner_block_menu'); // Register admin transaction log menu under "Utilities" elgg_register_admin_menu_item('administer', 'vouchers_transactions_log', 'administer_utilities'); // register plugin hooks elgg_register_plugin_hook_handler("public_pages", "walled_garden", "vouchers_walled_garden_hook"); // Register actions $action_path = elgg_get_plugins_path() . 'vouchers/actions'; elgg_register_action("vouchers/addvoucher", "{$action_path}/addvoucher.php"); elgg_register_action("vouchers/delete", "{$action_path}/delvoucher.php"); elgg_register_action("vouchers/set_featured", "{$action_path}/vouchers/set_featured.php"); // set a voucher post as featured elgg_register_action("vouchers/unset_featured", "{$action_path}/vouchers/unset_featured.php"); // unset a voucher post from featured elgg_register_action("vouchers/get_with_points", "{$action_path}/vouchers/get_with_points.php"); // voucher purchase with points only elgg_register_action('vouchers/be_interested', "{$action_path}/be_interested.php"); // send interest elgg_register_action("vouchers/usersettings", "{$action_path}/usersettings.php"); // save user settings // extend group main page elgg_extend_view('groups/tool_latest', 'vouchers/group_module'); //elgg_extend_view("print", "printpreview/pageshell/pageshell"); // add the group vouchers tool option add_group_tool_option('vouchers', elgg_echo('vouchers:group:enablevouchers'), true); // Add vouchers widgets elgg_register_widget_type('vouchers', elgg_echo('vouchers:widget'), elgg_echo('vouchers:widget:description'), 'profile,groups,dashboard'); // member's voucher posts elgg_register_widget_type('vouchers_featured', elgg_echo('vouchers:widget:featured'), elgg_echo('vouchers:widget:featured:description'), 'dashboard'); // featured vouchers for dashboard }
/** * Handles the sending of notifications when replied on group forum topic * * @param string $event the name of the event * @param string $type the type of the event * @param ElggAnnotation $annotation the supplied ElggAnnotation * * @return void */ function advanced_notifications_create_annotation_event_handler($event, $type, $annotation) { if (!empty($annotation) && $annotation instanceof ElggAnnotation) { // is this an annotation on which notifications should be sent if (advanced_notifications_is_registered_notification_annotation($annotation)) { // check if the entity isn't PRIVATE $entity = $annotation->getEntity(); if (!empty($entity) && $entity->access_id != ACCESS_PRIVATE) { // is the entity a registered notification entity if (advanced_notifications_is_registered_notification_entity($entity)) { // prepare to call the commandline $commandline_options = array("event" => $event, "type" => $type, "id" => $annotation->id); // in older versions of elgg do this differently if (version_compare(get_version(true), "1.8.6", "<")) { $entity = $annotation->getEntity(); unset($commandline_options["id"]); $commandline_options["type"] = $entity->getType(); $commandline_options["guid"] = $entity->getGUID(); $commandline_options["input"] = "group_topic_post|" . base64_encode($annotation->value); } advanced_notifications_start_commandline($commandline_options); } } } } }
function polls_init() { elgg_register_library('elgg:polls', elgg_get_plugins_path() . 'polls/models/model.php'); // Set up menu for logged in users if (elgg_is_logged_in()) { $item = new ElggMenuItem('polls', elgg_echo('polls'), 'polls/owner/' . elgg_get_logged_in_user_entity()->username); } else { $item = new ElggMenuItem('polls', elgg_echo('poll'), 'polls/all'); } elgg_register_menu_item('site', $item); // Extend system CSS with our own styles, which are defined in the polls/css view elgg_extend_view('css/elgg', 'polls/css'); // Extend hover-over menu elgg_extend_view('profile/menu/links', 'polls/menu'); // Register a page handler, so we can have nice URLs elgg_register_page_handler('polls', 'polls_page_handler'); // Register a URL handler for poll posts elgg_register_entity_url_handler('object', 'poll', 'polls_url'); // notifications $elgg_version = explode('.', get_version(true)); if ($elgg_version[1] > 8) { $send_notification = elgg_get_plugin_setting('send_notification', 'polls'); if (!$send_notification || $send_notification != 'no') { elgg_register_notification_event('object', 'poll'); elgg_register_plugin_hook_handler('prepare', 'notification:create:object:poll', 'polls_prepare_notification'); } } // add link to owner block elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'polls_owner_block_menu'); elgg_register_plugin_hook_handler('widget_url', 'widget_manager', 'polls_widget_url_handler'); // Register entity type elgg_register_entity_type('object', 'poll'); // register the JavaScript $js = elgg_get_simplecache_url('js', 'polls/js'); elgg_register_simplecache_view('js/polls/js'); elgg_register_js('elgg.polls', $js); // add group widget $group_polls = elgg_get_plugin_setting('group_polls', 'polls'); if (!$group_polls || $group_polls != 'no') { elgg_extend_view('groups/tool_latest', 'polls/group_module'); } if (!$group_polls || $group_polls == 'yes_default') { add_group_tool_option('polls', elgg_echo('polls:enable_polls'), TRUE); } else { if ($group_polls == 'yes_not_default') { add_group_tool_option('polls', elgg_echo('polls:enable_polls'), FALSE); } } //add widgets elgg_register_widget_type('poll', elgg_echo('polls:my_widget_title'), elgg_echo('polls:my_widget_description'), "profile,groups"); elgg_register_widget_type('latestPolls', elgg_echo('polls:latest_widget_title'), elgg_echo('polls:latest_widget_description'), "index,profile,dashboard,groups"); elgg_register_widget_type('poll_individual', elgg_echo('polls:individual'), elgg_echo('poll_individual_group:widget:description'), "index,profile,dashboard,groups"); // Register actions $action_path = elgg_get_plugins_path() . 'polls/actions/polls'; elgg_register_action("polls/add", "{$action_path}/add.php"); elgg_register_action("polls/edit", "{$action_path}/edit.php"); elgg_register_action("polls/delete", "{$action_path}/delete.php"); elgg_register_action("polls/vote", "{$action_path}/vote.php"); }
/** * Generate a basic report. * * @return string */ function diagnostics_basic_hook($hook, $entity_type, $returnvalue, $params) { // Get version information $version = get_version(); $release = get_version(true); $returnvalue .= elgg_echo('diagnostics:report:basic', array($release, $version)); return $returnvalue; }
/** * Generate a basic report. * * @param unknown_type $hook * @param unknown_type $entity_type * @param unknown_type $returnvalue * @param unknown_type $params */ function diagnostics_basic_hook($hook, $entity_type, $returnvalue, $params) { global $CONFIG; // Get version information $version = get_version(); $release = get_version(true); $returnvalue .= sprintf(elgg_echo('diagnostics:report:basic'), $release, $version); return $returnvalue; }
/** * Run once and only once. * * @param ElggSite $site The site who's information to use */ function ping_home(ElggSite $site) { global $NOTIFICATION_SERVER, $CONFIG; // Get version information $version = get_version(); $release = get_version(true); // Get export $export = export($site->guid); return send_api_post_call($NOTIFICATION_SERVER, array('method' => 'elgg.system.ping', 'url' => $site->url, 'version' => $version, 'release' => $release), array(), $export, 'text/xml'); }
/** * Determine if we're running elgg 1.8 or newer * @return boolean */ function is_elgg18() { static $is_elgg18; if ($is_elgg18 !== null) { return $is_elgg18; } if (is_callable('elgg_get_version')) { return false; // this is newer than 1.8 } $is_elgg18 = strpos(get_version(true), '1.8') === 0; return $is_elgg18; }
/** * Exports plugins and their configuration */ function transfer_plugins_export() { // metadata $info = array('elgg_version' => get_version(true), 'elgg_release' => get_version(false), 'transfer_plugins_format' => TRANSFER_PLUGINS_FORMAT); $info['plugins'] = array(); $plugins = elgg_get_plugins('all'); foreach ($plugins as $plugin) { if (is_object($plugin) && is_object($plugin->getManifest())) { $plugin_info = array('id' => $plugin->getID(), 'version' => $plugin->getManifest()->getVersion(), 'active' => (bool) $plugin->isActive(), 'settings' => $plugin->getAllSettings(), 'priority' => $plugin->getPriority()); } $plugin_order[$plugin->getPriority() * 10] = $plugin->getID(); $info['plugins'][] = $plugin_info; } $info['17_pluginorder'] = serialize($plugin_order); return serialize($info); }
function get_version_number() { $r = 'v'; $v = get_version(); $pos = strpos($v, ' ', 0); if ($pos === false) { my_die('Wrong version: ' . $v); } $vn = preg_split("/[.]/", substr($v, 0, $pos)); if (count($vn) < 3) { my_die('Wrong version: ' . $v); } for ($i = 0; $i < 3; $i++) { $r .= substr('000' . $vn[$i], -3); } return $r; // 'vxxxyyyzzz' wenn version = x.y.z }
header("Content-Type: text/plain"); ?> #!/bin/sh BASEURL="<?php echo (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . conf('subdirectory'); ?> " TPL_BASE="${BASEURL}/assets/client_installer/" MUNKIPATH="/usr/local/munki/" # TODO read munkipath from munki config PREFPATH="/Library/Preferences/MunkiReport" CURL="/usr/bin/curl --insecure --fail --silent --show-error" # Exit status ERR=0 VERSION="<?php echo get_version(); ?> " echo "BaseURL is ${BASEURL}" echo "Retrieving munkireport scripts" cd ${MUNKIPATH} $CURL "${TPL_BASE}{preflight,postflight,report_broken_client}" --remote-name --remote-name --remote-name \ && $CURL "${TPL_BASE}reportcommon" -o "${MUNKIPATH}munkilib/reportcommon.py" \ && $CURL "${TPL_BASE}phpserialize" -o "${MUNKIPATH}munkilib/phpserialize.py" if [ "${?}" != 0 ] then echo "Failed to download all required components!"
<?php define('VERSION_STATIC', '1.14'); function get_version() { date_default_timezone_set('UTC'); $root_dir = dirname(dirname(__FILE__)); if (is_dir("{$root_dir}/.git") && file_exists("{$root_dir}/.git/refs/heads/master")) { $suffix = substr(trim(file_get_contents("{$root_dir}/.git/refs/heads/master")), 0, 7); return VERSION_STATIC . ".{$suffix}"; } return VERSION_STATIC; } define('VERSION', get_version());
/** * Upgrades Elgg * */ function version_upgrade() { $dbversion = (int) datalist_get('version'); // No version number? Oh snap...this is an upgrade from a clean installation < 1.7. // Run all upgrades without error reporting and hope for the best. // See http://trac.elgg.org/elgg/ticket/1432 for more. $quiet = !$dbversion; // Upgrade database if (db_upgrade($dbversion, '', $quiet)) { system_message(elgg_echo('upgrade:db')); } // Upgrade core if (upgrade_code($dbversion, $quiet)) { system_message(elgg_echo('upgrade:core')); } // Now we trigger an event to give the option for plugins to do something $upgrade_details = new stdClass(); $upgrade_details->from = $dbversion; $upgrade_details->to = get_version(); trigger_elgg_event('upgrade', 'upgrade', $upgrade_details); // Update the version datalist_set('version', get_version()); }
if (isset($site_mods[$mod])) { if (file_exists(NV_ROOTDIR . "/modules/" . $site_mods[$mod]['module_file'] . "/language/admin_" . NV_LANG_INTERFACE . ".php")) { include NV_ROOTDIR . "/modules/" . $site_mods[$mod]['module_file'] . "/language/admin_" . NV_LANG_INTERFACE . ".php"; } elseif (file_exists(NV_ROOTDIR . "/modules/" . $site_mods[$mod]['module_file'] . "/language/admin_" . NV_LANG_DATA . ".php")) { include NV_ROOTDIR . "/modules/" . $site_mods[$mod]['module_file'] . "/language/admin_" . NV_LANG_DATA . ".php"; } elseif (file_exists(NV_ROOTDIR . "/modules/" . $site_mods[$mod]['module_file'] . "/language/admin_en.php")) { include NV_ROOTDIR . "/modules/" . $site_mods[$mod]['module_file'] . "/language/admin_en.php"; } } return $lang_module; } $info = array(); if (defined('NV_IS_GODADMIN')) { $field = array(); $field[] = array('key' => $lang_module['version_user'], 'value' => $global_config['version']); $new_version = get_version(28800); //kem tra lai sau 8 tieng if ($new_version != false) { if (nv_version_compare($global_config['version'], $new_version->version) < 0) { $field[] = array('key' => $lang_module['version_news'], 'value' => (string) $new_version->version); } } $caption = "<a href=\"" . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=settings&" . NV_OP_VARIABLE . "=checkupdate\">" . $lang_module['checkversion'] . "</a>"; $info[] = array('caption' => $caption, 'field' => $field); } foreach ($site_mods as $mod => $value) { if (file_exists(NV_ROOTDIR . "/modules/" . $value['module_file'] . "/siteinfo.php")) { $siteinfo = array(); $mod_data = $value['module_data']; include NV_ROOTDIR . "/modules/" . $value['module_file'] . "/siteinfo.php"; if (!empty($siteinfo)) {
<?php // Disallow direct access to this file for security reasons if (!defined("IN_MYBB")) { die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined."); } $page->add_breadcrumb_item("CloudFlare Manager", "index.php?module=cloudflare"); $page->add_breadcrumb_item("Change Log", "index.php?module=cloudflare-change_log"); $page->output_header("CloudFlare Manager - Change Log For Version " . get_version()); $version = str_replace(" ", "", get_version()); $changelog = @file_get_contents("http://cf.mybbsecurity.net/changelog/" . $version); if ($changelog) { echo nl2br($changelog); } else { echo "Error: Cannot find change log for version " . get_version() . "."; } $page->output_footer();
/** * iZAP izap_videos * * @package Elgg videotizer, by iZAP Web Solutions. * @license GNU Public License version 3 * @Contact iZAP Team "<*****@*****.**>" * @Founder Tarun Jangra "<*****@*****.**>" * @link http://www.izap.in/ * */ $limit = $vars['entity']->num_display; $limit = $limit ? $limit : 5; $options['type'] = 'object'; $options['subtype'] = 'izap_videos'; $options['limit'] = $limit; if ((double) get_version(true) <= 1.6) { $videos = get_entities($options['type'], $options['subtype'], 0, '', $options['subtype']); } else { $videos = elgg_get_entities($options); } if ($videos) { foreach ($videos as $video) { echo elgg_view('izap_videos/widgetListing', array('entity' => $video)); } } if (is_old_elgg()) { ?> <script type="text/javascript"> $(document).ready(function() { $(".izap_ajaxed_thumb").click(function() { $("#load_video_" + this.rel).attr('style', '');
/** * Returns if the Elgg system meets the plugin's dependency * requirements. This includes both requires and conflicts. * * Full reports can be requested. The results are returned * as an array of arrays in the form array( * 'type' => requires|conflicts, * 'dep' => array( dependency array ), * 'status' => bool if depedency is met, * 'comment' => optional comment to display to the user. * ) * * @param bool $full_report Return a full report. * @return bool|array */ public function checkDependencies($full_report = false) { // Note: $conflicts and $requires are not unused. They're called dynamically $requires = $this->getManifest()->getRequires(); $conflicts = $this->getManifest()->getConflicts(); $enabled_plugins = elgg_get_plugins('active'); $this_id = $this->getID(); $report = array(); // first, check if any active plugin conflicts with us. foreach ($enabled_plugins as $plugin) { $temp_conflicts = array(); $temp_manifest = $plugin->getManifest(); if ($temp_manifest instanceof ElggPluginManifest) { $temp_conflicts = $plugin->getManifest()->getConflicts(); } foreach ($temp_conflicts as $conflict) { if ($conflict['type'] == 'plugin' && $conflict['name'] == $this_id) { $result = $this->checkDepPlugin($conflict, $enabled_plugins, false); // rewrite the conflict to show the originating plugin $conflict['name'] = $plugin->getManifest()->getName(); if (!$full_report && !$result['status']) { $this->errorMsg = "Conflicts with plugin \"{$plugin->getManifest()->getName()}\"."; return $result['status']; } else { $report[] = array('type' => 'conflicted', 'dep' => $conflict, 'status' => $result['status'], 'value' => $this->getManifest()->getVersion()); } } } } $check_types = array('requires', 'conflicts'); if ($full_report) { // Note: $suggests is not unused. It's called dynamically $suggests = $this->getManifest()->getSuggests(); $check_types[] = 'suggests'; } foreach ($check_types as $dep_type) { $inverse = $dep_type == 'conflicts' ? true : false; foreach (${$dep_type} as $dep) { switch ($dep['type']) { case 'elgg_version': $result = $this->checkDepElgg($dep, get_version(), $inverse); break; case 'elgg_release': $result = $this->checkDepElgg($dep, get_version(true), $inverse); break; case 'plugin': $result = $this->checkDepPlugin($dep, $enabled_plugins, $inverse); break; case 'priority': $result = $this->checkDepPriority($dep, $enabled_plugins, $inverse); break; case 'php_extension': $result = $this->checkDepPhpExtension($dep, $inverse); break; case 'php_ini': $result = $this->checkDepPhpIni($dep, $inverse); break; } // unless we're doing a full report, break as soon as we fail. if (!$full_report && !$result['status']) { $this->errorMsg = "Missing dependencies."; return $result['status']; } else { // build report element and comment $report[] = array('type' => $dep_type, 'dep' => $dep, 'status' => $result['status'], 'value' => $result['value']); } } } if ($full_report) { // add provides to full report $provides = $this->getManifest()->getProvides(); foreach ($provides as $provide) { $report[] = array('type' => 'provides', 'dep' => $provide, 'status' => true, 'value' => ''); } return $report; } return true; }
if (!isset($import_handle)) { $import_handle = ""; } $package_size = 1048576; switch ($task) { case "get_sql": get_sql_dump(); break; case "get_sql_file": get_sql_file($filename, $position); break; case "put_sql": put_sql($import_handle); break; case "get_version": get_version($version); break; case "get_config": get_config(); break; case "get_category_tree": get_category_tree(); break; case "run_indexer": run_indexer(); break; case "get_include_tables_exists": get_include_tables_exists(); break; case "get_var_from_script": echo handle_dirs($vars_main_dir, $vars_names);
/** * This function checks a plugin manifest 'elgg_version' value against the current install * returning TRUE if the elgg_version is <= the current install's version. * @param $manifest_elgg_version_string The build version (eg 2009010201). * @return bool */ function check_plugin_compatibility($manifest_elgg_version_string) { $version = get_version(); if (strpos($manifest_elgg_version_string, '.') === false) { // Using version $req_version = (int) $manifest_elgg_version_string; return $version >= $req_version; } return false; }
/** * Sends a notice about deprecated use of a function, view, etc. * * This function either displays or logs the deprecation message, * depending upon the deprecation policies in {@link CODING.txt}. * Logged messages are sent with the level of 'WARNING'. Only admins * get visual deprecation notices. When non-admins are logged in, the * notices are sent to PHP's log through elgg_dump(). * * A user-visual message will be displayed if $dep_version is greater * than 1 minor releases lower than the current Elgg version, or at all * lower than the current Elgg major version. * * @note This will always at least log a warning. Don't use to pre-deprecate things. * This assumes we are releasing in order and deprecating according to policy. * * @see CODING.txt * * @param string $msg Message to log / display. * @param string $dep_version Human-readable *release* version: 1.7, 1.8, ... * @param int $backtrace_level How many levels back to display the backtrace. * Useful if calling from functions that are called * from other places (like elgg_view()). Set to -1 * for a full backtrace. * * @return bool * @since 1.7.0 */ function elgg_deprecated_notice($msg, $dep_version, $backtrace_level = 1) { // if it's a major release behind, visual and logged // if it's a 1 minor release behind, visual and logged // if it's for current minor release, logged. // bugfixes don't matter because we are not deprecating between them if (!$dep_version) { return false; } $elgg_version = get_version(true); $elgg_version_arr = explode('.', $elgg_version); $elgg_major_version = (int) $elgg_version_arr[0]; $elgg_minor_version = (int) $elgg_version_arr[1]; $dep_major_version = (int) $dep_version; $dep_minor_version = 10 * ($dep_version - $dep_major_version); $visual = false; if ($dep_major_version < $elgg_major_version || $dep_minor_version < $elgg_minor_version) { $visual = true; } $msg = "Deprecated in {$dep_major_version}.{$dep_minor_version}: {$msg}"; if ($visual && elgg_is_admin_logged_in()) { register_error($msg); } // Get a file and line number for the log. Never show this in the UI. // Skip over the function that sent this notice and see who called the deprecated // function itself. $msg .= " Called from "; $stack = array(); $backtrace = debug_backtrace(); // never show this call. array_shift($backtrace); $i = count($backtrace); foreach ($backtrace as $trace) { $stack[] = "[#{$i}] {$trace['file']}:{$trace['line']}"; $i--; if ($backtrace_level > 0) { if ($backtrace_level <= 1) { break; } $backtrace_level--; } } $msg .= implode("<br /> -> ", $stack); elgg_dump($msg, elgg_is_admin_logged_in(), 'WARNING'); return true; }
<?php /** * Elgg ICAL output pageshell * * @package Elgg * @subpackage Core * */ header("Content-Type: text/calendar"); echo $vars['body']; ?> BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Curverider Ltd//NONSGML Elgg <?php echo get_version(true); ?> //EN <?php echo $vars['body']; ?> END:VCALENDAR
/** * Sends a notice about deprecated use of a function, view, etc. * * This function either displays or logs the deprecation message, * depending upon the deprecation policies in {@link CODING.txt}. * Logged messages are sent with the level of 'WARNING'. * * A user-visual message will be displayed if $dep_version is greater * than 1 minor releases lower than the current Elgg version, or at all * lower than the current Elgg major version. * * @note This will always at least log a warning. Don't use to pre-deprecate things. * This assumes we are releasing in order and deprecating according to policy. * * @see CODING.txt * * @param str $msg Message to log / display. * @param str $dep_version Human-readable *release* version: 1.7, 1.7.3 * * @return bool * @since 1.7.0 */ function elgg_deprecated_notice($msg, $dep_version) { // if it's a major release behind, visual and logged // if it's a 1 minor release behind, visual and logged // if it's for current minor release, logged. // bugfixes don't matter because you're not deprecating between them, RIGHT? if (!$dep_version) { return FALSE; } $elgg_version = get_version(TRUE); $elgg_version_arr = explode('.', $elgg_version); $elgg_major_version = (int) $elgg_version_arr[0]; $elgg_minor_version = (int) $elgg_version_arr[1]; $dep_major_version = (int) $dep_version; $dep_minor_version = 10 * ($dep_version - $dep_major_version); $visual = FALSE; if ($dep_major_version < $elgg_major_version || $dep_minor_version < $elgg_minor_version) { $visual = TRUE; } $msg = "Deprecated in {$dep_major_version}.{$dep_minor_version}: {$msg}"; if ($visual) { register_error($msg); } // Get a file and line number for the log. Never show this in the UI. // Skip over the function that sent this notice and see who called the deprecated // function itself. $backtrace = debug_backtrace(); $caller = $backtrace[1]; $msg .= " (Called from {$caller['file']}:{$caller['line']})"; elgg_log($msg, 'WARNING'); return TRUE; }
<?php include_once "includes/includes.php"; checkauthentication(); $session_name = "Kh41r4"; $p = @$_GET['p']; $dekripsi = dekripsi($p); $get = explode("&", $dekripsi); $p = $get[0]; $errmsg = @$_SESSION['errmsg']; $slevel = @$_SESSION['xlevel_' . $session_name]; $susername = @$_SESSION['xusername_' . $session_name]; $snama = @$_SESSION['xnama_' . $session_name]; $sunit = @$_SESSION['xunit_' . $session_name]; $title = get_title(); $version = get_version(); $copyright = get_copyright(); $q = ekstrak_get(@$get[1]); $id = ekstrak_get(@$get[2]); $NoSurat = ekstrak_get(@$get[3]); $Perihal = ekstrak_get(@$get[4]); $BeritaFlag = ekstrak_get(@$get[5]); $StatusDisposisi = ekstrak_get(@$get[6]); $kotaksuratlist = 27; $xlevel = @$_SESSION['xlevel_' . $session_name]; $IdUser = @$_SESSION['xusername_' . $session_name]; $KdSatker = @$_SESSION['xunit_' . $session_name]; ?> <html id="minwidth"> <head>
/** * Initialize the site including site entity, plugins, and configuration * * @param array $submissionVars Submitted vars * * @return bool */ protected function saveSiteSettings($submissionVars) { global $CONFIG; // ensure that file path, data path, and www root end in / $submissionVars['path'] = sanitise_filepath($submissionVars['path']); $submissionVars['dataroot'] = sanitise_filepath($submissionVars['dataroot']); $submissionVars['wwwroot'] = sanitise_filepath($submissionVars['wwwroot']); $site = new ElggSite(); $site->name = $submissionVars['sitename']; $site->url = $submissionVars['wwwroot']; $site->access_id = ACCESS_PUBLIC; $site->email = $submissionVars['siteemail']; $guid = $site->save(); if (!$guid) { register_error(elgg_echo('install:error:createsite')); return FALSE; } // bootstrap site info $CONFIG->site_guid = $guid; $CONFIG->site = $site; datalist_set('installed', time()); datalist_set('path', $submissionVars['path']); datalist_set('dataroot', $submissionVars['dataroot']); datalist_set('default_site', $site->getGUID()); datalist_set('version', get_version()); datalist_set('simplecache_enabled', 1); datalist_set('system_cache_enabled', 1); // new installations have run all the upgrades $upgrades = elgg_get_upgrade_files($submissionVars['path'] . 'engine/lib/upgrades/'); datalist_set('processed_upgrades', serialize($upgrades)); set_config('view', 'default', $site->getGUID()); set_config('language', 'en', $site->getGUID()); set_config('default_access', $submissionVars['siteaccess'], $site->getGUID()); set_config('allow_registration', TRUE, $site->getGUID()); set_config('walled_garden', FALSE, $site->getGUID()); set_config('allow_user_default_access', '', $site->getGUID()); $this->enablePlugins(); return TRUE; }
/** * function to upload a profile icon on register of a user * * @param $user * @return unknown_type */ function add_profile_icon($user) { $topbar = get_resized_image_from_uploaded_file('profile_icon', 16, 16, true); $tiny = get_resized_image_from_uploaded_file('profile_icon', 25, 25, true); $small = get_resized_image_from_uploaded_file('profile_icon', 40, 40, true); $medium = get_resized_image_from_uploaded_file('profile_icon', 100, 100, true); $large = get_resized_image_from_uploaded_file('profile_icon', 200, 200); $master = get_resized_image_from_uploaded_file('profile_icon', 550, 550); $prefix = $user->guid; $cur_version = get_version(); if ($cur_version < 2010071002) { $prefix = $user->name; } if ($small !== false && $medium !== false && $large !== false && $tiny !== false) { $filehandler = new ElggFile(); $filehandler->owner_guid = $user->getGUID(); $filehandler->setFilename("profile/" . $prefix . "large.jpg"); $filehandler->open("write"); $filehandler->write($large); $filehandler->close(); $filehandler->setFilename("profile/" . $prefix . "medium.jpg"); $filehandler->open("write"); $filehandler->write($medium); $filehandler->close(); $filehandler->setFilename("profile/" . $prefix . "small.jpg"); $filehandler->open("write"); $filehandler->write($small); $filehandler->close(); $filehandler->setFilename("profile/" . $prefix . "tiny.jpg"); $filehandler->open("write"); $filehandler->write($tiny); $filehandler->close(); $filehandler->setFilename("profile/" . $prefix . "topbar.jpg"); $filehandler->open("write"); $filehandler->write($topbar); $filehandler->close(); $filehandler->setFilename("profile/" . $prefix . "master.jpg"); $filehandler->open("write"); $filehandler->write($master); $filehandler->close(); $user->icontime = time(); } }
// Work out number of users if (!subsite_manager_on_subsite()) { $users_stats = get_number_users(); $total_users = get_number_users(true); $users = $users_stats . " " . elgg_echo('active') . " / " . $total_users . " " . elgg_echo('total'); } else { $site = elgg_get_site_entity(); $options = array("type" => "user", "site_guids" => false, "count" => true); $users_stats = $site->getMembers($options); $users_pending = (int) $site->countMembershipRequests(); $users = $users_stats . " " . elgg_echo("active") . " / " . $users_pending . " " . elgg_echo('admin:users:membership'); } // Get version information $version = get_version(); $release = get_version(true); ?> <table class="elgg-table-alt"> <tr class="odd"> <td><b><?php echo elgg_echo('admin:statistics:label:version'); ?> :</b></td> <td><?php echo elgg_echo('admin:statistics:label:version:release'); ?> - <?php echo $release; ?> , <?php echo elgg_echo('admin:statistics:label:version:version');
$version = get_version(); $local_v = mysqli_fetch_array(mysqli_query($con, 'SELECT setting FROM tc_conf WHERE uid=1'))[0]; $file_list = get_update_file(); if (isset($_POST['confirm'])) { if (!($version == $local_v)) { if ($file_list[0] !== '') { $file_content = array(); for ($i = 0; $i < count($file_list); $i++) { $file_content[$i] = get_file_content('https://raw.githubusercontent.com/racaljk/tieba_cloud/master/' . $file_list[$i]); $url = dirname(dirname(__FILE__)) . "\\" . str_replace('/', "\\", $file_list[$i]); $fp = fopen($url, 'w'); fwrite($fp, $file_content[$i]); fclose($fp); $fp_v = fopen('ver.php', 'w'); $content = '<?php define("TC_VER","' . get_version() . '")?>'; fwrite($fp_v, $content); fclose($fp_v); } header('location:../index.php'); } } } ?> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"><meta charset="utf-8"> <title>Tieba Cloud - Update</title><meta name="generator" content="Bootply" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <link href="../stylesheets/bootstrap.min.css" rel="stylesheet"><link href="../stylesheets/styles.css" rel="stylesheet"> </head> <body><div class="modal show" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog"> <div class="modal-content"><div class="modal-header"><h1 class="text-center">贴吧云 - 更新</h1></div> <div class="modal-body"><div class="jumbotron">
/** * This function checks a plugin manifest 'elgg_version' value against the current install * returning TRUE if the elgg_version is >= the current install's version. * * @deprecated 1.8 Use ElggPlugin->canActivate() * * @param string $manifest_elgg_version_string The build version (eg 2009010201). * @return bool */ function check_plugin_compatibility($manifest_elgg_version_string) { elgg_deprecated_notice('check_plugin_compatibility() is deprecated by ElggPlugin->canActivate()', 1.8); $version = get_version(); if (strpos($manifest_elgg_version_string, '.') === false) { // Using version $req_version = (int) $manifest_elgg_version_string; return $version >= $req_version; } return false; }
<?php /* Don't remove this line */ if (!defined('XOOPS_ROOT_PATH')) { exit; } /* This file sets various arrays and variables for use in WordPress */ # WordPress version $GLOBALS['wp_version'] = 'ME for XOOPS ' . get_version(); # BBcode search and replace arrays $GLOBALS['wp_bbcode']['in'] = array('#\\[b](.+?)\\[/b]#is', '#\\[i](.+?)\\[/i]#is', '#\\[u](.+?)\\[/u]#is', '#\\[s](.+?)\\[/s]#is', '#\\[color=(.+?)](.+?)\\[/color]#is', '#\\[size=(.+?)](.+?)\\[/size]#is', '#\\[font=(.+?)](.+?)\\[/font]#is', '#\\[img](.+?)\\[/img]#is', '#\\[url](.+?)\\[/url]#is', '#\\[url=(.+?)](.+?)\\[/url]#is'); $GLOBALS['wp_bbcode']['out'] = array('<strong>$1</strong>', '<em>$1</em>', '<span style="text-decoration:underline">$1</span>', '<span style="text-decoration:line-through">$1</span>', '<span style="color:$1">$2</span>', '<span style="font-size:$1px">$2</span>', '<span style="font-family:$1">$2</span>', '<img src="$1" alt="" />', '<a href="$1">$1</a>', '<a href="$1" title="$2">$2</a>'); # GreyMatter formatting search and replace arrays $GLOBALS['wp_gmcode']['in'] = array('#\\*\\*(.+?)\\*\\*#is', '#\\\\(.+?)\\\\#is', '#\\__(.+?)\\__#is'); $GLOBALS['wp_gmcode']['out'] = array('<strong>$1</strong>', '<em>$1</em>', '<span style="text-decoration:underline">$1</span>'); # Translation of HTML entities and special characters $GLOBALS['wp_htmltrans'] = array_flip(get_html_translation_table(HTML_ENTITIES)); $GLOBALS['wp_htmltrans']['<'] = '<'; # preserve HTML $GLOBALS['wp_htmltrans']['>'] = '>'; # preserve HTML $wp_htmltransbis = array('–' => '–', '—' => '—', '‘' => '‘', '’' => '’', '“' => '“', '”' => '”', '•' => '•', '€' => '€', '<' => '<', '>' => '>', '&' => '&', '&sp;' => ' ', '!' => '!', '"' => '"', '#' => '#', '$' => '$', '%' => '%', ''' => ''', '(' => '(', ')' => ')', '*' => '*', '+' => '+', ',' => ',', '‐' => '-', '−' => '-', '.' => '.', '/' => '/', ':' => ':', ';' => ';', '<' => '<', '=' => '=', '>' => '>', '?' => '?', '@' => '@', '[' => '[', '\' => '\', ']' => ']', 'ˆ' => '^', '_' => '_', '―' => '_', '`' => '`', '{' => '{', '|' => '|', '}' => '}', '˜' => '~', '‚' => '‚', '„' => '„', '&ldots;' => '…', 'Š' => 'Š', '‹' => '‹', 'Œ' => 'Œ', '‘' => '‘', '’' => '‘', '’' => '’', '“' => '“', '”' => '“', '”' => '”', '•' => '•', '–' => '–', '&endash;' => '–', '—' => '—', '&emdash;' => '—', '˜' => '˜', '™' => '™', 'š' => 'š', '›' => '›', 'œ' => 'œ', 'Ÿ' => 'Ÿ', ' ' => ' ', '¡' => '¡', '¢' => '¢', '£' => '£', '¤' => '¤', '¥' => '¥', '¦' => '¦', '&brkbar;' => '¦', '§' => '§', '¨' => '¨', '¨' => '¨', '©' => '©', 'ª' => 'ª', '«' => '«', '¬' => '¬', '­' => '­', '®' => '®', '¯' => '¯', '&hibar;' => '¯', '°' => '°', '±' => '±', '²' => '²', '³' => '³', '´' => '´', 'µ' => 'µ', '¶' => '¶', '·' => '·', '¸' => '¸', '¹' => '¹', 'º' => 'º', '»' => '»', '¼' => '¼', '½' => '½', '½' => '½', '¾' => '¾', '¿' => '¿', 'À' => 'À', 'Á' => 'Á', 'Â' => 'Â', 'Ã' => 'Ã', 'Ä' => 'Ä', 'Å' => 'Å', 'Æ' => 'Æ', 'Ç' => 'Ç', 'È' => 'È', 'É' => 'É', 'Ê' => 'Ê', 'Ë' => 'Ë', 'Ì' => 'Ì', 'Í' => 'Í', 'Î' => 'Î', 'Ï' => 'Ï', 'Ð' => 'Ð', 'Ñ' => 'Ñ', 'Ò' => 'Ò', 'Ó' => 'Ó', 'Ô' => 'Ô', 'Õ' => 'Õ', 'Ö' => 'Ö', '×' => '×', 'Ø' => 'Ø', 'Ù' => 'Ù', 'Ú' => 'Ú', 'Û' => 'Û', 'Ü' => 'Ü', 'Ý' => 'Ý', 'Þ' => 'Þ', 'ß' => 'ß', 'à' => 'à', 'á' => 'á', 'â' => 'â', 'ã' => 'ã', 'ä' => 'ä', 'å' => 'å', 'æ' => 'æ', 'ç' => 'ç', 'è' => 'è', 'é' => 'é', 'ê' => 'ê', 'ë' => 'ë', 'ì' => 'ì', 'í' => 'í', 'î' => 'î', 'ï' => 'ï', 'ð' => 'ð', 'ñ' => 'ñ', 'ò' => 'ò', 'ó' => 'ó', 'ô' => 'ô', 'õ' => 'õ', 'ö' => 'ö', '÷' => '÷', 'ø' => 'ø', 'ù' => 'ù', 'ú' => 'ú', 'û' => 'û', 'ü' => 'ü', 'ý' => 'ý', 'þ' => 'þ', 'ÿ' => 'ÿ', 'Œ' => 'Œ', 'œ' => 'œ', 'Š' => 'Š', 'š' => 'š', 'Ÿ' => 'Ÿ', 'ƒ' => 'ƒ', 'ˆ' => 'ˆ', '˜' => '˜', 'Α' => 'Α', 'Β' => 'Β', 'Γ' => 'Γ', 'Δ' => 'Δ', 'Ε' => 'Ε', 'Ζ' => 'Ζ', 'Η' => 'Η', 'Θ' => 'Θ', 'Ι' => 'Ι', 'Κ' => 'Κ', 'Λ' => 'Λ', 'Μ' => 'Μ', 'Ν' => 'Ν', 'Ξ' => 'Ξ', 'Ο' => 'Ο', 'Π' => 'Π', 'Ρ' => 'Ρ', 'Σ' => 'Σ', 'Τ' => 'Τ', 'Υ' => 'Υ', 'Φ' => 'Φ', 'Χ' => 'Χ', 'Ψ' => 'Ψ', 'Ω' => 'Ω', 'α' => 'α', 'β' => 'β', 'γ' => 'γ', 'δ' => 'δ', 'ε' => 'ε', 'ζ' => 'ζ', 'η' => 'η', 'θ' => 'θ', 'ι' => 'ι', 'κ' => 'κ', 'λ' => 'λ', 'μ' => 'μ', 'ν' => 'ν', 'ξ' => 'ξ', 'ο' => 'ο', 'π' => 'π', 'ρ' => 'ρ', 'ς' => 'ς', 'σ' => 'σ', 'τ' => 'τ', 'υ' => 'υ', 'φ' => 'φ', 'χ' => 'χ', 'ψ' => 'ψ', 'ω' => 'ω', 'ϑ' => 'ϑ', 'ϒ' => 'ϒ', 'ϖ' => 'ϖ', ' ' => ' ', ' ' => ' ', ' ' => ' ', '‌' => '‌', '‍' => '‍', '‎' => '‎', '‏' => '‏', '–' => '–', '—' => '—', '‘' => '‘', '’' => '’', '‚' => '‚', '“' => '“', '”' => '”', '„' => '„', '†' => '†', '‡' => '‡', '•' => '•', '…' => '…', '‰' => '‰', '′' => '′', '″' => '″', '‹' => '‹', '›' => '›', '‾' => '‾', '⁄' => '⁄', '€' => '€', 'ℑ' => 'ℑ', '℘' => '℘', 'ℜ' => 'ℜ', '™' => '™', 'ℵ' => 'ℵ', '←' => '←', '↑' => '↑', '→' => '→', '↓' => '↓', '↔' => '↔', '↵' => '↵', '⇐' => '⇐', '⇑' => '⇑', '⇒' => '⇒', '⇓' => '⇓', '⇔' => '⇔', '∀' => '∀', '∂' => '∂', '∃' => '∃', '∅' => '∅', '∇' => '∇', '∈' => '∈', '∉' => '∉', '∋' => '∋', '∏' => '∏', '∑' => '∑', '−' => '−', '∗' => '∗', '√' => '√', '∝' => '∝', '∞' => '∞', '∠' => '∠', '∧' => '∧', '∨' => '∨', '∩' => '∩', '∪' => '∪', '∫' => '∫', '∴' => '∴', '∼' => '∼', '≅' => '≅', '≈' => '≈', '≠' => '≠', '≡' => '≡', '≤' => '≤', '≥' => '≥', '⊂' => '⊂', '⊃' => '⊃', '⊄' => '⊄', '⊆' => '⊆', '⊇' => '⊇', '⊕' => '⊕', '⊗' => '⊗', '⊥' => '⊥', '⋅' => '⋅', '⌈' => '⌈', '⌉' => '⌉', '⌊' => '⌊', '⌋' => '⌋', '⟨' => '〈', '⟩' => '〉', '◊' => '◊', '♠' => '♠', '♣' => '♣', '♥' => '♥', '♦' => '♦'); $GLOBALS['wp_htmltrans'] = array_merge($GLOBALS['wp_htmltrans'], $wp_htmltransbis); # Translation of invalid Unicode references range to valid range $GLOBALS['wp_htmltranswinuni'] = array('€' => '€', '' => '', '‚' => '‚', 'ƒ' => 'ƒ', '„' => '„', '…' => '…', '†' => '†', '‡' => '‡', 'ˆ' => 'ˆ', '‰' => '‰', 'Š' => 'Š', '‹' => '‹', 'Œ' => 'Œ', '' => '', 'Ž' => 'ž', '' => '', '' => '', '‘' => '‘', '’' => '’', '“' => '“', '”' => '”', '•' => '•', '–' => '–', '—' => '—', '˜' => '˜', '™' => '™', 'š' => 'š', '›' => '›', 'œ' => 'œ', '' => '', 'ž' => '', 'Ÿ' => 'Ÿ'); # on which page are we ? $GLOBALS['PHP_SELF'] = $_SERVER['PHP_SELF']; $GLOBALS['pagenow'] = explode('/', $GLOBALS['PHP_SELF']); $GLOBALS['pagenow'] = trim($GLOBALS['pagenow'][sizeof($GLOBALS['pagenow']) - 1]); $GLOBALS['pagenow'] = explode('?', $GLOBALS['pagenow']); $GLOBALS['pagenow'] = $GLOBALS['pagenow'][0];
function elgg_solr_is_elgg18() { if (is_callable('elgg_get_version')) { return false; // this is newer than 1.8 } $is_elgg18 = strpos(get_version(true), '1.8') === 0; return $is_elgg18; }
/** * Upgrades Elgg * */ function version_upgrade() { $dbversion = (int) datalist_get('version'); // Upgrade database db_upgrade($dbversion); system_message(elgg_echo('upgrade:db')); // Upgrade core if (upgrade_code($dbversion)) { system_message(elgg_echo('upgrade:core')); } // Update the version datalist_set('version', get_version()); }