コード例 #1
0
ファイル: webcore_class.php プロジェクト: rust1989/edit
 function getArticles($channelid, $type, $order, $n, $b, $w = 100, $returnarr = 0)
 {
     $channelid = intval($channelid);
     $type = intval($type);
     $order = intval($order);
     $n = intval($n);
     $b = intval($b);
     $w = intval($w);
     global $cache_channels;
     $channel = $cache_channels[$channelid];
     $articlestr = "";
     $orderstr = $order == 1 ? "hits desc" : "posttime desc";
     $arts = $this->db->row_select("articles", "langid={$this->langid}" . ($channelid > 0 ? " and channelid={$channelid}" : "") . ($type > 0 ? " and type={$type}" : "") . "", $n, "id,channelid,posttime,title,content,type,picid,picpath", $orderstr);
     if ($returnarr == 1) {
         return $arts;
     }
     $bn = 0;
     foreach ($arts as $art) {
         $arturl = $this->genUrl("view.php?id={$art['id']}");
         $art['posttime'] = getDateStr($art['posttime'], true);
         $bn++;
         if ($bn < $b + 1) {
             $art['picpath'] = $this->getPicPath($art['picpath']);
             $articlestr .= "<li class=\"pictitle\"><a href=\"{$arturl}\" target=\"_blank\">{$art['title']}</a><p><a href=\"{$arturl}\" target=\"_blank\"><img src=\"{$art['picpath']}\" /></a><a href=\"{$arturl}\" target=\"_blank\">" . cutStr(strip_tags($art['content']), $w) . "</a></p></li>";
         } else {
             $articlestr .= "<li class=\"normaltitle\"><span class=time>{$art['posttime']}</span><a href=\"{$arturl}\" target=\"_blank\">{$art['title']}</a></li>";
         }
     }
     return $articlestr;
 }
コード例 #2
0
function getWikiBirthdays($wf_cutoff, $start, $dbw)
{
    $result = "";
    $thisyear = date("Y") - 1;
    $ago = 1;
    while ($thisyear > 2004) {
        $ts1 = preg_replace("@^20[0-9]{2}@", $thisyear, $start);
        if (date('Y', wfTimestamp(TS_UNIX, $wf_cutoff)) > date('Y', wfTimestamp(TS_UNIX, $start))) {
            $ts2 = preg_replace("@^20[0-9]{2}@", $thisyear + 1, $wf_cutoff);
        } else {
            $ts2 = preg_replace("@^20[0-9]{2}@", $thisyear, $wf_cutoff);
        }
        $result .= "Between " . getDateStr($ts1) . " and " . getDateStr($ts2) . " <ol>";
        $res = $dbw->select('user', array('user_name', 'user_registration'), array("user_registration > '{$ts1}'", "user_registration <= '{$ts2}'", "user_editcount >= 200"), __METHOD__);
        while ($row = $dbw->fetchObject($res)) {
            $x = User::newFromName($row->user_name);
            $result .= "<li> " . getUserLink($x) . " (" . getDateStr($row->user_registration) . ") - " . getUserToolLinks($x) . "</li>";
        }
        $result .= "</ol>";
        $thisyear--;
    }
    return $result;
}
コード例 #3
0
ファイル: main_ajax.php プロジェクト: rust1989/edit
 case "savecontact":
     $settings = $_POST['settings'];
     try {
         $db->row_delete("contact", "langid={$_SYS['alangid']}");
         $settings['langid'] = $_SYS['alangid'];
         $db->row_insert("contact", $settings);
         writeContactCache();
         printRes("{$_AL['main.ct.setsucceed']}<script>setTimeout(function(){reloadSelf('admin.php?inc=main&action=contact');},2000);</script>");
     } catch (Exception $e) {
         echo $e;
     }
     break;
 case "testmail":
     require_once '../inc/email.php';
     $settings = $_POST['settings'];
     $mailsubject = "{$_AL['main.ct.testsubject']}" . getDateStr(time(), false, false);
     //Mail Subject
     $mailbody = "{$_AL['main.ct.testcontent']}";
     //Mail Content
     $receiver = $settings['testreceiver'];
     if (sendMail($receiver, $mailsubject, $mailbody)) {
         ob_end_clean();
         succeedFlag();
     }
     break;
 case "rebuildcache":
     $cachetype = $_POST['cachetype'];
     if (empty($cachetype)) {
         exit($_AL['main.cache.choose']);
     }
     if (substr($cachetype, 0, 4) == 'all,') {
コード例 #4
0
ファイル: view.php プロジェクト: rust1989/edit
    $headtitle = empty($row['seotitle']) ? strip_tags($row['title']) : strip_tags(str_replace(array("\r", "\n"), array('', ''), $row['seotitle']));
    $headtitle .= " - {$channel['title']}";
    $headkeywords = empty($row['metakeywords']) ? $headtitle : strip_tags(str_replace(array("\r", "\n"), array('', ''), $row['metakeywords']));
    $headdesc = empty($row['metadesc']) ? $headtitle : strip_tags(str_replace(array("\r", "\n"), array('', ''), $row['metadesc']));
}
$secmenu = '';
foreach ($channel['childcid'] as $childcid) {
    $tmpchannel = $cache_channels[$childcid];
    if ($tmpchannel['ishidden'] == '1') {
        continue;
    }
    $secmenu .= "<li class='big'><a href=\"" . $webcore->genNavLink($tmpchannel) . "\">{$tmpchannel['title']}</a></li>";
}
if (intval($channel['pid']) > 0) {
    $par_channel = $cache_channels[$channel['pid']];
    foreach ($cache_channels[$channel['pid']]['childcid'] as $childcid) {
        $tmpchannel = $cache_channels[$childcid];
        if ($tmpchannel['ishidden'] == '1') {
            continue;
        }
        $secmenu .= "<li class='big'><a href=\"" . $webcore->genNavLink($tmpchannel) . "\">{$tmpchannel['title']}</a></li>";
    }
} else {
    $par_channel = $channel;
}
$row['posttime'] = getDateStr($row['posttime'], false, 0);
$row['content'] = $parsefile->parse($row['content']);
$_SYS['positionchannel'] = " » <a href=" . $webcore->genUrl("articlelist.php?cid={$channel['id']}") . ">{$channel['title']}</a>";
require_once './header.php';
require_once getTemplatePath('view.htm');
footer();
コード例 #5
0
ファイル: vote.php プロジェクト: rust1989/edit
{$_AL['all.keyword']}: <input class="text_css" type="text" size="20" value="{$keyword}" id="keyword" />
<input class="button_css" type="button" value="  {$_AL['all.search']}  " onclick="searchvotes()" />
&nbsp;&nbsp;&nbsp;{$recstr}</div>
\t<table class="table_1" width="100%">
\t\t<tr><td class="td_6"><a class="td_5_1a" href="admin.php?inc=vote&action=add"><img src="images/ico_add.gif" border="0" /> {$_AL['vote.add']}</a></td></tr>
\t</table>

