当前位置: 首页>>代码示例>>PHP>>正文


PHP doAction函数代码示例

本文整理汇总了PHP中doAction函数的典型用法代码示例。如果您正苦于以下问题:PHP doAction函数的具体用法?PHP doAction怎么用?PHP doAction使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了doAction函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: edit_actions

function edit_actions($act, $log)
{
    global $mos;
    global $nav_modules;
    if (!isset($_REQUEST['mod'])) {
        return;
    }
    if (!isset($_REQUEST['edit_text'])) {
        return;
    }
    if ($act == "editsave") {
        $s = $_REQUEST['edit_text'];
        if (get_magic_quotes_gpc()) {
            $s = stripslashes($s);
        }
        $s = str_replace("\r", '', $s);
        $mod = $_REQUEST['mod'];
        $m = array();
        $m = parse_ini_file($mos . '/etc/pm/installed', true);
        $opts = $m[$mod];
        if (loadModuleOptions($mod, $opts)) {
            $conf = "{$mos}/" . $opts['config_edit'];
            file_put_contents($conf, $s);
            if (($st = $opts['_status']) != 'disable') {
                if (isset($opts['config_after'])) {
                    exec("{$mos}/etc/init/" . $opts['init'] . ' ' . $opts['config_after']);
                }
                if ($st != 'stop') {
                    doAction($mod, 'restart', $log);
                }
            }
        }
    }
}
开发者ID:jasanders,项目名称:os-aios,代码行数:34,代码来源:mod_edit.php

示例2: klUploadFile

function klUploadFile($filename, $errorNum, $tmpfile, $filesize, $filetype, $type, $isIcon = 0)
{
    $kl_album_config = unserialize(Option::get('kl_album_config'));
    $extension = strtolower(substr(strrchr($filename, "."), 1));
    $uppath = KL_UPLOADFILE_PATH . date("Ym") . "/";
    $fname = md5($filename) . date("YmdHis") . rand() . '.' . $extension;
    $attachpath = $uppath . $fname;
    if (!is_dir(KL_UPLOADFILE_PATH)) {
        umask(0);
        $ret = @mkdir(KL_UPLOADFILE_PATH, 0777);
        if ($ret === false) {
            return '创建文件上传目录失败';
        }
    }
    if (!is_dir($uppath)) {
        umask(0);
        $ret = @mkdir($uppath, 0777);
        if ($ret === false) {
            return "上传失败。文件上传目录(content/plugins/kl_album/upload)不可写";
        }
    }
    doAction('kl_album_upload', $tmpfile);
    //缩略
    $imtype = array('jpg', 'png', 'jpeg', 'gif');
    $thum = $uppath . "thum-" . $fname;
    $attach = in_array($extension, $imtype) && function_exists("ImageCreate") && klResizeImage($tmpfile, $filetype, $thum, $isIcon, KL_IMG_ATT_MAX_W, KL_IMG_ATT_MAX_H) ? $thum : $attachpath;
    $kl_album_compression_length = isset($kl_album_config['compression_length']) ? intval($kl_album_config['compression_length']) : 1024;
    $kl_album_compression_width = isset($kl_album_config['compression_width']) ? intval($kl_album_config['compression_width']) : 768;
    if ($kl_album_compression_length == 0 || $kl_album_compression_width == 0) {
        if (@is_uploaded_file($tmpfile)) {
            if (@(!move_uploaded_file($tmpfile, $attachpath))) {
                @unlink($tmpfile);
                return "上传失败。文件上传目录(content/plugins/kl_album/upload)不可写";
            } else {
                echo 'kl_album_successed';
            }
            chmod($attachpath, 0777);
        }
    } else {
        if (in_array($extension, $imtype) && function_exists("ImageCreate") && klResizeImage($tmpfile, $filetype, $attachpath, $isIcon, $kl_album_compression_length, $kl_album_compression_width)) {
            echo 'kl_album_successed';
        } else {
            if (@is_uploaded_file($tmpfile)) {
                if (@(!move_uploaded_file($tmpfile, $attachpath))) {
                    @unlink($tmpfile);
                    return "上传失败。文件上传目录(content/plugins/kl_album/upload)不可写";
                } else {
                    echo 'kl_album_successed';
                }
                chmod($attachpath, 0777);
            }
        }
    }
    $attach = substr($attach, 6, strlen($attach));
    return $attach;
}
开发者ID:MikeCoder,项目名称:mblog,代码行数:56,代码来源:kl_album.php

示例3: update_all_actions

