コード例 #1
0
ファイル: m_fb.php プロジェクト: BGCX261/zjrenju-svn-to-git
				if(IsSameName($n,$n2))
				{
					$this_name='<b>'.$this_name.'</b>';
					break;
				}
			$b_list.=$this_name."[<a href=\"m_fb.php?action=b_del&tname=$n\">删</a>] ";
		}
	}
	else $b_list='(空)';

	$addbox="<input type=text size=20 maxlength=12 name=\"tname\"> <input type=\"submit\" value=\"添加\">";
	$add_box_f=strlen($udata['friends']) >= $cfg['max_friends']?'您的好友列表已满': $addbox;
	$add_box_b=strlen($udata['blacklist']) >= $cfg['max_blacklist']?'您的黑名单已满': $addbox;
	ShowHeader('<img src="./images/profile.gif" /> 我的好友');
	eval ('echo "'.LoadTemplate('m_fb').'";');
	ShowFooter();
	break;
case 'f_add':
	if(!IsMember($tname)) ErrorBox('用户不存在');
	if(IsSameName($tname,$udata['u_name'])) MessageBox('不能加自己');
	if(strlen($udata['friends']) >= $cfg['max_friends']) MessageBox('您的好友列表已经满了');
	if(In_Names($tname,$udata['friends'])) MessageBox('该用户已经在好友列表中了');
	
	if(In_Names($tname,$udata['blacklist']))
	{
		//从黑名单中删除
		$blacklist=explode('|',$udata['blacklist']);
		foreach($blacklist as $k=>$n)
		{
			if(IsSameName($tname,$n))
			{
コード例 #2
0
function MessageBox($message, $links = array(), $helpid = '')
{
    SetNoUseCache();
    global $cfg, $color, $str;
    $urls = array();
    if (count($links) == 0) {
        $urls[0] = array($str['go_back'], 'JavaScript:history.back(-1)');
    } else {
        foreach ($links as $lnk) {
            $u = "{$lnk['1']}.php";
            $flag = false;
            foreach ($lnk as $k => $v) {
                if (!is_string($k)) {
                    continue;
                }
                if ($flag) {
                    $u .= "&{$k}={$v}";
                } else {
                    $u .= "?{$k}={$v}";
                    $flag = true;
                }
            }
            $urls[] = array($lnk[0], $u);
        }
    }
    $fixurl = '';
    foreach ($urls as $url) {
        $fixurl .= "[<a href=\"{$url['1']}\">{$url['0']}</a>]<br />";
    }
    $helplink = $helpid == '' ? '' : "[<a href=\"help.html#{$helpid}\" target=\"_blank\" >{$str['help']}</a>]";
    ShowHeader('<img src="./images/info.gif" /> ' . $str['general_msg'], $urls[0][1]);
    eval('echo "' . LoadTemplate('msgbox') . '";');
    ShowFooter();
}
コード例 #3
0
function mywebtonetperftest_plugin_all()
{
    global $wpdb;
    global $mysqltests;
    global $MySQLtotaltime;
    global $PHPtotaltime;
    global $testmathresult;
    global $teststringresult;
    global $testloopresult;
    global $testifelseresult;
    global $mysqltemp;
    global $mysqlresults;
    global $ourdatamysql70;
    global $ourdataphp70;
    $getcwdpath = getcwd();
    $servermode = $_SERVER['GATEWAY_INTERFACE'];
    $servername = $_SERVER['SERVER_NAME'];
    $serveraddr = $_SERVER['SERVER_ADDR'];
    $phpversion = PHP_VERSION;
    $phpmajorversion = PHP_MAJOR_VERSION;
    $phpos = PHP_OS;
    $phpuname = php_uname();
    $memorylimit = ini_get("memory_limit");
    $postmaxsize = ini_get("post_max_size");
    $uploadmaxsize = ini_get("upload_max_filesize");
    $mysqlversion = $wpdb->get_var("select version();");
    $maxexectime = ini_get('max_execution_time');
    $phpinilocation = php_ini_loaded_file();
    $apacheversion = function_exists('apache_get_version') ? apache_get_version() : '';
    if ($apacheversion == "") {
        $apacheversion = "Test not implemented yet/unknown web server";
    }
    $loadedmodules = function_exists('apache_get_modules') ? apache_get_modules() : '';
    if ($loadedmodules == "") {
        $loadedmodules = "Test not implemented yet";
    }
    ?>
	<table width='95%'><tr><td width='40%'></td><td width='20%'><h3><?php 
    echo $headertext;
    ?>
</h3></td><td width='40%' align='right'><a href='http://www.mywebtonet.com' target=_blank><img src="<?php 
    echo MYWEB_URL;
    ?>
mywebtonetlogo.png" border=0></a></td></tr></table>	
	<?php 
    echo "<center>Compare with results below, <a href='#footer'><b>click to view</b></a></center><br><br>\n";
    echo "<table>\n";
    echo "<tr><td valign='top'>Server:</td><td><font color='blue'><b>{$servername}@<font color='blue'><b>" . $serveraddr . "</b></font></td></tr>\n";
    echo "<tr><td valign='top'>PHP host information:</td><td><font color='blue'><b>" . $phpuname . "</b></font></td></tr>\n";
    echo "<tr><td valign='top'>PHP version:</td><td><font color='blue'><b>" . $phpversion . "</B></font></td></tr>\n";
    echo "<tr><td valign='top'>PHP memory limit:</td><td><font color='blue'><b>" . $memorylimit . "</b></font></td></tr>\n";
    echo "<tr><td valign='top'>PHP post_max_size:</td><td><font color='blue'><b>" . $postmaxsize . "</b></font></td></tr>\n";
    echo "<tr><td valign='top'>PHP upload_max_size:</td><td><font color='blue'><b>" . $uploadmaxsize . "</b></font></td></tr>\n";
    echo "<tr><td valign='top'>PHP max_execution_time:</td><td><font color='blue'><b>" . $maxexectime . "</b> seconds</font></td></tr>\n";
    echo "<tr><td valign='top'>PHP ini file location:</td><td><font color='blue'><b>" . $phpinilocation . "</b></font></td></tr>\n";
    if ($apacheversion != "") {
        echo "<tr><td valign='top'>Webserver:</td><td><font color='blue'><b>" . $apacheversion . "</b></font></td></tr>\n";
    }
    if ($loadedmodules != "") {
        echo "<tr><td valign='top'>Loaded webserver modules:</td><td style='word-wrap:'><font color='blue'><b>";
        $arrlength = count($loadedmodules);
        for ($x = 0; $x < $arrlength; $x++) {
            echo $loadedmodules[$x] . " ";
        }
        echo "</td></tr>\n";
    }
    echo "<tr><td valign='top'>Platform:</td><td><font color='blue'><b>" . $phpos . "</b></font></td></tr>\n";
    echo "<tr><td valign='top'>Gateway interface:</td><td><font color='blue'><b>" . $servermode . "</b></font></td></tr>\n";
    echo "<tr><td valign='top'>Path to files:</td><td><font color='blue'><b>" . $getcwdpath . "</b></font></td></tr>\n";
    echo "<tr><td valign='top'>MySQL version</td><td><font color='blue'><b>" . $mysqlversion . "</font></b></td></tr>";
    /*
     Windows shouldn't give us the load average
    */
    if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
        echo "<tr><td valign='top'>Server load now:</td><td valign='top' align='right'><b>Unable to fetch load as windows is used for webserver (incompatible)</b></td></tr>\n";
    } else {
        $load = sys_getloadavg();
        echo "<tr><td valign='top'>Server load now:</td><td valign='top' align='left'><font color='blue'><b>" . sprintf("%6.2f", $load[0]) . "</b></td></tr>\n";
        echo "<tr><td valign='top'>Server load avg. 5 minutes:</td><td valign='top' align='left'><font color='blue'><b>" . sprintf("%6.2f", $load[1]) . "</b></td></tr>\n";
        echo "<tr><td valign='top'>Server load avg. 15 minutes:</td><td valign='top' align='left'><font color='blue'><b>" . sprintf("%6.2f", $load[2]) . "</b></td></tr>\n";
    }
    echo "</table>\n";
    DoHeader();
    $queryresult = DoQueryTest();
    $MySQLtotaltime = $queryresult;
    DoMySQL();
    DoPHPTests();
    $networktest = test_Network();
    mywebtonetperftest_createtable();
    $tableprefix = $wpdb->prefix . "mywebtonetperfstatsresults";
    $phpuname = addslashes($phpuname);
    $storeresults = $wpdb->query("insert into {$tableprefix} (servername,serveraddr,phpversion,memorylimit,postmaxsize,mysqlversion,phpos,serverloadnow,serverload5,serverload15,mysql1,mysql2,mysql3,php1,php2,php3,php4,phpuname,queryresult,networktest,apacheversion,uploadmaxsize,maxexectime) values ('{$servername}','{$serveraddr}','{$phpversion}','{$memorylimit}','{$postmaxsize}','{$mysqlversion}','{$phpos}','{$load['0']}','{$load['1']}','{$load['2']}','{$mysqlresults['0']}','{$mysqlresults['1']}','{$mysqlresults['2']}','{$testmathresult}','{$teststringresult}','{$testloopresult}','{$testifelseresult}','{$phpuname}','{$queryresult}','{$networktest}','{$apacheversion}','{$uploadmaxsize}','{$maxexectime}');");
    echo "<table width=70%>\n";
    echo "<tr><td valign='top'><b>All tests:</b></td></tr>\n";
    echo "<tr><td valign='top' width=20%>Total time</td><td valign='top' width=58%><b>(all MySQL + PHP tests)</td><td valign='top' width=22%> :<font color='blue'><b>" . sprintf("%6.2f", $PHPtotaltime + $MySQLtotaltime) . "</b></font> seconds</td></tr></table>\n";
    $md5time = md5(time() . $servername);
    ?>
	<center>
	<br>
	<table width='95%' cellpadding=2 cellspacing=6 style='background: #FFFFFF;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;border: 2px solid #cccccc;'>
	<tr><td valign='top' align='left'>
	By submitting results we can evaluate figures and compare one test to the other. No tests will ever get disclosed. If you <b>do not want</b> this information to be submitted, please do <b>not</B> press the submit button.
	</td></tr></table>
	<br>
	<FORM name="myform" METHOD="POST" ACTION="http://gather.webhosting.dk/cgi-bin/mywebtonet-performancestatsresults.pl" accept-charset="ISO-8859-1" target=_blank>
	<input type='hidden' name='md5time' value='<?php 
    echo $md5time;
    ?>
'>
	<input type='hidden' name='servername' value='<?php 
    echo $servername;
    ?>
'>
	<input type='hidden' name='serveraddr' value='<?php 
    echo $serveraddr;
    ?>
'>
	<input type='hidden' name='phpversion' value='<?php 
    echo $phpversion;
    ?>
'>
	<input type='hidden' name='phpos' value='<?php 
    echo $phpos;
    ?>
'>
	<input type='hidden' name='mathresult' value='<?php 
    echo $testmathresult;
    ?>
'>
	<input type='hidden' name='stringresult' value='<?php 
    echo $teststringresult;
    ?>
'>
	<input type='hidden' name='testloopresult' value='<?php 
    echo $testloopresult;
    ?>
'>
	<input type='hidden' name='ifelseresult' value='<?php 
    echo $testifelseresult;
    ?>
'>
	<input type='hidden' name='queryresult' value='<?php 
    echo $queryresult;
    ?>
'>
	<input type='hidden' name='mysqlresults' value='<?php 
    echo $mysqltemp;
    ?>
'>
	<input type='hidden' name='phpmemorylimit' value='<?php 
    echo $memorylimit;
    ?>
'>
	<input type='hidden' name='postmaxsize' value='<?php 
    echo $postmaxsize;
    ?>
'>
	<input type='hidden' name='phpuname' value='<?php 
    echo $phpuname;
    ?>
'>
	<input type='hidden' name='loadnow' value='<?php 
    echo $load[0];
    ?>
'>
	<input type='hidden' name='load5' value='<?php 
    echo $load[1];
    ?>
'>
	<input type='hidden' name='load15' value='<?php 
    echo $load[2];
    ?>
'>
	<input type='hidden' name='networktest' value='<?php 
    echo $networktest;
    ?>
'>
	<input type='hidden' name='mysqlversion' value='<?php 
    echo $mysqlversion;
    ?>
'>
	<input type='hidden' name='apacheversion' value='<?php 
    echo $apacheversion;
    ?>
'>
	<input type='hidden' name='uploadmaxsize' value='<?php 
    echo $uploadmaxsize;
    ?>
'>
	<input type='hidden' name='maxexectime' value='<?php 
    echo $maxexectime;
    ?>
'>
	<font face="Verdana,Arial" size="1"><INPUT TYPE=submit VALUE="Submit results">
	</form>
	<br><br><table cellpadding=0 cellspacing=0 style='background: #FFFFFF;border-radius:10px;-moz-border-radius:10px;-webkit-border-radius:10px;border: 2px solid #cccccc;'>
	<?php 
    $datamysql = array("Query result" => $queryresult, "MySQL 1" => $mysqlresults[0], "MySQL 2" => $mysqlresults[1], "MySQL 3" => $mysqlresults[2]);
    $dataphp = array("Mathresult" => $testmathresult, "StringManipulation " => $teststringresult, "Loop" => $testloopresult, "IfElse" => $testifelseresult);
    ?>
		<?php 
    if ($phpmajorversion < 8) {
        ?>
	
		<td valign='top' align='left'>
			<table>
			<tr>
			<td><img src="<?php 
        echo MYWEB_URL;
        ?>
showgraphpie.php?showsmall=0&header=<?php 
        echo urlencode(serialize("MySQL results"));
        ?>
&mydata=<?php 
        echo urlencode(serialize($datamysql));
        ?>
" /></td>
			<td><img src="<?php 
        echo MYWEB_URL;
        ?>
showgraphpie.php?showsmall=0&header=<?php 
        echo urlencode(serialize("PHP results"));
        ?>
&mydata=<?php 
        echo urlencode(serialize($dataphp));
        ?>
" /></td>
			<br>
			</tr>
			<tr>	
			<td><img src="<?php 
        echo MYWEB_URL;
        ?>
showgraph.php?showsmall=0&header=<?php 
        echo urlencode(serialize("Lower is better, Our server=Green, Your server=Blue"));
        ?>
&mywebdata=<?php 
        echo urlencode(serialize($ourdatamysql70));
        ?>
&mydata=<?php 
        echo urlencode(serialize($datamysql));
        ?>
" /></td>
			<td><img src="<?php 
        echo MYWEB_URL;
        ?>
showgraph.php?showsmall=0&header=<?php 
        echo urlencode(serialize("Lower is better, Our server=Green, Your server=Blue"));
        ?>
&mywebdata=<?php 
        echo urlencode(serialize($ourdataphp70));
        ?>
&mydata=<?php 
        echo urlencode(serialize($dataphp));
        ?>
" /></td>
			</tr>	
			</table>		
		</td>
		<?php 
    }
    ?>
	</table><br>		
	<?php 
    ShowFooter();
}
コード例 #4
0
ファイル: lnl.php プロジェクト: Jireck-npds/npds_dune
function main()
{
    global $hlpfile, $f_meta_nom, $f_titre, $adminimg;
    include "header.php";
    GraphicAdmin($hlpfile);
    adminhead($f_meta_nom, $f_titre, $adminimg);
    echo '<h3>' . adm_translate("Petite Lettre D'information") . '</h3>';
    echo "\n   <a href=\"admin.php?op=lnl_List\" class=\"noir\">" . adm_translate("Liste des LNL envoyées") . "</a>\n   <a href=\"admin.php?op=lnl_User_List\" class=\"noir\">" . adm_translate("Afficher la liste des prospects") . "</a>";
    echo '<h4>' . adm_translate("Message d'entête") . '</h4><a href="admin.php?op=lnl_Add_Header" class="noir">' . adm_translate("Ajouter un article") . '</a>';
    ShowHeader();
    echo '<h4>' . adm_translate("Corps de message") . '</h4><a href="admin.php?op=lnl_Add_Body" class="noir">' . adm_translate("Ajouter un article") . '</a>';
    ShowBody();
    echo '<h4>' . adm_translate("Message de pied de page") . '</h4><a href="admin.php?op=lnl_Add_Footer" class="noir">' . adm_translate("Ajouter un article") . '</a>';
    ShowFooter();
    echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"2\" border=\"0\"><tr><td class=\"header\">\n";
    echo adm_translate("Assembler une lettre et la tester");
    echo "</td></tr></table>\n";
    echo "<form action=\"admin.php\" method=\"post\">";
    echo "<p align=\"center\">" . adm_translate("Entête") . " : <input class=\"textbox_standard\" type=\"text\" name=\"Xheader\" size=\"12\" max=\"11\" />&nbsp;" . adm_translate("Corps") . " : <input class=\"textbox_standard\" type=\"text\" name=\"Xbody\" size=\"12\" max=\"11\" />";
    echo "&nbsp;" . adm_translate("Pied") . " : <input class=\"textbox_standard\" type=\"text\" name=\"Xfooter\" size=\"12\" max=\"11\" />";
    echo "<input type=\"hidden\" name=\"op\" value=\"lnl_Test\" />";
    echo " - <input class=\"bouton_standard\" type=\"submit\" value=\"" . adm_translate("Valider") . "\" /></p>";
    echo "</form></td></tr>";
    echo "<tr>";
    echo "<td>";
    echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"2\" border=\"0\"><tr><td class=\"header\">\n";
    echo adm_translate("Envoyer La Lettre");
    echo "</td></tr></table>\n";
    echo '<form action="admin.php" method="post">';
    echo adm_translate("Entête") . " : <input class=\"textbox_standard\" type=\"text\" name=\"Xheader\" size=\"12\" max=\"11\" />&nbsp;" . adm_translate("Corps") . " : <input class=\"textbox_standard\" type=\"text\" name=\"Xbody\" size=\"12\" max=\"11\" />";
    echo "&nbsp;" . adm_translate("Pied") . " :&nbsp;&nbsp;<input class=\"textbox_standard\" type=\"text\" name=\"Xfooter\" size=\"12\" max=\"11\" /><br />";
    echo adm_translate("Sujet") . " :&nbsp;&nbsp;&nbsp;<input class=\"textbox_standard\" type=\"text\" size=\"80\" max=\"255\" name=\"Xsubject\" /><hr noshade=\"noshade\" class=\"ongl\" />";
    echo "<p align=\"center\"><input type=\"radio\" value=\"All\" checked=\"checked\" name=\"Xtype\" /> " . adm_translate("Tous les Utilisateurs") . " -";
    echo "<input type=\"radio\" value=\"Mbr\" name=\"Xtype\" /> " . adm_translate("Seulement aux membres") . " : ";
    // ---- Groupes
    $mX = liste_group();
    $tmp_groupe = "";
    while (list($groupe_id, $groupe_name) = each($mX)) {
        if ($groupe_id == "0") {
            $groupe_id = "";
        }
        $tmp_groupe .= "<option value=\"{$groupe_id}\" {$sel3}>{$groupe_name}</option>\n";
    }
    echo '<select class="form-control" name="Xgroupe">' . $tmp_groupe . '</select>';
    // ---- Groupes
    echo "<input type=\"radio\" value=\"Out\" name=\"Xtype\" /> " . adm_translate("Seulement aux prospects") . " - ";
    echo '
      <input type="hidden" name="op" value="lnl_Send" />
      <input class="btn btn-primary" type="submit" value="' . adm_translate("Valider") . '" />
      </form>';
    adminfoot('', '', '', '');
}