Пример #1
0
function send_file($file_name, $file_path)
{
    @session_write_close();
    header("Cache-Control: no-cache, must-revalidate");
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    if (get_user_os() == "MAC") {
        header("Content-Type: application/x-unknown\n");
        header("Content-Disposition: attachment; filename=\"" . $file_name . "\"\n");
    } elseif (get_browser_info() == "MSIE") {
        $disposition = !preg_match("/\\.zip\$/i", $file_name) ? 'attachment' : 'inline';
        header("Content-Disposition: {$disposition}; filename=\"" . $file_name . "\"\n");
        header("Content-Type: application/x-ms-download\n");
    } else {
        header("Content-Disposition: attachment; filename=\"" . $file_name . "\"\n");
        header("Content-Type: application/octet-stream\n");
    }
    $file_path = fix_file_path($file_path);
    if (!is_remote_file($file_path) && ($filesize = filesize($file_path)) > 0 && !@ini_get('zlib.output_compression') && !@ini_get('output_handler')) {
        header("Content-Length: " . $filesize . "\n\n");
    }
    @readfile($file_path);
}
Пример #2
0
if ($profiledata['user_posts'] != 0) {
    $total_posts = $config['max_posts'];
    $percentage = $total_posts ? min(100, $profiledata['user_posts'] / $total_posts * 100) : 0;
} else {
    $percentage = 0;
}
// Mighty Gorgon - Thanks Received - BEGIN
$total_thanks_received = 0;
if ($config['show_thanks_profile'] && empty($config['disable_likes_posts'])) {
    $total_thanks_received = user_get_thanks_received($profiledata['user_id']);
    $template->assign_block_vars('show_thanks_profile', array());
}
// Mighty Gorgon - Thanks Received - END
// Mighty Gorgon - HTTP AGENTS - BEGIN
include IP_ROOT_PATH . 'includes/functions_mg_http.' . PHP_EXT;
$user_os = get_user_os($profiledata['user_browser']);
$user_browser = get_user_browser($profiledata['user_browser']);
// Mighty Gorgon - HTTP AGENTS - END
// Mighty Gorgon - Full Album Pack - BEGIN
if (!empty($config['plugins']['album']['enabled'])) {
    include IP_ROOT_PATH . PLUGINS_PATH . $config['plugins']['album']['dir'] . 'common.' . PHP_EXT;
    include IP_ROOT_PATH . PLUGINS_PATH . $config['plugins']['album']['dir'] . 'includes/album_functions_profile.' . PHP_EXT;
    album_profile_last_pictures($profiledata);
}
// Mighty Gorgon - Full Album Pack - END
$avatar_img = user_get_avatar($profiledata['user_id'], $profiledata['user_level'], $profiledata['user_avatar'], $profiledata['user_avatar_type'], $profiledata['user_allowavatar']);
// Mighty Gorgon - Multiple Ranks - BEGIN
$user_ranks = generate_ranks($profiledata, $ranks_array);
// Mighty Gorgon - Multiple Ranks - END
// ONLINE OFFLINE - BEGIN
$user_online_status = 'offline';
Пример #3
0
 function log_request($url, $prev)
 {
     global $session;
     $sql = sprintf("insert into `User Request Dimension` (`User Key`,`Session Key`,`Date`,`URL`,`Previous URL`,`IP`,`OS`,`Browser`) values (%d,%d,%s,%s,%s,%s,%s,%s)", $this->id, $session->data['Session Key'], prepare_mysql(gmdate('Y-m-d H:i:s')), prepare_mysql($url), prepare_mysql($prev), prepare_mysql(ip()), prepare_mysql(get_user_os($_SERVER['HTTP_USER_AGENT'])), prepare_mysql(get_user_browser($_SERVER['HTTP_USER_AGENT'])));
     $this->mysqli->query($sql);
     $this->update_request_data();
 }
