function isNumberPrime() { $num = getNumber(); //1 is not prime. See: http://en.wikipedia.org/wiki/Prime_number#Primality_of_one if ($num == 1) { return false; } //2 is prime (the only even number that is prime) if ($num == 2) { return true; } /** * if the number is divisible by two, then it's not prime and it's no longer * needed to check other even numbers */ if ($num % 2 == 0) { return false; } /** * Checks the odd numbers. If any of them is a factor, then it returns false. * The sqrt can be an approximation, hence just for the sake of * security, one rounds it to the next highest integer value. */ for ($i = 3; $i <= ceil(sqrt($num)); $i = $i + 2) { if ($num % $i == 0) { return false; } } return true; }
function newGame() { start(); echo "<div class='title'> " . getNumber() . " </div>"; echo "<div class='sub-title'>Quedan por salir - " . getRest() . "</div>"; drawBoard(); fillTable(18); showTable(); }
function setNumber(&$param) { $n = getNumber($param); // Получаем объект базы данных $db = JFactory::getDbo(); // Получаем объект конструктора запросов $query = $db->getQuery(true); // Поля для обновления $fields = array($db->quoteName($param) . ' = ' . ++$n); // Условия для обновления $conditions = array($db->quoteName('id') . ' = 1'); // Конструируем запрос $query->update('#__feedback_buttons')->set($fields)->where($conditions); // Устанавливаем запрос $db->setQuery($query); // Выполняем запрос $db->query(); return $n; }
$members = getConference($db, $conference); ?> <table align="center" border="0" cellpadding="4" cellspacing="0" id="mainTable"> <tr class="tableHeader"> <td align="center" class="tableHeaderLeft">Number</td> <td align="center">Name</td> <td align="center">Member ID</td> <td align="center">Channel</td> <td align="center">Actions</td> <td align="center" class="tableHeaderRight">Talking</td> </tr> <?php foreach ($members as &$member) { $channel = getChannel($db, $member); $name = getName($db, $member); $number = getNumber($db, $member); $talking = getTalking($db, $member); $muted = getMuted($db, $member); if ($row_id == "RowEven") { $row_id = "RowOdd"; $bgcolor = "#FFFFFF"; } else { $row_id = "RowEven"; $bgcolor = "#D5F7FF"; } ?> <tr class="<?php echo $row_id; ?> "> <td align="center"><?php
$pattern2 = "/\"\\,*\"*/m"; $strings = preg_split($pattern2, $strings, -1, PREG_SPLIT_NO_EMPTY); for ($i = 0; $i < count($values); $i++) { $values[$i] = (int) $values[$i]; } //var_dump($values); $k = $values[0]; $s = $values[1]; $result = []; foreach ($strings as $word) { $tmp = str_split($word); $tableLine = []; //var_dump($tmp); foreach ($tmp as $element) { if (ord($element) >= ord("a") && ord($element) <= ord('z') || ord($element) >= ord("A") && ord($element) <= ord('Z')) { $tableLine[] = chr(ord("A") + ($k * getNumber($element) + $s) % 26); } else { $tableLine[] = $element; } } $result[] = $tableLine; } echo '<table border=' . '\'1\' cellpadding=\'5\'>'; foreach ($result as $element) { echo '<tr>'; for ($i = 0; $i < findTableWidth($strings); $i++) { if (isset($element[$i])) { echo '<td style=\'background:#CCC\'>' . htmlspecialchars($element[$i]) . '</td>'; } else { echo '<td></td>'; }
function getVodPlanAndWebUrl($id, $testUrl, $m_playfrom, $d_type) { global $db; $playUrl = ""; $webUrl = ""; $videoUrl = ""; if ($d_type === '3') { $sql2 = "select * from {pre}cj_vod_url where u_movieid=" . $id . " order by name desc "; } else { $sql2 = "select * from {pre}cj_vod_url where u_movieid=" . $id . " ORDER BY cast( name AS unsigned int ) ASC,u_id asc"; } $rs_collect2 = $db->query($sql2); $rscount = $db->getOne("Select count(m_id) as cc from {pre}cj_vod_url where u_movieid=" . $id); $num = 1; $playNum = 1; $noVideoUrlFlag = false; while ($row = $db->fetch_array($rs_collect2)) { if ($num == 1) { $playUrl .= $row["u_url"]; } else { $playUrl .= "#" . $row["u_url"]; } $urstee = $row["u_weburl"]; $setname = $row['name']; if ($rscount == 1 && !(isset($urstee) && !is_null($urstee))) { $urstee = $testUrl; } if (isset($setname) && !is_null($setname)) { // var_dump($m_playfrom);var_dump($d_type); $playNum = $setname . '$'; } else { $playNum = $num . '$'; if ($m_playfrom === 'letv' && $d_type === '2') { $playNum = getNumber($urstee) . '$'; } // var_dump($m_playfrom);var_dump($d_type);var_dump($urstee); } if (strpos($urstee, 'video.baidu.com') !== false) { $urstee = ''; } if ($num == 1) { $webUrl .= $playNum . $urstee; } else { $webUrl .= "{Array}" . $playNum . $urstee; } $videourstee = $row["iso_video_url"]; $android_vedio_url = $row["android_vedio_url"]; if (!isN($videourstee)) { if (!isN($android_vedio_url)) { $videourstee = $android_vedio_url . MovieType::VIDEO_SEP_VERSION . $videourstee; } } else { $videourstee = $android_vedio_url; } if (isset($videourstee) && !is_null($videourstee)) { // if($rscount==1 ){ // $videoUrl=$videourstee; // }else { if (isset($setname) && !is_null($setname)) { // var_dump($m_playfrom);var_dump($d_type); $playNum = $setname . '$'; } else { $playNum = $num . '$'; if ($m_playfrom === 'letv' && $d_type === '2') { $playNum = getNumber($urstee) . '$'; } } if (!isN($videourstee)) { if ($num == 1) { $videoUrl .= $playNum . $videourstee; } else { $videoUrl .= "{Array}" . $playNum . $videourstee; } } // if(!isN($android_vedio_url)) // } } else { $noVideoUrlFlag = true; } $num = $num + 1; } // var_dump($webUrl); unset($rs_collect2); if (strpos($videoUrl, 'http') === false) { $noVideoUrlFlag = true; } return array('playUrl' => $playUrl, 'webUrl' => $webUrl, 'videoUrl' => $videoUrl, 'noVideoUrlFlag' => $noVideoUrlFlag); }
function getVodPlanAndWebUrl($id, $testUrl, $m_playfrom, $d_type) { global $db; $playUrl = ""; $webUrl = ""; $videoUrl = ""; $sql2 = "select * from {pre}cj_vod_url where u_movieid=" . $id . " order by u_id asc"; $rs_collect2 = $db->query($sql2); $rscount = $db->num_rows($rs_collect2); $num = 1; $playNum = 1; while ($row = $db->fetch_array($rs_collect2)) { if ($num == 1) { $playUrl .= $row["u_url"]; } else { $playUrl .= "#" . $row["u_url"]; } $urstee = $row["u_weburl"]; $setname = $row['name']; if ($rscount == 1 && !(isset($urstee) && !is_null($urstee))) { $urstee = $testUrl; } if (isset($setname) && !is_null($setname)) { // var_dump($m_playfrom);var_dump($d_type); $playNum = $setname . '$'; } else { $playNum = $num . '$'; if ($m_playfrom === 'letv' && $d_type === '2') { $playNum = getNumber($urstee) . '$'; } // var_dump($m_playfrom);var_dump($d_type);var_dump($urstee); } if ($num == 1) { $webUrl .= $playNum . $urstee; } else { $webUrl .= "{Array}" . $playNum . $urstee; } $videourstee = $row["iso_video_url"]; $android_vedio_url = $row["android_vedio_url"]; if (!isN($videourstee)) { if (!isN($android_vedio_url)) { $videourstee = $android_vedio_url . MovieType::VIDEO_SEP_VERSION . $videourstee; } } else { $videourstee = $android_vedio_url; } if (isset($videourstee) && !is_null($videourstee)) { // if($rscount==1 ){ // $videoUrl=$videourstee; // }else { if (isset($setname) && !is_null($setname)) { // var_dump($m_playfrom);var_dump($d_type); $playNum = $setname . '$'; } else { $playNum = $num . '$'; if ($m_playfrom === 'letv' && $d_type === '2') { $playNum = getNumber($urstee) . '$'; } } if (!isN($videourstee)) { if ($num == 1) { $videoUrl .= $playNum . $videourstee; } else { $videoUrl .= "{Array}" . $playNum . $videourstee; } } // if(!isN($android_vedio_url)) // } } $num = $num + 1; } // var_dump($webUrl); unset($rs_collect2); return array('playUrl' => $playUrl, 'webUrl' => $webUrl, 'videoUrl' => $videoUrl); }
function getThree($chars) { $getValue = ""; //cek apakah belasan if ($chars[1] == 1) { if ($chars[2] > 0) { $sayNumber = getNumber($chars[2]); $sayNumber = $sayNumber . " Belas "; if ($sayNumber == "Satu Belas ") { $sayNumber = "Sebelas "; } $getValue = $getValue . $sayNumber; } else { $sayNumber = "Sepuluh"; $getValue = $getValue . $sayNumber; } } else { if ($chars[2] != 0) { $sayNumber = getNumber($chars[2]); $getValue = $getValue . $sayNumber; } if ($chars[1] != 0) { $sayNumber = getNumber($chars[1]); $sayNumber = $sayNumber . " Puluh "; if ($sayNumber == "Satu Puluh ") { $sayNumber = "Sepuluh "; } $getValue = $sayNumber . $getValue; } } if ($chars[0] != 0) { $sayNumber = getNumber($chars[0]); $sayNumber = $sayNumber . " Ratus "; if ($sayNumber == "Satu Ratus ") { $sayNumber = "Seratus "; } $getValue = $sayNumber . $getValue; } return $getValue; }
function getNumber() { global $ceiling, $floor; return floor(($ceiling + $floor) / 2); } function checkAnswer($answer) { global $ceiling, $floor, $num; switch ($answer) { case "h": //higher $floor = $num; return true; case "l": //lower $ceiling = $num; return true; case "y": //is the number echo "Good Game"; return false; default: return true; } } do { $num = getNumber(); echo "Is this your number: [" . $num . "]? (y)es, No? Is it (h)igher or is it (l)ower?\n"; $answer = trim(fgets(STDIN)); } while (checkAnswer($answer)); exit(0);
function getNumberCustomer($table, $val1, $val2, $op, $field, $range) { $nb = 0; foreach ($table as $t) { if (!$range) { if (getNumber($op, $val1, $t[$field])) { $nb++; } } elseif ($t[$field] >= $val1 && $t[$field] <= $val2) { $nb++; } } return $nb; }
function resetAccessData_temp() { handlePower('恢复模板数据'); //管理权限处理 $GLOBALS['conn='] = OpenConn(); $splStr = ''; $i = ''; $s = ''; $columnname = ''; $title = ''; $nCount = ''; $webdataDir = ''; $webdataDir = @$_REQUEST['webdataDir']; if ($webdataDir != '') { if (checkFolder($webdataDir) == false) { eerr('网站数据目录不存在,恢复默认数据未成功', $webdataDir); } } else { $webdataDir = '/Data/WebData/'; } aspEcho('提示', '恢复数据完成'); rw('<hr><a href=\'../index.php\' target=\'_blank\'>进入首页</a> | <a href="?" target=\'_blank\'>进入后台</a>'); $content = ''; $filePath = ''; $parentid = ''; $author = ''; $adddatetime = ''; $fileName = ''; $bodycontent = ''; $webtitle = ''; $webkeywords = ''; $webdescription = ''; $sortrank = ''; $labletitle = ''; $target = ''; $websitebottom = ''; $webTemplate = ''; $webimages = ''; $webcss = ''; $webjs = ''; $flags = ''; $websiteurl = ''; $splxx = ''; $columntype = ''; $relatedtags = ''; $npagesize = ''; $customaurl = ''; $nofollow = ''; $templatepath = ''; $isthrough = ''; $titlecolor = ''; $showreason = ''; $ncomputersearch = ''; $nmobliesearch = ''; $ncountsearch = ''; $ndegree = ''; //竞价表 $displaytitle = ''; $aboutcontent = ''; $isonhtml = ''; //单页表 $columnenname = ''; //导航表 $smallimage = ''; $bigImage = ''; $bannerimage = ''; //文章表 $httpurl = ''; $price = ''; $morepageurl = ''; $charset = ''; $thispage = ''; $countpage = ''; $bigClassName = ''; $startStr = ''; $endStr = ''; $startaddstr = ''; $endaddstr = ''; $sType = ''; $saction = ''; $fieldName = ''; $fieldcheck = ''; //网站配置 $content = GetFText($webdataDir . '/website.txt'); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } if ($content != '') { $webtitle = newGetStrCut($content, 'webtitle'); $webkeywords = newGetStrCut($content, 'webkeywords'); $webdescription = newGetStrCut($content, 'webdescription'); $websitebottom = newGetStrCut($content, 'websitebottom'); $webTemplate = newGetStrCut($content, 'webtemplate'); $webimages = newGetStrCut($content, 'webimages'); $webcss = newGetStrCut($content, 'webcss'); $webjs = newGetStrCut($content, 'webjs'); $flags = newGetStrCut($content, 'flags'); $websiteurl = newGetStrCut($content, 'websiteurl'); if (getRecordCount($GLOBALS['db_PREFIX'] . 'website', '') == 0) { connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'website(webtitle) values(\'测试\')'); } connexecute('update ' . $GLOBALS['db_PREFIX'] . 'website set webtitle=\'' . $webtitle . '\',webkeywords=\'' . $webkeywords . '\',webdescription=\'' . $webdescription . '\',websitebottom=\'' . $websitebottom . '\',webtemplate=\'' . $webTemplate . '\',webimages=\'' . $webimages . '\',webcss=\'' . $webcss . '\',webjs=\'' . $webjs . '\',flags=\'' . $flags . '\',websiteurl=\'' . $websiteurl . '\''); } //导航 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'webcolumn'); $content = getDirTxtList($webdataDir . '/webcolumn/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('导航', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【webtitle】') > 0) { $s = $s . vbCrlf(); $webtitle = newGetStrCut($s, 'webtitle'); $webkeywords = newGetStrCut($s, 'webkeywords'); $webdescription = newGetStrCut($s, 'webdescription'); $customaurl = newGetStrCut($s, 'customaurl'); $sortrank = newGetStrCut($s, 'sortrank'); if ($sortrank == '') { $sortrank = 0; } $fileName = newGetStrCut($s, 'filename'); $columnname = newGetStrCut($s, 'columnname'); $columnenname = newGetStrCut($s, 'columnenname'); $columntype = newGetStrCut($s, 'columntype'); $flags = newGetStrCut($s, 'flags'); $parentid = newGetStrCut($s, 'parentid'); $parentid = phpTrim(getColumnId($parentid)); //可根据栏目名称找到对应ID 不存在为-1 //call echo("parentid",parentid) $labletitle = newGetStrCut($s, 'labletitle'); //每页显示条数 $npagesize = newGetStrCut($s, 'npagesize'); if ($npagesize == '') { $npagesize = 10; } //默认分页数为10条 $target = newGetStrCut($s, 'target'); $smallimage = newGetStrCut($s, 'smallimage'); $bigImage = newGetStrCut($s, 'bigImage'); $bannerimage = newGetStrCut($s, 'bannerimage'); $templatepath = newGetStrCut($s, 'templatepath'); $bodycontent = newGetStrCut($s, 'bodycontent'); $bodycontent = contentTranscoding($bodycontent); //是否启用生成html $isonhtml = newGetStrCut($s, 'isonhtml'); if ($isonhtml == '0' || lCase($isonhtml) == 'false') { $isonhtml = 0; } else { $isonhtml = 1; } //是否为nofollow $nofollow = newGetStrCut($s, 'nofollow'); if ($nofollow == '1' || lCase($nofollow) == 'true') { $nofollow = 1; } else { $nofollow = 0; } //call echo(columnname,nofollow) $aboutcontent = newGetStrCut($s, 'aboutcontent'); $aboutcontent = contentTranscoding($aboutcontent); $bodycontent = newGetStrCut($s, 'bodycontent'); $bodycontent = contentTranscoding($bodycontent); connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'webcolumn (webtitle,webkeywords,webdescription,columnname,columnenname,columntype,sortrank,filename,customaurl,flags,parentid,labletitle,aboutcontent,bodycontent,npagesize,isonhtml,nofollow,target,smallimage,bigImage,bannerimage,templatepath) values(\'' . $webtitle . '\',\'' . $webkeywords . '\',\'' . $webdescription . '\',\'' . $columnname . '\',\'' . $columnenname . '\',\'' . $columntype . '\',' . $sortrank . ',\'' . $fileName . '\',\'' . $customaurl . '\',\'' . $flags . '\',' . $parentid . ',\'' . $labletitle . '\',\'' . $aboutcontent . '\',\'' . $bodycontent . '\',' . $npagesize . ',' . $isonhtml . ',' . $nofollow . ',\'' . $target . '\',\'' . $smallimage . '\',\'' . $bigImage . '\',\'' . $bannerimage . '\',\'' . $templatepath . '\')'); } } } } //文章 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'articledetail'); $content = getDirAllFileList($webdataDir . '/articledetail/', 'txt'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('文章', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【title】') > 0) { $s = $s . vbCrlf(); $parentid = newGetStrCut($s, 'parentid'); $parentid = getColumnId($parentid); $title = newGetStrCut($s, 'title'); $titlecolor = newGetStrCut($s, 'titlecolor'); $webtitle = newGetStrCut($s, 'webtitle'); $webkeywords = newGetStrCut($s, 'webkeywords'); $webdescription = newGetStrCut($s, 'webdescription'); $author = newGetStrCut($s, 'author'); $sortrank = newGetStrCut($s, 'sortrank'); if ($sortrank == '') { $sortrank = 0; } $adddatetime = newGetStrCut($s, 'adddatetime'); $fileName = newGetStrCut($s, 'filename'); $templatepath = newGetStrCut($s, 'templatepath'); $flags = newGetStrCut($s, 'flags'); $relatedtags = newGetStrCut($s, 'relatedtags'); $customaurl = newGetStrCut($s, 'customaurl'); $target = newGetStrCut($s, 'target'); $smallimage = newGetStrCut($s, 'smallimage'); $bigImage = newGetStrCut($s, 'bigImage'); $bannerimage = newGetStrCut($s, 'bannerimage'); $labletitle = newGetStrCut($s, 'labletitle'); $aboutcontent = newGetStrCut($s, 'aboutcontent'); $aboutcontent = contentTranscoding($aboutcontent); $bodycontent = newGetStrCut($s, 'bodycontent'); $bodycontent = contentTranscoding($bodycontent); //是否启用生成html $isonhtml = newGetStrCut($s, 'isonhtml'); if ($isonhtml == '0' || lCase($isonhtml) == 'false') { $isonhtml = 0; } else { $isonhtml = 1; } //是否为nofollow $nofollow = newGetStrCut($s, 'nofollow'); if ($nofollow == '1' || lCase($nofollow) == 'true') { $nofollow = 1; } else { $nofollow = 0; } //价格 $price = getDianNumb(newGetStrCut($s, 'price')); if ($price == '') { $price = 0; } connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'articledetail (parentid,title,titlecolor,webtitle,webkeywords,webdescription,author,sortrank,adddatetime,filename,flags,relatedtags,aboutcontent,bodycontent,updatetime,isonhtml,customaurl,nofollow,target,smallimage,bigImage,bannerimage,templatepath,labletitle,price) values(' . $parentid . ',\'' . $title . '\',\'' . $titlecolor . '\',\'' . $webtitle . '\',\'' . $webkeywords . '\',\'' . $webdescription . '\',\'' . $author . '\',' . $sortrank . ',\'' . $adddatetime . '\',\'' . $fileName . '\',\'' . $flags . '\',\'' . $relatedtags . '\',\'' . $aboutcontent . '\',\'' . $bodycontent . '\',\'' . now() . '\',' . $isonhtml . ',\'' . $customaurl . '\',' . $nofollow . ',\'' . $target . '\',\'' . $smallimage . '\',\'' . $bigImage . '\',\'' . $bannerimage . '\',\'' . $templatepath . '\',\'' . $labletitle . '\',' . $price . ')'); } } } } //单页 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'OnePage'); $content = getDirTxtList($webdataDir . '/OnePage/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('单页', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【webkeywords】') > 0) { $s = $s . vbCrlf(); $title = newGetStrCut($s, 'title'); $displaytitle = newGetStrCut($s, 'displaytitle'); $webtitle = newGetStrCut($s, 'webtitle'); $webkeywords = newGetStrCut($s, 'webkeywords'); $webdescription = newGetStrCut($s, 'webdescription'); $adddatetime = newGetStrCut($s, 'adddatetime'); $fileName = newGetStrCut($s, 'filename'); $aboutcontent = newGetStrCut($s, 'aboutcontent'); $aboutcontent = contentTranscoding($aboutcontent); $target = newGetStrCut($s, 'target'); $templatepath = newGetStrCut($s, 'templatepath'); $bodycontent = newGetStrCut($s, 'bodycontent'); $bodycontent = contentTranscoding($bodycontent); //是否启用生成html $isonhtml = newGetStrCut($s, 'isonhtml'); if ($isonhtml == '0' || lCase($isonhtml) == 'false') { $isonhtml = 0; } else { $isonhtml = 1; } //是否为nofollow $nofollow = newGetStrCut($s, 'nofollow'); if ($nofollow == '1' || lCase($nofollow) == 'true') { $nofollow = 1; } else { $nofollow = 0; } connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'onepage (title,displaytitle,webtitle,webkeywords,webdescription,adddatetime,filename,isonhtml,aboutcontent,bodycontent,nofollow,target,templatepath) values(\'' . $title . '\',\'' . $displaytitle . '\',\'' . $webtitle . '\',\'' . $webkeywords . '\',\'' . $webdescription . '\',\'' . $adddatetime . '\',\'' . $fileName . '\',' . $isonhtml . ',\'' . $aboutcontent . '\',\'' . $bodycontent . '\',' . $nofollow . ',\'' . $target . '\',\'' . $templatepath . '\')'); } } } } //竞价 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'Bidding'); $content = getDirTxtList($webdataDir . '/Bidding/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('竞价', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【webkeywords】') > 0) { $s = $s . vbCrlf(); $webkeywords = newGetStrCut($s, 'webkeywords'); $showreason = newGetStrCut($s, 'showreason'); $ncomputersearch = newGetStrCut($s, 'ncomputersearch'); $nmobliesearch = newGetStrCut($s, 'nmobliesearch'); $ncountsearch = newGetStrCut($s, 'ncountsearch'); $ndegree = newGetStrCut($s, 'ndegree'); $ndegree = getNumber($ndegree); if ($ndegree == '') { $ndegree = 0; } connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'Bidding (webkeywords,showreason,ncomputersearch,nmobliesearch,ndegree) values(\'' . $webkeywords . '\',\'' . $showreason . '\',' . $ncomputersearch . ',' . $nmobliesearch . ',' . $ndegree . ')'); } } } } //搜索统计 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'SearchStat'); $content = getDirTxtList($webdataDir . '/SearchStat/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('搜索统计', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【title】') > 0) { $s = $s . vbCrlf(); $title = newGetStrCut($s, 'title'); $webtitle = newGetStrCut($s, 'webtitle'); $webkeywords = newGetStrCut($s, 'webkeywords'); $webdescription = newGetStrCut($s, 'webdescription'); $customaurl = newGetStrCut($s, 'customaurl'); $target = newGetStrCut($s, 'target'); $isthrough = newGetStrCut($s, 'isthrough'); if ($isthrough == '0' || lCase($isthrough) == 'false') { $isthrough = 0; } else { $isthrough = 1; } $sortrank = newGetStrCut($s, 'sortrank'); if ($sortrank == '') { $sortrank = 0; } //是否启用生成html $isonhtml = newGetStrCut($s, 'isonhtml'); if ($isonhtml == '0' || lCase($isonhtml) == 'false') { $isonhtml = 0; } else { $isonhtml = 1; } //是否为nofollow $nofollow = newGetStrCut($s, 'nofollow'); if ($nofollow == '1' || lCase($nofollow) == 'true') { $nofollow = 1; } else { $nofollow = 0; } //call echo("title",title) connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'SearchStat (title,webtitle,webkeywords,webdescription,customaurl,target,isthrough,sortrank,isonhtml,nofollow) values(\'' . $title . '\',\'' . $webtitle . '\',\'' . $webkeywords . '\',\'' . $webdescription . '\',\'' . $customaurl . '\',\'' . $target . '\',' . $isthrough . ',' . $sortrank . ',' . $isonhtml . ',' . $nofollow . ')'); } } } } $itemid = ''; $userName = ''; $ip = ''; $reply = ''; $tableName = ''; //评论 //评论 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'TableComment'); $content = getDirTxtList($webdataDir . '/TableComment/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('评论', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【title】') > 0) { $s = $s . vbCrlf(); $tableName = newGetStrCut($s, 'tablename'); $title = newGetStrCut($s, 'title'); $itemid = getArticleId(newGetStrCut($s, 'itemid')); if ($itemid == '') { $itemid = 0; } //call echo("itemID",itemID) $adddatetime = newGetStrCut($s, 'adddatetime'); $userName = newGetStrCut($s, 'username'); $ip = newGetStrCut($s, 'ip'); $bodycontent = newGetStrCut($s, 'bodycontent'); $reply = newGetStrCut($s, 'reply'); $isthrough = newGetStrCut($s, 'isthrough'); if ($isthrough == '0' || lCase($isthrough) == 'false') { $isthrough = 0; } else { $isthrough = 1; } //call echo("title",title) connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'TableComment (tablename,title,itemid,adddatetime,username,ip,bodycontent,reply,isthrough) values(\'' . $tableName . '\',\'' . $title . '\',' . $itemid . ',\'' . $adddatetime . '\',\'' . $userName . '\',\'' . $ip . '\',\'' . $bodycontent . '\',\'' . $reply . '\',' . $isthrough . ')'); } } } } //友情链接 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'FriendLink'); $content = getDirTxtList($webdataDir . '/FriendLink/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('评论', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【title】') > 0) { $s = $s . vbCrlf(); $title = newGetStrCut($s, 'title'); $httpurl = newGetStrCut($s, 'httpurl'); $smallimage = newGetStrCut($s, 'smallimage'); $flags = newGetStrCut($s, 'flags'); $target = newGetStrCut($s, 'target'); $sortrank = newGetStrCut($s, 'sortrank'); if ($sortrank == '0' || lCase($sortrank) == 'false') { $sortrank = 0; } else { $sortrank = 1; } $isthrough = newGetStrCut($s, 'isthrough'); if ($isthrough == '0' || lCase($isthrough) == 'false') { $isthrough = 0; } else { $isthrough = 1; } //call echo("title",title) connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'FriendLink (title,httpurl,smallimage,flags,sortrank,isthrough,target) values(\'' . $title . '\',\'' . $httpurl . '\',\'' . $smallimage . '\',\'' . $flags . '\',' . $sortrank . ',' . $isthrough . ',\'' . $target . '\')'); } } } } //留言 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'GuestBook'); $content = getDirTxtList($webdataDir . '/GuestBook/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('留言', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【adddatetime】') > 0) { $s = $s . vbCrlf(); $adddatetime = newGetStrCut($s, 'adddatetime'); $bodycontent = newGetStrCut($s, 'bodycontent'); $reply = newGetStrCut($s, 'reply'); $isthrough = newGetStrCut($s, 'isthrough'); if ($isthrough == '0' || lCase($isthrough) == 'false') { $isthrough = 0; } else { $isthrough = 1; } connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'GuestBook (adddatetime,bodycontent,reply,isthrough) values(\'' . $adddatetime . '\',\'' . $bodycontent . '\',\'' . $reply . '\',' . $isthrough . ')'); } } } } //采集网站 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'CaiWeb'); $content = getDirTxtList($webdataDir . '/CaiWeb/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('采集网站', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【bigclassname】') > 0) { $s = $s . vbCrlf(); $bigClassName = newGetStrCut($s, 'bigclassname'); $httpurl = newGetStrCut($s, 'httpurl'); $morepageurl = newGetStrCut($s, 'morepageurl'); $charset = newGetStrCut($s, 'charset'); $adddatetime = newGetStrCut($s, 'adddatetime'); $bodycontent = newGetStrCut($s, 'bodycontent'); $sortrank = newGetStrCut($s, 'sortrank'); if ($sortrank == '') { $sortrank = 0; } $thispage = newGetStrCut($s, 'thispage'); if ($thispage == '') { $thispage = 0; } $countpage = newGetStrCut($s, 'countpage'); if ($countpage == '') { $thispage = 0; } $columnname = newGetStrCut($s, 'columnname'); connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'CaiWeb (adddatetime,bodycontent,httpurl,morepageurl,charset,sortrank,thispage,countpage,bigclassname,columnname) values(\'' . $adddatetime . '\',\'' . $bodycontent . '\',\'' . $httpurl . '\',\'' . $morepageurl . '\',\'' . $charset . '\',' . $sortrank . ',' . $thispage . ',' . $countpage . ',\'' . $bigClassName . '\',\'' . $columnname . '\')'); } } } } //采集配置 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'CaiConfig'); $content = getDirTxtList($webdataDir . '/CaiConfig/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('采集配置', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【bigclassname】') > 0) { $s = $s . vbCrlf(); $bigClassName = newGetStrCut($s, 'bigclassname'); $sType = newGetStrCut($s, 'stype'); $startStr = newGetStrCut($s, 'startstr'); $endStr = newGetStrCut($s, 'endstr'); $startaddstr = newGetStrCut($s, 'startaddstr'); $endaddstr = newGetStrCut($s, 'endaddstr'); $adddatetime = newGetStrCut($s, 'adddatetime'); $sortrank = newGetStrCut($s, 'sortrank'); if ($sortrank == '') { $sortrank = 0; } $saction = newGetStrCut($s, 'saction'); $isthrough = newGetStrCut($s, 'isthrough'); $isthrough = IIF($isthrough == '0' || lCase($isthrough) == 'false', 0, 1); $fieldName = newGetStrCut($s, 'fieldname'); $fieldcheck = newGetStrCut($s, 'fieldcheck'); if ($fieldcheck == '') { $fieldcheck = 0; } connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'CaiConfig (adddatetime,sortrank,bigclassname,stype,startstr,endstr,startaddstr,endaddstr,saction,isthrough,fieldname,fieldcheck) values(\'' . $adddatetime . '\',' . $sortrank . ',\'' . $bigClassName . '\',\'' . $sType . '\',\'' . $startStr . '\',\'' . $endStr . '\',\'' . $startaddstr . '\',\'' . $endaddstr . '\',\'' . $saction . '\',' . $isthrough . ',\'' . $fieldName . '\',' . $fieldcheck . ')'); } } } } writeSystemLog('', '恢复默认数据' . $GLOBALS['db_PREFIX']); //系统日志 }
$i = 0; while ($BOOK = db_fetch_array($MBR_DATA)) { ?> <tr height=25 bgcolor=ffffff align=center> <td><input type=checkbox name="sms[]" id='lv<?php echo $BOOK[UID]; ?> ' value='<?php echo $BOOK[ID]; ?> -<?php echo $BOOK[NAME]; ?> -<?php echo getNumber($BOOK[NUMBER]); ?> -' onclick="book_check()"></td> <td><?php echo $DATA_NUM[0] - ($i + $recnum * ($p - 1)); ?> </td> <td><?php echo $BOOK[NAME]; ?> </td> <td><a style='cursor:hand;' onclick="book_ncheck('lv<?php echo $BOOK[UID]; ?> ')"><font class=Blink><?php echo $BOOK[NUMBER];
<?php // basic.php function getNumber() { foreach (['tahi', 'rua', 'toru', 'wha'] as $i) { (yield $i); } } $numbers = getNumber(); echo $numbers->current() . '<br>'; $numbers->next(); echo $numbers->current() . '<br>'; $numbers->next(); echo $numbers->current() . '<br>'; $numbers->next(); echo $numbers->current() . '<br>'; $numbers->next(); echo $numbers->current() . '<br>'; $numbers->next(); echo '<hr>'; foreach (getNumber() as $number) { echo $number . '<br>'; }
<?php function getNumber() { foreach (['tahi', 'rua', 'toru', 'wha'] as $i) { $message = (yield $i); echo $message; } } $numbers = getNumber(); echo $numbers->current(); $numbers->next("test"); echo $numbers->current(); $numbers->next(); echo $numbers->current(); $numbers->next(); echo $numbers->current(); $numbers->next();
if (intval($fields['q' . $i]) !== $answers[$i]) { $result = 'error'; $fields['q' . $i] = 'N'; } else { $fields['q' . $i] = 'Y'; } } } if ($_REQUEST['debug']) { var_dump($fields); } foreach ($fields as $key => $field) { $props[strtoupper($key)] = $field; } if ($fields['type'] && $fields['horizont'] && $fields['vertical']) { $number = getNumber($fields['horizont'], $fields['vertical']); $props['NUMBER'] = $number; $src = $_SERVER["DOCUMENT_ROOT"] . '/group/u_creative/images/email/' . $fields['type'] . '/' . $fields['type'] . '_design_dev_' . $fields['horizont'] . '_' . $fields['vertical'] . '.jpg'; $raw = new CIBlockElement(); $raw->Update($current['ID'], array('PREVIEW_PICTURE' => CFile::MakeFileArray($src))); } CIBlockElement::SetPropertyValuesEx($current['ID'], false, $props); if ($fields['email'] && $fields['phone'] && $fields['address']) { // Для отладки //CIBlockElement::Delete($ID); $raw = new CIBlockElement(); $raw->Update($current['ID'], array("IBLOCK_SECTION_ID" => $sections['success'])); $str = date("d.m.Y H:i:s") . ";" . $ID . ";" . $number . ";" . $fields['size'] . ";" . $fields['type'] . ";" . $USER->GetFullName() . ";+7" . preg_replace('/[^0-9]/', '', $fields['phone']) . ";доставка;" . $fields['address'] . ";new;\n"; $dir = $_SERVER["DOCUMENT_ROOT"] . '/group/u_creative/orders/'; $file = $dir . $ID . '.csv'; // Письмо менеджеру
<?php include './src/Prime.php'; include './src/Test.php.php'; ?> <html> <head> <title>PHP Test</title> </head> <body> <?php $number = getNumber(); echo '<p>The Current Build is ' . $number . '</p>'; ?> </body> </html>
<div class="outer-block gold-block" style="color:#FFFFFF;text-align:center"> <div id="block-content"> <img src="images/StatsIcon.png" style="width:15%"> <h4 style="display:inline;margin-left:20px">VIEW YOUR STATS</h4> </div> </div> </a> </div> </div> <hr> <div class="row"> <div class="col-sm-3"> <div class="col-sm-12 dashboard-stat"> <?php echo getNumber($db, $userid); ?> <p class="dashboard-stat-text">Total <br>Workouts</p> </div> </div> <div class="col-sm-3"> <div class="col-sm-12 dashboard-stat"> <?php echo getNumClimbs($db, $userid); ?> <p class="dashboard-stat-text">Total <br>Climbs</p> </div> </div> <div class="col-sm-3"> <div class="col-sm-12 dashboard-stat"> <?php
function makeWebHtml($action) { $actionType = ''; $npagesize = ''; $npage = ''; $url = ''; $addSql = ''; $sortSql = ''; $sortFieldName = ''; $ascOrDesc = ''; $serchKeyWordName = ''; $parentid = ''; //追加于20160716 home $actionType = RParam($action, 'actionType'); $npage = RParam($action, 'npage'); $npage = getNumber($npage); if ($npage == '') { $npage = 1; } else { $npage = CInt($npage); } //导航 if ($actionType == 'nav') { $GLOBALS['glb_columnType'] = RParam($action, 'columnType'); $GLOBALS['glb_columnName'] = RParam($action, 'columnName'); $GLOBALS['glb_columnId'] = RParam($action, 'columnId'); if ($GLOBALS['glb_columnId'] == '') { $GLOBALS['glb_columnId'] = RParam($action, 'id'); } if ($GLOBALS['glb_columnType'] != '') { $addSql = 'where columnType=\'' . $GLOBALS['glb_columnType'] . '\''; } if ($GLOBALS['glb_columnName'] != '') { $addSql = getWhereAnd($addSql, 'where columnName=\'' . $GLOBALS['glb_columnName'] . '\''); } if ($GLOBALS['glb_columnId'] != '') { $addSql = getWhereAnd($addSql, 'where id=' . $GLOBALS['glb_columnId'] . ''); } //call echo("addsql",addsql) $rsObj = $GLOBALS['conn']->query('Select * from ' . $GLOBALS['db_PREFIX'] . 'webcolumn ' . $addSql); if (@mysql_num_rows($rsObj) != 0) { $rs = mysql_fetch_array($rsObj); $GLOBALS['glb_columnId'] = $rs['id']; $GLOBALS['glb_columnName'] = $rs['columnname']; $GLOBALS['glb_columnType'] = $rs['columntype']; $GLOBALS['glb_bodyContent'] = $rs['bodycontent']; $GLOBALS['glb_detailTitle'] = $GLOBALS['glb_columnName']; $GLOBALS['glb_flags'] = $rs['flags']; $npagesize = $rs['npagesize']; //每页显示条数 $GLOBALS['glb_isonhtml'] = $rs['isonhtml']; //是否生成静态网页 $sortSql = ' ' . $rs['sortsql']; //排序SQL if ($rs['webtitle'] != '') { $GLOBALS['cfg_webTitle'] = $rs['webtitle']; //网址标题 } if ($rs['webkeywords'] != '') { $GLOBALS['cfg_webKeywords'] = $rs['webkeywords']; //网站关键词 } if ($rs['webdescription'] != '') { $GLOBALS['cfg_webDescription'] = $rs['webdescription']; //网站描述 } if ($GLOBALS['templateName'] == '') { if (aspTrim($rs['templatepath']) != '') { $GLOBALS['templateName'] = $rs['templatepath']; } else { if ($rs['columntype'] != '首页') { $GLOBALS['templateName'] = getDateilTemplate($rs['id'], 'List'); } } } } $GLOBALS['glb_columnENType'] = handleColumnType($GLOBALS['glb_columnType']); $GLOBALS['glb_url'] = getColumnUrl($GLOBALS['glb_columnName'], 'name'); //文章类列表 if (inStr('|产品|新闻|视频|下载|案例|', '|' . $GLOBALS['glb_columnType'] . '|') > 0) { $GLOBALS['glb_bodyContent'] = getDetailList($action, defaultListTemplate($GLOBALS['glb_columnType'], $GLOBALS['glb_columnName']), 'ArticleDetail', '栏目列表', '*', $npagesize, $npage, 'where parentid=' . $GLOBALS['glb_columnId'] . $sortSql); //留言类列表 } else { if (inStr('|留言|', '|' . $GLOBALS['glb_columnType'] . '|') > 0) { $GLOBALS['glb_bodyContent'] = getDetailList($action, defaultListTemplate($GLOBALS['glb_columnType'], $GLOBALS['glb_columnName']), 'GuestBook', '留言列表', '*', $npagesize, $npage, ' where isthrough<>0 ' . $sortSql); } else { if ($GLOBALS['glb_columnType'] == '文本') { //航行栏目加管理 if (@$_REQUEST['gl'] == 'edit') { $GLOBALS['glb_bodyContent'] = '<span>' . $GLOBALS['glb_bodyContent'] . '</span>'; } $url = WEB_ADMINURL . '?act=addEditHandle&actionType=WebColumn&lableTitle=网站栏目&nPageSize=10&page=&id=' . $GLOBALS['glb_columnId'] . '&n=' . getRnd(11); $GLOBALS['glb_bodyContent'] = handleDisplayOnlineEditDialog($url, $GLOBALS['glb_bodyContent'], '', 'span'); } } } //细节 } else { if ($actionType == 'detail') { $GLOBALS['glb_locationType'] = 'detail'; $rsObj = $GLOBALS['conn']->query('Select * from ' . $GLOBALS['db_PREFIX'] . 'articledetail where id=' . RParam($action, 'id')); if (@mysql_num_rows($rsObj) != 0) { $rs = mysql_fetch_array($rsObj); $GLOBALS['glb_columnName'] = getColumnName($rs['parentid']); $GLOBALS['glb_detailTitle'] = $rs['title']; $GLOBALS['glb_flags'] = $rs['flags']; $GLOBALS['glb_isonhtml'] = $rs['isonhtml']; //是否生成静态网页 $GLOBALS['glb_id'] = $rs['id']; //文章ID if ($GLOBALS['isMakeHtml'] == true) { $GLOBALS['glb_url'] = getHandleRsUrl($rs['filename'], $rs['customaurl'], '/detail/detail' . $rs['id']); } else { $GLOBALS['glb_url'] = handleWebUrl('?act=detail&id=' . $rs['id']); } if ($rs['webtitle'] != '') { $GLOBALS['cfg_webTitle'] = $rs['webtitle']; //网址标题 } if ($rs['webkeywords'] != '') { $GLOBALS['cfg_webKeywords'] = $rs['webkeywords']; //网站关键词 } if ($rs['webdescription'] != '') { $GLOBALS['cfg_webDescription'] = $rs['webdescription']; //网站描述 } //改进20160628 $sortFieldName = 'id'; $ascOrDesc = 'asc'; $addsql = aspTrim(getWebColumnSortSql($rs['parentid'])); if ($addsql != '') { $sortFieldName = aspTrim(replace(replace(replace($addsql, 'order by', ''), ' desc', ''), ' asc', '')); if (inStr($addsql, ' desc') > 0) { $ascOrDesc = 'desc'; } } $GLOBALS['glb_artitleAuthor'] = $rs['author']; $GLOBALS['glb_artitleAdddatetime'] = $rs['adddatetime']; $GLOBALS['glb_upArticle'] = upArticle($rs['parentid'], $sortFieldName, $rs[$sortFieldName], $ascOrDesc); $GLOBALS['glb_downArticle'] = downArticle($rs['parentid'], $sortFieldName, $rs[$sortFieldName], $ascOrDesc); $GLOBALS['glb_aritcleRelatedTags'] = aritcleRelatedTags($rs['relatedtags']); $GLOBALS['glb_aritcleSmallImage'] = $rs['smallimage']; $GLOBALS['glb_aritcleBigImage'] = $rs['bigimage']; //文章内容 //glb_bodyContent = "<div class=""articleinfowrap"">[$articleinfowrap$]</div>" & rs("bodycontent") & "[$relatedtags$]<ul class=""updownarticlewrap"">[$updownArticle$]</ul>" //上一篇文章,下一篇文章 //glb_bodyContent = Replace(glb_bodyContent, "[$updownArticle$]", upArticle(rs("parentid"), "sortrank", rs("sortrank")) & downArticle(rs("parentid"), "sortrank", rs("sortrank"))) //glb_bodyContent = Replace(glb_bodyContent, "[$articleinfowrap$]", "来源:" & rs("author") & " 发布时间:" & format_Time(rs("adddatetime"), 1)) //glb_bodyContent = Replace(glb_bodyContent, "[$relatedtags$]", aritcleRelatedTags(rs("relatedtags"))) $GLOBALS['glb_bodyContent'] = $rs['bodycontent']; //文章详细加控制 if (@$_REQUEST['gl'] == 'edit') { $GLOBALS['glb_bodyContent'] = '<span>' . $GLOBALS['glb_bodyContent'] . '</span>'; } $url = WEB_ADMINURL . '?act=addEditHandle&actionType=ArticleDetail&lableTitle=分类信息&nPageSize=10&page=&parentid=&id=' . RParam($action, 'id') . '&n=' . getRnd(11); $GLOBALS['glb_bodyContent'] = handleDisplayOnlineEditDialog($url, $GLOBALS['glb_bodyContent'], '', 'span'); if ($GLOBALS['templateName'] == '') { if (aspTrim($rs['templatepath']) != '') { $GLOBALS['templateName'] = $rs['templatepath']; } else { $GLOBALS['templateName'] = getDateilTemplate($rs['parentid'], 'Detail'); } } } //单页 } else { if ($actionType == 'onepage') { $rsObj = $GLOBALS['conn']->query('Select * from ' . $GLOBALS['db_PREFIX'] . 'onepage where id=' . RParam($action, 'id')); if (@mysql_num_rows($rsObj) != 0) { $rs = mysql_fetch_array($rsObj); $GLOBALS['glb_detailTitle'] = $rs['title']; $GLOBALS['glb_isonhtml'] = $rs['isonhtml']; //是否生成静态网页 if ($GLOBALS['isMakeHtml'] == true) { $GLOBALS['glb_url'] = getHandleRsUrl($rs['filename'], $rs['customaurl'], '/page/page' . $rs['id']); } else { $GLOBALS['glb_url'] = handleWebUrl('?act=detail&id=' . $rs['id']); } if ($rs['webtitle'] != '') { $GLOBALS['cfg_webTitle'] = $rs['webtitle']; //网址标题 } if ($rs['webkeywords'] != '') { $GLOBALS['cfg_webKeywords'] = $rs['webkeywords']; //网站关键词 } if ($rs['webdescription'] != '') { $GLOBALS['cfg_webDescription'] = $rs['webdescription']; //网站描述 } //内容 $GLOBALS['glb_bodyContent'] = $rs['bodycontent']; //文章详细加控制 if (@$_REQUEST['gl'] == 'edit') { $GLOBALS['glb_bodyContent'] = '<span>' . $GLOBALS['glb_bodyContent'] . '</span>'; } $url = WEB_ADMINURL . '?act=addEditHandle&actionType=ArticleDetail&lableTitle=分类信息&nPageSize=10&page=&parentid=&id=' . RParam($action, 'id') . '&n=' . getRnd(11); $GLOBALS['glb_bodyContent'] = handleDisplayOnlineEditDialog($url, $GLOBALS['glb_bodyContent'], '', 'span'); if ($GLOBALS['templateName'] == '') { if (aspTrim($rs['templatepath']) != '') { $GLOBALS['templateName'] = $rs['templatepath']; } else { $GLOBALS['templateName'] = 'Main_Model.html'; //call echo(templateName,"templateName") } } } //搜索 } else { if ($actionType == 'Search') { $GLOBALS['templateName'] = 'Main_Model.html'; $serchKeyWordName = @$_REQUEST['keywordname']; $parentid = @$_REQUEST['parentid']; if ($serchKeyWordName == '') { $serchKeyWordName = 'wd'; } $GLOBALS['glb_searchKeyWord'] = replace(@$_REQUEST[$serchKeyWordName], '<', '<'); $addSql = ''; if ($parentid != '') { $addSql = ' where parentid=' . $parentid; } $addSql = getWhereAnd($addSql, ' where title like \'%' . $GLOBALS['glb_searchKeyWord'] . '%\''); $npagesize = 20; //call echo(npagesize, npage) $GLOBALS['glb_bodyContent'] = getDetailList($action, defaultListTemplate($GLOBALS['glb_columnType'], $GLOBALS['glb_columnName']), 'ArticleDetail', '网站栏目', '*', $npagesize, $npage, $addSql); $GLOBALS['positionEndStr'] = ' >> 搜索内容”' . $GLOBALS['glb_searchKeyWord'] . '“'; //加载等待 } else { if ($actionType == 'loading') { rwEnd('页面正在加载中。。。'); } } } } } //模板为空,则用默认首页模板 if ($GLOBALS['templateName'] == '') { $GLOBALS['templateName'] = 'Index_Model.html'; //默认模板 } //检测当前路径是否有模板 if (inStr($GLOBALS['templateName'], '/') == false) { $GLOBALS['templateName'] = $GLOBALS['cfg_webTemplate'] . '/' . $GLOBALS['templateName']; } //call echo("templateName",templateName) if (CheckFile($GLOBALS['templateName']) == false) { Eerr('未找到模板文件', $GLOBALS['templateName']); } $GLOBALS['code'] = getFText($GLOBALS['templateName']); $GLOBALS['code'] = handleAction($GLOBALS['code']); //处理动作 $GLOBALS['code'] = thisPosition($GLOBALS['code']); //位置 $GLOBALS['code'] = replaceGlobleVariable($GLOBALS['code']); //替换全局标签 $GLOBALS['code'] = handleAction($GLOBALS['code']); //处理动作 '再来一次,处理数据内容里动作 $GLOBALS['code'] = handleAction($GLOBALS['code']); //处理动作 $GLOBALS['code'] = handleAction($GLOBALS['code']); //处理动作 $GLOBALS['code'] = thisPosition($GLOBALS['code']); //位置 $GLOBALS['code'] = replaceGlobleVariable($GLOBALS['code']); //替换全局标签 $GLOBALS['code'] = delTemplateMyNote($GLOBALS['code']); //删除无用内容 //格式化HTML if (inStr($GLOBALS['cfg_flags'], '|formattinghtml|') > 0) { //code = HtmlFormatting(code) '简单 $GLOBALS['code'] = handleHtmlFormatting($GLOBALS['code'], false, 0, '删除空行'); //自定义 //格式化HTML第二种 } else { if (inStr($GLOBALS['cfg_flags'], '|formattinghtmltow|') > 0) { $GLOBALS['code'] = htmlFormatting($GLOBALS['code']); //简单 $GLOBALS['code'] = handleHtmlFormatting($GLOBALS['code'], false, 0, '删除空行'); //自定义 //压缩HTML } else { if (inStr($GLOBALS['cfg_flags'], '|ziphtml|') > 0) { $GLOBALS['code'] = zipHTML($GLOBALS['code']); } } } //闭合标签 if (inStr($GLOBALS['cfg_flags'], '|labelclose|') > 0) { $GLOBALS['code'] = handleCloseHtml($GLOBALS['code'], true, ''); //图片自动加alt "|*|", } //在线编辑20160127 if (rq('gl') == 'edit') { if (inStr($GLOBALS['code'], '</head>') > 0) { if (inStr(lCase($GLOBALS['code']), 'jquery.min.js') == false) { $GLOBALS['code'] = replace($GLOBALS['code'], '</head>', '<script src="/Jquery/jquery.Min.js"></script></head>'); } $GLOBALS['code'] = replace($GLOBALS['code'], '</head>', '<script src="/Jquery/Callcontext_menu.js"></script></head>'); } if (inStr($GLOBALS['code'], '<body>') > 0) { //Code = Replace(Code,"<body>", "<body onLoad=""ContextMenu.intializeContextMenu()"">") } } //call echo(templateName,templateName) $makeWebHtml = $GLOBALS['code']; return @$makeWebHtml; }
function sortHandle($actionType) { $splId = ''; $splValue = ''; $i = ''; $id = ''; $sortrank = ''; $tableName = ''; $url = ''; $tableName = lCase($actionType); //表名称 $splId = aspSplit(@$_REQUEST['id'], ','); $splValue = aspSplit(@$_REQUEST['value'], ','); for ($i = 0; $i <= uBound($splId); $i++) { $id = $splId[$i]; $sortrank = $splValue[$i]; $sortrank = getNumber($sortrank . ''); if ($sortrank == '') { $sortrank = 0; } connexecute('update ' . $GLOBALS['db_PREFIX'] . $tableName . ' set sortrank=' . $sortrank . ' where id=' . $id); } $url = getUrlAddToParam(getThisUrl(), '?act=dispalyManageHandle', 'replace'); Rw(getMsg1('更新排序完成,正在返回列表...', $url)); writeSystemLog($tableName, '排序' . @$_REQUEST['lableTitle']); //系统日志 }
이 페이지에서 설정된 데이터는 <a href='./add_fmanager.php?pwd=../conf/' target='_blank'><font color=blue>bbs/conf/</font></a> 디렉토리 이하에 <a href='./add_fmanager.php?pwd=../conf/&query=modify&file=root_info.php&type=file' target='_blank'><font color=blue>root_info.php</font></a> 의 형태로 저장됩니다.<br> 따라서, 디렉토리에 직접 접근하여 동일형식으로 변수파일을 생성해 줄 수 있습니다.<br> </td> </tr> </table> <p> <?php if ($query == 'normal') { include '../conf/root_info.php'; include './module/Sms/var/sms_var.php'; $HandTel_Exp = explode('-', getNumber($sms_admin_num)); $CompTel_Exp = explode('-', $root[comp_tel]); $CompFax_Exp = explode('-', $root[comp_fax]); $CompNum_Exp = explode('-', $root[comp_num]); ?> <form action='<?php echo $THIS_FILE; ?> ' method='post' onsubmit="return confCheck(this)"> <img src='./image/dot_03.gif' align=absmiddle> <b>운영자 및 사이트관련 기본 정보입니다.</b><p>
} else { if ($_POST["ok"]) { if ($_POST["parts_sernr"]) { $rc = updateMaschine($_POST); } else { $rc = saveNewMaschine($_POST); } if ($rc) { $msg = "Maschine gesichert"; } else { $msg = "Fehler beim Sichern"; } $data = getArtikel($_POST["partnumber"]); $data = $data[0]; $pid = $data["id"]; $nummern = getNumber($data["id"]); $bekannt = getBekannt($data["id"]); } } $t->set_file(array("masch" => "maschinen3.tpl")); doHeader($t); $t->set_var(array(action => "maschine3.php", msg => $msg, parts_id => $pid, mid => $data["mid"], inspdatum => db2date($data["inspdatum"]), snumber => $data["serialnumber"], partnumber => $data["partnumber"], description => $data["description"], notes => $data["notes"], beschreibung => $data["beschreibung"])); $t->set_block("masch", "Bekannt", "Block1"); if ($bekannt) { foreach ($bekannt as $zeile) { $t->set_var(array(maschine => $zeile["serialnumber"])); $t->parse("Block1", "Bekannt", true); } } $t->set_block("masch", "Sernumber", "Block2"); if ($nummern) {