EOT;
        echo "<form id=\"votesform\" onsubmit=\"return false;\">";
        echo "<table class=\"table_1\" width=\"100%\">";
        echo "<tr style=\"font-weight:bold;color:#333333;\"><td class=\"row_0\">" . "<div class=\"rowdiv_0\" style=\"width:{$dwidth[6]}px;\">{$_AL['vote.order']}</div>" . "<div class=\"rowdiv_0\" style=\"width:{$dwidth[2]}px;\">{$_AL['vote.subject']}</div>" . "<div class=\"rowdiv_0\" style=\"width:{$dwidth[3]}px;\">{$_AL['vote.allowvotetime']}</div>" . "<div class=\"rowdiv_0\" style=\"width:{$dwidth[4]}px;\">{$_AL['vote.totalnum']}</div>" . "<div class=\"rowdiv_0\" style=\"width:{$dwidth[5]}px;\">{$_AL['all.control']}</div>" . "";
        for ($i = 0; $i < count($rows); $i++) {
            $tabindex = $i;
            $row = $rows[$i];
            $row['starttime'] = getDateStr($row['starttime']);
            $row['stoptime'] = getDateStr($row['stoptime']);
            $row['title'] = htmlFilter($row['title']);
            $checkboxstr = "<input type=\"checkbox\" value=\"{$row['id']}\" name=\"ids[]\" class=\"checkbox_css\" />";
            echo "<tr><td class=\"row_0\" style=\"line-height:150%;\">" . "<div class='rowdiv_0' style='width:{$dwidth[6]}px;'><input type=\"text\" size=\"2\" value=\"{$row[ordernum]}\" name=\"ordernum[{$row['id']}]\" tabIndex=\"{$tabindex}\" class=\"text_css\" /></div>" . "<div class='rowdiv_0' style='width:{$dwidth[2]}px;'><a href=\"../vote.php?id={$row['id']}\" target=\"_blank\">{$row['title']}</a>&nbsp;</div>" . "<div class='rowdiv_0' style='width:{$dwidth[3]}px;'><span class='time'>{$row['starttime']}</span> ~ <span class='time'>{$row['stoptime']}</span> </div>" . "<div class='rowdiv_0' style='width:{$dwidth[4]}px;'><span class='time'>{$row['votednum']}</span></div>" . "<div class='rowdiv_0' style='width:{$dwidth[5]}px;'><a href=\"admin.php?inc=vote&action=edit&id={$row['id']}\">{$_AL['all.edit']}</a>&nbsp;&nbsp;&nbsp;<a href=\"javascript:ajax_delvote_yn({$row['id']})\">{$_AL['all.delete']}</a>&nbsp;</div>" . "";
        }
        echo "</table>";
        echo <<<EOT
\t<table class="table_1" width="100%">
\t\t<tr><td class="td_6"><a class="td_5_1a" href="admin.php?inc=vote&action=add"><img src="images/ico_add.gif" border="0" /> {$_AL['vote.add']}</a></td></tr>
\t</table>
\t<table width=100%><tr><td><input type="button" class="button_css" value="  {$_AL['all.submit']}  " onclick="ajax_dovotes()" /></td><td><div class='pagestrdiv'>{$pager->getPageStr()}</div></td></tr></table>
EOT;
        echo "</form>";
        echo <<<EOT

\t</div>
コード例 #6
0
function getFinalData($color = 'gray', $json = false)
{
    $schedules = loadDataStr(getDateStr($color));
    $finalDisplay = array();
    foreach ($schedules as $stopName => $departTimes) {
        $count = 3;
        foreach ($departTimes as $departTime) {
            if ($departTime > 0) {
                $count--;
                if ($count >= 0) {
                    if ($json == true) {
                        $finalDisplay[$stopName][] = secondsToArray($departTime);
                    } else {
                        $finalDisplay[$stopName][] = secondsToReadableTime($departTime);
                    }
                }
            }
        }
    }
    return $finalDisplay;
}
コード例 #7
0
ファイル: product.php プロジェクト: rust1989/edit
<?php

