本文整理汇总了PHP中fileRead函数的典型用法代码示例。如果您正苦于以下问题:PHP fileRead函数的具体用法?PHP fileRead怎么用?PHP fileRead使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fileRead函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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]);
}
示例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>';
}
示例4: readFromFile
private function readFromFile($filename)
{
if (file_exists($filename)) {
// $content = file_get_contents($filename);
$content = fileRead($filename);
return unserialize($content);
} else {
return false;
}
}
示例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>';
}
示例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>';
}
}
示例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>';
}
示例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';
}
}
示例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>';
}
示例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>';
}
示例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>';
}
示例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'];
}
}
示例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'];
}
}
}
示例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);
示例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');