本文整理汇总了PHP中addAction函数的典型用法代码示例。如果您正苦于以下问题:PHP addAction函数的具体用法?PHP addAction怎么用?PHP addAction使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了addAction函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login
function login($ip, $nick, $password)
{
/*$intentos = 0;
if (isset($_COOKIE['intentos'])){
$intentos = $_COOKIE['intentos'];
}
if ($intentos <= 3){*/
$hashedPassword = hash("sha256", $password, false);
if (checkNickPassword($nick, $hashedPassword)) {
$email = getEmail($nick);
$_SESSION['nick'] = $nick;
$_SESSION['email'] = $email;
$_SESSION['role'] = getRole($email);
//setcookie( 'intentos', 0, time() + 1800 ); //30 minutos
addAction($nick, $email, $ip, 'logged_in');
addConnection($nick, $email, $ip);
return '0';
// Logged.
} else {
//if ($intentos < 3) {
//setcookie( 'intentos', $intentos + 1, time() + 1800 ); //30 minutos
return '1';
// Log in failed.
}
/*}
setcookie( 'intentos', 0, time() + 1800);
return '2'; // Superado el límite de intentos.
*/
}
示例2: hook
public function hook()
{
addAction('adm_siderbar_ext', array('MoeCDN', 'options_menu'));
addAction('index_head', array('MoeCDN', 'bufferStart'));
addAction('index_footer', array('MoeCDN', 'bufferEnd'));
addAction('adm_head', array('MoeCDN', 'bufferStart'));
addAction('adm_footer', array('MoeCDN', 'bufferEnd'));
}
示例3: uploadPhoto
function uploadPhoto($ip, $image, $nick, $email, $path, $albumName)
{
$existsAlbum = isAlbum($nick, $albumName);
if (!$existsAlbum) {
if (!newAlbum($ip, $nick, $email, $albumName, "private", "DEFAULT")) {
return '1';
}
}
if (uploadImage($image, $path)) {
$newPhoto = addPhoto($nick, $path, $albumName);
if (!newPhoto and !$existsAlbum) {
deleteAlbum($nick, $albumName);
// Remove Photo
return '2';
}
addAction($nick, $email, $ip, 'new_photo');
return '0';
}
return '3';
}
示例4: addAction
if ($mok_bgimg['tishikuang'] == 1) {
$css .= '.alert{background:none !important}';
}
if ($mok_bgimg['caidan'] == 1) {
$css .= '.nav>li>a:hover, .nav>li>a:focus{background:none !important}';
}
if ($mok_bgimg['shurukuang'] == 1) {
$css .= '.form-control{background:none !important}';
}
if ($mok_bgimg['anniu'] == 1) {
$css .= '.btn{background:none !important}';
}
//字体颜色
if (!empty($mok_bgimg['c_putong'])) {
$css .= 'body{color:' . $mok_bgimg['c_putong'] . '}';
}
if (!empty($mok_bgimg['c_zuoce'])) {
$css .= '.container .nav>li>a{color:' . $mok_bgimg['c_zuoce'] . '}';
}
if (!empty($mok_bgimg['c_dingbu'])) {
$css .= '.navbar-default .navbar-nav>li>a,.navbar-default .navbar-brand{color:' . $mok_bgimg['c_dingbu'] . ' !important}';
}
if (!empty($mok_bgimg['c_shurukuang'])) {
$css .= '.form-control{color:' . $mok_bgimg['c_shurukuang'] . '}';
}
$css .= '</style>';
echo $css;
}
}
addAction('header', 'mok_bgimg_header');
示例5: defined
<?php
defined('IN_TS') or die('Access Denied.');
function signuser()
{
$arrUser = aac('user')->getHotUser(20);
echo '<div class="panel panel-default">';
echo '<div class="panel-heading">最新签到用户</div>';
echo '<div class="panel-body facelist"><ul>';
foreach ($arrUser as $key => $item) {
echo '<li><a href="' . tsUrl('user', 'space', array('id' => $item['userid'])) . '"><img class="img-circle" src="' . $item['face'] . '" alt="' . $item['username'] . '" width="48" height="48" /></a><div><a href="' . tsUrl('user', 'space', array('id' => $item['userid'])) . '">' . cututf8(t($item['username']), 0, 5, false) . '</a></div></li>';
}
echo '</ul></div><div class="clear"></div></div>';
}
addAction('home_index_left', 'signuser');
示例6: die
<?php
/*
Plugin Name: 高仿谷歌扁平样式
Version: 1.0
Plugin URL: http://zhizhe8.net
Description: Bootstrap 的高仿谷歌扁平样式
Author: 无名智者
Author Email: kenvix@vip.qq.com
Author URL: http://zhizhe8.net
For: V3.0+
*/
if (!defined('SYSTEM_ROOT')) {
die('Insufficient Permissions');
}
function wmzz_todcui_core()
{
echo '<link rel="stylesheet" href="' . SYSTEM_URL . 'plugins/wmzz_todcui/css/todc-bootstrap.min.css">';
}
addAction('header', 'wmzz_todcui_core');
示例7: die
<?php
if (!defined('SYSTEM_ROOT')) {
die('Insufficient Permissions');
}
/*
Plugin Name: 邮箱验证(UI_3)
Version: 1.2
Plugin URL: http://www.vgoing.net
Description: 此插件用于用户邮箱验证
Author: white
Author Email: admin@vgoing.net
Author URL: http://blog.vgoing.net
For: V3.0+
*/
function white_vmail_set()
{
echo '<li ';
if (isset($_GET['plugin']) && $_GET['plugin'] == 'white_vmail') {
echo 'class="active"';
}
echo '><a href="index.php?mod=admin:setplug&plug=white_vmail"><span class="glyphicon glyphicon-envelope"></span> 邮箱验证管理</a></li>';
}
addAction('navi_3', 'white_vmail_set');
示例8: Juser_add_static_css
}
}
#载入Juser前台css静态文件
function Juser_add_static_css()
{
if (isset($_GET['plugin']) && $_GET['plugin'] == 'juser') {
echo '<link href="' . BLOG_URL . 'content/plugins/juser/static/JuserView.css" type="text/css" rel="stylesheet"/>' . PHP_EOL;
}
}
#载入Juser前台js静态文件
function Juser_add_static_js()
{
if (isset($_GET['plugin']) && $_GET['plugin'] == 'juser') {
echo '<script type="text/javascript">' . PHP_EOL;
echo 'if(typeof jQuery == "undefined") {' . PHP_EOL;
echo ' document.write(unescape("%3Cscript%20type%3D%22text/javascript%22%20src%3D%22http%3A//apps.bdimg.com/libs/jquery/1.9.1/jquery.min.js%22%3E%3C/script%3E"));' . PHP_EOL . '}' . PHP_EOL;
echo '</script>' . PHP_EOL;
echo '<script src="' . BLOG_URL . 'content/plugins/juser/static/Jlib.js" type="text/javascript"></script>' . PHP_EOL;
echo '<script src="' . BLOG_URL . 'content/plugins/juser/static/JuserView.js" type="text/javascript"></script>' . PHP_EOL;
}
}
addAction('index_head', 'Juser_add_static_css');
#载入前台css
addAction('index_footer', 'Juser_add_static_js');
#载入前台js
addAction('data_prebakup', 'juser_data_backup');
#后台数据库备份动作添加juser_data表
addAction('adm_head', 'juser_adm_static');
#后台载入css、js等文件
addAction('adm_sidebar_ext', 'juser_adm_menu');
#后台载入侧边栏
示例9: while
<div id="kl_album_photo_list" style="height:auto!important;min-height:150px;height:150px;margin-bottom:20px;"><ul style="list-style: none; font-size:12px;color: #666666;float:left;margin:5px; padding:0px; text-align:center;">';
while ($photo = $DB->fetch_array($query)) {
$log_content .= '
<li style=" border:1px solid #CCC;display:inline; width:110px; height:120px; float:left; padding:5px; margin:10px 5px 5px;">
<a href="' . str_replace('thum-', '', substr($photo['filename'], 1, strlen($photo['filename']))) . '" title="相片名称:' . $photo['truename'] . ' 相片描述:' . $photo['description'] . '">
<img style="border:0px; padding:5px 5px 5px;" src="' . substr($photo['filename'], 1, strlen($photo['filename'])) . '" /></a>
</li>';
}
$log_content .= '</ul></div><div id="pagenavi">' . $pageurl . '<span>(共有' . $page_all_no . '张相片)</span></div>';
}
} else {
$log_content .= '参数错误。';
}
$allow_remark = 'n';
$logid = '';
addAction('index_head', 'kl_album_show_js');
include View::getView('header');
include View::getView('page');
}
} else {
emMsg('不存在的页面!');
}
function kl_album_show_js()
{
$active_plugins = Option::get('active_plugins');
echo '<script type="text/javascript" src="./content/plugins/kl_album/js/jquery.lazyload.mini.js"></script>
<script type="text/javascript" src="./content/plugins/kl_album/js/jquery.lightbox-0.5.js"></script>
<link rel="stylesheet" type="text/css" href="./content/plugins/kl_album/css/jquery.lightbox-0.5.css" media="screen" />
<script type="text/javascript">
jQuery(function($){
$(\'img\').lazyload({effect:\'fadeIn\',placeholder:\'./content/plugins/kl_album/images/grey.gif\',threshold:200});
示例10: defined
<?php
defined('IN_TS') or die('Access Denied.');
function signuser()
{
$arrUser = aac('user')->getHotUser(20);
echo '<div class="bs">
<div class="bbox">';
echo '<div class="btitle">文人</div>';
echo '<div class="bc facelist"><ul>';
foreach ($arrUser as $key => $item) {
echo '<li><a href="' . tsUrl('user', 'space', array('id' => $item['userid'])) . '"><img class="img-circle" src="' . $item['face'] . '" alt="' . $item['username'] . '" width="48" height="48" /></a><div><a href="' . tsUrl('user', 'space', array('id' => $item['userid'])) . '">' . cututf8(t($item['username']), 0, 5, false) . '</a></div></li>';
}
echo '</ul></div><div class="clear"></div></div></div>';
}
addAction('home_index_right', 'signuser');
示例11: die
<?php
/*
Plugin Name: Skeumorphism UI
Version: 1.0
Plugin URL: http://zhizhe8.net
Description: Bootstrap Skeumorphism UI
Author: 无名智者
Author Email: kenvix@vip.qq.com
Author URL: http://zhizhe8.net
For: V3.1+
*/
if (!defined('SYSTEM_ROOT')) {
die('Insufficient Permissions');
}
function wmzz_skui_core()
{
echo '<link rel="stylesheet" href="' . SYSTEM_URL . 'plugins/wmzz_skui/core.css">';
}
addAction('header', 'wmzz_skui_core');
示例12: mok_follow_check
}
function mok_follow_check()
{
$head = array('User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.99 Safari/537.36', 'Cookie:BDUSS=' . $_GET['bduss']);
$opt = unserialize(option::get('mok_follow'));
foreach ($opt['mustTieba'] as $tb => $lv) {
$c = new wcurl('http://tieba.baidu.com/mo/m?kw=' . urlencode($tb), $head);
$t = $c->get();
$c->close();
if (textMiddle($t, ' (等级', ')') < $lv) {
msg($opt['error'][0]);
}
}
if (count($opt['optionTieba']) > 0) {
$check = false;
foreach ($opt['optionTieba'] as $tb => $lv) {
$c = new wcurl('http://tieba.baidu.com/mo/m?kw=' . urlencode($tb), $head);
$t = $c->get();
$c->close();
if (textMiddle($t, ' (等级', ')') >= $lv) {
$check = true;
break;
}
}
if ($check == false) {
msg($opt['error'][0]);
}
}
}
addAction('baiduid_set_2', 'mok_follow_check');
示例13: exit
Author Email: mikecoder13@gmail.com
Author URL: http://mikecoder.net
*/
!defined('EMLOG_ROOT') && exit('access deined!');
function advancemarkdown()
{
$active_plugins = Option::get('active_plugins');
}
function advancemarkdown_savelog($id)
{
header("Content-Type:text/html;charset=utf-8");
global $logData, $Log_Model;
include EMLOG_ROOT . '/content/plugins/advancemarkdown/lib/parsedown.php';
$Parsedown = new Parsedown();
$logData['content'] = $Parsedown->text($logData['content']);
$Log_Model->updateLog($logData, $id);
}
addAction('save_log', 'advancemarkdown_savelog');
function advancemarkdown_headcss()
{
echo '<link rel="stylesheet" type="text/css" href ="' . BLOG_URL . 'content/plugins/advancemarkdown/lib/css/default.css" />';
}
addAction('log_related', 'advancemarkdown_headcss');
function advancemarkdown_relatedlog()
{
echo '<script type="text/javascript" src="' . BLOG_URL . 'content/plugins/advancemarkdown/lib/js/highlight.js"></script>';
echo '<script type="text/javascript" src="' . BLOG_URL . 'content/plugins/advancemarkdown/lib/js/highlight.pack.js"></script>';
echo '<script>hljs.initHighlightingOnLoad();</script>';
}
addAction('log_related', 'advancemarkdown_relatedlog');
示例14: alert
<?php
// define globals
global $APP;
//, $SETTINGS, $CURRENT_USER, $TABLE_PREFIX;
$APP['selectedMenu'] = 'admin';
// show admin menu as selected
// check access level - admin only!
if (!$GLOBALS['CURRENT_USER']['isAdmin']) {
alert(t("You don't have permissions to access this menu."));
showInterface('');
}
// mailer plugin hooks
addAction('section_preDispatch', '_cronlog_showModeNotice', null, 2);
// Prefix Menu with "Admin"
//$GLOBALS['schema']['menuName'] = "Admin > ". $GLOBALS['schema']['menuName'];
// Let regular actionHandler run
$REDIRECT_FOR_CUSTOM_MENUS_DONT_EXIT = true;
return;
//
function _cronlog_showModeNotice($tableName, $action)
{
if ($action != 'list') {
return;
}
$notice = sprintf(t("Background Tasks: This menu lists all log entries, view <a href='%s'>current status and scheduled task list</a>."), "?menu=admin&action=general#background-tasks");
notice($notice);
}
示例15: die
Plugin Name: 多说留言板
Version: 1.0
Plugin URL: http://www.weirdo.ga/
Description: 多说留言板
Author: weirdo4253
Author Email: weirdo4253@foxmail.com
Author URL: http://www.weirdo.ga/
For: V3.8+
*/
if (!defined('SYSTEM_ROOT')) {
die('Insufficient Permissions');
}
function weirdoga_dscomment()
{
?>
<li <?php
if (isset($_GET['plugin']) && $_GET['plugin'] == 'weirdoga_dscomment') {
echo 'class="active"';
}
?>
><a href="index.php?pub_plugin=weirdoga_dscomment"><span class="glyphicon glyphicon-comment"></span> <?php
echo option::get('weirdoga_dscomment_title');
?>
</a></li>
<?php
}
addAction('navi_1', 'weirdoga_dscomment');
addAction('navi_7', 'weirdoga_dscomment');
addAction('navi_10', 'weirdoga_dscomment');
addAction('navi_11', 'weirdoga_dscomment');