Esempio n. 1
0
function GetGamesCountText($time = 86400)
{
    // default: last 24 hours
    if (!gotConnection()) {
        return;
    }
    $count = 0;
    $list = references();
    foreach ($list as $reference) {
        if (ParseINI::parseValue('State', $reference['data']) == 'Running' && $reference['time'] >= time() - $time) {
            $count++;
        }
    }
    $last = $time / 60 / 60;
    if ($count > 0) {
        if ($count > 1) {
            return $count . ' games in the last ' . $last . ' hours.';
        } else {
            return 'One game in the last ' . $last . ' hours.';
        }
    } else {
        return 'No games running in the last ' . $last . ' hours.';
    }
}
Esempio n. 2
0
        _e('Rejected by:', 'glotpress');
    } else {
        _e('Last updated by:', 'glotpress');
    }
    ?>
					</dt>
					<dd><?php 
    gp_link_user($t->user_last_modified);
    ?>
</dd>
				</dl>
			<?php 
}
?>
			<?php 
references($project, $t);
?>

			<dl>
			    <dt><?php 
_e('Priority of the original:', 'glotpress');
?>
</dt>
			<?php 
if ($can_write) {
    ?>
				<dd><?php 
    echo gp_select('priority-' . $t->original_id, GP::$original->get_static('priorities'), $t->priority, array('class' => 'priority', 'tabindex' => '-1', 'data-nonce' => wp_create_nonce('set-priority_' . $t->original_id)));
    ?>
</dd>
			<?php 
Esempio n. 3
0
<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
function references($a)
{
    echo "Truyen kieu tham tri" . $a;
}
references(5);
echo "========================" . "<br />";
function add_some_extra(&$string)
{
    $string .= 'and something extra.';
}
$str = 'This is a string, ';
add_some_extra($str);
echo $str;
// xuất ra là 'This is a string, and something extra.'
echo "========================" . "<br />";
echo "============ Truyen tham chieu =========" . "<br />";
function count_1(&$var)
{
    $var++;
}
$b = 5;
count_1($b);
echo $b;
// kết quả sẽ là 6
echo "<br />";
Esempio n. 4
0
        die;
    }
    if (!is_array($references)) {
        redirectMsg('./references.php' . $ruta, __('Select a note to delete!', 'docs'), 1);
        die;
    }
    $db = XoopsDatabaseFactory::getDatabaseConnection();
    $sql = "DELETE FROM " . $db->prefix("pa_references") . " WHERE id_ref IN(" . implode(',', $references) . ")";
    if (!$db->queryF($sql)) {
        redirectMsg('./references.php' . $ruta, __('Errores ocurred while trying to delete notes.'), 1);
    } else {
        redirectMsg('./references.php' . $ruta, __('Notes deleted successfully!', 'docs'), 0);
    }
}
$action = rmc_server_var($_REQUEST, 'action', '');
switch ($action) {
    case 'edit':
        references(1);
        break;
    case 'save':
        saveReferences();
        break;
    case 'saveedit':
        saveReferences(1);
        break;
    case 'delete':
        deleteReferences();
        break;
    default:
        references();
}