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


PHP lt函数代码示例

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


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

示例1: showareas

function showareas()
{
    doAreaEdit();
    global $indexTemplateAreas;
    //execute the nano site in demo to read the content areas
    demoExecuteNanoSite();
    $sett = getDetails('settings');
    $contents = $sett['def-template-areas'];
    $areaInfo = array();
    foreach ($contents as $areaName) {
        $areaFile = areaDataDir("{$areaName}");
        $fileContent = file_exists($areaFile) ? file_get_contents($areaFile) : '';
        $areaInfo[$areaName] = $fileContent;
    }
    $saveAllTxt = lt('Save all Areas');
    $biggerInp = lt('Bigger Input Box');
    $smallerInp = lt('Smaller Input Box');
    echo "<form action='?action=showareas&do=editarea' method='post'>";
    echo "<input type='submit' value='+ {$saveAllTxt} +' class='floatright'>";
    echo "<input type='hidden' name='areaCount' value='" . count($areaInfo) . "'>";
    $cnt = 1;
    foreach ($areaInfo as $areaName => $areaContents) {
        $boxId = "box{$cnt}";
        //md5($areaName);
        echo "<h2>&raquo; {$areaName}</h2>\r\n\t\t\t    <input type='hidden' name='areaName{$cnt}' value='{$areaName}'>\r\n\t\t\t\t<table><tr valign='top'><td>\r\n\t\t\t\t<textarea name='areaContent{$cnt}' rows='2' cols='60' id='{$boxId}' class='areabox'>" . htmlentities($areaContents) . "</textarea>\r\n\t\t\t\t</td><td>\r\n\t\t\t\t<input type='button' onclick='makesmall(\"{$boxId}\")' value='-' title='{$smallerInp}' class='isizeh'>\r\n\t\t\t\t<input type='button' onclick='makebig(\"{$boxId}\")' value='+' title='{$biggerInp}' class='isizeh'>\r\n\t\t\t\t</td></tr></table>\r\n\t\t\t ";
        $cnt++;
    }
    echo "<input type='submit' value='+ {$saveAllTxt} +' class='floatright'>";
    echo "</form>";
    echo "<script language='javascript'>\r\n\t\t\tfunction makebig(id) {\r\n\t\t\tobj = document.getElementById(id);\r\n\t\t\tif( obj.rows < 30 ) obj.rows+= 5;\r\n\t\t\t}\r\n\t\t\tfunction makesmall(id) {\r\n\t\t\tobj = document.getElementById(id);\r\n\t\t\tif( obj.rows > 5 ) obj.rows-= 5;\r\n\t\t\t}\r\n\t\t  </script>";
}
开发者ID:appcoding2,项目名称:nano-cms,代码行数:31,代码来源:admin.contentareas.lib.php

示例2: sortSlice

 /**
  * Recursively quicksorts the slice of the array between
  * the specified left and right positions.
  *
  * @param integer $left The position of the leftmost element to be sorted.
  * @param integer $right The position of the rightmost element to be sorted.
  */
 protected function sortSlice($left, $right)
 {
     if ($right - $left + 1 > self::CUTOFF) {
         $p = $this->selectPivot($left, $right);
         $this->swap($p, $right);
         $pivot = $this->array[$right];
         $i = $left;
         $j = $right - 1;
         for (;;) {
             while ($i < $j && lt($this->array[$i], $pivot)) {
                 ++$i;
             }
             while ($i < $j && gt($this->array[$j], $pivot)) {
                 --$j;
             }
             if ($i >= $j) {
                 break;
             }
             $this->swap($i++, $j--);
         }
         if (gt($this->array[$i], $pivot)) {
             $this->swap($i, $right);
         }
         if ($left < $i) {
             $this->sortSlice($left, $i - 1);
         }
         if ($right > $i) {
             $this->sortSlice($i + 1, $right);
         }
     }
 }
