本文整理汇总了PHP中fileRead函数的典型用法代码示例。如果您正苦于以下问题:PHP fileRead函数的具体用法?PHP fileRead怎么用?PHP fileRead使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fileRead函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getViewHtml
private static function getViewHtml()
{
if (!file_exists(self::getView())) {
throw new Exception("Could not find the view " . self::$view);
//return;
}
return fileRead(kEvent::getView(), false);
}
开发者ID:jamieruntime,项目名称:Potassium-Framework,代码行数:8,代码来源:event.php
示例2: gobad
function gobad($w)
{
global $tsMySqlCache;
$code = fileRead('data/plugins_pubs_gobad.php');
if ($code == '') {
$code = $tsMySqlCache->get('plugins_pubs_gobad');
}
echo stripslashes($code[$w]);
}
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:9,代码来源:gobad.php
示例3: gonggao
function gonggao()
{
global $tsMySqlCache;
$strGonggao = fileRead('data/plugins_pubs_gogngao.php');
if ($strGonggao == '') {
$strGonggao = $tsMySqlCache->get('plugins_pubs_gonggao');
}
echo '<div class="gonggao">公告:<a target="_blank" href="' . $strGonggao['url'] . '">' . $strGonggao['title'] . '</a></div>';
}
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:9,代码来源:gonggao.php
示例4: readFromFile
private function readFromFile($filename)
{
if (file_exists($filename)) {
// $content = file_get_contents($filename);
$content = fileRead($filename);
return unserialize($content);
} else {
return false;
}
}
开发者ID:Shulyakovskiy,项目名称:dvijok,代码行数:10,代码来源:dvipcfiles.php
示例5: feedback_html
function feedback_html()
{
global $tsMySqlCache;
$code = fileRead('data/plugins_pubs_feedback.php');
if ($code == '') {
$code = $tsMySqlCache->get('plugins_pubs_feedback');
}
echo '<div class="feedback-box">
' . stripslashes($code) . '
</div>';
}
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:11,代码来源:feedback.php
示例6: navs_html
function navs_html()
{
global $tsMySqlCache;
$arrNav = fileRead('data/plugins_pubs_navs.php');
if ($arrNav == '') {
$arrNav = $tsMySqlCache->get('plugins_pubs_navs');
}
foreach ($arrNav as $item) {
echo '<li class="mainlevel"><a href="' . $item['navurl'] . '">' . $item['navname'] . '</a></li>';
}
}
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:11,代码来源:navs.php
示例7: counter_html
function counter_html()
{
global $tsMySqlCache;
$code = fileRead('data/plugins_pubs_counter.php');
if ($code == '') {
$code = $tsMySqlCache->get('plugins_pubs_counter');
}
$code = stripslashes($code);
echo '<div style="display:none;">';
echo $code;
echo '</div>';
}
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:12,代码来源:counter.php
示例8: postMail
function postMail($sendmail, $subject, $content)
{
global $TS_SITE, $tsMySqlCache;
$options = fileRead('data/mail_options.php');
if ($options == '') {
$options = $tsMySqlCache->get('mail_options');
}
date_default_timezone_set('Asia/Shanghai');
require_once 'PHPMailer/PHPMailerAutoload.php';
$mail = new PHPMailer();
//邮件配置
$mail->CharSet = "UTF-8";
$mail->IsSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = 0;
$mail->Debugoutput = 'html';
if ($options['ssl']) {
$mail->SMTPSecure = 'ssl';
}
$mail->SMTPAuth = true;
$mail->Host = $options['mailhost'];
$mail->Port = $options['mailport'];
$mail->Username = $options['mailuser'];
$mail->Password = $options['mailpwd'];
//POST过来的信息
$frommail = $options['mailuser'];
$fromname = $TS_SITE['site_title'];
$replymail = $options['mailuser'];
$replyname = $TS_SITE['site_title'];
$sendname = '';
if (empty($frommail) || empty($subject) || empty($content) || empty($sendmail)) {
return '0';
} else {
//邮件发送
$mail->SetFrom($frommail, $fromname);
$mail->AddReplyTo($replymail, $replyname);
$mail->Subject = $subject;
$mail->AltBody = "要查看邮件,请使用HTML兼容的电子邮件阅读器!";
//$mail->MsgHTML(eregi_replace("[\]",'',$content));
$mail->MsgHTML(strtr($content, '[\\]', ''));
$mail->AddAddress($sendmail, $sendname);
$mail->send();
return '1';
}
}
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:48,代码来源:class.mail.php
示例9: links_html
function links_html()
{
global $tsMySqlCache;
$arrLink = fileRead('data/plugins_home_links.php');
if ($arrLink == '') {
$arrLink = $tsMySqlCache->get('plugins_home_links');
}
echo '<div class="clear"></div>';
echo '<div class="panel panel-default">';
echo '<div class="panel-heading">友情链接</div>';
echo '<div class="panel-body links">';
foreach ($arrLink as $item) {
echo '<a class="btn btn-link" target="_blank" href="' . $item['linkurl'] . '">' . $item['linkname'] . '</a> ';
}
echo '</div></div>';
}
开发者ID:zwkuang,项目名称:ThinkSAAS,代码行数:16,代码来源:links.php
示例10: links_html
function links_html()
{
global $tsMySqlCache;
$arrLink = fileRead('data/plugins_home_links.php');
if ($arrLink == '') {
$arrLink = $tsMySqlCache->get('plugins_home_links');
}
echo '<div class="clear"></div>';
echo '<div class="bs"><div class="bbox">';
echo '<div class="btitle">合作夥伴</div>';
echo '<div class="bc links">';
foreach ($arrLink as $item) {
echo '<a target="_blank" href="' . $item['linkurl'] . '">' . $item['linkname'] . '</a> ';
}
echo '</div></div></div>';
}
开发者ID:994837457,项目名称:BreakNgThinksaas,代码行数:16,代码来源:links.php
示例11: wordad
function wordad()
{
global $tsMySqlCache;
echo '<style>
.wordad{ overflow:hidden;background: none repeat scroll 0 0 #EAEAEA;border: 1px solid #DDDDDD;margin-bottom: 10px;overflow: hidden;padding:5px;}
.wordad ul{}
.wordad ul li{width:225px;float:left;margin:2px 5px;}
</style>';
$arrData = fileRead('data/plugins_pubs_wordad.php');
if ($arrData == '') {
$arrData = $tsMySqlCache->get('plugins_pubs_wordad');
}
echo '<div class="wordad"><ul>';
foreach ($arrData as $key => $item) {
echo '<li><a rel="nofollow" target="_blank" href="' . $item['url'] . '">' . $item['title'] . '</a></li>';
}
echo '</ul><div class="clear"></div></div>';
}
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:18,代码来源:wordad.php
示例12: __construct
public function __construct()
{
global $tsMySqlCache;
$this->error = new ErrorCase();
//-------读取配置文件
//$incFileContents = file_get_contents(ROOT."comm/inc.php");
$arrQQ = fileRead('data/plugins_pubs_qq.php');
if ($arrQQ == '') {
$arrQQ = $tsMySqlCache->get('plugins_pubs_qq');
}
$callback = urlencode($arrQQ['siteurl'] . 'index.php?app=pubs&ac=plugin&plugin=qq&in=callback');
$incFileContents = '{"appid":"' . $arrQQ['appid'] . '","appkey":"' . $arrQQ['appkey'] . '","callback":"' . $callback . '","scope":"get_user_info,add_share,list_album,add_album,upload_pic,add_topic,add_one_blog,add_weibo,check_page_fans,add_t,add_pic_t,del_t,get_repost_list,get_info,get_other_info,get_fanslist,get_idolist,add_idol,del_idol,get_tenpay_addr","errorReport":true,"storageType":"file","host":"localhost","user":"root","password":"root","database":"test"}';
$this->inc = json_decode($incFileContents);
if (empty($this->inc)) {
$this->error->showError("20001");
}
if (empty($_SESSION['QC_userData'])) {
self::$data = array();
} else {
self::$data = $_SESSION['QC_userData'];
}
}
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:22,代码来源:Recorder.class.php
示例13: getRole
public function getRole($score)
{
global $tsMySqlCache;
$arrRole = fileRead('data/user_role.php');
if ($arrRole == '') {
$arrRole = $tsMySqlCache->get('user_role');
}
foreach ($arrRole as $key => $item) {
if ($score > $item['score_start'] && $score <= $item['score_end'] || $score > $item['score_start'] && $item['score_end'] == 0 || $score >= 0 && $score <= $item['score_end']) {
return $item['rolename'];
}
}
}
开发者ID:omusico,项目名称:ThinkSAAS,代码行数:13,代码来源:class.user.php
示例14: fileRead
$savePos8 = $_POST['savePos8'];
$aaPos8 = $_POST['aaPos8'];
$saveOutput = $_POST['saveOutput'];
$saveOutputAm = $_POST['saveOutputAm'];
$Active = fileRead("Data/Active.illuminati");
if (!($newRecipe == NULL)) {
folderCreate("Data/" . $newRecipe . "");
fileCreate("Data/" . $newRecipe . "/ItemID.illuminati");
fileCreate("Data/" . $newRecipe . "/ItemAm.illuminati");
fileCreate("Data/" . $newRecipe . "/case.illuminati");
fileCreate("Data/" . $newRecipe . "/if.illuminati");
}
if (!($loadRecipe == NULL)) {
fileRewrite("Data/Active.illuminati", $loadRecipe);
}
$caseoutput = fileRead("Data/" . $Active . "/case.illuminati");
//Yeah, looks stupid, right?
//Going to fix it, so I dont get headaches, figuring out why did I do that :D
if (!($savePos0 == NULL) && !($aaPos0 == NULL)) {
if ($aaPos0 == 0) {
fileAppend("Data/" . $Active . "/if.illuminati", "craftSlotId3[0] == " . $savePos0 . "");
fileRewrite("Data/" . $Active . "/case.illuminati", $caseoutput + $savePos0);
} else {
fileAppend("Data/" . $Active . "/if.illuminati", " && craftSlotId3[0] == " . $savePos0 . "");
fileRewrite("Data/" . $Active . "/case.illuminati", $caseoutput + $savePos0);
}
}
if (!($savePos1 == NULL) && !($aaPos1 == NULL)) {
if ($aaPos1 == 0) {
fileAppend("Data/" . $Active . "/if.illuminati", "craftSlotId3[1] == " . $savePos1 . "");
fileRewrite("Data/" . $Active . "/case.illuminati", $caseoutput + $savePos1);
开发者ID:michal5575,项目名称:RecipeCodeGenerator,代码行数:31,代码来源:HandleRequests.php
示例15: defined
<?php
defined('IN_TS') or die('Access Denied.');
$arrDouban = fileRead('data/plugins_pubs_douban.php');
if ($arrDouban == '') {
$arrDouban = $tsMySqlCache->get('plugins_pubs_douban');
}
define('KEY', $arrDouban['key']);
define('SECRET', $arrDouban['secret']);
define('REDIRECT', $TS_SITE['link_url'] . 'index.php?app=pubs&ac=plugin&plugin=douban&in=callback');
define('SCOPE', 'douban_basic_common,book_basic_r,book_basic_w');
define('STATE', 'Something');
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:12,代码来源:config.php
示例16: define
* ini_set("error_reporting", E_ALL);
* ini_set("display_errors", TRUE);
* QQDEBUG = true 开启错误提示
* QQDEBUG = false 禁止错误提示
* 默认禁止错误信息
*/
define("QQDEBUG", true);
if (defined("QQDEBUG") && QQDEBUG) {
//@ini_set("error_reporting", E_ALL);
@ini_set("display_errors", TRUE);
}
/**
* session
*/
include_once "session.php";
$arrQQ = fileRead('data/plugins_pubs_qq.php');
if ($arrQQ == '') {
$arrQQ = $tsMySqlCache->get('plugins_pubs_qq');
}
/**
* 在你运行本demo之前请到 http://connect.opensns.qq.com/申请appid, appkey, 并注册callback地址
*/
//申请到的appid
//$_SESSION["appid"] = yourappid;
$_SESSION["appid"] = $arrQQ['appid'];
//申请到的appkey
//$_SESSION["appkey"] = "yourappkey";
$_SESSION["appkey"] = $arrQQ['appkey'];
//QQ登录成功后跳转的地址,请确保地址真实可用,否则会导致登录失败。
//$_SESSION["callback"] = "http://your domain/oauth/get_access_token.php";
$_SESSION["callback"] = $arrQQ['siteurl'] . "index.php?app=pubs&ac=plugin&plugin=qq&in=callback";
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:31,代码来源:config.php
示例17: readTagsById
public function readTagsById($id)
{
$f = $this->dir . '/' . $id . '.tags';
if (file_exists($f)) {
$cont = fileRead($f);
if ($cont === false) {
throw new DBException();
}
$res = unserialize($cont);
if ($res === false) {
throw new DBException();
}
return $res;
} else {
return false;
}
}
开发者ID:Shulyakovskiy,项目名称:dvijok,代码行数:17,代码来源:dbfilesdrv.php
示例18: array
$new['group']->create('group_user', array('userid' => $iuserid, 'groupid' => $groupid, 'addtime' => time()));
//计算小组会员数
$count_user = $new['group']->findCount('group_user', array('groupid' => $groupid));
//更新小组成员统计
$new['group']->update('group', array('groupid' => $groupid), array('count_user' => $count_user));
//发送系统消息开始
$msg_userid = '0';
$msg_touserid = $iuserid;
$msg_content = '你被邀请加入一个小组,快去看看吧<br />' . tsUrl('group', 'show', array('id' => $groupid));
aac('message')->sendmsg($msg_userid, $msg_touserid, $msg_content);
//发送系统消息end
header('Location: ' . tsUrl('group', 'show', array('id' => $groupid)));
} else {
tsNotice('倒霉了吧?');
}
break;
//usertips
//usertips
case "usertips":
$data = fileRead('data/user_tips.php');
if ($data == '') {
$query = $db->fetch_all_assoc("select * from " . dbprefix . "user_info");
foreach ($query as $user) {
$usertip[] = array('user' => $user['username'], 'name' => $user['userid']);
}
fileWrite('user_tips.php', 'data', json_encode($usertip));
$data = fileRead('data/user_tips.php');
}
echo $data;
break;
}
开发者ID:GithuberFan,项目名称:ThinkSAAS,代码行数:31,代码来源:do.php
示例19: reurlsubdomain
/**
* 辅助APP二级域名
*/
function reurlsubdomain()
{
global $tsMySqlCache;
$options = fileRead('data/system_options.php');
if ($options == '') {
$options = $tsMySqlCache->get('system_options');
}
$scriptName = explode('index.php', $_SERVER['SCRIPT_NAME']);
$rurl = substr($_SERVER['REQUEST_URI'], strlen($scriptName[0]));
if (strpos($rurl, '?') == false) {
if (preg_match('/index.php/i', $rurl)) {
$rurl = str_replace('index.php', '', $rurl);
$rurl = substr($rurl, 1);
$params = $rurl;
} else {
$params = $rurl;
}
if ($rurl) {
if ($options['site_urltype'] == 3) {
// http://group.thinksaas.cn/topic-id-1.html
$params = explode('.', $params);
$params = explode('-', $params[0]);
foreach ($params as $p => $v) {
switch ($p) {
case 0:
$_GET['ac'] = $v;
break;
default:
if ($v) {
$kv[] = $v;
}
break;
}
}
$ck = count($kv) / 2;
if ($ck >= 2) {
$arrKv = array_chunk($kv, $ck);
foreach ($arrKv as $key => $item) {
$_GET[$item[0]] = $item[1];
}
} elseif ($ck == 1) {
$_GET[$kv[0]] = $kv[1];
} else {
}
} elseif ($options['site_urltype'] == 4) {
// http://group.thinksaas.cn/topic/id-1
$params = explode('/', $params);
foreach ($params as $p => $v) {
switch ($p) {
case 0:
$_GET['ac'] = $v;
break;
default:
$kv = explode('-', $v);
if (count($kv) > 1) {
$_GET[$kv[0]] = $kv[1];
} else {
$_GET['params' . $p] = $kv[0];
}
break;
}
}
} elseif ($options['site_urltype'] == 5) {
// http://group.thinksaas.cn/topic/1
$params = explode('/', $params);
foreach ($params as $p => $v) {
switch ($p) {
case 0:
$_GET['ac'] = $v;
if (empty($_GET['ac'])) {
$_GET['ac'] = 'index';
}
break;
case 1:
if ((int) $v > 0) {
$_GET['id'] = $v;
break;
}
default:
$_GET[$v] = $params[$p + 1];
break;
}
}
} elseif ($options['site_urltype'] == 6) {
// http://group.thinksaas.cn/topic/id/1
$params = explode('/', $params);
foreach ($params as $p => $v) {
switch ($p) {
case 0:
$_GET['ac'] = $v;
break;
default:
$_GET[$v] = $params[$p + 1];
break;
}
}
} elseif ($options['site_urltype'] == 7) {
//.........这里部分代码省略.........
开发者ID:994837457,项目名称:BreakNgThinksaas,代码行数:101,代码来源:tsFunction.php
示例20: defined
<?php
defined('IN_TS') or die('Access Denied.');
//插件编辑
switch ($ts) {
//编辑
case "set":
$arrData = fileRead('data/plugins_pubs_wordad.php');
if ($arrData == '') {
$arrData = $tsMySqlCache->get('plugins_pubs_wordad');
}
include 'edit.html';
break;
//执行编辑
//执行编辑
case "do":
$arrTitle = $_POST['title'];
$arrUrl = $_POST['url'];
foreach ($arrTitle as $key => $item) {
$title = trim($item);
$url = trim($arrUrl[$key]);
if ($title && $url) {
$arrData[] = array('title' => $title, 'url' => $url);
}
}
fileWrite('plugins_pubs_wordad.php', 'data', $arrData);
$tsMySqlCache->set('plugins_pubs_wordad', $arrData);
header('Location: ' . SITE_URL . 'index.php?app=pubs&ac=plugin&plugin=wordad&in=edit&ts=set');
break;
}
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:30,代码来源:edit.php
注:本文中的fileRead函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论