Beispiel #1
0
/**
 * returns a URL which javascript can connect to to accesss FireStats resources.
 * browser security prevents JavaScript from accessing hosts other than the one 
 * it was downloaded from.
 */
function fs_js_url($file, $suffix = "")
{
    // This is a work around browsers restricting javascript from accessing different hosts.
    // in wordpress, the Ajax url may be on a different host than the url of the blog.
    // so the browsers prevent javascript from accessing the ajax handler.
    // what happens here is that we redirect the ajax call through the origin page
    global $FS_CONTEXT;
    if (isset($FS_CONTEXT['JAVASCRIPT_URL'])) {
        return $FS_CONTEXT['JAVASCRIPT_URL'] . $file . "&" . fs_get_request_suffix($suffix, false);
    } else {
        return fs_url($file) . fs_get_request_suffix($suffix);
    }
}
Beispiel #2
0
function fs_get_country_flag_url($country_code, $is_int = false)
{
    if ($is_int && $country_code != NULL) {
        $c = chr($country_code >> 8 & 0xff) . chr($country_code & 0xff);
        $country_code = $c;
    }
    if (!$country_code) {
        return "";
    }
    $code = strtolower($country_code);
    $flag_url = fs_url("img/flags/{$code}.png");
    $name = fs_get_country_name($code);
    return fs_get_flag_img_tag($name, $flag_url);
}
Beispiel #3
0
				<input type="hidden" id="original_site_id" value="<?php 
echo isset($site_id) ? $site_id : fs_r('Automatic');
?>
"/>
				<input type="text" id="site_edit_id" onkeypress="$('fs_clear_site_id').style.display='inline'" onfocus="this.select()" value="<?php 
echo isset($site_id) ? $site_id : fs_r('Automatic');
?>
"/>
				<?php 
fs_create_wiki_help_link('SiteID');
?>
				<input id="fs_clear_site_id" style="display:none" type='image' title="<?php 
fs_e('Clear');
?>
" class='img_btn' src="<?php 
echo fs_url("img/clear.png");
?>
"
					onclick="FS.clearSiteID()"
				/>
			</td>
		</tr>
		<tr>
			<td><label for='site_edit_name'><?php 
fs_e('Name');
?>
</label></td>
			<td><input type="text" size='20' id="site_edit_name" value="<?php 
echo isset($site) ? $site->name : "";
?>
"/></td>
Beispiel #4
0
function fs_output_head()
{
    ?>
<link rel="stylesheet" href="<?php 
    echo fs_url('css/base.css');
    ?>
" type="text/css"/>
<link rel="stylesheet" href="<?php 
    echo fs_url('css/mktree.css.php');
    ?>
" type="text/css" />
<link rel="stylesheet" href="<?php 
    echo fs_url('lib/jscalendar-1.0/skins/aqua/theme.css');
    ?>
" type="text/css" />
<link rel="stylesheet" href="<?php 
    echo fs_url('lib/dhtml-windows/css/floating-window.css');
    ?>
" media="screen" type="text/css"/>

<?php 
    // AND HOW CAN WE GO WITHOUT SOME I.E SPECIFIC HACKS?!
    ?>
<!--[if lt IE 7]>
		<link rel="stylesheet" href="<?php 
    echo fs_url('css/ie6-hacks.css');
    ?>
" type="text/css" />
	<![endif]-->
<!--[if IE]>
	<link rel="stylesheet" href="<?php 
    echo fs_url('css/ie-hacks.css');
    ?>
" type="text/css" />
<![endif]-->

<script type="text/javascript">
<!--
	<?php 
    // Configure window buttons
    ?>
	var conf = new Object();
	conf.img_top_left = '<?php 
    echo fs_url('lib/dhtml-windows/images/top_left.gif');
    ?>
';
	conf.img_top_center = '<?php 
    echo fs_url('lib/dhtml-windows/images/top_center.gif');
    ?>
';
	conf.img_minimize = '<?php 
    echo fs_url('lib/dhtml-windows/images/minimize.gif');
    ?>
';
	conf.img_close = '<?php 
    echo fs_url('lib/dhtml-windows/images/close.gif');
    ?>
';
	conf.img_top_right = '<?php 
    echo fs_url('lib/dhtml-windows/images/top_right.gif');
    ?>
';
	conf.img_buttom_right = '<?php 
    echo fs_url('lib/dhtml-windows/images/bottom_right.gif');
    ?>
';
	conf.root = 'firestats';
//-->
</script>

<script type="text/javascript" src='<?php 
    echo fs_url('lib/dhtml-windows/js/ajax.js');
    ?>
'></script>
<script type="text/javascript" src='<?php 
    echo fs_url('lib/dhtml-windows/js/floating-window.js');
    ?>
'></script>
<script type="text/javascript" src='<?php 
    echo fs_url('js/prototype.js');
    ?>
'></script> 
<script type="text/javascript" src='<?php 
    echo fs_url('js/firestats.js.php') . fs_get_request_suffix();
    ?>
'></script>
<script type="text/javascript" src='<?php 
    echo fs_url('js/mktree.js');
    ?>
'></script>
<script type="text/javascript" src="<?php 
    echo fs_url('lib/jscalendar-1.0/calendar_stripped.js');
    ?>
"></script>
<script type="text/javascript" src="<?php 
    echo fs_url('lib/jscalendar-1.0/lang/calendar-en.js');
    ?>
"></script>
<script type="text/javascript" src="<?php 
    echo fs_url('lib/jscalendar-1.0/calendar-setup_stripped.js');
    ?>
"></script>
<?php 
}
Beispiel #5
0
			}
		}
	},
	'onLoad': function(argsObj) 
	{
//		/* Load the first tab */
//		argsObj.index = 0;
//		this.onClick(argsObj);
	}
}

