本文整理汇总了PHP中get_file_contents函数的典型用法代码示例。如果您正苦于以下问题:PHP get_file_contents函数的具体用法?PHP get_file_contents怎么用?PHP get_file_contents使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_file_contents函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_file_contents
function &pass_out()
{
global $filestr;
//$exactly equivalent to: $filestr =& $_GLOBALS['filestr'];
$filestr = get_file_contents("./bigfile.txt");
return $_GLOBALS['filestr'];
}
开发者ID:Gecko136,项目名称:RosettaCodeData,代码行数:7,代码来源:pointers-and-references.php
示例2: parseaddons
function parseaddons($addonspath, $filename, $shop_lang)
{
global $modx, $modulea, $moduleid, $tables, $tsvshop;
$out = "";
$tmp = "";
$temp = "";
$num = 1;
$lang = isset($lang) ? $lang : $modx->config['manager_language'];
//$filename=$modx->config['base_path'].'assets/snippets/tsvshop/admin/tpl/addonstable.tpl';
$tpl = get_file_contents($filename);
if (!empty($addonspath) && !empty($filename)) {
$folders = scandir($addonspath, 1);
foreach ($folders as $folder) {
if ($folder != "." && $folder != ".." && file_exists($addonspath . $folder . "/main.inc.php")) {
$temp = str_replace('[+moduleid+]', $_GET['id'], $tpl);
$temp = str_replace('[+lang+]', $lang, $temp);
$temp = str_replace('[+num+]', $num++, $temp);
$temp = str_replace('[+addon+]', $shop_lang[$folder . '_title'], $temp);
if (is_install($folder)) {
if ($tables[$folder] == "system") {
$temp = str_replace('[+actions+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/system.png" alt="" />', $temp);
} else {
$temp = str_replace('[+actions+]', '<a href="/' . MGR_DIR . '/index.php?id=' . $moduleid . '&a=' . $modulea . '&act=addonuninstall&addon=' . $folder . '" title="' . $shop_lang['addons_uninstall'] . '" onclick="uninstall(\'' . $shop_lang['addons_uninstall_question'] . '\');return false"><img src="' . TSVSHOP_SURL . 'addons/addons/img/uninstall.png" alt="' . $shop_lang['addons_uninstall'] . '" /></a>', $temp);
}
if (getConf("addons", $folder . "_active") == "yes") {
if ($tables[$folder] == "system") {
$temp = str_replace('[+status+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="" /> <img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="" />', $temp);
} else {
$temp = str_replace('[+status+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_on.png" alt="' . $shop_lang['addons_on'] . '" title="' . $shop_lang['addons_on'] . '" /> <a href="/' . MGR_DIR . '/index.php?id=' . $moduleid . '&a=' . $modulea . '&act=addonoff&addon=' . $folder . '" title="' . $shop_lang['addons_off_act'] . '"><img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="' . $shop_lang['addons_off_act'] . '" /></a>', $temp);
}
} else {
if ($tables[$folder] == "system") {
$temp = str_replace('[+status+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="" /> <img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="" />', $temp);
} else {
$temp = str_replace('[+status+]', '<a href="/' . MGR_DIR . '/index.php?id=' . $moduleid . '&a=' . $modulea . '&act=addonon&addon=' . $folder . '" title="' . $shop_lang['addons_on_act'] . '"><img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="' . $shop_lang['addons_on_act'] . '" /></a> <img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_off.png" alt="' . $shop_lang['addons_off'] . '" title="' . $shop_lang['addons_off'] . '" />', $temp);
}
}
} else {
if ($tables[$folder] == "system") {
$temp = str_replace('[+actions+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/system.png" alt="" />', $temp);
$temp = str_replace('[+status+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="' . $shop_lang['addons_on'] . '" title="' . $shop_lang['addons_on'] . '" /> <img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="' . $shop_lang['addons_on'] . '" title="' . $shop_lang['addons_on'] . '" />', $temp);
} else {
$temp = str_replace('[+actions+]', '<a href="/' . MGR_DIR . '/index.php?id=' . $moduleid . '&a=' . $modulea . '&act=addoninstall&addon=' . $folder . '" title="' . $shop_lang['addons_install'] . '"><img src="' . TSVSHOP_SURL . 'addons/addons/img/install.png" alt="' . $shop_lang['addons_install'] . '" /></a>', $temp);
$temp = str_replace('[+status+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="' . $shop_lang['addons_on'] . '" title="' . $shop_lang['addons_on'] . '" /> <img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="' . $shop_lang['addons_on'] . '" title="' . $shop_lang['addons_on'] . '" />', $temp);
}
}
$temp = str_replace('[+description+]', $shop_lang[$folder . '_desc'], $temp);
$out .= $temp;
}
}
$out = preg_replace('/(\\[\\+.*?\\+\\])/', '', $out);
return $out;
} else {
return "";
}
}
开发者ID:myindexlike,项目名称:tsvshop,代码行数:56,代码来源:functions.inc.php
示例3: fetch_wikihow
function fetch_wikihow($url)
{
echo "<h2>FROM WIKIHOW</h2>";
global $current_file;
global $machine_id;
global $source_machine;
global $spell_checked;
global $source_id, $oldSource_id;
global $fetchFromOutside, $oldSource, $lastResult, $newResult;
$title = substr($url, 23);
$query = "select * from data_how where title = '" . mysql_real_escape_string($title) . "'";
$result = mysql_query($query) or trigger_error(mysql_error() . " in {$query}", E_USER_ERROR);
if (mysql_num_rows($result) && !$fetchFromOutside) {
$row = mysql_fetch_array($result);
$source_id = $row['id'];
$source_machine = $row['machine'];
$current_file = "/hownew/{$source_id}";
$how_return = get_file_contents($current_file, $source_machine);
} else {
require_once 'class.WikiHow.php';
$mywiki = new WikiHow($url);
$how_return = $mywiki->start_search();
if ($how_return) {
if (mysql_num_rows($result)) {
$source_machine = $row['machine'];
$source_id = $row['id'];
$current_file = "/hownew/" . $row['id'];
$str = substr($result, 0, 500);
$newResult = str2hex($str);
if ($newResult != $lastResult || $oldSource != "how") {
writeToFile($source_machine, DATA_PATH . $current_file, $how_return);
}
} else {
$query = "insert into data_how(title,machine) values('" . mysql_real_escape_string($title) . "',{$machine_id})";
mysql_query($query) or trigger_error(mysql_error() . " in {$query}", E_USER_ERROR);
$source_id = mysql_insert_id();
file_put_contents(DATA_PATH . "/hownew/{$source_id}", $how_return);
$source_machine = $machine_id;
$current_file = "/hownew/{$source_id}";
}
}
}
echo "HOW RETURN : " . $how_return;
return $how_return;
}
开发者ID:superego546,项目名称:SMSGyan,代码行数:45,代码来源:fix_fetch_functions.php
示例4: explode
if ($m == "db") {
//target = table/field/id_field/id
$fields = explode("/", $current_file);
echo "<br>request table<br>";
print_r($fields);
echo "<br>";
$query = "SELECT " . $fields[1] . " FROM " . $fields[0] . " WHERE `" . $fields[2] . "` = '" . mysql_real_escape_string($fields[3]) . "'";
$result = mysql_query($query) or die(mysql_error() . " in {$query}");
$row = mysql_fetch_row($result);
echo "<br>row<br>";
print_r($row);
echo "<br>";
$content = str_replace("\r", "\n", $row[0]);
$content = trim($content);
} else {
$content = get_file_contents($current_file, $m);
}
var_dump($content);
$e = 0;
//
//for disamb pages
if (substr($content, 0, 1) == '|') {
echo "<br>DISAMBIGUATION PAGE<br>";
$e = strpos($content, '|', 1) + 1;
}
//
$first_char = substr($content, $position + $e - 1, 2);
echo "\n<br>first char: ";
var_dump($first_char);
echo "<br>";
if (strpos($first_char, ".") === false && strpos($first_char, "\n") === false) {
开发者ID:superego546,项目名称:SMSGyan,代码行数:31,代码来源:moredu.php
示例5: system_info_archive_page
function system_info_archive_page()
{
info_disabled_check();
$loader = find_loader(true);
if (is_string($loader)) {
$loader_file = $loader;
} else {
$loader_file = '';
}
$all_files = system_info_temporary_files();
if (!empty($all_files)) {
if (!empty($loader_file)) {
$all_files['loader'] = $loader_file;
}
$archive_name = tempnam('/tmp', "ARC");
if (extension_loaded('zip')) {
$archive_name .= '.zip';
$zip = @new ZipArchive();
$mode = @constant("ZIPARCHIVE::OVERWRITE");
if (!$zip || $zip->open($archive_name, $mode) !== TRUE) {
$archive_name = '';
} else {
foreach ($all_files as $f) {
$zip->addFile($f, basename($f));
}
$zip->close();
}
} elseif (extension_loaded('zlib') && !is_ms_windows()) {
$tar_name = $archive_name . ".tar";
$all_files_str = join(' ', $all_files);
$script = "tar -chf {$tar_name} {$all_files_str}";
$result = @system($script, $retval);
if ($result !== false) {
$archive_name = $tar_name . '.gz';
$zp = gzopen($archive_name, "w9");
$tar_contents = get_file_contents($tar_name);
gzwrite($zp, $tar_contents);
gzclose($zp);
} else {
$archive_name = '';
}
} else {
$archive_name = '';
}
} else {
$archive_name = '';
}
if ($archive_name) {
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=' . $archive_name);
@readfile($archive_name);
} else {
$self = get_self();
$base = get_base_address();
$server_type_code = server_type_code();
heading();
echo "<p>A downloadable archive of system information could not be created.<br> \r\n <strong>Please save each of the following and then attach those files to the support ticket:</strong></p>";
echo "<ul>";
echo "<li><a href=\"{$base}&page=phpinfo\" target=\"phpinfo\">phpinfo()</a></li>";
echo "<li><a href=\"{$base}&page=phpconfig\" target=\"phpconfig\">config</a></li>";
echo "<li><a href=\"{$base}&page=extra&stype={$server_type_code}\" target=\"extra\">additional information</a></li>";
echo "<li><a href=\"{$self}?page=loaderbin\">loader file</a></li>";
echo "</ul>";
footer(true);
}
}
开发者ID:juliushermosura,项目名称:globeloop,代码行数:66,代码来源:loader-wizard.php
示例6: get_file_contents
<?php
include "../db_connect.php";
$tmp = get_file_contents('idelprice.txt');
echo $tmp;
$query = "SELECT * FROM im_catalog WHERE `show` ='1';";
$result = mysql_query($query);
while ($r = mysql_fetch_array($result)) {
// echo "<a href='download_images_5.php?filename=$r[6]'>Скачать $r[6]</a><br>";
}
开发者ID:beholder17,项目名称:ls.files,代码行数:10,代码来源:download_images_5_start.php
示例7: dirname
<?php
/**
* Dynamically generate the TinyMCE localization file if it doesn't already exist
*/
$lang_file = dirname(__FILE__) . '/' . $mce_locale . '_dlg.js';
if (is_file($lang_file) && is_readable($lang_file)) {
$strings = get_file_contents($lang_file);
} else {
$strings = get_file_contents(dirname(__FILE__) . '/en_dlg.js');
$strings = preg_replace('/([\'"])en\\./', '$1' . $mce_locale . '.', $strings, 1);
}
开发者ID:VLabsInc,项目名称:WordPressPlatforms,代码行数:12,代码来源:langs.php
示例8: tsv_minregjs
function tsv_minregjs()
{
global $modx, $jsfiles;
$data = "";
if (is_array($jsfiles)) {
array_unique($jsfiles);
foreach ($jsfiles as $file) {
if (file_exists(TSVSHOP_PATH . $file)) {
$data .= get_file_contents(TSVSHOP_PATH . $file);
}
}
$fn = md5($data);
$filename = TSVSHOP_PATH . 'cache/' . $fn . '.js';
if (!file_exists($filename)) {
if ($handle = opendir(TSVSHOP_PATH . 'cache/')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
unlink(TSVSHOP_PATH . 'cache/' . $file);
}
}
closedir($handle);
}
require TSVSHOP_PATH . 'include/jsmin5.php';
$data = JSMin::minify($data);
$tmp = fopen($filename, "w");
@flock($tmp, LOCK_EX);
fwrite($tmp, $data);
flock($tmp, LOCK_UN);
fclose($tmp);
$modx->regClientStartupScript(TSVSHOP_SURL . 'cache/' . $fn . '.js');
} else {
$modx->regClientStartupScript(TSVSHOP_SURL . 'cache/' . $fn . '.js');
}
} else {
foreach ($jsfiles as $file) {
if (file_exists(TSVSHOP_PATH . $file)) {
$modx->regClientStartupScript(TSVSHOP_SURL . $file);
}
}
}
unset($jsfiles);
unset($data);
unset($fn);
}
开发者ID:vvp24,项目名称:tsvshop,代码行数:44,代码来源:core.inc.php
示例9: tsv_showorder
function tsv_showorder()
{
global $modx, $tsvshop;
$dborders = $modx->getFullTableName('shop_order');
$dborders_details = $modx->getFullTableName('shop_order_detail');
$userid = $modx->getLoginUserID();
$i = explode(":", _filter($_GET['i'], 1));
$n = $i[0];
$c = $i[1];
$out = "";
$r = 0;
$temp = "";
$filename = $modx->config['base_path'] . 'assets/snippets/tsvoffice/tpl/orderview.tpl';
if (!empty($n) && !empty($c) && !empty($userid)) {
$res = $modx->db->select('*', $dborders, 'numorder = "' . $n . '" AND code="' . $c . '" AND userid="' . $userid . '"', 'numorder', '1');
$row = $modx->db->getRow($res);
if ($res && is_array($row)) {
//$row = $modx->db->getRow($res);
$tpl = get_file_contents($filename);
$tpltr = getStr($tpl, '<!--repeat-->', '<!--/repeat-->');
foreach ($row as $key => $value) {
if (in_array($key, explode(",", $tsvshop['SecFields']))) {
$value = DeCryptMessage($value, $tsvshop['SecPassword']);
//echo "key=".$key.", value=".$value;
}
if ($key == "dateorder") {
$value = date("d.m.Y H:i:s", $value);
}
// игнорируем дисконтную карту, проверим позже
if ($key == "discountnum") {
$value = '[+discountnum+]';
}
//
$tpl = str_replace('[+' . $key . '+]', $value, $tpl);
}
// Проверим валидна ли дисконтная карта и если её нет в базе выведем предупреждение
if ($tsvshop['addons_discount_active'] == 'yes') {
$discountres = $modx->db->query("SELECT * FROM " . $modx->getFullTableName('shop_discount') . " AS a WHERE a.discountnum = '" . $row['discountnum'] . "' AND a.active = 1 AND (a.use < a.count OR a.count = 0) AND (a.summa >= '" . $sub . "' OR a.summa = 0) LIMIT 1");
$discountrow = $modx->db->getRow($discountres);
}
if ($discountrow['discountnum']) {
$tpl = str_replace('[+discountnum+]', $discountrow['discountnum'], $tpl);
} else {
$tpl = str_replace('[+discountnum+]', '<span class="error_discount">Карта указана неверно или неактивна</span>', $tpl);
}
// end
if ($res = $modx->db->select('*', $dborders_details, 'numorder = "' . $n . '"', 'numorder')) {
while ($row = $modx->db->getRow($res)) {
$r++;
$temp = $tpltr;
foreach ($row as $key => $value) {
$temp = str_replace('[+' . $key . '+]', $value, $temp);
}
$temp = str_replace('[+num+]', $r, $temp);
$out .= $temp;
}
$out = str_replace($tpltr, $out, $tpl);
$out = preg_replace('/(\\[\\+.*?\\+\\])/', '', $out);
return $out;
}
} else {
return '<div class="error">Извините, но такого заказа не существует.</div>';
}
} else {
return '<div class="error">Извините, но такого заказа не существует.</div>';
}
// если номер заказа, ид пользователя и код доступа подходят, выдаем подробности заказа
// backid
}
开发者ID:myindexlike,项目名称:tsvshop,代码行数:69,代码来源:tsvoffice.inc.php
示例10: get_file_contents
$total_return = get_file_contents($current_file, $source_machine);
break;
case 'wiki_ext':
$source_machine = $source_id;
$current_file = "/mwikiext/{$id}";
$to_logserver['source'] = 'wiki';
$total_return = get_file_contents($current_file, $source_machine);
break;
case 'evi':
case 'duck':
case 'wolf':
$case = $row['source'];
$source_machine = $source_id;
$current_file = "/{$case}/{$id}";
$to_logserver['source'] = $case;
$total_return = get_file_contents($current_file, $source_machine);
break;
case 'wans':
case 'linked':
case 'ans':
case 'iforum':
case 'imdb':
case 'ehow':
case 'local':
$case = $row['source'];
$q = "select ans from data_{$case} where id = {$source_id}";
$r = mysql_query($q) or trigger_error(mysql_error() . " in " . $q, E_USER_ERROR);
$rw = mysql_fetch_array($r);
$total_return = $rw['ans'];
$source_machine = 'db';
$current_file = "data_{$case}/ans/id/{$source_id}";
开发者ID:superego546,项目名称:SMSGyan,代码行数:31,代码来源:tmpfix.php
示例11: BinarySearch
echo "<h4>CITY SEARCH</h4>";
$tree = new BinarySearch('msi_cities', 'city', 3);
echo $city_name = $tree->search($city, 1);
if (!empty($city_name)) {
echo $query = "select * from msi_cities where city='{$city_name}'";
$result = mysql_query($query);
if (mysql_num_fields($result) > 0) {
$row = mysql_fetch_array($result);
$flag = $row['flag'];
$mid = $row['machineID'];
$id = $row['id'];
if ($flag != 0 && $mid != 0) {
echo "<h2>Inside DB</h2>";
$current_file = "/city/{$id}";
$source_machine = $mid;
$total_return = get_file_contents($current_file, $mid);
echo $total_return;
$to_logserver['source'] = 'city';
include 'allmanip.php';
putOutput($total_return);
exit;
} else {
echo $url = "http://www.mustseeindia.com/" . ucfirst($city_name);
$content = httpGet($url);
if (!empty($content)) {
preg_match_all("~<td class=\"td-title-sm-pl\">(.+)<div class=\"sep10\"></div>~Usi", $content, $match);
if (!empty($match[1])) {
$out = $match[1][0];
$out = preg_replace('~<td class="td-pl">|<br>~', "***", $out);
$out = strip_tags($out);
$out = str_replace("More details coming soon. Stay tuned!", "", $out);
开发者ID:superego546,项目名称:SMSGyan,代码行数:31,代码来源:city.php
示例12: implode
$data = implode("\n", array_filter(explode("\n", $tmpdata)));
}
}
if ($_SERVER['REQUEST_METHOD'] == "POST") {
$usern = $_POST['username'];
$passw = $_POST['phrase'];
$tgt = $_POST['target'];
$fpath = json_decode($_POST['filepath']);
$cfg = "/tmp/" . $_POST['cfg'] . ".s3cfg";
$tmp_data = "";
if ($tgt == "1") {
// Currently, we expect only element 0
get_s3_file($fpath, $tmp_data, $cfg);
} else {
$myhost = $_POST['host'];
get_file_contents($myhost, $usern, $passw, $fpath, $tmp_data);
}
if ($tmp_data != "") {
$myc_arr = "";
// create map
$realkey_cnt = 0;
$paths_map = array();
foreach (array_filter(explode("\n", $tmp_data)) as $f) {
$dn = dirname($f);
if (!array_key_exists($dn, $paths_map)) {
$paths_map[$dn] = $realkey_cnt;
$realkey_cnt++;
}
}
$mymap = array_flip($paths_map);
// output map and data
开发者ID:AdamDS,项目名称:GenomeVIP,代码行数:31,代码来源:get_rpathfile2.php
示例13: execute_command_return_output
key vpnkey.pem
*/
execute_command_return_output("/usr/bin/openssl req -nodes -new -x509 -keyout /tmp/cakey.pem -out /tmp/cacert.pem -config /etc/ssl/openssl.cnf");
echo "\n<script language=\"JavaScript\">document.forms[0].status.value=\"Creating Server Certificates...\";</script>";
execute_command_return_output("/usr/bin/openssl req -nodes -new -keyout /tmp/vpnkey.pem -out /tmp/vpncert-req.pem -config /etc/ssl/openssl.cnf");
execute_command_return_output("/usr/bin/openssl ca -out /tmp/vpncert.pem -in /tmp/vpncert-req.pem -batch");
echo "\n<script language=\"JavaScript\">document.forms[0].status.value=\"Creating DH Parms...\";</script>";
execute_command_return_output("/usr/bin/openssl dhparam -out /tmp/dh1024.pem 1024");
echo "\n<script language=\"JavaScript\">document.forms[0].status.value=\"Done!\";</script>";
//CLIENT
//mwexec("openssl req -nodes -new -keyout home.key -out home.csr");
//mwexec("openssl ca -out home.crt -in home.csr");
$cacertA = get_file_contents("/tmp/cacert.pem");
$serverkeyA = get_file_contents("/tmp/vpnkey.pem");
$servercertA = get_file_contents("/tmp/vpncert.pem");
$dhpemA = get_file_contents("/tmp/dh1024.pem");
$cacert = ereg_replace("\n", "\\n", $cacertA);
$serverkey = ereg_replace("\n", "\\n", $serverkeyA);
$dhpem = ereg_replace("\n", "\\n", $dhpemA);
//$servercert = ereg_replace("\n","\\n", $servercertA);
$tmp = strstr($servercertA, "-----BEGIN CERTIFICATE-----");
$servercert = ereg_replace("\n", "\\n", $tmp);
?>
<script language="JavaScript">
<!--
var ca_cert ='<?php
echo $cacert;
?>
';
var srv_key ='<?php
echo $serverkey;
开发者ID:rootsghost,项目名称:5651-pfsense,代码行数:31,代码来源:vpn_openvpn_create_certs.php
示例14: unserialize
<?php
if ($req == "localmovie_list") {
echo "<br>LOCALMOVIE LIST<br>";
$localmovie_list = unserialize(get_file_contents("/localmovie/" . $numbers, $m));
echo "<br>localmovie_list: ";
print_r($localmovie_list);
echo "<br>";
include 'localmovie_list.php';
$total_return = "Movie listing for " . $localmovie_list['city'] . "\n";
include 'allmanip.php';
$to_logserver['source'] = 'showtimes';
if ($fromHi == true) {
$total_return = str_replace("OPTIONS", "ALSO TRY", $total_return);
$total_return = str_replace("Reply with", "Try with", $total_return);
}
putOutput($total_return);
die;
}
开发者ID:superego546,项目名称:SMSGyan,代码行数:19,代码来源:localmovielist.php
示例15: vieworder
function vieworder($filename)
{
global $modx, $shop_lang, $theme, $tsvshop, $tables, $moduleid, $modulea;
$user = $modx->userLoggedIn();
$out = "";
$output_sales_notice = "";
$output_sales_error = "";
$temp = "";
$act = $_GET['act'];
$id = _filter($_GET['idorder'], 1);
$filename = empty($filename) ? TSVSHOP_PATH . 'addons/sales/tpl/orderview.tpl' : $filename;
if ($user['usertype'] == "manager") {
if (!empty($act) && $act == "vieworder" && $tables['sales'] != "none" && $tsvshop['dborders'] != "" && !empty($id) && is_numeric($id)) {
if ($res = $modx->db->select('*', $tsvshop['dborders'], 'numorder = "' . $id . '"', 'numorder', '1')) {
$row = $modx->db->getRow($res);
$url = "index.php";
$tpl = get_file_contents($filename);
$row1 = array('moduleurl' => $url, 'modulea' => $modulea, 'moduleid' => $moduleid, 'theme' => $theme);
$tpltr = getStr($tpl, '<!--repeat-->', '<!--/repeat-->');
$row = array_merge($shop_lang, $row1, $row);
foreach ($row as $key => $value) {
if (in_array($key, explode(",", $tsvshop['SecFields']))) {
$value = DeCryptMessage($value, $tsvshop['SecPassword']);
}
if ($key == "dateorder") {
$value = date("d.m.Y H:i:s", $value);
}
if ($key == "status") {
$tpl = str_replace('[+buildstatus+]', '<select name="status" id="status">' . buildstatus($value, explode("||", $tsvshop['StatusOrder'])) . '</select>', $tpl);
}
$tpl = str_replace('[+' . $key . '+]', $value, $tpl);
}
if ($res = $modx->db->select('*', $tsvshop['dborders_details'], 'numorder = "' . $id . '"', 'numorder')) {
while ($order = $modx->db->getRow($res)) {
$row = array_merge($row, $order);
$r++;
$temp = str_replace('[+moduleid+]', $_GET['id'], $tpltr);
foreach ($order as $key => $value) {
$temp = str_replace('[+' . $key . '+]', $value, $temp);
}
$temp = str_replace('[+num+]', $r, $temp);
$out .= $temp;
}
$out = str_replace($tpltr, $out, $tpl);
$out = preg_replace('/(\\[\\+.*?\\+\\])/', '', $out);
return $out;
}
}
//---
}
}
}
开发者ID:myindexlike,项目名称:tsvshop,代码行数:52,代码来源:functions.inc.php
示例16: testDirWrite
$test = testDirWrite('', '', $d, '', 0, $debug);
if ($test->res == 'red') {
installerShowErrorPage('Directory not writable! ' . $d . '<br />Please correct by executing: <em>chmod 777</em> or set writing permission for php process, exiting!', 'Directory_not_writable');
}
}
require_once $pathSmartClass;
$smarty = new Smarty();
$smarty->compile_dir = TMP_TEMPLATES_C_LOCATION;
$smarty->cache_dir = TMP_CACHE_LOCATION;
$smarty->template_dir = cms_join_path(CMS_INSTALL_BASE, 'templates');
$smarty->caching = false;
$smarty->force_compile = true;
$smarty->debugging = false;
$smarty->assign('languages', $installer->dropdown_lang());
if (file_exists(cms_join_path(CMS_INSTALL_BASE, 'releasenotes.txt'))) {
$smarty->assign('release_notes', get_file_contents(cms_join_path(CMS_INSTALL_BASE, 'releasenotes.txt')));
}
$smarty->display('installer_start.tpl');
$smarty->display('pagestart.tpl');
$smarty->display('installer_end.tpl');
exit;
} else {
if (!isset($_SESSION['test'])) {
installerShowErrorPage('Session not working, you have problem with some modules and functionality! Ask your provider, exiting!', 'Session_not_working');
}
}
// First checks ok
if (isset($_POST['default_cms_lang'])) {
$frontendlang = $_POST['default_cms_lang'];
}
require_once cms_join_path(CMS_INSTALL_BASE, 'lang.php');
开发者ID:RTR-ITF,项目名称:usse-cms,代码行数:31,代码来源:upgrade.php
示例17: getContents
function getContents()
{
if (!is_file($this->getPathname())) {
throw new Exception("Not a file or not readable");
}
return get_file_contents($this->getPathname());
}
开发者ID:j2sh,项目名称:php-tracer-weaver,代码行数:7,代码来源:scanner.inc.php
示例18: while
if ($rows->key() == "row") {
$fileid = $filename = NULL;
$props = $rows->getChildren();
$props->rewind();
while ($props->valid()) {
switch ($props->key()) {
case "id":
$fileid = strval($props->current());
break;
case "file_name":
$filename = strval($props->current());
}
$props->next();
}
if (!empty($fileid) && !empty($filename)) {
$contents = get_file_contents($fileid);
if ($contents) {
parse_file($filename, $contents);
}
}
}
$rows->next();
}
}
$xml->next();
}
$lastchange = intval(ConfigHelper::getConfig('finances.bgz_password_lastchange', 0));
if (!$lastchange || time() - $lastchange > 30 * 86400) {
if (!$quiet) {
printf("Changing BGZ password ... ");
}
开发者ID:Akheon23,项目名称:lms,代码行数:31,代码来源:lms-cashimport-bgz.php
示例19: get_file_contents
<?php
if (preg_match("~__bestmaketrip__(.+)__(.+)__(.+)__~", $req, $matches)) {
echo "<h3>Route API SPCL CASE</h3>";
$input = $matches[1];
$origin = $matches[2];
$destination = $matches[3];
$hitMake = false;
$matched = TRUE;
$file = $listAll["target"];
$mch = $listAll['machine_id'];
$content = get_file_contents($file, $mch);
$arResult = json_decode($content, TRUE);
if (empty($arResult)) {
$hitMake = TRUE;
}
include 'routeapi.php';
} elseif (preg_match("~\\b(routes?|distances?|directions?)\\b~", $spell_checked, $match)) {
echo "<br>ROUTE DETAILS<br>";
echo $route_req = $spell_checked;
$rout_must = false;
$hitapi = true;
if ($match[1] == 'to' || $match[1] == ' 2 ') {
$route_req = preg_replace("~ 2 ~", " to ", $route_req);
$hitapi = false;
} else {
if ($match[1] == 'route' || $match[1] == 'routes') {
$rout_must = true;
}
}
if (!preg_match("~\\b(who|where|movie|song|weather|climate|cricket|cri|score|review|lyrics|bus|dict)\\b~", $req)) {
开发者ID:superego546,项目名称:SMSGyan,代码行数:31,代码来源:match_route.php
示例20: parseUrl
function parseUrl($Url)
{
if ($Content = @get_file_contents($Url)) {
return $this->Parse($Conent);
}
}
开发者ID:jagermesh,项目名称:bright,代码行数:6,代码来源:BrRSSFeed.php
注:本文中的get_file_contents函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论