当前位置: 首页>>代码示例>>PHP>>正文


PHP checkday函数代码示例

本文整理汇总了PHP中checkday函数的典型用法代码示例。如果您正苦于以下问题:PHP checkday函数的具体用法?PHP checkday怎么用?PHP checkday使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了checkday函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dwellings_run

function dwellings_run()
{
    checkday();
    page_header("Dwellings");
    global $session;
    $op = httpget("op");
    $dwid = httpget('dwid');
    $type = httpget('type');
    debug(get_module_pref("location_saver"));
    if ($type == "" && $dwid > 0) {
        $sql = "SELECT type FROM " . db_prefix("dwellings") . " WHERE dwid={$dwid}";
        $result = db_query($sql);
        $row = db_fetch_assoc($result);
        $type = $row['type'];
    }
    $cityid = httpget('cityid');
    require_once "modules/dwellings/run/case_{$op}.php";
    if ($op != "list" && $op != "") {
        addnav("Leave");
        addnav("Return to Hamlet", "runmodule.php?module=dwellings");
    } else {
        addnav("Navigation");
        villagenav();
    }
    page_footer();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:26,代码来源:dwellings.php

示例2: darkhorse_checkday

function darkhorse_checkday()
{
    // Reset special-in just in case checkday kicks in.
    $session['user']['specialinc'] = "";
    checkday();
    // And now set it back.
    $session['user']['specialinc'] = "module:darkhorse";
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:8,代码来源:darkhorse.php

示例3: checkday

<?php

require_once "common.php";
checkday();
$result = db_query("SELECT login,name,level,sex,title,specialty,hashorse,acctid,resurrections,bio,dragonkills,race FROM accounts WHERE login='{$_GET['char']}'");
$row = db_fetch_assoc($result);
$row[login] = rawurlencode($row['login']);
page_header("Character Biography: " . preg_replace("'[`].'", "", $row['name']));
$specialty = array(0 => "Unspecified", "Dark Arts", "Mystical Powers", "Thieving Skills");
//$horses=array(0=>"None","Pony","Gelding","Stallion");
output("`^Biography for " . $row['name'] . "");
if ($session['user']['loggedin']) {
    output("<a href=\"mail.php?op=write&to={$row['login']}\" target=\"_blank\" onClick=\"" . popup("mail.php?op=write&to={$row['login']}") . ";return false;\"><img src='images/newscroll.png' width='16' height='16' alt='Write Mail' border='0'></a>", true);
}
output("`n`n");
output("`^Title: `@" . $row['title'] . "`n");
output("`^Level: `@" . $row['level'] . "`n");
output("`^Resurrections: `@" . $row['resurrections'] . "`n");
output("`^Race: `@" . $races[$row['race']] . "`n");
output("`^Gender: `@" . ($row['sex'] ? "Female" : "Male") . "`n");
output("`^Specialty: `@" . $specialty[$row['specialty']] . "`n");
$sql = "SELECT mountname FROM mounts WHERE mountid='{$row['hashorse']}'";
$result = db_query($sql);
$mount = db_fetch_assoc($result);
if ($mount['mountname'] == "") {
    $mount['mountname'] = "`iNone`i";
}
output("`^Creature: `@" . $mount['mountname'] . "`n");
if ($row['dragonkills'] > 0) {
    output("`^Dragon Kills: `@" . $row['dragonkills'] . "`n");
}
开发者ID:BackupTheBerlios,项目名称:dragonsaga-svn,代码行数:31,代码来源:bio.php

示例4: worldmapen_run_real

function worldmapen_run_real()
{
    global $session, $badguy, $pvptimeout, $options, $outdoors, $shady;
    $outdoors = true;
    $op = httpget("op");
    $battle = false;
    if ($op == 'move' && rawurldecode(httpget('oloc')) != get_module_pref('worldXYZ')) {
        debug(get_module_pref('worldXYZ'));
        $op = 'continue';
        httpset('op', $op);
    }
    //	debug("Worldmap running op={$op} ...");
    // handle the admin editor first
    if ($op == "edit") {
        if (!get_module_pref("canedit")) {
            check_su_access(SU_EDIT_USERS);
        }
        if (get_module_setting("worldmapenInstalled") != 1) {
            set_module_setting('worldmapenInstalled', "1");
            worldmapen_defaultcityloc();
        }
        worldmapen_editor();
    }
    if ($op == "destination") {
        $cname = httpget("cname");
        $session['user']['location'] = $cname;
        addnav(array("Enter %s", $cname), "village.php");
        output("`c`4`bYou've Arrived in %s.`b`0`c`n", $cname);
        output("`cYou have reached the outer gates of the city.`c");
    }
    if (!get_module_setting("worldmapenInstalled")) {
        page_header("A rip in the fabric of space and time");
        require_once "lib/villagenav.php";
        villagenav();
        output("`^The admins of this game haven't yet finished installing the worldmapen module.");
        output("You should send them a petition and tell them that they forgot to generate the initial locations of the cities.");
        output("Until then, you are kind of stuck here, so I hope you like where you are.`n`n");
        output("After all, remember:`nWherever you go, there you are.`0");
        page_footer();
    }
    $subop = httpget("subop");
    $act = httpget("act");
    $type = httpget("type");
    $name = httpget("name");
    $direction = httpget("dir");
    $su = httpget("su");
    $buymap = httpget("buymap");
    $worldmapCostGold = get_module_setting("worldmapCostGold");
    $pvp = httpget('pvp');
    require_once "lib/events.php";
    if ($session['user']['specialinc'] != "" || httpget("eventhandler")) {
        $in_event = handle_event(get_module_setting("randevent"), "runmodule.php?module=worldmapen&op=continue&", "Travel");
        if ($in_event) {
            addnav("Continue", "runmodule.php?module=worldmapen&op=continue");
            module_display_events(get_module_setting("randevent"), "runmodule.php?module=worldmapen&op=continue");
            page_footer();
        }
    }
    page_header("Journey");
    //is the player looking at chat?
    if (httpget('comscroll') || httpget('comscroll') === 0 || httpget('comment') || httpget('refresh')) {
        $chatoverride = 1;
        require_once "lib/commentary.php";
        addcommentary();
        $loc = get_module_pref("worldXYZ", "worldmapen");
        viewcommentary("mapchat-" . $loc, "Chat with others who walk this path...", 25);
    }
    if ($op == "beginjourney") {
        $loc = $session['user']['location'];
        $x = get_module_setting($loc . "X");
        $y = get_module_setting($loc . "Y");
        $z = get_module_setting($loc . "Z");
        $xyz = $x . "," . $y . "," . $z;
        set_module_pref("worldXYZ", $xyz);
        output("`b`&The gates of %s`& stand closed behind you.`0`b`n`n", $session['user']['location']);
        $num = e_rand(1, 5);
        $msg = get_module_setting("leaveGates{$num}");
        output("`c`n`^%s`0`n`c`n", $msg);
        worldmapen_determinenav();
        if (get_module_setting("smallmap")) {
            worldmapen_viewsmallmap();
        }
        if (!$chatoverride) {
            require_once "lib/commentary.php";
            addcommentary();
            $loc = get_module_pref("worldXYZ", "worldmapen");
            viewcommentary("mapchat-" . $loc, "Chat with others who walk this path...", 25);
        }
        worldmapen_viewmapkey(true, false);
        module_display_events(get_module_setting("randevent"), "runmodule.php?module=worldmapen&op=continue");
        $loc = get_module_pref('worldXYZ');
        list($x, $y, $z) = explode(",", $loc);
        $t = worldmapen_getTerrain($x, $y, $z);
        //debug($t);
        if ($t['type'] == "Forest") {
            $shady = true;
        }
    } elseif ($op == "continue") {
        checkday();
        worldmapen_determinenav();
//.........这里部分代码省略.........
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:101,代码来源:run.php

示例5: peerpressure_runevent

function peerpressure_runevent($type)
{
    global $session;
    $session['user']['specialinc'] = "module:peerpressure";
    // For translation reasons, you cannot really substitute in his/her
    // since the gender can change other things
    if ($session['user']['sex']) {
        addnews("`&%s`7 heroically decided to seek out `@The Green Dragon`7 with cheers of encouragement from her peers ringing in her ears.", $session['user']['name']);
    } else {
        addnews("`&%s`7 heroically decided to seek out `@The Green Dragon`7 with cheers of encouragement from his peers ringing in his ears.", $session['user']['name']);
    }
    output("`2Wandering the village, going about your business, you are suddenly surrounded by a group of villagers.");
    output("They wonder why such an experienced adventurer as yourself hasn't slain a dragon yet.");
    output("You mutter some embarrassed excuses but they aren't listening.");
    output("They crowd around you closer, and lift you up on their shoulders.");
    $isforest = 0;
    $vloc = modulehook('validforestloc', array());
    foreach ($vloc as $i => $l) {
        if ($session['user']['location'] == $l) {
            $isforest = 1;
            break;
        }
    }
    if ($isforest || count($vloc) == 0) {
        output("`n`nCheering your name the whole way, they carry you into the forest, and right to the mouth of a cave outside the town!`n`n");
    } else {
        $key = array_rand($vloc);
        output("`n`nCheering your name the whole way, they carry you far into the forest, and right to the mouth of a cave outside the town of %s!`n`n", $key);
        $session['user']['location'] = $key;
    }
    output("Still cheering your name, they put you down and eagerly wait for you to enter and slay that dragon.`n`n");
    output("You know that you'd never live it down if you tried to back out now.");
    output("Swallowing your fear as best you can, you enter the cave.");
    if (is_module_active("dragonplace")) {
        addnav("Enter the cave", "runmodule.php?module=dragonplace&op=cave");
    } else {
        addnav("Enter the cave", "dragon.php?nointro=1");
    }
    $session['user']['specialinc'] = "";
    checkday();
    //increment buffs, newday buffs, and heal... and probably throw people off in general
    $session['user']['specialinc'] = "module:peerpressure";
    apply_buff('peerpressure', array("name" => "`2Heroic Valor", "rounds" => 20, "atkmod" => 1 + get_module_pref("dayspast") / 100, "defmod" => 1 + get_module_pref("dayspast") / 100, "startmsg" => "`2You fight bravely, considering the pressure you're under.", "wearoff" => "`@The Green Dragon`2 has beaten and burnt the bravery out of you.", "schema" => "module-peerpressure"));
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:44,代码来源:peerpressure.php

示例6: checkday

               <input type="checkbox" id="inlineCheckbox4" <?php 
        checkday('Jueves', $dias);
        ?>
 name="diasC[]" value="Jueves">
               <span class='checkbox-material'><span class='check'></span></span> Jue
            </label>
            <label class="checkday">
               <input type="checkbox" id="inlineCheckbox5" <?php 
        checkday('Viernes', $dias);
        ?>
 name="diasC[]" value="Viernes">
               <span class='checkbox-material'><span class='check'></span></span> Vie
            </label>
            <label class="checkday">
               <input type="checkbox" id="inlineCheckbox6" <?php 
        checkday('Sabado', $dias);
        ?>
 name="diasC[]" value="Sabado" name="diasC">
               <span class='checkbox-material'><span class='check'></span></span> Sab
            </label>
         </div>
      </div>
   </div>
   <div class="clearfix"></div>
</div>
<div class="row">
   <div class="col-xs-12 col-sm-12 bg-info ">   
      <div class="form-group">
         <label class="col-xs-12 col-sm-3">Hora Entrada: </label>
         <div class="col-xs-12 col-sm-9">
            <input type="time" class="form-control" name="hora1" value="<?php 
开发者ID:Nacked15,项目名称:schoolcontrol,代码行数:31,代码来源:viewEditCourse.php

示例7: count

<?
require_once "common.php";
if ((int)getsetting("expirecontent",180)>0){
	$sql = "DELETE FROM news WHERE newsdate<'".date("Y-m-d H:i:s",strtotime("-".getsetting("expirecontent",180)." days"))."'";
	//echo $sql;
	db_query($sql);
}
if ($session[user][slainby]!=""){
	page_header("You have been slain!");
		output("`\$You were slain in ".$session[user][killedin]."`\$ by `%".$session[user][slainby]."`\$.  They cost you 5% of your experience, and took any gold you had.  Don't you think it's time for some revenge?");
	addnav("Continue",$REQUEST_URI);
	$session[user][slainby]="";
	page_footer();
}else{
	
	if ($session['user']['loggedin']) checkday();
	$newsperpage=50;
	
	$offset = (int)$HTTP_GET_VARS[offset];
	$timestamp=strtotime((0-$offset)." days");
	$sql = "SELECT count(newsid) AS c FROM news WHERE newsdate='".date("Y-m-d",$timestamp)."'";
	$result = db_query($sql);
	$row = db_fetch_assoc($result);
	$totaltoday=$row['c'];
	$pageoffset = (int)$_GET['page'];
	if ($pageoffset>0) $pageoffset--;
	$pageoffset*=$newsperpage;
	$sql = "SELECT * FROM news WHERE newsdate='".date("Y-m-d",$timestamp)."' ORDER BY newsid DESC LIMIT $pageoffset,$newsperpage";
	$result = db_query($sql) or die(db_error(LINK));
	page_header("LoGD News");
	$date=date("D, M j, Y",$timestamp);
开发者ID:BackupTheBerlios,项目名称:dragonsaga-svn,代码行数:31,代码来源:news.php

示例8: grassyfield_runevent

function grassyfield_runevent($type)
{
    require_once "lib/buffs.php";
    require_once "lib/commentary.php";
    addcommentary();
    global $session, $playermount;
    // We assume this event only shows up in the forest currently.
    $from = "forest.php?";
    $session['user']['specialinc'] = "module:grassyfield";
    $op = httpget('op');
    if ($op == "return") {
        $session['user']['specialmisc'] = "";
        $session['user']['specialinc'] = "";
        redirect($from, "Redirected to " . $from . " from Grassy Field module");
    }
    checkday();
    output("`n`c`#You Stumble Upon a Grassy Field`c`n`n");
    addnav("Return to the forest", $from . "op=return");
    require_once "lib/mountname.php";
    list($name, $lcname) = getmountname();
    if ($session['user']['specialmisc'] != "Nothing to see here, move along.") {
        if ($session['user']['hashorse'] > 0) {
            list($max, $cur) = grassyfield_getrounds();
            if ($cur > $max * 0.5) {
                // XXX: this message really should be a module objpref
                if ($playermount['partrecharge']) {
                    tlschema("mounts");
                    output($playermount['partrecharge']);
                    tlschema();
                } else {
                    output("`&You allow %s`& to frolic and gambol in the field.", $lcname);
                }
            } else {
                // XXX: this message really should be a module objpref
                if ($playermount['recharge']) {
                    tlschema("mounts");
                    output($playermount['recharge']);
                    tlschema();
                } else {
                    output("`&You allow %s`& to hunt and rest in the field.", $lcname);
                }
            }
            $buff = unserialize($playermount['mountbuff']);
            if (!isset($buff['schema']) || $buff['schema'] == "") {
                $buff['schema'] = "mounts";
            }
            apply_buff('mount', $buff);
            if ($session['user']['hitpoints'] < $session['user']['maxhitpoints']) {
                output("`n`^Your nap leaves you completely healed!");
                $session['user']['hitpoints'] = $session['user']['maxhitpoints'];
            }
            $args = array('soberval' => 0.8, 'sobermsg' => "`n`&Naps are quite a sobering experience!`n", 'schema' => "module-grassyfield");
            modulehook("soberup", $args);
            $session['user']['turns']--;
            output("`n`n`^You spend some time - and Stamina - lying around.");
        } else {
            output("`&Deciding to take a moment and a load off your poor weary feet you take a quick break from your ventures to take in the beautiful surroundings.");
            output("`n`n`^Your break leaves you completely healed!");
            if ($session['user']['hitpoints'] < $session['user']['maxhitpoints']) {
                $session['user']['hitpoints'] = $session['user']['maxhitpoints'];
            }
        }
        $session['user']['specialmisc'] = "Nothing to see here, move along.";
    } else {
        output("`&You relax a while in the fields enjoying the sun and the shade.");
    }
    commentdisplay("`n`n`@Talk with the others lounging here.`n", "grassyfield", "Speak lazily", 10);
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:68,代码来源:grassyfield.php

示例9: haberdasher_run


//.........这里部分代码省略.........
            output("You pay `\$Deimos`7 his `^%s `7gold. You now have a size `@%s `7hat, worth `^%s`7 gold!", $amount, $hatsize, $worth);
            addnav("H?Return to Haberdashery", "runmodule.php?module=haberdasher");
            addnav("L?View Deimos' Customer List", "runmodule.php?module=haberdasher&op=listing");
        }
        villagenav();
    } elseif ($op == "listing") {
        $page = (int) $page;
        if (!$page) {
            $page = 1;
        }
        $pageoffset = $page;
        if ($pageoffset > 0) {
            $pageoffset--;
        }
        $pageoffset *= $perpage;
        $from = $pageoffset + 1;
        $limit = " LIMIT {$pageoffset},{$perpage} ";
        output("`7You take a look at `\$Deimos`7' customer listing, which is sitting on the counter.");
        output("Apparently `\$Deimos`7 is rather proud of his biggest customers.`n`n");
        output("`c`b`\$Deimos' Customer Listing`b`c`n");
        $sql = "SELECT COUNT(*) AS c FROM " . db_prefix("module_userprefs") . " WHERE modulename='haberdasher' and value>0 and setting='hatsize'";
        $result = db_query($sql);
        $row = db_fetch_assoc($result);
        $listtotal = $row['c'];
        $sql = "SELECT prefs.userid, (prefs.value+0) AS hatsize, users.name, users.sex, users.race FROM " . db_prefix("module_userprefs") . " AS prefs, " . db_prefix("accounts") . " AS users WHERE prefs.setting='hatsize' AND prefs.value>0 AND prefs.modulename='haberdasher' AND prefs.userid=users.acctid ORDER BY (prefs.value+0) DESC, prefs.userid ASC {$limit}";
        $result = db_query($sql);
        $count = db_num_rows($result);
        $rank = translate_inline("Rank");
        $size = translate_inline("Size");
        $cust = translate_inline("Customer");
        $sex = translate_inline("Sex");
        $race = translate_inline("Race");
        rawoutput("<table border='0' cellpadding='2' cellspacing='1' align='center' bgcolor='#999999'>");
        rawoutput("<tr class='trhead'><td>{$rank}</td><td>{$size}</td><td>{$cust}</td><td>{$sex}</td><td>{$race}</td>");
        if ($from + $perpage < $listtotal) {
            $cond = $pageoffset + $perpage;
        } else {
            $cond = $listtotal;
        }
        for ($i = $pageoffset; $i < $cond && $count; $i++) {
            $row = db_fetch_assoc($result);
            if ($row['name'] == $session['user']['name']) {
                rawoutput("<tr class='trhilight'><td>");
            } else {
                rawoutput("<tr class='" . ($i % 2 ? "trdark" : "trlight") . "'><td>");
            }
            $j = $i + 1;
            output_notl("{$j}.");
            rawoutput("</td><td align=\"center\">");
            output_notl("`@%s`0", $row['hatsize']);
            rawoutput("</td><td>");
            output_notl("`&%s`0", $row['name']);
            rawoutput("</td><td>");
            output_notl("%s`0", translate_inline($row['sex'] ? "`%Female" : "`!Male"));
            rawoutput("</td><td>");
            output_notl("`#%s`0", translate_inline($row['race'], "race"));
            rawoutput("</td></tr>");
        }
        if ($count == 0) {
            rawoutput("<tr><td colspan='5'>");
            output("`i`7Nobody has yet bought one of `\$Deimos'`7 fine hats. Why not be the first?`i");
            rawoutput("</td></tr>");
        }
        rawoutput("</table>");
        addnav("H?Return to Haberdashery", "runmodule.php?module=haberdasher");
        villagenav();
        if ($listtotal > $perpage) {
            // only show multipage navs if multiple pages are used.
            addnav("Pages");
            for ($p = 0; $p < $listtotal; $p += $perpage) {
                $pnum = $p / $perpage + 1;
                if ($pnum == $page) {
                    addnav(array("`b`#Page %s`0 (%s-%s)`b", $p / $perpage + 1, $p + 1, min($p + $perpage, $listtotal)), "runmodule.php?module=haberdasher&op=listing&page={$pnum}");
                } else {
                    addnav(array("Page %s (%s-%s)", $pnum, $p + 1, min($p + $perpage, $listtotal)), "runmodule.php?module=haberdasher&op=listing&page={$pnum}");
                }
            }
        }
    } else {
        checkday();
        output("`7You step into a respectable building, and see `\$Deimos`7 hard at work on a hat, as usual.");
        $hattypes = array("rakish", "stylish", "dashing", "snazzy", "jaunty", "dapper");
        $n = array_rand($hattypes);
        $hattype = $hattypes[$n];
        output("`7He himself wears a `\$%s red hat`7, which you take to be a good sign of his skill.`n`n", $hattype);
        output("`\$Deimos`7 notices your entrance and stands and doffs his hat to you and says, \"`\$Hi, I assume you're here about a hat.");
        output("Most people who come in here are, this being a haberdashery and all.");
        output("So, what can I do for you?`7\"`n`n");
        if (get_module_pref("hatsize") < 1) {
            output("`7You currently do not have a hat.");
            addnav("Buy a Hat", "runmodule.php?module=haberdasher&op=buy");
        } else {
            output("`7You have a size `@%s `7hat.", get_module_pref("hatsize"));
            addnav("Upgrade Your Hat", "runmodule.php?module=haberdasher&op=upgrade");
        }
        addnav("L?View Deimos' Customer List", "runmodule.php?module=haberdasher&op=listing");
        villagenav();
    }
    page_footer();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:101,代码来源:haberdasher.php


注:本文中的checkday函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。