function update_all_actions($act, $log)
{
    if ($act == 'prepare') {
        core_actions('getrep', $log);
    } elseif ($act == 'update') {
        $updates = getUpdates();
        foreach ($updates as $mod => $item) {
            doAction($mod, 'update', $log);
        }
    }
}
开发者ID:jasanders,项目名称:os-aios,代码行数:11,代码来源:mod_update_all.php

示例4: addComment

 function addComment($params)
 {
     $name = isset($_POST['comname']) ? addslashes(trim($_POST['comname'])) : '';
     $content = isset($_POST['comment']) ? addslashes(trim($_POST['comment'])) : '';
     $mail = isset($_POST['commail']) ? addslashes(trim($_POST['commail'])) : '';
     $url = isset($_POST['comurl']) ? addslashes(trim($_POST['comurl'])) : '';
     $imgcode = isset($_POST['imgcode']) ? addslashes(trim(strtoupper($_POST['imgcode']))) : '';
     $blogId = isset($_POST['gid']) ? intval($_POST['gid']) : -1;
     $pid = isset($_POST['pid']) ? intval($_POST['pid']) : 0;
     if (ISLOGIN === true) {
         $CACHE = Cache::getInstance();
         $user_cache = $CACHE->readCache('user');
         $name = addslashes($user_cache[UID]['name_orig']);
         $mail = addslashes($user_cache[UID]['mail']);
         $url = addslashes(BLOG_URL);
     }
     if ($url && strncasecmp($url, 'http', 4)) {
         $url = 'http://' . $url;
     }
     doAction('comment_post');
     $Comment_Model = new Comment_Model();
     $Comment_Model->setCommentCookie($name, $mail, $url);
     if ($Comment_Model->isLogCanComment($blogId) === false) {
         emMsg('评论失败:该文章已关闭评论');
     } elseif ($Comment_Model->isCommentExist($blogId, $name, $content) === true) {
         emMsg('评论失败:已存在相同内容评论');
     } elseif (ROLE == ROLE_VISITOR && $Comment_Model->isCommentTooFast() === true) {
         emMsg('评论失败:您提交评论的速度太快了,请稍后再发表评论');
     } elseif (empty($name)) {
         emMsg('评论失败:请填写姓名');
     } elseif (strlen($name) > 20) {
         emMsg('评论失败:姓名不符合规范');
     } elseif ($mail != '' && !checkMail($mail)) {
         emMsg('评论失败:邮件地址不符合规范');
     } elseif (ISLOGIN == false && $Comment_Model->isNameAndMailValid($name, $mail) === false) {
         emMsg('评论失败:禁止使用管理员昵称或邮箱评论');
     } elseif (!empty($url) && preg_match("/^(http|https)\\:\\/\\/[^<>'\"]*\$/", $url) == false) {
         emMsg('评论失败:主页地址不符合规范', 'javascript:history.back(-1);');
     } elseif (empty($content)) {
         emMsg('评论失败:请填写评论内容');
     } elseif (strlen($content) > 8000) {
         emMsg('评论失败:内容不符合规范');
     } elseif (ROLE == ROLE_VISITOR && Option::get('comment_needchinese') == 'y' && !preg_match('/[\\x{4e00}-\\x{9fa5}]/iu', $content)) {
         emMsg('评论失败:评论内容需包含中文');
     } elseif (ISLOGIN == false && Option::get('comment_code') == 'y' && session_start() && (empty($imgcode) || $imgcode !== $_SESSION['code'])) {
         emMsg('评论失败:验证码错误');
     } else {
         $_SESSION['code'] = null;
         $Comment_Model->addComment($name, $content, $mail, $url, $imgcode, $blogId, $pid);
     }
 }
开发者ID:flyysr,项目名称:emlog,代码行数:51,代码来源:comment_controller.php

示例5: display

 private static function display($code, $message, $file, $line, $trace)
 {
     $msg = SYSTEM_FN . ' V' . SYSTEM_VER . ' 在工作时发生致命的异常 @ ' . date('Y-m-d H:m:s') . '<br/><b>消息:</b>#' . $code . ' - ' . $message . '<br/><br/>';
     $msg .= '<table style="width:100%"><thead><th>文件</th><th>行</th><th>代码</th></thead><tbody>';
     $msg .= '<tr><td>' . $file . '</td><td>' . $line . '' . '</td><td>[抛出异常]</td></tr>';
     foreach ($trace as $v) {
         $tracefile = isset($v['file']) ? $v['file'] : '';
         $traceline = isset($v['line']) ? $v['line'] : '';
         $msg .= '<tr><td>' . $tracefile . '</td><td>' . $traceline . '</td><td>' . $v['function'] . '</td></tr>';
     }
     $msg .= '</tbody></table>';
     if (function_exists('doAction')) {
         doAction('error_2', $code, $message, $file, $line, $trace);
     }
     msg($msg);
 }