require_once './inc/init.php';
require_once './inc/pager.php';
require_once './inc/parsefile.php';
$id = intval($_GET['id']);
$row = $db->row_select_one("products", "id='{$id}' and langid={$_SYS['langid']}");
if (!empty($row)) {
    $id = $row['id'];
    $db->row_query("update {$db->pre}products set hits=hits+1 where id={$id}");
    $row['posttime'] = getDateStr($row['posttime'], 0, 0);
    $row['name'] = htmlFilter($row['name']);
    $row['serialnum'] = htmlFilter($row['serialnum']);
    $row['price1'] = number_format($row['price1'], 2);
    $row['content'] = $parsefile->parse($row['content']);
    $row['smallimages'] = '';
    $pics = $webcore->getPics($row['picids'], $row['picpaths'], -1, true, true);
    foreach ($pics as $pic) {
        $row['smallimages'] .= intval($pic['picid']) > 0 ? "<li id=\"liimg_{$pic['picpath']}\"><img src=\"{$pic['picpath']}\" /></li>" : "";
    }
    $row['picpath'] = $pics[0]['picpath'];
    unset($pics);
}
empty($row) && $webcore->checkViewLang('product', $id);
$cid = $row['cid'];
$procate = $cache_procates[$cid];
$_SYS['positionchannel'] = " » <a href=" . $webcore->genUrl("productlist.php?cid={$procate['id']}") . ">{$procate['title']}</a>";
$headtitle = empty($row['seotitle']) ? strip_tags($row['name']) : strip_tags(str_replace(array("\r", "\n"), array('', ''), $row['seotitle']));
$headtitle .= " - {$procate['title']}";
$headkeywords = empty($row['metakeywords']) ? $headtitle : strip_tags(str_replace(array("\r", "\n"), array('', ''), $row['metakeywords']));
$headdesc = empty($row['metadesc']) ? $headtitle : strip_tags(str_replace(array("\r", "\n"), array('', ''), $row['metadesc']));
コード例 #8
0
ファイル: msg.php プロジェクト: rust1989/edit
        $secmenu .= "<li class='big'><a href=\"" . $webcore->genNavLink($tmpchannel) . "\">{$tmpchannel['title']}</a></li>";
    }
} else {
    $par_channel = $channel;
}
$msgkey = $_GET['msgkey'];
$curPage = intval($_GET["page"]);
$condition = "langid={$_SYS['langid']} and state=1";
$condition .= empty($msgkey) ? "" : " and (name like '%{$msgkey}%' or title like '%{$msgkey}%' or remark like '%{$msgkey}%' or reply like '%{$msgkey}%')";
$orderstr = "id desc";
$pagerlink = $webcore->genUrl("msg.php?page={page}" . (empty($msgkey) ? "" : "&msgkey={$msgkey}"));
$pager = new Pager();
$pager->init(intval($cache_settings['perpagemsg']), $curPage, $pagerlink);
$msgs = $pager->queryRows($db, "msgs", $condition, "*", $orderstr);
$index = 0;
foreach ($msgs as $key => $msg) {
    $msg['mod'] = ++$index % 2;
    $msg['name'] = htmlFilter($msg['name']);
    $msg['email'] = htmlFilter($msg['email']);
    $msg['contact1'] = htmlFilter($msg['contact1']);
    $msg['title'] = htmlFilter($msg['title']);
    $msg['remark'] = nl2br(htmlFilter($msg['remark']));
    $msg['posttime'] = getDateStr($msg['posttime']);
    $msg['replytime'] = getDateStr($msg['replytime']);
    $msgs[$key] = $msg;
}
$_SYS['positionchannel'] = " » <a href=" . $webcore->genUrl("msg.php") . ">{$channel['title']}</a>";
$msgkey = empty($msgkey) ? $_LANG['header.search'] : htmlFilter($msgkey);
require_once './header.php';
require_once getTemplatePath('msg.htm');
footer();
コード例 #9
0
ファイル: fun.php プロジェクト: rust1989/edit
function footer($f = true)
{
    global $timer_begin;
    global $db;
    global $cache_global;
    global $cache_settings;
    global $webcore;
    $times = $db->query_count();
    $time_now = getDateStr(time(), false, false);
    $timer_end = getmicrotime();
    $timer_run = round($timer_end - $timer_begin, 6);
    if ($f) {
        require_once getTemplatePath('footer.htm');
    }
    ob_end_flush();
    exit;
}
コード例 #10
0
ファイル: vote.php プロジェクト: rust1989/edit
                 setCookies("vote{$voteid}", '1');
             }
             $totalrow = $db->row_query_one("SELECT SUM(votednum) as total FROM `{$db->pre}voteitems` WHERE voteid={$voteid} LIMIT 1");
             $db->query_unbuffered("update `{$db->pre}votes` set votednum={$totalrow['total']} where id={$voteid}");
             $votetips = $_SLANG['vote.succeed'];
         }
         $votetips = empty($votetips) ? "" : "<div class='votesucceed'>{$votetips}</div>";
     }
 }
 $votecolors = array('', '#DCEF17', '#FFBF2A', '#EA793F', '#ECA45C', '#4CBA4A', '#5D74B1', '#98C6D5', '#DD30AE', '#BDF752', '#EE335F');
 $votestr .= "<div class='view_vote'>";
 $voterow = $db->row_select_one("votes", "id={$id}");
 $allvotednum = $voterow['votednum'];
 $itemrows = $db->row_select("voteitems", "voteid={$id}", 0, "*", "id");
 $votestarttime = getDateStr($voterow['starttime'], 'dateonly', false);
 $votestoptime = getDateStr($voterow['stoptime'], 'dateonly', false);
 $voteindex = 1;
 $votestr .= "<div class='votetitle'>{$voterow['title']}</div>";
 if ($voterow['maxvotes'] > 1) {
     $votestr .= "<div class='votelimit'>" . _LANG($_SLANG['vote.title'], array($voterow['votednum'], "<span class='time'>{$votestarttime}</span>", "<span class='time'>{$votestoptime}</span>")) . "</div>";
 } else {
     $votestr .= "<div class='votelimit'>" . _LANG($_SLANG['vote.title'], array($voterow['votednum'], "<span class='time'>{$votestarttime}</span>", "<span class='time'>{$votestoptime}</span>")) . "</div>";
 }
 $votestr .= "<table class='view_votetable'>";
 foreach ($itemrows as $item) {
     @($votev = number_format($item['votednum'] / $allvotednum * 100, 2));
     $width = 300 * $votev / 100;
     $votestr .= "<tr><td class='votetd1'>{$item['title']}</td>";
     $votestr .= "<td class='votetd2'><div class='vote100'><div style='width:{$width}px; background:{$votecolors[$voteindex]};'></div></div></td><td class='votetd3'> {$item['votednum']} ({$votev}%)</td></tr>";
     $voteindex++;
 }
コード例 #11
0
function getFinalData($color = 'gray', $json = false)
{
    global $myStops;
    global $myArrival;
    $arrival = $myArrival[$color];
    $schedules = loadDataStr(getDateStr($color));
    $finalDisplay = array();
    foreach ($schedules as $stopName => $departTimes) {
        $stopId = $stopName;
        $stopName = $myStops[$stopName];
        $count = 3;
        $arrival[$stopId] = str_replace('min', '', $arrival[$stopId]);
        $arrivals = explode('&', $arrival[$stopId]);
        if (!empty($arrivals)) {
            foreach ($arrivals as &$a) {
                $a = trim($a);
                if (is_numeric($a)) {
                    $a = $a . ' min';
                } else {
                    $a = '';
                }
            }
        }
        foreach ($departTimes as $departTime) {
            if ($departTime > 0) {
                $count--;
                if ($count >= 0) {
                    if ($json == true) {
                        $finalDisplay[$stopName][] = secondsToArray($departTime);
                    } else {
                        $rider = array_shift($arrivals);
                        $finalDisplay[$stopName][] = secondsToReadableTime($departTime) . "(Rider: " . (empty($rider) ? 'N/A' : $rider) . ")";
                    }
                }
            }
        }
    }
    return $finalDisplay;
}
コード例 #12
0
ファイル: folder.php プロジェクト: JackyMamba/SimpleEOW
<?php