Пример #4
0
    }
    if (!empty($error_log)) {
        $msg = "<p><b>" . $lang['backup_restore_error'] . "</b></p>";
        $msg .= "<ol>";
        foreach ($error_log as $val) {
            $msg .= sprintf("<li>%s</li>", $val);
        }
        $msg .= "</ol>";
    } else {
        $msg .= sprintf("<p><b>%s</b></p>", $lang['backup_restore_success']);
    }
    $action = "modifybackups";
}
if ($action == "makebackup") {
    $db_tables = $HTTP_POST_VARS['db_tables'];
    $crlf = get_user_os() == "WIN" ? "\r\n" : (get_user_os() == "MAC" ? "\r" : "\n");
    $tables_info = array();
    $db = get_mysql_version() >= 32306 ? "`{$db_name}`" : $db_name;
    $result = $site_db->query("SHOW TABLE STATUS FROM {$db}");
    if ($result) {
        while ($row = $site_db->fetch_array($result)) {
            $tables_info[$row['Name']] = isset($row['Type']) ? $row['Type'] : $row['Engine'];
        }
        $site_db->free_result($result);
    }
    ob_start();
    @ob_implicit_flush(0);
    echo "#----------------------------------------------------------" . $crlf;
    echo "# Database Backup for " . $config['site_name'] . $crlf;
    echo "# " . date("Y-m-d H:i") . $crlf;
    echo "#----------------------------------------------------------" . $crlf;
Пример #5
0
 echo "<body>\n";
 include_once 'api/analyticstracking.php';
 /*visited count*/
 mysql_query("UPDATE shortcut_list SET count = count+1 WHERE id = {$sid}");
 /*get basic information*/
 $result_name = mysql_query("SELECT name,count,tags FROM shortcut_list WHERE id = {$sid}");
 echo "\t<div class='box_header_hp'>\n";
 echo "\t\t<div class='return_sc'><a href='#'>" . $print_sc_text . "</a>&nbsp;&nbsp;<a href='index.php'>" . $return_text . "</a></div>\n";
 echo "\t\t<div class='header_hp'>\n";
 $row_name = mysql_fetch_array($result_name);
 echo "\t\t\t<h2>" . $row_name['name'] . "</h2>\n";
 tags_output($row_name['tags'], $tag_sc_text);
 echo "\t\t\t<div class='count_sc'><span>" . $visit_count_sc_text . $row_name['count'] . "</span></div>\n";
 echo "\t\t</div>\n\t</div>\n";
 /*os type */
 $os = get_user_os();
 $os_count_result = mysql_query("SELECT id FROM shortcut_data WHERE shortcut_id = {$sid} AND os LIKE '{$os}'");
 $os_count = mysql_num_rows($os_count_result);
 $group_sql = "SELECT DISTINCT(group_name) FROM shortcut_data WHERE shortcut_id = {$sid}";
 $group_os_sql = "SELECT DISTINCT(group_name) FROM shortcut_data WHERE shortcut_id = {$sid} AND os LIKE '{$os}'";
 /*get data by group*/
 $result = $os_count ? mysql_query($group_os_sql) : mysql_query($group_sql);
 if (mysql_num_rows($result)) {
     echo "\t<div><div class='content_sc'>\n";
     while ($row = mysql_fetch_array($result)) {
         $groupname = $row['group_name'];
         $group_data_sql = "SELECT function,key_input,recom FROM shortcut_data WHERE shortcut_id = {$sid} AND group_name LIKE '{$groupname}' ";
         $group_data_os_sql = "SELECT function,key_input,recom FROM shortcut_data WHERE shortcut_id = {$sid} AND os LIKE '{$os}' AND group_name LIKE '{$groupname}' ";
         echo "\t\t<div class='group_section_sc'><h3>" . $groupname . "</h3>\n";
         $result_data = $os_count ? mysql_query($group_data_os_sql) : mysql_query($group_data_sql);
         /*each group*/
Пример #6
0
$guest_users = 0;
$registered_users = 0;
$hidden_users = 0;

$reg_counter = 0;
$guest_counter = 0;
$prev_user = 0;
$session_ip_array = array();
foreach ($online_users as $row)
{
	$view_online = false;
	$is_auth_view = false;
	$forum_id = false;
	$topic_id = false;
	// Mighty Gorgon - HTTP AGENTS - BEGIN
	$user_os = get_user_os($row['session_browser']);
	$user_browser = get_user_browser($row['session_browser']);
	// Mighty Gorgon - HTTP AGENTS - END

	if ($row['session_logged_in'])
	{
		$user_id = $row['user_id'];

		if ($user_id != $prev_user)
		{
			$username = colorize_username($row['user_id'], $row['username'], $row['user_color'], $row['user_active']);

			if (!$row['user_allow_viewonline'])
			{
				$view_online = (($user->data['user_level'] == ADMIN) || ($user->data['user_id'] == $user_id)) ? true : false;
				$hidden_users++;