开发者ID:pixode,项目名称:Tieba-Cloud-Sign,代码行数:16,代码来源:class.E.php

示例6: loadfoot

/**
 * 加载底部
 * @param bool|string $copy 如果为string,则必须输入插件标识符,并显示插件版权,bool(true)则显示云签到版权
 */
function loadfoot($copy = false)
{
    global $i;
    if (defined('SYSTEM_NO_UI')) {
        return;
    }
    $icp = option::get('icp');
    if (!empty($icp)) {
        echo ' | <a href="http://www.miitbeian.gov.cn/" target="_blank">' . $icp . '</a>';
    }
    echo '<br/>' . option::get('footer');
    doAction('footer');
    if (is_string($copy)) {
        if (isset($i['plugins']['desc'][$copy])) {
            $plug = $i['plugins']['desc'][$copy];
            echo '<br/><br/>';
            if (!empty($plug['plugin']['url'])) {
                echo '<a href="' . htmlspecialchars($plug['plugin']['url']) . '" target="_blank">';
            }
            echo $plug['plugin']['name'];
            if (!empty($plug['plugin']['url'])) {
                echo '</a>';
            }
            if (!empty($plug['plugin']['version'])) {
                echo ' V' . $plug['plugin']['version'];
            }
            echo ' // 作者:';
            if (!empty($plug['author']['url'])) {
                echo '<a href="' . htmlspecialchars($plug['author']['url']) . '" target="_blank">';
            }
            echo $plug['author']['author'];
            if (!empty($plug['author']['url'])) {
                echo '</a>';
            }
        }
    }
    if ($copy) {
        echo '<br/><br/>' . SYSTEM_FN . ' V' . SYSTEM_VER . ' // 作者: <a href="http://zhizhe8.net" target="_blank">Kenvix</a>  &amp; <a href="http://www.longtings.com/" target="_blank">mokeyjay</a> &amp;  <a href="http://fyy.l19l.com/" target="_blank">FYY</a> ';
    }
    echo '</div></div></div></div></body></html>';
}
开发者ID:quericy,项目名称:Tieba-Cloud-Sign,代码行数:45,代码来源:ui.php

示例7: doAction

function doAction($action, $url = "")
{
    $forwardpage = "";
    $forward = true;
    $loggedin = isUserLoggedIn();
    if (!$loggedin && strcmp($action, "install") != 0 && strcmp($action, "redirect") != 0) {
        $action = "";
    }
    if (strcmp($action, "install") == 0) {
        $forwardpage = "views/install.php";
    } else {
        if (strcmp($action, "redirect") == 0) {
            $forwardpage = "views/redirect.php";
        } else {
            if (strcmp($action, "") == 0) {
                if ($loggedin) {
                    doAction("home");
                    $forward = false;
                } else {
                    include 'login.php';
                }
            } else {
                if (strcmp($action, "home") == 0) {
                    include 'home.php';
                } else {
                    if (strcmp($action, "logout") == 0) {
                        include 'logout.php';
                    } else {
                        if (strcmp($action, "createGrid") == 0) {
                            include 'createGrid.php';
                        }
                    }
                }
            }
        }
    }
    if ($forward == true) {
        include $forwardpage;
    }
}
开发者ID:nithin001,项目名称:flubber,代码行数:40,代码来源:controller.php

示例8: ReDirect

    if (defined('ROLE')) {
        ReDirect('index.php');
    }
    define('ROLE', 'visitor');
    $i['user']['role'] = 'visitor';
    template('login');
    doAction('login_page_4');
    die;
} elseif (SYSTEM_PAGE == 'reg') {
    if (defined('ROLE')) {
        ReDirect('index.php');
    }
    define('ROLE', 'visitor');
    $i['user']['role'] = 'visitor';
    template('reg');
    doAction('reg_page_4');
    die;
} elseif (isset($_GET['pub_plugin'])) {
    define('ROLE', 'visitor');
    define('SYSTEM_READY_LOAD_PUBPLUGIN', true);
} elseif (SYSTEM_PAGE == 'admin:logout') {
    doAction('logout');
    setcookie("uid", '', time() - 3600);
    setcookie("toolpw", '', time() - 3600);
    setcookie("pwd", '', time() - 3600);
    ReDirect('index.php?mod=login');
} elseif (!defined('UID') && !defined('SYSTEM_DO_NOT_LOGIN')) {
    define('ROLE', 'visitor');
    $i['user']['role'] = 'visitor';
    ReDirect('index.php?mod=login');
}
开发者ID:pixode,项目名称:Tieba-Cloud-Sign,代码行数:31,代码来源:globals.php