require_once '../init.php';
require_once '../pager.php';
require_once getCacheFilePath('folders.php');
require_once './../../' . ADMIN_DIR . '/language/language.php';
if (!isAdmin()) {
    exit($_AL['all.notlogin']);
}
$folders = $cache_folders;
foreach ($folders as $key => $folder) {
    $folder['title'] = htmlFilter($folder['title']);
    $folder['updatetime'] = getDateStr($folder['updatetime']);
    $folders[$key] = $folder;
}
print <<<EOT
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Folder</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../getfiles.php?t=js&v={$_SYS['VERSION']}&f=util|ajax|admin"></script>
<body style="background:#fff;">
<table width="100%"><tr><td><a href="index.php?enter=1" target="_self"  title="{$_AL['folder.returnlist']}"><img src="images/btn_list.gif" border="0" /></a> <img src="images/btn_close.gif" id="btnClose" onclick="window.parent.popwin.close()" border="0" style="cursor:pointer;" /> </td></tr></table>
<form id="folderform" onsubmit="return false">
<!--#######################-->
<div class="condiv"><a href="javascript:showCreateFolder()">{$_AL['folder.new']}</a> | <input type="checkbox" onclick="selectAll('folderform',this.checked)" />{$_AL['all.selectall']} &nbsp;<a href="javascript:showDelFolder()">{$_AL['folder.delsel']}</a>
\t<!--#######################-->
\t<div id="createfolderdiv" style="display:none;">
\t\t{$_AL['folder.pleaseinputname']}: <input type="text" value="" size="30" maxlength="50" id="newfoldername" name="newfoldername" class="text_css" /> <input type="button" value="  {$_AL['folder.create']}  " onclick="createFolder()" class="button_css" />
コード例 #13
0
ファイル: func3.php プロジェクト: denson7/phpstudy
function getTable1()
{
    $table = '<table border="1" width="60%">';
    for ($i = 1; $i <= 3; ++$i) {
        $table .= '<tr>';
        for ($j = 1; $j <= 3; ++$j) {
            $table .= '<td>x</td>';
        }
        $table .= '</tr>';
    }
    $table .= '</table>';
    return $table;
}
getTable1();
//sdffkljfsdkljsdfjklsdfkljsdf
echo '<hr/>';
//输出4行5列的表格
//得到2015年8月21日 星期五
/**
 * 得到2015年8月21日 星期五
 * @return string
 */
function getDateStr()
{
    $search = array(0, 1, 2, 3, 4, 5, 6);
    $replace = array('日', '一', '二', '三', '四', '五', '六');
    $string = date('w');
    return date("Y年m月d日  星期") . str_replace($search, $replace, $string);
}
echo getDateStr();
//sdjklsdfljksdfklj
コード例 #14
0
ファイル: member.php プロジェクト: rust1989/edit
        echo <<<EOT
\t<div id="smalltab_container"></div>
\t<div class="smalltab_line"></div>
\t<div class="div_clear" style="height:10px;"></div>
\t<div id="t1">
\t\t<form id="verifyform" onsubmit="return false;">
\t\t<div class="tips_1">{$_AL['member.s.tips']}</div>
\t\t<div class="div_clear" style="height:10px;"></div>
\t\t
EOT;
        echo "<table class=\"table_1\" width=\"100%\">";
        echo "<tr style=\"font-weight:bold;color:#333333;\"><td class=\"row_0\"><div class=\"rowdiv_0\" style=\"width:{$dwidth[1]}px;\">{$_AL['all.control']}</div><div class=\"rowdiv_0\" style=\"width:{$dwidth[2]}px;\">{$_AL['member.name']}/{$_AL['member.email']}</div><div class=\"rowdiv_0\" style=\"width:{$dwidth[3]}px;\">{$_AL['member.signupip']}/{$_AL['member.signuptime']}</div></td></tr>";
        for ($i = 0; $i < count($rows); $i++) {
            $row = $rows[$i];
            $row['membername'] = htmlFilter($row['membername']);
            $row['signuptime'] = getDateStr($row['signuptime'], false);
            echo "<tr><td class=\"row_0\" style=\"line-height:180%;\"><div class='rowdiv_0' style='width:{$dwidth[1]}px;'><input type='radio' value='0' name='doaction[{$row['id']}]' class='radio_css' /> {$_AL['member.state0']} &nbsp; <input type='radio' value='1' name='doaction[{$row['id']}]' checked='true' class='radio_css' /> {$_AL['member.state1']}<br /><input type='radio' value='2' name='doaction[{$row['id']}]' class='radio_css' /> {$_AL['member.state2']} &nbsp; <input type='radio' value='3' name='doaction[{$row['id']}]' class='radio_css' /> {$_AL['member.state3']}<br /></div><div class='rowdiv_0' style='width:{$dwidth[2]}px;'><span style='color:#FF6600;'>{$row['membername']}</span><br />{$row['email']}</div><div class='rowdiv_0' style='width:{$dwidth[3]}px;'>{$row['signupip']}<br />{$row['signuptime']}</div></td></tr>";
        }
        echo "<tr><td class=\"td_3\"><input class=\"button_css\" type=\"button\" value=\"  {$_AL['all.submit']}  \" onclick=\"ajax_verify()\" /></td></tr>";
        echo "</table>";
        echo <<<EOT
\t\t
\t
\t</form>
</div>
<div id="t2"></div>
<div id="t3"></div>
<div class="div_clear" style="height:30px;"></div>
<script>
var smallNowTab;
var pt = new Tabs();
コード例 #15
0
ファイル: index.php プロジェクト: rust1989/edit
<?php

