コード例 #1
0
ファイル: wrappers.php プロジェクト: exts/nab145
 function users_online()
 {
     $all_users = "";
     echo "<b>Users Online:</b><br />";
     $time = time() - 300;
     $users = mysql_query("SELECT `level`,`username` FROM users WHERE online >= '{$time}' ORDER BY online DESC");
     $USZ = mysql_num_rows($users);
     if ($USZ == 0) {
         echo "There hasn't been anyone online in the past 5 minutes.";
     } else {
         while ($uzas = mysql_fetch_array($users)) {
             $all_users .= "<a style='text-decoration:none;' href='?act=profile&amp;profile;id=" . getid($uzas['username']) . "' title=\"View " . $uzas['username'] . "'s Profile\">" . legend($uzas['level'], $uzas['username']) . "</a>,";
         }
     }
     echo substr($all_users, 0, strlen($all_users) - 1);
 }
コード例 #2
0
ファイル: preferences.php プロジェクト: CamTosh/blogotext
function afficher_form_captcha()
{
    afficher_html_head($GLOBALS['lang']['preferences']);
    echo '<div id="top">';
    afficher_msg();
    afficher_topnav(basename($_SERVER['PHP_SELF']), $GLOBALS['lang']['preferences']);
    echo '</div>';
    echo '<div id="axe">' . "\n";
    echo '<div id="page">' . "\n";
    if (!empty($_SESSION['freecap_word_hash']) and !empty($_POST['word'])) {
        if (sha1(strtolower($_POST['word'])) == $_SESSION['freecap_word_hash']) {
            $_SESSION['freecap_word_hash'] = false;
            $word_ok = "yes";
        } else {
            $word_ok = "no";
        }
    } else {
        $word_ok = FALSE;
    }
    echo '<form id="preferences-captcha" action="' . basename($_SERVER['PHP_SELF']) . '?test_captcha" method="post" class="bordered-formbloc" >' . "\n";
    echo '<div role="group" class="pref">';
    echo '<div class="form-legend">' . legend('Captcha', 'legend-config') . '</div>' . "\n";
    echo '<p>';
    if ($word_ok !== FALSE) {
        if ($word_ok == "yes") {
            echo '<b style="color: green;">you got the word correct, rock on.</b>';
        } else {
            echo '<b style="color: red;">sorry, that\'s not the right word, try again.</b>';
        }
    }
    echo '</p>';
    echo '<p><img src="../inc/freecap/freecap.php" id="freecap" alt="freecap"/></p>' . "\n";
    echo '<p>If you can\'t read the word, <a href="#" onclick="new_freecap();return false;">click here to change image</a></p>' . "\n";
    echo '<p>word above : <input type="text" class="text" name="word" /></p>' . "\n";
    echo '<input class="submit blue-square" type="submit" name="valider" value="' . $GLOBALS['lang']['envoyer'] . '" />' . "\n";
    echo '</div>';
    echo '</form>' . "\n";
}
コード例 #3
0
ファイル: skyview.php プロジェクト: leearmstrong/gpsd
    } else {
        $cellmode = 1;
    }
}
// How many samples to read of SKY messages.
$count = $argv[1];
$sz = 640;
$cellsize = 5;
# degrees
$radius = 8;
# pixels
$filled = 0;
$im = imageCreate($sz, $sz);
$C = colorsetup($im);
skyview($im, $sz, $C);
legend($im, $sz, $C);
$sky = array();
error_reporting(E_ALL);
// Get the port for the GPSD service.
$service_port = 2947;
// Get the IP address for the target host.
$address = "127.0.0.1";
// Create a TCP/IP socket.
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
if ($socket === false) {
    echo "socket_create() failed: reason: " . socket_strerror(socket_last_error()) . "\n";
}
$result = socket_connect($socket, $address, $service_port);
if ($result === false) {
    echo "socket_connect() failed.\nReason: ({$result}) " . socket_strerror(socket_last_error($socket)) . "\n";
}
コード例 #4
0
ファイル: maintenance.php プロジェクト: CamTosh/blogotext
                case 'xmlwp':
                    $xml = file_get_contents($_FILES['file']['tmp_name']);
                    $message = importer_wordpress($xml);
                    break;
                case 'rssopml':
                    $xml = file_get_contents($_FILES['file']['tmp_name']);
                    $message['feeds'] = importer_opml($xml);
                    break;
                default:
                    die('nothing');
                    break;
            }
            if (!empty($message)) {
                echo '<form action="maintenance.php" method="get" class="bordered-formbloc">' . "\n";
                echo '<fieldset class="pref valid-center">';
                echo legend($GLOBALS['lang']['bak_restor_done'], 'legend-backup');
                echo '<ul>';
                foreach ($message as $type => $nb) {
                    echo '<li>' . $GLOBALS['lang']['label_' . $type] . ' : ' . $nb . '</li>' . "\n";
                }
                echo '</ul>';
                echo '<p class="submit-bttns"><button class="submit blue-square" type="submit">' . $GLOBALS['lang']['valider'] . '</button></p>' . "\n";
                echo '</fieldset>' . "\n";
                echo '</form>' . "\n";
            }
        } else {
            echo 'nothing to do.';
        }
    }
}
echo '</div>' . "\n";
コード例 #5
0
    $scaleViews = (double) 100 / (double) $maxViews;
}
if (defined('LIB_GRAPH_SAME_SCALE')) {
    $scaleClicks = $scaleViews;
} elseif ($maxClicks == 0) {
    $scaleClicks = 50;
} else {
    $scaleClicks = (double) 50 / (double) $maxClicks;
}
imageline($im, $leftMargin + 10, 20, $leftMargin + 10 + $items_count * 12, 20, $graycolor);
imageline($im, $leftMargin + 10, 45, $leftMargin + 10 + $items_count * 12, 45, $graycolor);
imageline($im, $leftMargin + 10, 70, $leftMargin + 10 + $items_count * 12, 70, $graycolor);
imageline($im, $leftMargin + 10, 95, $leftMargin + 10 + $items_count * 12, 95, $graycolor);
imageline($im, $leftMargin + 10, 120, $leftMargin + 10 + $items_count * 12, 120, $linecolor);
legend($im, $leftMargin + 10, 2, $text["value1"], $adviewscolor, $linecolor, $textcolor);
legend($im, $leftMargin + 40 + imageFontwidth(2) * strlen($text["value1"]), 2, $text["value2"], $adclickscolor, $linecolor, $textcolor);
// Views
imagestring($im, 2, $leftMargin - imageFontwidth(2) * strlen($maxViews), 12, $maxViews, $textcolor);
imagestring($im, 2, $leftMargin - imageFontwidth(2) * strlen('0'), 115, '0', $textcolor);
// Clicks
if (!defined('LIB_GRAPH_SAME_SCALE')) {
    imagestring($im, 2, $leftMargin + 20 + $items_count * 12, 63, $maxClicks, $textcolor);
    imagestring($im, 2, $leftMargin + 20 + $items_count * 12, 115, '0', $textcolor);
}
for ($x = 0; $x < $items_count; $x++) {
    // AdViews
    ImageFilledRectangle($im, $leftMargin + 10 + $x * 12, 120 - (int) ($count[$x] * $scaleViews), $leftMargin + 19 + $x * 12, 120, $adviewscolor);
    ImageRectangle($im, $leftMargin + 10 + $x * 12, 120 - (int) ($count[$x] * $scaleViews), $leftMargin + 19 + $x * 12, 120, $linecolor);
    // AdClicks
    ImageFilledRectangle($im, $leftMargin + 12 + $x * 12, 120 - (int) ($count2[$x] * $scaleClicks), $leftMargin + 21 + $x * 12, 120, $adclickscolor);
    ImageRectangle($im, $leftMargin + 12 + $x * 12, 120 - (int) ($count2[$x] * $scaleClicks), $leftMargin + 21 + $x * 12, 120, $linecolor);
コード例 #6
0
echo $ip;
?>
?port=<?php 
echo $port;
?>
">>> Connect!</a></h3>
		</td></tr></table>

        <?php 
if (!isset($error[0])) {
    echo useron($info, $sinfo, $new);
}
?>

        <?php 
if (!isset($error[0])) {
    echo ts_server($sinfo, $info, $new);
}
?>

        <?php 
echo tree('0', '', $clist, $error, $sinfo, $plist, $info, $new);
if (!isset($error[0])) {
    echo legend($info, $new);
    echo stats($info, $sinfo, $new);
    echo tm_client($info, $plist, $new);
    echo showlink($info, $new);
}
echo "</td></tr></table>";
closetable();
require_once THEMES . "templates/footer.php";