示例9: doAction

》上的评论" href="<?php 
echo Url::log($logid);
?>
"><?php 
echo $comnum;
?>
</a>
				</div>
			</header><!-- .entry-header -->
			<div class="entry-content"><?php 
echo $log_content;
?>
</div>
	</article>
	<?php 
doAction('log_related', $logData);
?>
	
	<nav id="nav-single">
	<?php 
neighbor_log($neighborLog);
?>
	</nav>
	<?php 
blog_comments($comments);
?>
	<?php 
blog_comments_post($logid, $ckname, $ckmail, $ckurl, $verifyCode, $allow_remark);
?>
</div><!-- #content -->
<?php 
开发者ID:MikeCoder,项目名称:mblog,代码行数:31,代码来源:echo_log.php

示例10: checkt

    <input name="token" id="token" value="<?php 
echo LoginAuth::genToken();
?>
" type="hidden" />
    <div class="msg">你还可以输入140字</div>
    <div class="box_1"><textarea class="box" name="t"></textarea></div>
    <div class="tbutton"><input type="submit" value="发布" onclick="return checkt();"/> </div>
	<img class="twImg" id="face" style="margin-right: 10px;cursor: pointer;" src="./views/images/face.png">
    <div class="twImg" id="img_select"><input width="120" type="file" height="30" name="Filedata" id="custom_file_upload" style="display: none;"></div>
    <div id="img_name" class="twImg" style="display:none;">
        <a id="img_name_a" class="imgicon" href="javascript:;" onmouseover="$('#img_pop').show();" onmouseout="$('#img_pop').hide();">{图片名称}</a>
        <a href="javascript:;" onclick="unSelectFile()"> [取消]</a>
        <div id="img_pop"></div>
    </div>
    <?php 
doAction('twitter_form');
?>
    </form>
    </div>
    <div class="clear"></div>
    <ul>
    <?php 
foreach ($tws as $val) {
    $author = $user_cache[$val['author']]['name'];
    $avatar = empty($user_cache[$val['author']]['avatar']) ? './views/images/avatar.jpg' : '../' . $user_cache[$val['author']]['avatar'];
    $tid = (int) $val['id'];
    $replynum = $Reply_Model->getReplyNum($tid);
    $hidenum = $replynum - $val['replynum'];
    $img = empty($val['img']) ? "" : '<a title="查看图片" href="' . BLOG_URL . str_replace('thum-', '', $val['img']) . '" target="_blank"><img style="border: 1px solid #EFEFEF;" src="' . BLOG_URL . $val['img'] . '"/></a>';
    ?>
    <li class="li">
开发者ID:LockGit,项目名称:emlog,代码行数:31,代码来源:twitter.php

示例11: getmicrotime

            }
        }
    }
}
//运行统计结束
$time_end = getmicrotime();
$runTime = $time_end - $time_start;
$TS_CF['runTime'] = number_format($runTime, 6);
//定义全局变量
global $TS_CF, $TS_SITE, $TS_APP, $TS_USER, $TS_URL, $TS_MC, $db, $tsMySqlCache;
//装载APP应用
if (is_file('app/' . $TS_URL['app'] . '/class.' . $TS_URL['app'] . '.php')) {
    include_once 'app/' . $TS_URL['app'] . '/class.' . $TS_URL['app'] . '.php';
    $new[$TS_URL['app']] = new $TS_URL['app']($db);
    //在执行action之前加载
    doAction('beforeAction');
    //全站通用数据加载
    include 'thinksaas/common.php';
    if (is_file('app/' . $TS_URL['app'] . '/action.' . $TS_URL['app'] . '.php')) {
        //面向对象的写法
        include_once 'app/' . $TS_URL['app'] . '/action.' . $TS_URL['app'] . '.php';
        $appAction = $TS_URL['app'] . 'Action';
        $newAction = new $appAction($db);
        $newAction->{$TS_URL}['ac']();
    } else {
        //面向目录和文件的逻辑加载写法
        include 'app.php';
    }
} else {
    ts404();
}
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:31,代码来源:thinksaas.php

