Ejemplo n.º 1
0
</div>
<div class="blockform">
<h2 class="block2"><span>WAP Стили</span></h2>
<div class="box">
<form method="post" action="' . $_SERVER['REQUEST_URI'] . '">
<div class="inform">
<fieldset>
<legend>WAP Стили</legend>
<div class="infldset">
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">Используемые WAP стили</th><td>';
            $result = $db->query('SELECT `style_wap`, COUNT(1) AS `number` FROM `' . $db->prefix . 'users` WHERE id > 1 GROUP BY `style_wap` ORDER BY `number`') or error('Unable to fetch style_wap settings', __FILE__, __LINE__, $db->error());
            $number = $db->num_rows($db->query('SELECT `username` FROM `' . $db->prefix . 'users` WHERE id > 1'));
            while ($cur_lang = $db->fetch_assoc($result)) {
                echo $cur_lang['number'] . ' - ' . RoundSigDigs($cur_lang['number'] / $number * 100, 3) . '% <strong>' . str_replace('_', ' ', $cur_lang['style_wap']) . '</strong><br />';
            }
            echo '</td></tr><tr><th scope="row">WAP Стиль</th><td>';
            $styles = array();
            $d = dir(PUN_ROOT . 'include/template/wap');
            while (($entry = $d->read()) !== false) {
                if ($entry[0] != '.' && is_dir(PUN_ROOT . 'include/template/wap/' . $entry)) {
                    $styles[] = $entry;
                }
            }
            $d->close();
            echo '<select name="form[style_wap]">';
            while (list(, $temp) = @each($styles)) {
                echo '<option value="' . $temp . '">' . str_replace('_', ' ', $temp) . '</option>';
            }
            echo '</select>
Ejemplo n.º 2
0
    echo $_SERVER['REQUEST_URI'];
    ?>
">
				<div class="inform">
					<fieldset>
						<legend>Styles</legend>
						<div class="infldset">
						<table class="aligntop" cellspacing="0">
													<tr>
								<th scope="row">Style Usage</th>
								<td>
<?php 
    $result = $db->query('SELECT style, count(*) as number FROM ' . $db->prefix . 'users WHERE id > 1 GROUP BY style ORDER BY number') or error('Unable to fetch style settings', __FILE__, __LINE__, $db->error());
    $number = $db->num_rows($db->query('SELECT username from ' . $db->prefix . 'users WHERE id > 1'));
    while ($cur_lang = $db->fetch_assoc($result)) {
        echo RoundSigDigs($cur_lang['number'] / $number * 100, 3) . '% ' . str_replace('_', ' ', $cur_lang['style']) . '<br>';
    }
    ?>
								</td>
							</tr>

							<tr>
								<th scope="row">Style</th>
								<td>
<?php 
    $styles = array();
    $d = dir(PUN_ROOT . 'style');
    while (($entry = $d->read()) !== false) {
        if (substr($entry, strlen($entry) - 4) == '.css') {
            $styles[] = substr($entry, 0, strlen($entry) - 4);
        }