本文整理汇总了PHP中get_js_url函数的典型用法代码示例。如果您正苦于以下问题:PHP get_js_url函数的具体用法?PHP get_js_url怎么用?PHP get_js_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_js_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send_action
public function send_action()
{
if (trim($_POST['message']) == '') {
H::ajax_json_output(AWS_APP::RSM(null, '-1', AWS_APP::lang()->_t('请输入私信内容')));
}
if (!($recipient_user = $this->model('account')->get_user_info_by_username($_POST['recipient']))) {
H::ajax_json_output(AWS_APP::RSM(null, '-1', AWS_APP::lang()->_t('接收私信的用户不存在')));
}
if ($recipient_user['uid'] == $this->user_id) {
H::ajax_json_output(AWS_APP::RSM(null, '-1', AWS_APP::lang()->_t('不能给自己发私信')));
}
if ($recipient_user['inbox_recv']) {
if (!$this->model('message')->check_permission($recipient_user['uid'], $this->user_id)) {
H::ajax_json_output(AWS_APP::RSM(null, '-1', AWS_APP::lang()->_t('对方设置了只有 Ta 关注的人才能给 Ta 发送私信')));
}
}
// !注: 来路检测后面不能再放报错提示
if (!valid_post_hash($_POST['post_hash'])) {
H::ajax_json_output(AWS_APP::RSM(null, '-1', AWS_APP::lang()->_t('页面停留时间过长,或内容已提交,请刷新页面')));
}
$this->model('message')->send_message($this->user_id, $recipient_user['uid'], $_POST['message']);
if ($_POST['return_url']) {
$rsm = array('url' => get_js_url(strip_tags($_POST['return_url'])));
} else {
$rsm = array('url' => get_js_url('/inbox/'));
}
H::ajax_json_output(AWS_APP::RSM($rsm, 1, null));
}
示例2: binding_callback_action
function binding_callback_action()
{
$oauth = new Services_Weibo_WeiboOAuth(get_setting('sina_akey'), get_setting('sina_skey'));
if ($_GET['uid'] and $this->user_info['permission']['is_administortar']) {
$user_id = intval($_GET['uid']);
$user_info = $this->model('account')->get_user_info_by_uid($user_id);
if (empty($user_info)) {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('本地用户不存在,无法绑定')));
}
$sina_token = $oauth->getAccessToken('code', array('code' => $_GET['code'], 'redirect_uri' => get_js_url('/account/sina/binding_callback/uid-' . $user_id)));
} else {
$user_id = $this->user_id;
AWS_APP::session()->sina_token = $oauth->getAccessToken('code', array('code' => $_GET['code'], 'redirect_uri' => get_js_url('/account/sina/binding_callback/')));
$sina_token = AWS_APP::session()->sina_token;
$redirect = get_js_url('/account/setting/openid/');
}
$client = new Services_Weibo_WeiboClient(get_setting('sina_akey'), get_setting('sina_skey'), $sina_token['access_token']);
$uid_get = $client->get_uid();
$sina_profile = $client->show_user_by_id($uid_get['uid']);
if ($sina_profile['error']) {
H::redirect_msg(AWS_APP::lang()->_t('与微博通信出错, 错误代码: %s', $sina_profile['error']), "/account/setting/openid/");
}
if (!$this->model('integral')->fetch_log($user_id, 'BIND_OPENID')) {
$this->model('integral')->process($user_id, 'BIND_OPENID', round(get_setting('integral_system_config_profile') * 0.2), '绑定 OPEN ID');
}
//$this->model('openid_weibo')->bind_account($sina_profile, get_js_url('/account/setting/openid/'), $user_id, $last_key['oauth_token'], $last_key['oauth_token_secret'], $sina_token);
$this->model('openid_weibo')->bind_account($sina_profile, $redirect, $user_id, $sina_token);
}
示例3: list_action
public function list_action()
{
if ($this->is_post()) {
foreach ($_POST as $key => $val) {
if ($key == 'start_date' or $key == 'end_date') {
$val = base64_encode($val);
}
if ($key == 'keyword' or $key == 'user_name') {
$val = rawurlencode($val);
}
$param[] = $key . '-' . $val;
}
H::ajax_json_output(AWS_APP::RSM(array('url' => get_js_url('/admin/article/list/' . implode('__', $param))), 1, null));
}
$where = array();
if ($_GET['keyword']) {
$where[] = "(`title` LIKE '%" . $this->model('article')->quote($_GET['keyword']) . "%')";
}
if ($_GET['start_date']) {
$where[] = 'add_time >= ' . strtotime(base64_decode($_GET['start_date']));
}
if ($_GET['end_date']) {
$where[] = 'add_time <= ' . strtotime('+1 day', strtotime(base64_decode($_GET['end_date'])));
}
if ($_GET['user_name']) {
$user_info = $this->model('account')->get_user_info_by_username($_GET['user_name']);
$where[] = 'uid = ' . intval($user_info['uid']);
}
if ($_GET['comment_count_min']) {
$where[] = 'comments >= ' . intval($_GET['comment_count_min']);
}
if ($_GET['answer_count_max']) {
$where[] = 'comments <= ' . intval($_GET['comment_count_max']);
}
if ($articles_list = $this->model('article')->fetch_page('article', implode(' AND ', $where), 'id DESC', $_GET['page'], $this->per_page)) {
$search_articles_total = $this->model('article')->found_rows();
}
if ($articles_list) {
foreach ($articles_list as $key => $val) {
$articles_list_uids[$val['uid']] = $val['uid'];
}
if ($articles_list_uids) {
$articles_list_user_infos = $this->model('account')->get_user_info_by_uids($articles_list_uids);
}
foreach ($articles_list as $key => $val) {
$articles_list[$key]['user_info'] = $articles_list_user_infos[$val['uid']];
}
}
$url_param = array();
foreach ($_GET as $key => $val) {
if (!in_array($key, array('app', 'c', 'act', 'page'))) {
$url_param[] = $key . '-' . $val;
}
}
TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/admin/article/list/') . implode('__', $url_param), 'total_rows' => $search_articles_total, 'per_page' => $this->per_page))->create_links());
$this->crumb(AWS_APP::lang()->_t('文章管理'), 'admin/article/list/');
TPL::assign('articles_count', $search_articles_total);
TPL::assign('list', $articles_list);
TPL::output('admin/article/list');
}
示例4: index_action
public function index_action()
{
if ($_GET['tag']) {
$this->crumb(AWS_APP::lang()->_t('标签') . ': ' . $_GET['tag'], '/favorite/tag-' . $_GET['tag']);
}
//边栏可能感兴趣的人或话题
if (TPL::is_output('block/sidebar_recommend_users_topics.tpl.htm', 'favorite/index')) {
$recommend_users_topics = $this->model('module')->recommend_users_topics($this->user_id);
TPL::assign('sidebar_recommend_users_topics', $recommend_users_topics);
}
if ($action_list = $this->model('favorite')->get_item_list($_GET['tag'], $this->user_id, calc_page_limit($_GET['page'], get_setting('contents_per_page')))) {
foreach ($action_list as $key => $val) {
$item_ids[] = $val['item_id'];
}
TPL::assign('list', $action_list);
} else {
if (!$_GET['page'] or $_GET['page'] == 1) {
$this->model('favorite')->remove_favorite_tag(null, null, $_GET['tag'], $this->user_id);
}
}
if ($item_ids) {
$favorite_items_tags = $this->model('favorite')->get_favorite_items_tags_by_item_id($this->user_id, $item_ids);
TPL::assign('favorite_items_tags', $favorite_items_tags);
}
TPL::assign('favorite_tags', $this->model('favorite')->get_favorite_tags($this->user_id));
TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/favorite/tag-' . $_GET['tag']), 'total_rows' => $this->model('favorite')->count_favorite_items($this->user_id, $_GET['tag']), 'per_page' => get_setting('contents_per_page')))->create_links());
TPL::output('favorite/index');
}
示例5: list_action
public function list_action()
{
$this->crumb(AWS_APP::lang()->_t('专题管理'), 'admin/feature/list/');
$feature_list = $this->model('feature')->get_feature_list('id DESC', $_GET['page'], $this->per_page);
TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/admin/feature/list/'), 'total_rows' => $this->model('feature')->found_rows(), 'per_page' => 20))->create_links());
TPL::assign('list', $feature_list);
TPL::output('admin/feature/list');
}
示例6: createSign
public function createSign($out_trade_no, $subject, $total_fee, $extra_common_param = null)
{
$parameter = array("service" => "create_direct_pay_by_user", "payment_type" => "1", "partner" => trim(get_setting('alipay_partner')), "_input_charset" => 'utf-8', "seller_email" => trim(get_setting('alipay_seller_email')), "return_url" => get_js_url('/payment/callback/alipay/'), 'notify_url' => get_js_url('/payment/notify/alipay/'), "out_trade_no" => $out_trade_no, "subject" => $subject, "body" => '', "total_fee" => $total_fee, "paymethod" => '', "defaultbank" => '', "anti_phishing_key" => '', "exter_invoke_ip" => '', "show_url" => get_setting('base_url'), "extra_common_param" => $extra_common_param, "royalty_type" => '', "royalty_parameters" => '');
//除去待签名参数数组中的空值和签名参数
$parameter = $this->paraFilter($parameter);
//对待签名参数数组排序
$para_sort = $this->argSort($parameter);
return $this->buildMysign($para_sort, get_setting('alipay_key'));
}
示例7: format_js_users_output
public function format_js_users_output($data)
{
if ($data) {
foreach ($data as $key => $val) {
$output .= '<div class="item"><dl class="inf"><dt><a href="' . get_js_url('/people/' . $val['url_token']) . '">' . $val['user_name'] . '</a></dt><dd>回复了 ' . $val['answer_count'] . ' 个问题</dd><dd>获得 ' . $val['agree_count'] . ' 个赞同</dd></dl><div class="avatar"><a href=""><img src="' . get_avatar_url($val['uid'], 'mid') . '" /></a></div></div><!-- .item -->';
}
}
return "document.write('" . addcslashes($output, "'") . "');";
}
示例8: new_find_password
public function new_find_password($uid, $server = 'master')
{
if (!$uid) {
return false;
}
$active_code_hash = $this->active_code_generate();
$active_id = $this->model('active')->new_active_code($uid, time() + 60 * 60 * 24, $active_code_hash, 'FIND_PASSWORD');
return $this->model('email')->action_email('FIND_PASSWORD', $uid, get_js_url('/account/find_password/modify/key-' . $active_code_hash), $server);
}
示例9: list_action
public function list_action()
{
if ($recommend_homepage_list = $this->model('recommend')->fetch_page('recommend_homepage', 'id > 0', ' add_time DESC', $_GET['page'], $this->per_page)) {
$total_rows = $this->model('recommend')->found_rows();
foreach ($recommend_homepage_list as $key => $val) {
switch ($val['item_type']) {
case 'question':
$val['item_tag'] = '问题(精选)';
$val['item_link'] = 'question/' . $val['item_id'];
$question_info = $this->model('question')->get_question_info_by_id($val['item_id']);
if ($question_info) {
$val['item_title'] = $question_info['question_content'];
} else {
$val['item_title'] = '问题 #' . $val['item_id'];
}
break;
case 'article':
$val['item_tag'] = '文章(精选)';
$val['item_link'] = 'article/' . $val['item_id'];
$article_info = $this->model('article')->get_article_info_by_id($val['item_id']);
if ($article_info) {
$val['item_title'] = $article_info['title'];
} else {
$val['item_title'] = '文章 #' . $val['item_id'];
}
break;
case 'topic':
$val['item_tag'] = '专题(精选)';
$val['item_link'] = 'topic/' . $val['item_id'];
$topic_info = $this->model('topic')->get_topic_by_id($val['item_id']);
if ($topic_info) {
$val['item_title'] = $topic_info['topic_title'];
} else {
$val['item_title'] = '专题 #' . $val['item_id'];
}
break;
case 'top_question':
$val['item_tag'] = '问题(置顶)';
$val['item_link'] = 'question/' . $val['item_id'];
$question_info = $this->model('question')->get_question_info_by_id($val['item_id']);
if ($question_info) {
$val['item_title'] = $question_info['question_content'];
} else {
$val['item_title'] = '问题 #' . $val['item_id'];
}
break;
}
$recommend_homepage_list[$key] = $val;
}
}
TPL::assign('recommend_homepage_list', $recommend_homepage_list);
TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/admin/recommend/list/') . implode('__', $url_param), 'total_rows' => $total_rows, 'per_page' => $this->per_page))->create_links());
$this->crumb(AWS_APP::lang()->_t('首页精选管理'), 'admin/recommend/list/');
TPL::output('admin/recommend/list');
}
示例10: parse_redirect_url
public static function parse_redirect_url($url)
{
if (substr($url, 0, 1) == '?') {
$url = base_url() . $url;
} else {
if (substr($url, 0, 1) == '/') {
$url = get_js_url($url);
}
}
return $url;
}
示例11: index_action
public function index_action()
{
if ($order_list = $this->model('project')->get_sponsored_order_list($_GET['id'], $this->user_id, $_GET['page'], get_setting('contents_per_page'))) {
TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/project/sponsored/' . $_GET['id']), 'total_rows' => $this->model('project')->found_rows(), 'per_page' => get_setting('contents_per_page')))->create_links());
foreach ($order_list as $key => $val) {
$order_list[$key]['order_status'] = $this->model('project')->get_order_status($val);
}
}
TPL::assign('order_list', $order_list);
TPL::output('project/sponsored/index');
}
示例12: send_batch_invitations
public function send_batch_invitations($email_list, $uid, $user_name)
{
foreach ($email_list as $key => $email) {
if ($this->model('account')->check_email($email)) {
continue;
}
$invitation_code = $this->get_unique_invitation_code();
$this->model('invitation')->add_invitation($uid, $invitation_code, $email, time(), ip2long($_SERVER['REMOTE_ADDR']));
$this->model('email')->action_email('INVITE_REG', $email, get_js_url('/account/register/email-' . urlencode($email) . '__icode-' . $invitation_code), array('user_name' => $user_name));
}
return true;
}
示例13: list_action
public function list_action()
{
$this->crumb(AWS_APP::lang()->_t('内容审核'), 'admin/approval/list/');
TPL::assign('menu_list', $this->model('admin')->fetch_menu_list(300));
if (!$_GET['type']) {
$_GET['type'] = 'question';
}
switch ($_GET['type']) {
case 'weibo_msg':
case 'received_email':
$approval_list = $this->model('admin')->fetch_page($_GET['type'], 'question_id IS NULL', 'id ASC', $_GET['page'], $this->per_page);
$found_rows = $this->model('admin')->found_rows();
break;
case 'unverified_modify':
$approval_list = $this->model('question')->fetch_page('question', 'unverified_modify_count <> 0', 'question_id ASC', $_GET['page'], $this->per_page);
$found_rows = $this->model('question')->found_rows();
break;
default:
$approval_list = $this->model('publish')->get_approval_list($_GET['type'], $_GET['page'], $this->per_page);
$found_rows = $this->model('publish')->found_rows();
break;
}
TPL::assign('answer_count', $this->model('publish')->count('approval', "type = 'answer'"));
TPL::assign('question_count', $this->model('publish')->count('approval', "type = 'question'"));
TPL::assign('article_count', $this->model('publish')->count('approval', "type = 'article'"));
TPL::assign('article_comment_count', $this->model('publish')->count('approval', "type = 'article_comment'"));
TPL::assign('weibo_msg_count', $this->model('openid_weibo_weibo')->count('weibo_msg', 'question_id IS NULL'));
TPL::assign('received_email_count', $this->model('edm')->count('received_email', 'question_id IS NULL'));
TPL::assign('unverified_modifies_count', $this->model('question')->count('question', 'unverified_modify_count <> 0'));
if ($approval_list) {
TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/admin/approval/list/type-' . $_GET['type']), 'total_rows' => $found_rows, 'per_page' => $this->per_page))->create_links());
if ($_GET['type'] == 'unverified_modify') {
foreach ($approval_list as $key => $approval_info) {
$approval_list[$key]['uid'] = $approval_info['published_uid'];
if (!$approval_uids[$approval_list[$key]['uid']]) {
$approval_uids[$approval_list[$key]['uid']] = $approval_list[$key]['uid'];
}
$approval_list[$key]['unverified_modify'] = @unserialize($approval_info['unverified_modify']);
}
} else {
foreach ($approval_list as $approval_info) {
if (!$approval_uids[$approval_info['uid']]) {
$approval_uids[$approval_info['uid']] = $approval_info['uid'];
}
}
}
TPL::assign('users_info', $this->model('account')->get_user_info_by_uids($approval_uids));
}
TPL::assign($_GET['type'] . '_count', $found_rows);
TPL::assign('approval_list', $approval_list);
TPL::output('admin/approval/list');
}
示例14: index_action
public function index_action()
{
$this->model('account')->update_inbox_unread($this->user_id);
if ($inbox_dialog = $this->model('message')->get_inbox_message($_GET['page'], get_setting('contents_per_page'), $this->user_id)) {
$inbox_total_rows = $this->model('message')->found_rows();
foreach ($inbox_dialog as $key => $val) {
$dialog_ids[] = $val['id'];
if ($this->user_id == $val['recipient_uid']) {
$inbox_dialog_uids[] = $val['sender_uid'];
} else {
$inbox_dialog_uids[] = $val['recipient_uid'];
}
}
}
if ($inbox_dialog_uids) {
if ($users_info_query = $this->model('account')->get_user_info_by_uids($inbox_dialog_uids)) {
foreach ($users_info_query as $user) {
$users_info[$user['uid']] = $user;
}
}
}
if ($dialog_ids) {
$last_message = $this->model('message')->get_last_messages($dialog_ids);
}
if ($inbox_dialog) {
foreach ($inbox_dialog as $key => $value) {
if ($value['recipient_uid'] == $this->user_id and $value['recipient_count']) {
$data[$key]['user_name'] = $users_info[$value['sender_uid']]['user_name'];
$data[$key]['url_token'] = $users_info[$value['sender_uid']]['url_token'];
$data[$key]['unread'] = $value['recipient_unread'];
$data[$key]['count'] = $value['recipient_count'];
$data[$key]['uid'] = $value['sender_uid'];
$data[$key]['profile_update_time'] = $users_info[$value['sender_uid']]['profile_update_time'];
} else {
if ($value['sender_uid'] == $this->user_id and $value['sender_count']) {
$data[$key]['user_name'] = $users_info[$value['recipient_uid']]['user_name'];
$data[$key]['url_token'] = $users_info[$value['recipient_uid']]['url_token'];
$data[$key]['unread'] = $value['sender_unread'];
$data[$key]['count'] = $value['sender_count'];
$data[$key]['uid'] = $value['recipient_uid'];
$data[$key]['profile_update_time'] = $users_info[$value['recipient_uid']]['profile_update_time'];
}
}
$data[$key]['last_message'] = $last_message[$value['id']];
$data[$key]['update_time'] = $value['update_time'];
$data[$key]['id'] = $value['id'];
}
}
TPL::assign('list', $data);
TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/inbox/'), 'total_rows' => $inbox_total_rows, 'per_page' => get_setting('contents_per_page')))->create_links());
TPL::output('inbox/index');
}
示例15: index_actions_action
public function index_actions_action()
{
//if ($_GET['filter'] == 'publish')
if ($_GET['filter'] == 'focus') {
if ($result = $this->model('question')->get_user_focus($this->user_id, intval($_GET['page']) * $this->per_page . ", {$this->per_page}")) {
foreach ($result as $key => $val) {
$question_ids[] = $val['question_id'];
}
$topics_questions = $this->model('topic')->get_topics_by_item_ids($question_ids, 'question');
foreach ($result as $key => $val) {
if (!$user_info_list[$val['published_uid']]) {
$user_info_list[$val['published_uid']] = $this->model('account')->get_user_info_by_uid($val['published_uid'], true);
}
$data[$key]['user_info'] = $user_info_list[$val['published_uid']];
$data[$key]['associate_type'] = 1;
$data[$key]['topics'] = $topics_questions[$val['question_id']];
$data[$key]['link'] = get_js_url('/question/' . $val['question_id']);
$data[$key]['title'] = $val['question_content'];
$data[$key]['question_info'] = $val;
}
}
} else {
if ($_GET['filter'] == 'public') {
$data = $this->model('actions')->get_user_actions(null, intval($_GET['page']) * $this->per_page . ", {$this->per_page}", null, $this->user_id);
} else {
if ($_GET['filter'] == 'activity' and check_extension_package('project')) {
$project_like = $this->model('project')->fetch_all('project_like', 'uid = ' . $this->user_id);
foreach ($project_like as $project_info) {
$project_ids[] = $project_info['project_id'];
}
$this->model('project')->fetch_all('product_order', 'uid = ' . $this->user_id);
foreach ($product_order as $project_info) {
$project_ids[] = $project_info['project_id'];
}
$project_ids = array_unique($project_ids);
$data = $this->model('project')->get_project_info_by_ids($project_ids, intval($_GET['page']) * $this->per_page . ", {$this->per_page}");
} else {
$data = $this->model('actions')->home_activity($this->user_id, intval($_GET['page']) * $this->per_page . ", {$this->per_page}");
}
}
}
if (!is_array($data)) {
$data = array();
}
TPL::assign('list', $data);
if (is_mobile()) {
TPL::output('m/ajax/index_actions');
} else {
TPL::output('home/ajax/index_actions');
}
}