示例12: isset

 $sort = isset($_POST['sort']) ? intval($_POST['sort']) : '';
 $author = isset($_POST['author']) ? intval($_POST['author']) : '';
 $gid = isset($_GET['gid']) ? intval($_GET['gid']) : '';
 LoginAuth::checkToken();
 if ($operate == '') {
     emDirect("./admin_log.php?pid={$pid}&error_b=1");
 }
 if (empty($logs) && empty($gid)) {
     emDirect("./admin_log.php?pid={$pid}&error_a=1");
 }
 switch ($operate) {
     case 'del':
         foreach ($logs as $val) {
             doAction('before_del_log', $val);
             $Log_Model->deleteLog($val);
             doAction('del_log', $val);
         }
         $CACHE->updateCache();
         if ($pid == 'draft') {
             emDirect("./admin_log.php?pid=draft&active_del=1");
         } else {
             emDirect("./admin_log.php?active_del=1");
         }
         break;
     case 'top':
         foreach ($logs as $val) {
             $Log_Model->updateLog(array('top' => 'y'), $val);
         }
         emDirect("./admin_log.php?active_up=1");
         break;
     case 'sortop':
开发者ID:MikeCoder,项目名称:mblog,代码行数:31,代码来源:admin_log.php

示例13: foreach

echo '<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title><![CDATA[' . Option::get('blogname') . ']]></title>
<description><![CDATA[' . Option::get('bloginfo') . ']]></description>
<link>' . $URL . '</link>
<language>zh-cn</language>
<generator>www.emlog.net</generator>';
if (!empty($blog)) {
    $user_cache = $CACHE->readCache('user');
    foreach ($blog as $value) {
        $link = Url::log($value['id']);
        $abstract = str_replace('[break]', '', $value['content']);
        $pubdate = gmdate('r', $value['date']);
        $author = $user_cache[$value['author']]['name'];
        doAction('rss_display');
        echo <<<END

<item>
\t<title>{$value['title']}</title>
\t<link>{$link}</link>
\t<description><![CDATA[{$abstract}]]></description>
\t<pubDate>{$pubdate}</pubDate>
\t<author>{$author}</author>
\t<guid>{$link}</guid>

</item>
END;
    }
}
echo <<<END
开发者ID:MikeCoder,项目名称:mblog,代码行数:31,代码来源:rss.php

示例14: foreach

		<th width="300"><b>评论者</b></th>
        <th width="250"><b>所属文章</b></th>
      </tr>
    </thead>
    <tbody>
	<?php 
if ($comment) {
    foreach ($comment as $key => $value) {
        $ishide = $value['hide'] == 'y' ? '<font color="red">[待审]</font>' : '';
        $mail = !empty($value['mail']) ? "({$value['mail']})" : '';
        $ip = !empty($value['ip']) ? "<br />来自:{$value['ip']}" : '';
        $poster = !empty($value['url']) ? '<a href="' . $value['url'] . '" target="_blank">' . $value['poster'] . '</a>' : $value['poster'];
        $value['content'] = str_replace('<br>', ' ', $value['content']);
        $sub_content = subString($value['content'], 0, 50);
        $value['title'] = subString($value['title'], 0, 42);
        doAction('adm_comment_display');
        ?>
     <tr>
        <td width="19"><input type="checkbox" value="<?php 
        echo $value['cid'];
        ?>
" name="com[]" class="ids" /></td>
        <td width="350"><a href="comment.php?action=reply_comment&amp;cid=<?php 
        echo $value['cid'];
        ?>
" title="<?php 
        echo $value['content'];
        ?>
"><?php 
        echo $sub_content;
        ?>
开发者ID:MikeCoder,项目名称:mblog,代码行数:31,代码来源:comment.php

示例15: template

include template('header');
?>
<div class="container">
<div class="my">
<div class="col-md-3">
<div class="my_left">
<?php 
include pubTemplate("my");
?>
</div>
</div>
<div class="col-md-9">
<div class="my_right">
<div class="rc">
<?php 
doAction('my_right_top');
?>
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="">我的圖</a></li>
</ul>
<?php 
foreach ((array) $arrAlbum as $key => $item) {
    ?>
<div class="box albumlst">
<a target="_blank" href="<?php 
    echo tsurl('photo', 'album', array('id' => $item['albumid']));
    ?>
" class="album_photo"><img src="<?php 
    if ($item['albumface'] == '') {
        echo SITE_URL;
        ?>
开发者ID:994837457,项目名称:BreakNgThinksaas,代码行数:31,代码来源:index.tpl.php


注:本文中的doAction函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。