//]]>
</script>

<script type="text/javascript" src="<?php 
echo fs_url('lib/tabber/tabber-minimized.js');
?>
">
</script>

<?php 
if (fs_db_valid()) {
    fs_output_send_info_form();
    ?>

<script type='text/javascript'>
//<![CDATA[
	// this is done here instead of sending an updated page in the first place
	// to improve startup time.
	updateAllStats();
	toggleAutoRefresh();
Beispiel #6
0
    $user = fs_get_current_user();
    if (isset($user->logged_in) && $user->logged_in) {
        ?>
		<button class="button" onclick="sendRequest('action=logout')">
			<?php 
        fs_e('Log out');
        ?>
		</button>
		<?php 
    }
    ?>
		</span>
	<?php 
}
$home = FS_HOMEPAGE;
echo "<a style='border-bottom: 0px' href='{$home}'><img alt='" . fs_r('FireStats') . "' src='" . fs_url("img/firestats-header.png") . "'/></a>";
echo '<span class="normal_font" style="padding-left:10px">';
echo sprintf("%s %s\n", FS_VERSION, fs_is_demo() ? fs_r('Demo') : '');
if (fs_is_admin()) {
    echo "<!-- Checking if there is a new FireStats version, if FireStats hangs refresh the page -->\n";
    flush();
    echo fs_get_latest_firestats_version_message() . "\n";
    echo "<!-- Checking if there is a new IP2Country database, if FireStats hangs refresh the page -->\n";
    flush();
    echo '<span id="new_ip2c_db_notification">' . fs_get_latest_ip2c_db_version_message() . "</span>";
}
echo '</span>';
?>
</h1>

Beispiel #7
0
            ?>
)'><?php 
            fs_e('Change password');
            ?>
</button>
		</td>
	</tr>
</table>
<?php 
        }
    } else {
        echo $instructions;
        ?>
</div>
<form action="<?php 
        fs_url("php/tools/reset-password.php?show");
        ?>
"
	method="POST">
<table>
	<tr>
		<td><label for='username'><?php 
        fs_e('User name');
        ?>
</label></td>
		<td><input id='username' name='username' type='text' size="25"></input><br />
		</td>
	</tr>
	<tr>
		<td><label for='email'><?php 
        fs_e('Email address');
Beispiel #8
0
    fs_e('Automatic update');
    ?>
<br/>
								<button class="button" 
									onclick="sendRequest('action=updateBotsList&amp;update=botlist_placeholder,num_excluded')">
									<?php 
    fs_e('Update now');
    ?>
								</button>
								<button class="button" onclick="openImportBots()"> <?php 
    fs_e('Import');
    ?>
 </button>
								<button class="button" 
									onclick="window.location.href='<?php 
    echo fs_url('php/export-bots-list.php');
    ?>
'">
									<?php 
    fs_e('Export');
    ?>
								</button>
							</span>
						</td>

					</tr>
					<tr>
						<td>
							<div id="botlist_placeholder"><?php 
    echo fs_get_bot_list();
    ?>
Beispiel #9
0
	$('fs_clear_site_id').style.display='none';
	$('site_edit_id').value = $('original_site_id').value;
}


function updateDeleteDialog()
{
	var dt = $('delete_type');
	var del = dt.selectedIndex == 0;
	var s = (del ? "none" : "block");
	$('transfer_option').style.display = s;
	var text = del ? "<?php 
fs_e("Delete");
?>
" : "<?php 
fs_e("Transfer");
?>
";
	$('fs_site_delete_button').innerHTML = text;
}


FS.activationHelp = function(type,id)
{
	var url = '<?php 
echo fs_url('php/help-window.php');
?>
?TYPE=' + type + "&SITE_ID=" + id;
	openWindow(url,600,600);
}
Beispiel #10
0
		<td>Ajax test</td>
		<td id="js_injection_result">Testing...</td>
	</tr>
	<tr  id="injection_tr" style="display:none">
		<td>
		   	<table border="0">
				<tr id="injection_res">
					<td></td>
				</tr>
		   	</table>
		</td>
	</tr>
</table>

<script type="text/javascript"	src='<?php 
echo fs_url('js/prototype.js');
?>
'></script> 
	<script	type="text/javascript">