require_once './../inc/init.php';
_header_('Content-Type:text/xml;');
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n";
$url = getUrlPath(0);
$lastmod = getDateStr(time(), 'dateonly', false);
print <<<EOT
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
EOT;
foreach ($cache_langs as $lang) {
    print <<<EOT
<sitemap>
\t<loc>{$url}/channels.php?langid={$lang['id']}</loc>
\t<lastmod>{$lastmod}</lastmod>
</sitemap>
<sitemap>
\t<loc>{$url}/articlelist.php?langid={$lang['id']}</loc>
\t<lastmod>{$lastmod}</lastmod>
</sitemap>
<sitemap>
\t<loc>{$url}/productlist.php?langid={$lang['id']}</loc>
\t<lastmod>{$lastmod}</lastmod>
</sitemap>
EOT;
}
print <<<EOT
</sitemapindex>
EOT
;
コード例 #16
0
ファイル: user.php プロジェクト: rust1989/edit
        $curPage = intval($_GET["page"]);
        $pager = new Pager();
        $cond = "ishidden=0";
        $pager->init(10, $curPage, "admin.php?inc=user&action=search&username={$username}&userid={$userid}&groupid={$groupid}&page={page}");
        $rows = $pager->queryRows($db, "users", $cond, "*", "id desc");
        echo <<<EOT
\t<div class="div_clear" style="height:10px;"></div>
EOT;
        echo "<form id=\"usersform\" onsubmit=\"return false;\">";
        echo "<table class=\"table_1\" width=\"100%\">";
        echo "<tr style=\"font-weight:bold;color:#333333;\"><td class=\"row_0\"><div class=\"rowdiv_0\" style=\"width:{$dwidth[1]}px;\"><span class=\"warning\">{$_AL['all.delete']}</span></div><div class=\"rowdiv_0\" style=\"width:{$dwidth[2]}px;\">{$_AL['user.username']}</div><div class=\"rowdiv_0\" style=\"width:{$dwidth[3]}px;\">{$_AL['user.realname']}</div><div class=\"rowdiv_0\" style=\"width:{$dwidth[4]}px;\">{$_AL['user.lastip']}</div><div class=\"rowdiv_0\" style=\"width:{$dwidth[5]}px;\">{$_AL['user.lastlogin']}</div><div class=\"rowdiv_0\" style=\"width:{$dwidth[6]}px;\">{$_AL['user.addtime']}</div><div class=\"rowdiv_0\" style=\"width:{$dwidth[7]}px;\">{$_AL['all.control']}</div></td></tr>";
        for ($i = 0; $i < count($rows); $i++) {
            $row = $rows[$i];
            $row['lastip'] = empty($row['lastip']) ? '--' : $row['lastip'];
            $row['lasttime'] = empty($row['lasttime']) ? '--' : getDateStr($row['lasttime']);
            $row['addtime'] = empty($row['addtime']) ? '--' : getDateStr($row['addtime']);
            $row['username'] = htmlFilter($row['username']);
            $row['realname'] = htmlFilter($row['realname']);
            $checkboxstr = '';
            if ($row['id'] == $lg['userid']) {
                $checkboxstr = "<input type=\"checkbox\" disabled=\"true\" class=\"checkbox_css\" />";
            } else {
                $checkboxstr = "<input type=\"checkbox\" value=\"{$row['id']}\" name=\"deluid[]\" class=\"checkbox_css\" />";
            }
            echo "<tr><td class=\"row_0\" style=\"line-height:150%;\"><div class='rowdiv_0' style='width:{$dwidth[1]}px;'>{$checkboxstr}</div><div class='rowdiv_0' style='width:{$dwidth[2]}px;'><a href=\"admin.php?inc=user&action=edituser&uid={$row['id']}\">{$row['username']}</a>&nbsp;</div><div class='rowdiv_0' style='width:{$dwidth[3]}px;'>{$row['realname']}&nbsp;</div><div class='rowdiv_0' style='width:{$dwidth[4]}px;'>{$row['lastip']}</div><div class='rowdiv_0' style='width:{$dwidth[5]}px;'>{$row['lasttime']}</div><div class='rowdiv_0' style='width:{$dwidth[6]}px;'>{$row['addtime']}</div><div class='rowdiv_0' style='width:{$dwidth[7]}px;'><a href=\"admin.php?inc=user&action=edituser&uid={$row['id']}\">{$_AL['all.edit']}</a>&nbsp;&nbsp; <a href=\"admin.php?inc=user&action=popedom&uid={$row['id']}\">{$_AL['user.popedom']}</a></div></td></tr>";
        }
        echo "</table>";
        echo <<<EOT
\t<table class="table_1" width="100%">
\t\t<tr><td class="td_6"><a class="td_5_1a" href="admin.php?inc=user&action=adduser"><img src="images/ico_add.gif" border="0" /> {$_AL['user.add.tab']}</a></td></tr>
\t</table>
コード例 #17
0
ファイル: files.php プロジェクト: JackyMamba/SimpleEOW
    setCookies("lastfolderid", $folderid);
} else {
    $folderid = intval(getCookies("lastfolderid"));
}
//preview
setCookies("lastfoldertype", 2);
$pagerlink = "files.php?page={page}&folderid={$folderid}";
$condition = "folderid={$folderid}";
$orderstr = "id desc";
$pager = new Pager();
$pager->init(10, $curPage, $pagerlink);
$attachements = $pager->queryRows($db, "attachments", $condition, "*", $orderstr);
foreach ($attachements as $key => $att) {
    $att['shortfilename'] = htmlFilter(cutStr($att['filename'], 12));
    $att['filename'] = htmlFilter($att['filename']);
    $att['uploadtime'] = getDateStr($att['uploadtime']);
    $attachements[$key] = $att;
}
$folderrow = $cache_folders[$folderid];
$folderrow['title'] = htmlFilter($folderrow['title']);
print <<<EOT
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>IMAGE</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../getfiles.php?t=js&v={$_SYS['VERSION']}&f=util|ajax|admin"></script>
<body style="background:#fff;">
<table width="100%"><tr><td width="140px"><a href="folder.php" target="_self" title="{$_AL['folder.returnfolder']}"><img src="images/btn_uplevel.gif" border="0" /></a> <img src="images/btn_close.gif" id="btnClose" onclick="window.parent.popwin.close()" border="0" style="cursor:pointer;" /> </td><td><div class="list_pager">{$pager->getPageStr()}</div></td></tr></table>
<form id="filesform" onsubmit="return false">
コード例 #18
0
ファイル: msg.php プロジェクト: rust1989/edit
        $pager->init(10, $curPage, "admin.php?inc=msg&action=list&k={$keyword}&state={$state}&page={page}");
        $rows = $pager->queryRows($db, "msgs", $cond, "*", $orderbystr);
        $recstr = _LANG($_AL['all.totalrecords'], array($pager->recordNum));
        echo <<<EOT
