示例#1
0
function action_link($type, $key)
{
    global $db;
    if ($type = 'Action') {
        $name = get_action_name($key);
        $link = '<a href="action.php?action_KEY=' . $key . '">' . $name . '</a>';
        return $link;
    }
}
 public function limitList()
 {
     $action_name = I('get.action', '', 'op_t');
     !empty($action_name) && ($map['action_list'] = array(array('like', '%[' . $action_name . ']%'), '', 'or'));
     //读取规则列表
     $map['status'] = array('EGT', 0);
     $model = M('action_limit');
     $List = $model->where($map)->order('id asc')->select();
     $timeUnit = $this->getTimeUnit();
     foreach ($List as &$val) {
         $val['time'] = $val['time_number'] . $timeUnit[$val['time_unit']];
         $val['action_list'] = get_action_name($val['action_list']);
         empty($val['action_list']) && ($val['action_list'] = L('_ALL_ACTS_'));
         $val['punish'] = get_punish_name($val['punish']);
     }
     unset($val);
     //显示页面
     $builder = new AdminListBuilder();
     $builder->title(L('_ACTION_LIST_'))->buttonNew(U('editLimit'))->setStatusUrl(U('setLimitStatus'))->buttonEnable()->buttonDisable()->buttonDelete()->keyId()->keyTitle()->keyText('name', L('_NAME_'))->keyText('frequency', L('_FREQUENCY_'))->keyText('time', L('_TIME_UNIT_'))->keyText('punish', L('_PUNISHMENT_'))->keyBool('if_message', L('_SEND_REMINDER_'))->keyText('message_content', L('_MESSAGE_PROMPT_CONTENT_'))->keyText('action_list', L('_ACT_'))->keyStatus()->keyDoActionEdit('editLimit?id=###')->data($List)->display();
 }
 public function limitList()
 {
     $action_name = I('get.action', '', 'op_t');
     !empty($action_name) && ($map['action_list'] = array(array('like', '%[' . $action_name . ']%'), '', 'or'));
     //读取规则列表
     $map['status'] = array('EGT', 0);
     $model = M('action_limit');
     $List = $model->where($map)->order('id asc')->select();
     $timeUnit = $this->getTimeUnit();
     foreach ($List as &$val) {
         $val['time'] = $val['time_number'] . $timeUnit[$val['time_unit']];
         $val['action_list'] = get_action_name($val['action_list']);
         empty($val['action_list']) && ($val['action_list'] = '所有行为');
         $val['punish'] = get_punish_name($val['punish']);
     }
     unset($val);
     //显示页面
     $builder = new AdminListBuilder();
     $builder->title('行为限制列表')->buttonNew(U('editLimit'))->setStatusUrl(U('setLimitStatus'))->buttonEnable()->buttonDisable()->buttonDelete()->keyId()->keyTitle()->keyText('name', '名称')->keyText('frequency', '频率')->keyText('time', '时间单位')->keyText('punish', '处罚')->keyBool('if_message', '是否发送提醒')->keyText('message_content', '消息提示内容')->keyText('action_list', '行为')->keyStatus()->keyDoActionEdit('editLimit?id=###')->data($List)->display();
 }
		<th>Facebook</th>
		<th>Twitter</th>
		<th>Email</th>
		<th>Old Count</th>



		<th>Department</th>
		<th>Campaign</th>
		<th>Action</th>
	
		
		</tr> </thead><tbody>';
    foreach ($tell_a_friends as $i) {
        echo '<tr>
		<td>' . $i['tell_a_friend_KEY'] . '</td>
		<td>' . $i['Reference_Name'] . '</td>
		<td>' . $i['facebook'] . '</td>
		<td>' . $i['twitter'] . '</td>
		<td>' . $i['email'] . '</td>

		<td>' . $i['Number_of_Friends_Told'] . '</td>
		<td>' . $i['campaign'] . '</td>
		<td><a href="/campaign_item.php?campaign_KEY=' . $i['campaign_KEY'] . '">' . get_campaign_name($i['campaign_KEY']) . '</a></td>
		<td><a href="/report/report_action.php.php?action_KEY=' . $i['action_KEY'] . '">' . get_action_name($i['action_KEY']) . '</a></td>
	
	
		</tr>';
    }
    echo '</tbody></table>';
}
示例#5
0
<?php

// Nathan Reed
define('__ROOT__', dirname(dirname(__FILE__)));
require_once __ROOT__ . '/models/db.php';
if (isset($_GET['url'])) {
    $url = $_GET['url'];
    $action = get_action_name($url);
    ESQL::Insert('action_usage', array('action_name' => $action));
}
include 'ba-simple-proxy.php';
function get_action_name($url)
{
    if (strpos($url, '/api/login') != null) {
        return 'login';
    } else {
        if (strpos($url, '/api/vote') != null) {
            return 'vote';
        } else {
            if (strpos($url, '/api/comment') != null) {
                return 'comment';
            }
        }
    }
}