//<![CDATA[

	function timedOut()
	{
		var result = $('js_injection_result');
		var msg = "Timed out";
		var html = "<td class='fatal'>fatal</td><td>"+msg+"</td>";
		$('injection_res').innerHTML = html;
		
		result.innerHTML = "Failed";
		result.className = 'fatal';
		$('injection_tr').style.display = '';
Beispiel #11
0
require_once FS_ABS_PATH . '/php/utils.php';
require_once FS_ABS_PATH . '/php/db-sql.php';
require_once FS_ABS_PATH . '/php/html-utils.php';
?>

<!-- if the javascript for this page was not already loaded, load it now -->
<script type="text/javascript">
//<![CDATA[
if (typeof(FS.newUserDialog) != "function")
{
	FS.loadJavaScript("<?php 
echo fs_url('js/page-users.js.php') . fs_get_request_suffix();
?>
");
	FS.loadCSS("<?php 
echo fs_url('css/page-users.css.php') . fs_get_request_suffix();
?>
");
}
//]]>

</script>
<div id="fs_users_div">
	<!-- Use table for base layout -->
	<table>
		<tr>
			<td>
				<div id="fs_users_table_holder" class="fwrap">
					<h2><?php 
fs_e('Manage users');
?>
Beispiel #12
0
function fs_get_powered_by($css_class)
{
    $img = fs_url("img/firestats-icon-small.png");
    $firestats_url = FS_HOMEPAGE;
    $powered = "<img alt='FireStats icon' src='{$img}'/><a href='{$firestats_url}'>&nbsp;" . fs_r("Powered by FireStats") . '</a>';
    return "<span class='{$css_class}'>{$powered}</span>";
}
Beispiel #13
0
function changeLanguage()
{
    sendRequest('action=changeLanguage&language=' + $F('language_code'));
}

function changeTimeZone()
{
    saveOption('firestats_user_timezone','firestats_user_timezone','string','records_table');
}


function toggleArchiveOldData()
{
	if (!FS.archivingOldData)
	{
		FS.archiveOldData();
	}
	else
	{
		FS.archiveCleanup();
	}
}

function openImportBots() 
{
	openWindow('<?php 
echo fs_url('bridge.php') . fs_get_request_suffix("file_id=import_bots");
?>
',300,300);
}
Beispiel #14
0
	<head>
		<title><?php 
fs_e('Import bots list');
?>
</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link rel="stylesheet" href="<?php 
echo 'css/base.css';
?>
" type='text/css'/>
		<script	type="text/javascript" src='<?php 
echo fs_url('js/prototype.js');
?>
'></script>
		<script	type="text/javascript" src='<?php 
echo fs_url('js/firestats.js.php') . fs_get_request_suffix();
?>
'></script>
	</head>
	<body id="firestats">
	<div class="fs_body width_margin <?php 
echo fs_lang_dir();
?>
">
	<h3><?php 
fs_e('Import bots list');
?>
</h3>
	
<?php 
if (!(isset($_FILES['bots_list']['tmp_name']) && is_uploaded_file($_FILES['bots_list']['tmp_name']))) {
Beispiel #15
0
<?php 
fs_output_sysinfo_information();
echo "<br/>";
fs_create_checkbox("user_agreed_to_send_system_information", "<b>" . fs_r("I agree to send system information") . "</b>", false, true);
?>


<h3><?php 
fs_e('Diagnostics');
?>
</h3>
<?php 
fs_e('System diagnostics page');
?>
: <button class="button" onclick="openWindow('<?php 
echo fs_url("bridge.php?file_id=system_test");
?>
',800,800)"><?php 
fs_e('Open');
?>
</button>
<br/>
<br/>
<table border="1">
  <tr>
    <td><?php 
fs_e('PHP Version');
?>
</td><td><?php 
echo phpversion();
?>
Beispiel #16
0
<?php

/*
Browser Sniff
based on a wordpress plugin by Iman Nurchyo (http://priyadi.net/)
which is available at http://priyadi.net/archives/2005/03/29/wordpress-browser-detection-plugin/
*/
require_once dirname(__FILE__) . '/utils.php';
### specify width and height for icons here
$GLOBALS['fs_pri_width_height'] = "14";
$GLOBALS['fs_pri_image_url'] = fs_url('img/browsers');
$GLOBALS['fs_pri_image_path'] = dirname(__FILE__) . "/../img/browsers";
function fs_pri_print_images()
{
    global $user_ID, $post, $comment;
    get_currentuserinfo();
    if (!$comment->comment_agent) {
        return;
    }
    echo fs_pri_browser_images($comment->comment_agent);
}
function fs_pri_print_browser($before = '', $after = '', $image = false, $between = 'on')
{
    global $user_ID, $post, $comment;
    get_currentuserinfo();
    if (!$comment->comment_agent) {
        return;
    }
    if (user_can_edit_post_comments($user_ID, $post->ID)) {
        $uastring = "<a href=\"#\" title=\"" . htmlspecialchars($comment->comment_agent) . "\">*</a>";
    }