\t<div class="div_clear" style="height:10px;"></div>
\t<div class="tips_1">
{$_AL['all.keyword']}: <input class="text_css" type="text" size="20" value="{$keyword}" id="keyword" /> <select id="state"><option value="all">{$_AL['msg.cond0']}</option><option value="y">{$_AL['msg.cond1']}</option><option value="n">{$_AL['msg.cond2']}</option></select> <input class="button_css" type="button" value="  {$_AL['all.search']}  " onclick="searchmsg()" />
&nbsp;&nbsp;&nbsp;{$recstr}</div>
EOT;
        echo "<form id=\"msgsform\" onsubmit=\"return false;\">";
        echo "<table class=\"table_1\" width=\"100%\">";
        echo "<tr style=\"font-weight:bold;color:#333333;\"><td class=\"row_0\">" . "<div class=\"rowdiv_0\" style=\"width:{$dwidth[1]}px;\">{$_AL['all.select']}</div>" . "<div class=\"rowdiv_0\" style=\"width:{$dwidth[2]}px;padding:0px 10px;\">{$_AL['msg.title']}/{$_AL['msg.user']}</div>" . "<div class=\"rowdiv_0\" style=\"width:{$dwidth[3]}px;\">{$_AL['msg.email']}/{$_AL['msg.contact']}/{$_AL['msg.ip']}</div>" . "<div class=\"rowdiv_0\" style=\"width:{$dwidth[4]}px;padding:0px 10px;\">{$_AL['msg.lastreply']}</div>" . "<div class=\"rowdiv_0\" style=\"width:{$dwidth[5]}px;\">&nbsp;{$_AL['msg.verify.state']}</div>" . "<div class=\"rowdiv_0\" style=\"width:{$dwidth[6]}px;\">{$_AL['all.control']}</div>" . "";
        for ($i = 0; $i < count($rows); $i++) {
            $row = $rows[$i];
            $row['posttime'] = $row['posttime'] == 0 ? "——" : getDateStr($row['posttime']);
            $row['replytime'] = $row['replytime'] == 0 ? "——" : getDateStr($row['replytime']);
            $row['name'] = htmlFilter($row['name']);
            $row['contact1'] = htmlFilter($row['contact1']);
            $row['email'] = htmlFilter($row['email']);
            $row['title'] = htmlFilter($row['title']);
            $row['replier'] = htmlFilter($row['replier']);
            $row['remark'] = cutStr(strip_tags(str_replace(array("\r", "\n"), array('', ''), $row['remark'])), 30);
            $row['reply'] = cutStr(strip_tags(str_replace(array("\r", "\n"), array('', ''), $row['reply'])), 30);
            $statestr = intval($row['state']) == 0 ? "<a href='msg_ajax.php?action=verify&state=1&id={$row['id']}' class='def_no' title=\"{$_AL['msg.click2verify']}\">{$_AL['msg.notverify']}</a>" : "<a href='msg_ajax.php?action=verify&state=0&id={$row['id']}' class='def_yes' title='{$_AL['msg.click2notverify']}'>{$_AL['msg.hadverify']}</a>";
            $checkboxstr = "<input type=\"checkbox\" value=\"{$row['id']}\" name=\"ids[]\" class=\"checkbox_css\" />";
            echo "<tr><td class=\"row_0\" style=\"line-height:150%;\">" . "<div class='rowdiv_0' style='width:{$dwidth[1]}px;'>{$checkboxstr}</div>" . "<div class='rowdiv_0' style='width:{$dwidth[2]}px; padding:0px 10px;'>{$row['title']}<br /><b>{$row['name']}</b> <span class='time'>{$row['posttime']}</span></div>" . "<div class='rowdiv_0' style='width:{$dwidth[3]}px;'>{$row['email']}<br />{$row['contact1']}<br /><span class='time'>{$row['ip']}</span></div>" . "<div class='rowdiv_0' style='width:{$dwidth[4]}px; padding:0px 10px;'>{$row['reply']}<br /><b>{$row['replier']}</b> <span class='time'>{$row['replytime']}</span></div>" . "<div class='rowdiv_0' style='width:{$dwidth[5]}px;'>{$statestr}</div>" . "<div class='rowdiv_0' style='width:{$dwidth[6]}px;'><a href=\"admin.php?inc=msg&action=reply&id={$row['id']}\">{$_AL['msg.reply']}</a></div>" . "";
        }
        echo "</table>";
        echo <<<EOT
\t<table width=100%><tr><td><input type="checkbox" onclick="selectAll('msgsform',this.checked)" class="checkbox_css" /> {$_AL['all.selectall']} &nbsp;&nbsp;<select id="postaction" name="postaction">
\t\t<option value="NOTHING">{$_AL['all.chooseaction']}</option>
コード例 #19
0
ファイル: func5.php プロジェクト: denson7/phpstudy
* @param string $del1
* @param string $del2
* @param string $del3
* @return string
*/
function getDateStr($del1 = '年', $del2 = '月', $del3 = '日')
{
    $search = array(0, 1, 2, 3, 4, 5, 6);
    $replace = array('日', '一', '二', '三', '四', '五', '六');
    $subject = date('w');
    return date("Y{$del1}m{$del2}d{$del3} 星期") . str_replace($search, $replace, $subject);
}
echo '<hr/>';
echo getDateStr();
echo '<br/>';
echo getDateStr('-', '-', '');
//3.给你一个字符串,将字符串中的特殊字符转换成HTML 实体 > < ' " &
//得到转换之后的字符串
$string = <<<EOF
\tA>B > > >
EOF;
echo '<hr/>';
/**
 * 过滤字符串中的特殊字符
 * @param string $string
 * @return string
 */