开发者ID:EdenChan,项目名称:Instances,代码行数:38,代码来源:AbstractQuickSorter.php

示例3: savepages

function savepages()
{
    global $nc;
    runTweak('on-save-pages');
    $pagesdata = serialize($nc);
    if (!put2file(PAGES_DETAILS_FILE, $pagesdata)) {
        MsgBox(lt("file writing error"), 'redbox');
    }
}
开发者ID:appcoding2,项目名称:nano-cms,代码行数:9,代码来源:general.lib.php

示例4: savepages

function savepages()
{
    global $NANO;
    runTweak('on-save-pages');
    $pagesdata = serialize($NANO);
    if (!put2file(PAGES_DETAILS_FILE, $pagesdata)) {
        MsgBox(lt("File writing error"), 'redbox');
        return false;
    }
    return true;
}
开发者ID:appcoding2,项目名称:nano-cms,代码行数:11,代码来源:general.lib.php

示例5: contains

 /**
  * Tests whether the specified comparable object
  * is in this binary search tree.
  *
  * @param object IComparable $obj The object for which to look.
  * @return boolean True if the specified object
  * is in this binary search tree; false otherwise.
  */
 public function contains(IComparable $obj)
 {
     if ($this->isEmpty()) {
         return false;
     } elseif (eq($obj, $this->getKey())) {
         return true;
     } elseif (lt($obj, $this->getKey())) {
         return $this->getLeft()->contains($obj);
     } else {
         return $this->getRight()->contains($obj);
     }
 }
开发者ID:EdenChan,项目名称:Instances,代码行数:20,代码来源:BinarySearchTree.php

示例6: savepages

function savepages()
{
    global $NANO;
    runTweak('on-save-pages');
    $pagesdata = serialize($NANO);
    $pagesdata = '<?php header("Location: ../index.php"); /*    DO NOT EDIT THIS FILE' . "\n{$pagesdata}\n*/?>";
    if (!put2file(PAGES_DETAILS_FILE, $pagesdata)) {
        MsgBox(lt("File writing error"), 'redbox');
        return false;
    }
    return true;
}
开发者ID:a6smile,项目名称:dvdbrowsereview,代码行数:12,代码来源:general.lib.php

示例7: merge

 /**
  * Merges two sorted subsequences of the array into one.
  * @param integer $left The first position of the left subsequence.
  * @param integer $middle The first position of the right subsequence.
  * The last position in the left subsequences is middle-1.
  * @param integer $right The last position of the right subsequence.
  */
 protected function merge($left, $middle, $right)
 {
     $i = $left;
     $j = $left;
     $k = $middle + 1;
     while ($j <= $middle && $k <= $right) {
         if (lt($this->array[$j], $this->array[$k])) {
             $this->tempArray[$i++] = $this->array[$j++];
         } else {
             $this->tempArray[$i++] = $this->array[$k++];
         }
     }
     while ($j <= $middle) {
         $this->tempArray[$i++] = $this->array[$j++];
     }
     for ($i = $left; $i < $k; ++$i) {
         $this->array[$i] = $this->tempArray[$i];
     }
 }
开发者ID:EdenChan,项目名称:Instances,代码行数:26,代码来源:TwoWayMergeSorter.php

示例8: showpageslist