function filterString($string)
{
    return htmlspecialchars($string, ENT_QUOTES);
}
コード例 #20
0
ファイル: search.php プロジェクト: rust1989/edit
$tempsql .= "\r\n (\r\n\tSELECT 1 as rtype,id,name as title,posttime,content FROM {$db->pre}products WHERE langid={$_SYS['langid']} and (name like '%{$k}%' or content like '%{$k}%')\r\n\tUNION ALL\r\n\tSELECT 2 as rtype,id,title,posttime,content FROM {$db->pre}articles WHERE langid={$_SYS['langid']} and (title like '%{$k}%' or content like '%{$k}%')\r\n\tUNION ALL\r\n\tSELECT 3 as rtype,id,title,null as posttime,content FROM {$db->pre}channels WHERE langid={$_SYS['langid']} and (content like '%{$k}%' or content like '%{$k}%')\r\n) TEMPTB\r\n";
$recordnum = $db->row_query_one("SELECT count(1) as total FROM {$tempsql}");
$recordnum = intval($recordnum['total']);
$recordnumstr = _LANG($_SLANG['search.total'], array($recordnum));
$pager = new Pager();
$pager->init(10, $curPage, $pagerlink);
$res = $pager->queryRowsBySQL($db, "SELECT * FROM {$tempsql} ORDER BY posttime DESC", $recordnum);
foreach ($res as $key => $rs) {
    switch ($rs['rtype']) {
        case 1:
            $rs['link'] = $webcore->genUrl("product.php?id={$rs['id']}");
            $rs['posttime'] = getDateStr($rs['posttime']);
            break;
        case 2:
            $rs['link'] = $webcore->genUrl("view.php?id={$rs['id']}");
            $rs['posttime'] = getDateStr($rs['posttime']);
            break;
        case 3:
            $rs['link'] = $webcore->genUrl("page.php?cid={$rs['id']}");
            $rs['posttime'] = "";
            break;
    }
    $rs['type'] = $_SLANG['search.types'][intval($rs['rtype'])];
    $rs['title'] = htmlFilter($rs['title']);
    $rs['content'] = cutStr(strip_tags($rs['content']), 300);
    $rs['title'] = preg_replace('/' . $k . '/i', "<u>{$k}</u>", $rs['title']);
    $rs['content'] = preg_replace('/' . $k . '/i', "<u>{$k}</u>", $rs['content']);
    $res[$key] = $rs;
}
$headtitle = empty($voterow['title']) ? "" : strip_tags(str_replace(array("\r", "\n"), array('', ''), $voterow['title']));
$headkeywords = $headtitle;
コード例 #21
0
ファイル: channels.php プロジェクト: rust1989/edit
<?php

require_once '../inc/init.php';
$langid = intval($_GET['langid']);
$urlrewrite = intval($cache_settings['urlrewrite']);
_header_('Content-Type:text/xml;');
print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n";
$lastmod = getDateStr(time(), "dateonly", false);
print <<<EOT
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

EOT;
$rows = $db->row_select("channels", "langid={$langid}", "5000", "id,ishidden,channeltype,pid,systemtype");
$i = 0;
foreach ($rows as $channel) {
    if ($channel['channeltype'] == '4') {
        continue;
    }
    $priority = 1 - $i++ / 10000;
    $priority = $priority < 0.6 ? 0.6 : $priority;
    $priority = number_format($priority, 2);
    $locurl = $webcore->genNavLink($channel);
    $locurl = str_replace('/sitemap/', '/', $locurl);
    print <<<EOT
<url>
<loc>{$locurl}</loc>
<priority>{$priority}</priority>
<changefreq>daily</changefreq>
<lastmod>{$lastmod}</lastmod>
</url>
コード例 #22
0
ファイル: articlelist.php プロジェクト: rust1989/edit
    $par_channel = $cache_channels[$channel['pid']];
    foreach ($cache_channels[$channel['pid']]['childcid'] as $childcid) {
        $tmpchannel = $cache_channels[$childcid];
        if ($tmpchannel['ishidden'] == '1') {
            continue;
        }
        $secmenu .= "<li class='big'><a href=\"" . $webcore->genNavLink($tmpchannel) . "\">{$tmpchannel['title']}</a></li>";
    }
} else {
    $par_channel = $channel;
}
$condition = empty($channelid) ? "" : "channelid={$channelid}";
$orderstr = "id desc";
$curPage = intval($_GET["page"]);
$pagerlink = "articlelist.php?cid={$channelid}";
$pagerlink .= "&page={page}";
$pagerlink = $webcore->genUrl($pagerlink);
$pager = new Pager();
$pager->init(intval($cache_settings['perpageart']), $curPage, $pagerlink);
$articles = $pager->queryRows($db, "articles", $condition, "*", $orderstr);
foreach ($articles as $key => $article) {
    $article['link'] = $webcore->genUrl("view.php?id={$article['id']}");
    $article['title'] = htmlFilter($article['title']);
    $article['picpath'] = $webcore->getPicPath($article['picpath'], true, true);
    $article['posttime'] = getDateStr($article['posttime'], false, 0);
    $articles[$key] = $article;
}
$_SYS['positionchannel'] = " » <a href=" . $webcore->genUrl("articlelist.php?cid={$channel['id']}") . ">{$channel['title']}</a>";
require_once './header.php';
require_once getTemplatePath('articlelist.htm');
footer();
コード例 #23
0
ファイル: article.php プロジェクト: rust1989/edit
\t<div class="tips_1">
{$_AL['all.keyword']}: <input class="text_css" type="text" size="20" value="{$keyword}" id="keyword" />
<select id="orderby"><option value="id">{$_AL['all.orderby']}</option><option value="posttime">{$_AL['all.posttime']}</option><option value="hits">{$_AL['all.hits']}</option></select>
<input class="button_css" type="button" value="  {$_AL['all.search']}  " onclick="searcharticle()" />
&nbsp;&nbsp;&nbsp;{$recstr}</div>
\t<table class="table_1" width="100%">
\t\t<tr><td class="td_6"><a class="td_5_1a" href="admin.php?inc=article&action=add&channelid={$channelid}"><img src="images/ico_add.gif" border="0" /> {$_AL['article.add']}</a></td></tr>
\t</table>

EOT;
        echo "<form id=\"articlesform\" onsubmit=\"return false;\">";
        echo "<table class=\"table_1\" width=\"100%\">";
        echo "<tr style=\"font-weight:bold;color:#333333;\"><td class=\"row_0\">" . "<div class=\"rowdiv_0\" style=\"width:{$dwidth[1]}px;\">{$_AL['all.select']}</div>" . "<div class=\"rowdiv_0\" style=\"width:{$dwidth[2]}px;\">{$_AL['all.title']}</div>" . "<div class=\"rowdiv_0\" style=\"width:{$dwidth[7]}px;\">{$_AL['all.hits']}</div>" . "<div class=\"rowdiv_0\" style=\"width:{$dwidth[5]}px;\">{$_AL['all.posttime']}</div>" . "<div class=\"rowdiv_0\" style=\"width:{$dwidth[8]}px;\">{$_AL['all.control']}</div>" . "";
        for ($i = 0; $i < count($rows); $i++) {
            $row = $rows[$i];
            $row['posttime'] = getDateStr($row['posttime']);
            $row['title'] = htmlFilter($row['title']);
            $row['username'] = htmlFilter($row['username']);
            $checkboxstr = "<input type=\"checkbox\" value=\"{$row['id']}\" name=\"aids[]\" class=\"checkbox_css\" />";
            echo "<tr><td class=\"row_0\" style=\"line-height:150%;\">" . "<div class='rowdiv_0' style='width:{$dwidth[1]}px;'>{$checkboxstr}</div>" . "<div class='rowdiv_0' style='width:{$dwidth[2]}px;'><a href=\"../view.php?id={$row['id']}\" target=\"_blank\">{$row['title']}</a>&nbsp;</div>" . "<div class='rowdiv_0' style='width:{$dwidth[7]}px;'><span class='time'>{$row['hits']}</span></div>" . "<div class='rowdiv_0' style='width:{$dwidth[5]}px;'><span class='time'>{$row['posttime']}</span></div>" . "<div class='rowdiv_0' style='width:{$dwidth[8]}px;'><a href=\"admin.php?inc=article&action=edit&id={$row['id']}\">{$_AL['all.edit']}</a></div>" . "";
        }
        echo "</table>";
        echo "<table width=100%><tr><td><input type=\"checkbox\" onclick=\"selectAll('articlesform',this.checked)\" class=\"checkbox_css\" /> {$_AL['all.selectall']} &nbsp;&nbsp;<input type=\"button\" class=\"button_css\" value=\"  {$_AL['all.delete']}  \" onclick=\"ajax_doarticles_yn()\" /></td><td><div class='pagestrdiv'>{$pager->getPageStr()}</div></td></tr></table>";
        echo "</form>";
        echo <<<EOT
\t</div>
\t<div id="t2"></div>
\t<div id="t3"></div>
\t<div class="div_clear" style="height:30px;"></div>
<script>
var smallNowTab;
コード例 #24
0
ファイル: order.php プロジェクト: rust1989/edit
        $rows = $pager->queryRows($db, "orders", "{$cond} AND langid={$_SYS['alangid']}", "*", "{$orderbystr}");
        echo <<<EOT
\t<div class="div_clear" style="height:10px;"></div>
\t<div class="tips_1">
{$_AL['all.keyword']}: <input class="text_css" type="text" size="20" value="{$keyword}" id="keyword" />
<select id="state"><option value="-1">{$_AL['all.state']}</option>{$options}</select> <select id="orderby"><option value="id">{$_AL['all.orderby']}</option><option value="createtime">{$_AL['order.createtime']}</option><option value="total">{$_AL['order.total.noexp']}</option></select>
<input class="button_css" type="button" value="  {$_AL['all.search']}  " onclick="searchorders()" />
&nbsp;&nbsp;&nbsp;{$recstr}</div>

EOT;
        echo "<form id=\"ordersform\" onsubmit=\"return false;\">";
        echo "<table class=\"table_1\" width=\"100%\">";
        echo "<tr style=\"font-weight:bold;color:#333333;\"><td class=\"row_0\">" . "<div class=\"rowdiv_0\" style=\"width:{$dwidth[1]}px;\">{$_AL['all.select']}</div>" . "<div class=\"rowdiv_0\" style=\"width:{$dwidth[2]}px;\">{$_AL['order.number']}/{$_AL['order.createtime']}</div>" . "<div class=\"rowdiv_0\" style=\"width:{$dwidth[3]}px; padding-right:8px;\">{$_AL['order.product.list']}</div>" . "<div class=\"rowdiv_0\" style=\"width:{$dwidth[4]}px;\">{$_AL['order.total']}</div>" . "<div class=\"rowdiv_0\" style=\"width:{$dwidth[5]}px;\">{$_AL['order.csg.details']}</div>" . "<div class=\"rowdiv_0\" style=\"width:{$dwidth[6]}px;\">{$_AL['order.state']}</div>" . "<div class=\"rowdiv_0\" style=\"width:{$dwidth[7]}px;\">{$_AL['all.control']}</div>" . "";
        for ($i = 0; $i < count($rows); $i++) {
            $row = $rows[$i];
            $row['createtime'] = getDateStr($row['createtime']);
            $row['name'] = htmlFilter($row['name']);
            $row['phonenum'] = htmlFilter($row['phonenum']);
            $row['email'] = htmlFilter($row['email']);
            $row['address'] = htmlFilter(cutStr($row['address'], 12));
            $row['zipcode'] = htmlFilter($row['zipcode']);
            $row['remark'] = htmlFilter($row['remark']);
            $row['total'] = number_format($row['total'], 2);
            $orows = $db->row_select("orderdetails", "langid={$_SYS['alangid']} and orderid={$row['id']}", 0, "proid,price,proname,pronum");
            //$proids=explode($SPRT,$row['proids']);
            //$prices=explode($SPRT,$row['prices']);
            //$pronames=explode($SPRT,htmlFilter($row['pronames']));
            //$pronums=explode($SPRT,$row['pronums']);
            $prostr = '';
            foreach ($orows as $key => $orow) {
                //$prices[$key]=number_format($prices[$key],2);