function showpageslist()
{
    global $nc;
    demoExecuteNanoSite();
    $cdt = getDetails('cats');
    $sett = getDetails('settings');
    $slugs = getDetails('slugs');
    $titles = getDetails('titles');
    $templateCats = $sett['def-template-links'];
    $defaultCats = explode(',', NANO_MUSTHAVE_CATS);
    $musthaveCats = array_unique(array_merge($templateCats, $defaultCats));
    $selectedCat = 1;
    $toggStat = 'false';
    if (isset($_GET[addcat])) {
        $newCatName = strtolower(stripslashes($_POST[catname]));
        if (in_array($newCatName, array_keys($cdt))) {
            $msg = sprintf(lt("Cannot add new Links Category : %s already exists", 'cat-add-fail-already-exists'), "<b>{$newCatName}</b>");
            MsgBox($msg);
        } else {
            $cdt[$newCatName] = array();
            $msg = sprintf(lt("Pages Category %s Added Successfully", 'cat-add-success'), "<b>{$newCatName}</b>");
            MsgBox($msg, 'greenbox');
            setDetails('cats', $cdt);
            savepages();
        }
    }
    if (isset($_GET[removecat])) {
        $catN = $_GET[removecat];
        if (!in_array($catN, array_keys($cdt))) {
            MsgBox(lt("Category to be deleted does not exist", 'cat-to-del-not-exists'), 'redbox');
        } else {
            if (in_array($catN, $musthaveCats)) {
                MsgBox("<b>{$catN}</b> : " . lt('Cannot be deleted'), 'redbox');
            } else {
                unset($cdt[$catN]);
                $msg = sprintf(lt("Pages Category %s was removed Successfully", 'cat-remove-success'), "<b>{$catN}</b>");
                MsgBox($msg, 'greenbox');
                setDetails('cats', $cdt);
                savepages();
            }
        }
    }
    if (isset($_GET[addtocat])) {
        $slug2add = $_POST[page];
        $cat2add = $_POST[cat];
        if (in_array($slug2add, $cdt[$cat2add])) {
            $msg = sprintf(lt("The page %s is already listed in %s", 'page-already-listed'), "<b>{$titles[$slug2add]}</b>", "<b>{$cat2add}</b>");
            MsgBox($msg);
        } else {
            array_push($cdt[$cat2add], $slug2add);
            $msg = sprintf(lt("The page %s was added successfully under %s", 'page-to-cat-add-success'), "<b>{$titles[$slug2add]}</b>", "<b>{$cat2add}</b>");
            MsgBox($msg);
            setDetails('cats', $cdt);
            savepages();
            $selectedCat = $cat2add;
            $toggStat = 'true';
        }
    }
    $catSelectList = array();
    foreach ($cdt as $cN => $cSC) {
        $catSelectList[$cN] = $cN;
    }
    $pagesAndOpt = lt('Pages & Category Options', 'page-and-cat-opt');
    $pagesListing = lt('Pages & Category Listing', 'page-and-cat-list');
    $addNewCat = lt('Add new Category');
    $addToAnotherCat = lt('Add page to another category', 'add-page-to-another-cat');
    $addLabel = lt('Add');
    $useUrlLabel = lt('Url you can use');
    $moveLabel = lt('Move');
    $optLabel = lt('Options');
    $pageLabel = lt('Page');
    echo "<a href='#nogo' class='nodeco'><h2 id='cat_anchor' class='cattitle'><span id='toggCon'></span>{$pagesAndOpt}</h2></a>\r\n\t\t\t<table id='cat_options'>\r\n\t\t\t <tr>\r\n\t\t\t \t<form action='?action=showpages&addcat=true' method='post'>\r\n\t\t\t\t<td>{$addNewCat} : </td><td><input type='text' name='catname'> <input type='submit' value='{$addLabel}'></td>\r\n\t\t\t\t</form>\r\n\t\t\t </tr>\r\n\t\t\t <tr>\r\n\t\t\t\t<form action='?action=showpages&addtocat=true' method='post'>\r\n\t\t\t\t<td>{$addToAnotherCat}</td><td>" . pagesList('page', $titles, 0) . " to " . pagesList('cat', $catSelectList, $selectedCat) . "\r\n\t\t\t\t\t <input type='submit' value='{$addLabel}'>\r\n\t\t\t\t</td>\r\n\t\t\t\t</form>\r\n\t\t\t </tr>\r\n\t\t\t</table>";
    $js = "catopt = new Toggle('cat_options',{$toggStat},'cat_anchor');catopt.setToggleContent( 'toggCon', '+', '-' );";
    $v = 0;
    echo "<h2>&raquo; {$pagesListing}</h2>";
    echo "<div class='linkcats-div'>";
    foreach ($cdt as $catname => $catslugs) {
        $v++;
        $slugids = array_values($catslugs);
        $n = count($slugids) - 1;
        if (!in_array($catname, $musthaveCats)) {
            $removeOpt = "( <a href='?action=showpages&removecat={$catname}'>remove</a> )";
        } else {
            $removeOpt = '';
        }
        //just user interface stuff
        $toggStat = $catname == $_SESSION[opencat] ? 'true' : 'false';
        if (!isset($_SESSION[opencat]) and $catname == 'sidebar') {
            $toggStat = true;
        }
        if ($catname == $_SESSION[opencat]) {
            $toggStat = 'true';
            unset($_SESSION[opencat]);
        } else {
            $toggStat == 'false';
        }
        $js .= "catopt{$v} = new Toggle('t{$v}',{$toggStat},'h2{$v}'); catopt{$v}.setToggleContent( 'co{$v}', '+', '-' );";
        echo "<a href='#nogo'><h2 class='cattitle noborder' id='h2{$v}'><span id='co{$v}' class='togg'>&raquo;</span> {$catname} {$removeOpt}</h2></a>";
        echo "<div class='borderWrap'>";
        echo "<table cellpadding='5px' cellspacing='2px'  width='100%' id='t{$v}' class='pageListTable'>";
//.........这里部分代码省略.........
开发者ID:appcoding2,项目名称:nano-cms,代码行数:101,代码来源:admin.pages.lib.php

示例9: lt

lt(array(), 'Array');
lt(array('a', 'b'), 'Array');
echo "\n";
gt('Array', array(1, 2));
gt('Array', array());
gt(array(), 'Array');
gt(array('a', 'b'), 'Array');
echo "======\n";
eq('', null);
eq(null, null);
eq(null, '');
eq('', '');
echo "\n";
lt('', null);
lt(null, null);
lt(null, '');
lt('', '');
echo "\n";
gt('', null);
gt(null, null);
gt(null, '');
gt('', '');
echo "======\n";
eq(-1.0, null);
eq(null, -1.0);
echo "\n";
lt(-1.0, null);
lt(null, -1.0);
echo "\n";
gt(-1.0, null);
gt(null, -1.0);
开发者ID:badlamer,项目名称:hhvm,代码行数:31,代码来源:some_cmp_tests.php

示例10: dt

function dt()
{
    global $T, $V;
    // go through all the pending ticks
    foreach ($T as $e => $f) {
        if ($f[0] <= lt()) {
            // if this entry needs to be done
            if ($f[1][0] == '$') {
                $V[substr($f[1], 1)]($f[3], 1, $f[2]);
            } else {
                $f[1]($f[2]);
            }
            // do it
            unset($T[$e]);
            // and call it done
        }
    }
}
开发者ID:pushcx,项目名称:Hennepin,代码行数:18,代码来源:hennepin.php

示例11: main

 /**
  * Main program.
  *
  * @param array $args Command-line arguments.
  * @return integer Zero on success; non-zero on failure.
  */
 public static function main($args)
 {
     printf("BoxedFloat main program.\n");
     $status = 0;
     $d1 = new BoxedFloat(1.0);
     printf("d1 = %s\n", str($d1));
     $d2 = new BoxedFloat(0.5);
     printf("d2 = %s\n", str($d2));
     printf("d1 < d2 = %s\n", str(lt($d1, $d2)));
     printf("hash(d1) = %d\n", hash($d1));
     printf("hash(d2) = %d\n", hash($d2));
     printf("hash(57.0) = 0%o\n", hash(new BoxedFloat(57.0)));
     printf("hash(23.0) = 0%o\n", hash(new BoxedFloat(23.0)));
     printf("hash(0.75) = 0%o\n", hash(new BoxedFloat(0.75)));
     printf("hash(-123.0e6) = 0%o\n", hash(new BoxedFloat(-123000000.0)));
     printf("hash(-123.0e7) = 0%o\n", hash(new BoxedFloat(-1230000000.0)));
     printf("hash(0.875) = 0%o\n", hash(new BoxedFloat(0.875)));
     printf("hash(14.0) = 0%o\n", hash(new BoxedFloat(14.0)));
     return $status;
 }
开发者ID:EdenChan,项目名称:Instances,代码行数:26,代码来源:BoxedFloat.php

示例12: lt

                    <a href="../" title="<?php 
echo lt('View Site');
?>
" target="_blank"><img class='updown' src='theme/images/window.gif' alt="<?php 
echo lt('View Site');
?>
" /></a> 
                    <a href="?logout" title="<?php 
echo lt('Logout');
?>
"><img class='delete' src='theme/images/trash.gif' alt="<?php 
echo lt('Logout');
?>
" <?php 
if (isset($razorArray['settings']['maintenance']) && $razorArray['settings']['maintenance'] == true) {
    echo "onclick='return confirm(\"" . lt("You are in maintenance mode, are you sure you want to log out in maintenance mode") . "\");'";
}
?>
 /></a>
                </div>
            </div>
        <div id="midbrace">
            <div id="midbox">
                <div id="leftbar">
                    <div id="leftnav">
                        <?php 
loadAdminSubLinks();
?>
                        <?php 
BsocketB('admin-xhtml-leftnav');
?>
开发者ID:roboshepherd,项目名称:FaruqsFewDays,代码行数:31,代码来源:default_admin_xhtml.php

示例13: commitChanges

 function commitChanges()
 {
     $catList = getDetails('cats');
     $sd = getDetails('slugs');
     $tt = getDetails('titles');
     $tt[$this->slugId] = $this->title;
     $sd[$this->slugId] = $this->slug;
     foreach ($catList as $catName => $catSlugs) {
         //the cat is there in our list and our page is not there in master list then just add/push it
         $isCategoryInOurList = in_array($catName, $this->cats);
         $isSlugInMasterCategory = in_array($this->slugId, $catSlugs);
         if ($isCategoryInOurList and !$isSlugInMasterCategory) {
             array_push($catList[$catName], $this->slugId);
             echo '<br>' . lt('Added');
         }
         if (!$isCategoryInOurList and $isSlugInMasterCategory) {
             $catSlugsIndexes = array_flip($catList[$catName]);
             array_splice($catList[$catName], $catSlugsIndexes[$this->slugId], 1);
             echo "<br>" . lt('Deleted from list') . " - {$catName}";
         }
     }
     setDetails('cats', $catList);
     setDetails('slugs', $sd);
     setDetails('titles', $tt);
 }
开发者ID:appcoding2,项目名称:nano-cms,代码行数:25,代码来源:setting.php

示例14: nanoadmin_showsettings

function nanoadmin_showsettings()
{
    $home = getDetails('homepage');
    $pages = getDetails('titles');
    $slugs = getDetails('slugs');
    $username = getDetails('username');
    $seourl_stat = (bool) getDetails('seourl');
    $seourl = array(lt('Disabled'), lt('Enabled'));
    $is_modrewrite_available = true;
    if (isset($_POST['save'])) {
        runTweak('save-settings');
        $_POST = array_map('stripslashes', $_POST);
        $home = $_POST['homepage'];
        $seourl_stat = $_POST['seourls'];
        $seourl_stat = $is_modrewrite_available ? $seourl_stat : 0;
        if ($seourl_stat == 1) {
            file_put_contents(NANO_INDEX_LOCATION . '.htaccess', NANO_HTACCESS_FORMAT);
        } else {
            unlink(NANO_INDEX_LOCATION . '.htaccess');
        }
        $username = $_POST['username'];
        $password = $_POST['password'];
        setDetails('homepage', $home);
        setDetails('seourl', $seourl_stat);
        if (!empty($username)) {
            setDetails('username', $username);
        }
        if (!empty($password)) {
            setDetails('password', md5($password));
            //reset the logged session variable
            $_SESSION[NANO_CMS_ADMIN_LOGGED] = md5(md5($password) . $_SESSION[LOGIN_TIME_STAMP]);
        }
        if (savepages()) {
            MsgBox(lt('Settings were saved successfully'), 'greenbox');
        }
    }
    $word_homepage = lt('Home Page');
    $word_sefurl = lt('Search Engine Friendly URL\'s');
    $word_new = lt('New');
    $word_username = lt('Username');
    $word_password = lt('Password');
    $word_leaveitemtpy = lt("Leave empty if you don't want to change", 'leave-empty-for-no-change');
    $word_loginsettings = lt("Login Settings");
    $word_save = lt("Save Changes");
    $word_settings = lt("NanoCMS Settings");
    if ($is_modrewrite_available) {
        $select_seourl = html_select('seourls', $seourl, $seourl_stat);
        $word_modrewrite = lt("mod_rewrite is required and is available");
    } else {
        $select_seourl = html_select('seourls', $seourl, $seourl_stat, ' disabled="disabled"');
        $word_modrewrite = lt("mod_rewrite is <b>not available</b>, please contact your host or enable it via httpd.conf", 'modrewrite-not-available');
    }
    $select_homepage = html_select('homepage', $pages, $home);
    echo $output = <<<NANO_SETTINGS
\t<h2>{$word_settings}</h2>
\t<form action="#" method="POST" accept-charset="utf-8">
\t\t<table width="100%" cellpadding="5">
\t\t\t<tr>
\t\t\t\t<td>{$word_homepage}</td><td>{$select_homepage}</td>
\t\t\t</tr>
\t\t\t<tr>
\t\t\t\t<td>{$word_sefurl} <br /><small>[ {$word_modrewrite} ]</small></td><td>{$select_seourl}</td>
\t\t\t</tr>
\t\t\t<tr><td>&nbsp;</td></tr>
\t\t\t<tr>
\t\t\t\t<td colspan="2"><h2>{$word_loginsettings}</h2></td>
\t\t\t</tr>
\t\t\t<tr>
\t\t\t\t<td colspan="2">{$word_leaveitemtpy}</td>
\t\t\t</tr>
\t\t\t<tr>
\t\t\t\t<td>{$word_new} {$word_username}</td><td><input type="text" value="{$username}" name="username" /></td>
\t\t\t</tr>
\t\t\t<tr>
\t\t\t\t<td>{$word_new} {$word_password}</td><td><input type="text" name="password" value="" /></td>
\t\t\t</tr>
\t\t\t<tr>
\t\t\t\t<td><br /><input type="submit" value="{$word_save}" name="save" /></td>
\t\t\t</tr>
NANO_SETTINGS;
    runTweak('admin-settings');
    echo "\r\n\t\t</table>\r\n\t</form>";
}
开发者ID:a6smile,项目名称:dvdbrowsereview,代码行数:83,代码来源:admin.settings.lib.php

示例15: findMinTree

 /**
  * Returns the binomial tree in this binomial queue
  * that has the "smallest" root.
  * The smallest root is the root which is less than or
  * equal to all other roots.
  *
  * @return object BinomialTree The binomial tree in this binomial queue
  * that has the "smallest" root.
  */
 protected function findMinTree()
 {
     $minTree = NULL;
     for ($ptr = $this->treeList->getHead(); $ptr !== NULL; $ptr = $ptr->getNext()) {
         $tree = $ptr->getDatum();
         if ($minTree === NULL || lt($tree->getKey(), $minTree->getKey())) {
             $minTree = $tree;
         }
     }
     return $minTree;
 }
开发者ID:EdenChan,项目名称:Instances,代码行数:20,代码来源:BinomialQueue.php


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