本文整理汇总了PHP中vlang函数的典型用法代码示例。如果您正苦于以下问题:PHP vlang函数的具体用法?PHP vlang怎么用?PHP vlang使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了vlang函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
function index()
{
$data['theme'] = $this->options->get('theme');
$data['title'] = $this->lang->line('support_title');
$data['body'] = '';
$data['user'] = $this->users->get_by_id($this->users->id());
$data['user_balance'] = $data['balance'] = $this->user_funds->user_balance($this->users->id());
//process new contact form submission
$this->form_validation->set_rules('name', 'Name', 'required|xss_clean|max_length[128]');
$this->form_validation->set_rules('email', 'Email', 'required|xss_clean|valid_email|max_length[256]');
$this->form_validation->set_rules('phone', 'Phone #', 'required|xss_clean|max_length[50]');
$this->form_validation->set_rules('subject', 'Subject','required|xss_clean|max_length[256]');
$this->form_validation->set_rules('message', 'Message', 'required|xss_clean|max_length[2000]');
if ($this->form_validation->run() == FALSE){
}else{
//email message
$email_data['name'] = $this->input->post('name');
$email_data['email'] = $this->input->post('email');
$email_data['phone'] = $this->input->post('phone');
$email_data['message'] = $this->input->post('message');
$subject = 'Support: '.$this->input->post('subject');
$db_data=$email_data;
$db_data['message']=htmlspecialchars($this->input->post('message'));
$db_data['subject']=htmlspecialchars($this->input->post('subject'));
$ticket_id=$this->support_tickets->add_new($db_data);
$this->users->send_admin_email($email_data['email'],$subject,'support_ticket',$email_data);
$this->session->set_flashdata('success', vlang('support_thanks'));
redirect('support');
}
$this->load->view($data['theme'].'/support', $data);
}
示例2: index
function index()
{
$data['theme'] = $this->options->get('theme');
$data['title'] = $this->lang->line('contactus_title');
$data['body'] = '';
$data['user'] = $this->users->get_by_id($this->users->id());
//begin recaptcha
/* $this->load->library('recaptcha');
$data['recaptcha']=$this->recaptcha->get_html();
$this->form_validation->set_rules('recaptcha_response_field', 'lang:recaptcha_field_name', 'required|callback_check_captcha');*/
//end recaptcha
//process new contact form submission
$this->form_validation->set_rules('name', 'Name', 'strip_tags|trim|required|xss_clean|max_length[128]');
$this->form_validation->set_rules('email', 'Email', 'strip_tags|trim|required|xss_clean|valid_email|max_length[256]');
$this->form_validation->set_rules('phone', 'Phone #', 'strip_tags|trim|required|xss_clean|max_length[50]');
$this->form_validation->set_rules('subject', 'Subject','strip_tags|trim|required|xss_clean|max_length[256]');
$this->form_validation->set_rules('message', 'Message', 'strip_tags|trim|required|xss_clean|max_length[2000]');
//$this->form_validation->set_rules('recaptcha_response_field', 'Recaptcha', 'required|callback_check_captcha');
if ($this->form_validation->run() == FALSE)
{
}
else
{
//email message
$email_data['name'] = $this->input->post('name');
$email_data['email'] = $this->input->post('email');
$email_data['phone'] = $this->input->post('phone');
$email_data['message'] = $this->input->post('message');
$subject = 'Contact Form Submission: '.$this->input->post('subject');
/*$msg = $this->load->view($this->options->get('theme').'/emails/contact_form', $email_data, true);
$this->email->subject($subject);
$this->email->from($email_data['email'], $email_data['name']);
$this->email->to($this->options->get('main_email'));
$this->email->message($msg);
if($this->email->send()) {
$this->session->set_flashdata('success', vlang('contactus_thanks'));
$this->email->clear();
redirect('contact_us');
}*/
$this->users->send_admin_email($email_data['email'],$subject,'contact_form',$email_data);
$this->session->set_flashdata('success', vlang('contactus_thanks'));
redirect('contact_us');
}
$this->load->view($data['theme'].'/contact_us', $data);
}
示例3: forgot_password
function forgot_password()
{
$data['theme'] = $this->options->get('theme');
$data['title'] = vlang('forgotpw_title');
$data['body'] = '';
$data['user'] = $this->users->get_by_id($this->users->id());
if ($this->form_validation->run() == FALSE) {
} else {
$this->users->reset_password($this->input->post('email'));
$this->session->set_flashdata('success', 'Your new password has been sent to your email.');
redirect('login');
}
$this->load->view($data['theme'] . '/users/forgot_password', $data);
}
示例4: time_nice
function time_nice($time = '')
{
$time_now = time();
$difference = $time_now - $time;
if ($difference < 3600) {
//return minutes
return vlang('dashboard_minutes_ago', floor($difference / 60));
} elseif ($difference < 86400) {
//return hours
//return floor($difference / 3600).' hours ago';
return vlang('dashboard_hours_ago', floor($difference / 3600));
} else {
//return days
//return floor($difference / 86400).' days ago';
return vlang('dashboard_days_ago', floor($difference / 86400));
}
}
示例5: index
function index()
{
//echo "<pre>".print_r($this->session->all_userdata(),true)."</pre>";exit;
redirect('lobby');exit;
$this->load->model('activities');
//$data['extra_js'] = '<script type="text/javascript" src="'.site_url('js/jcrop/js/jquery.Jcrop.js').'"></script>';
//$data['extra_js'] = '<script type="text/javascript" src="'.site_url('js/user/notifications.js').'"></script>';
$data['theme'] = $this->options->get('theme');
//$data['title'] = 'Hello, '.$this->session->userdata('first_name').' '.$this->session->userdata('last_name').'!';
$data['title'] = vlang('dashboard_greeting', $this->session->userdata('first_name').' '.$this->session->userdata('last_name'));
$data['body'] = '';
$data['user'] = $this->users->get_by_id($this->users->id());
$data['new_members'] = $this->users->get_new_members(5);
$data['featured_members'] = $this->users->get_featured_members(5);
/*echo '<pre>';
print_r($data['new_members']);*/
$this->load->view($data['theme'].'/users/dashboard', $data);
}
示例6: send
function send($receivers = array(), $subject = '', $message = '', $from = '0', $redirect = TRUE)
{
$current_sender = $this->users->get_by_id($from);
$this->load->model('notifications');
foreach($receivers as $receiver)
{
$curr_reciever = $this->users->get_by_username(trim($receiver));
//insert inbox message
$insert = array(
'from' => $from,
'to' => $curr_reciever->cid,
'subject' => $subject,
'message' => $message,
'box' => '0',
'owner_id' => $curr_reciever->cid,
'status' => '0',
'timestamp' => time()
);
$this->db->insert('messages', $insert);
$msg_id = $this->db->insert_id();
$this->notifications->add($curr_reciever->cid, vlang('messages_notification',$current_sender->first_name.' '.$current_sender->last_name), 'message/read/'.$msg_id);
//insert outbox message
$insert = array(
'from' => $from,
'to' => $curr_reciever->cid,
'subject' => $subject,
'message' => $message,
'box' => '1',
'owner_id' => $from,
'status' => '0',
'timestamp' => time()
);
$this->db->insert('messages', $insert);
if ($redirect)
{
$this->session->set_flashdata('success', 'Message was sent.');
redirect('message/sent');
}
}
}
示例7: affiliate
function affiliate()
{
$data['theme'] = $this->options->get('theme');
$data['title'] = vlang('inviteafriend_title');
$data['body'] = '';
$data['user'] = $this->users->get_by_id($this->users->id());
$use_real_name = $this->input->post('use_real_name');
$friend_emails = $this->input->post('invite_email');
$message = $this->input->post('invite_message');
if(is_array($friend_emails)) {
foreach($friend_emails as $friend_email)
{
//make sure email is good
if(valid_email($friend_email)) {
//email confirmation code
if($use_real_name == 'yes') {
$email_data['name'] = $data['user']->first_name.' '.$data['user']->last_name;
} else {
$email_data['name'] = $data['user']->username;
}
$email_data['email'] = $data['user']->email;
$email_data['user'] = $data['user']->username;
if(!empty($message)) { $email_data['message'] = $message.'<hr />'; } else { $email_data['message'] = ''; }
$subject=vlang('email_subject_invite_a_friend');
$this->users->send_basic_email(trim($friend_email),$subject,'invite_a_friend',$email_data);
}
}
$this->session->set_flashdata('success', vlang('inviteafriend_thanks'));
redirect('my_account');
}
$this->load->view($data['theme'].'/invite_a_friend', $data);
}
示例8: vlang
{
foreach($activities as $item)
{
$item_user = $this->users->get_by_id($item->owner_id);
echo '<li>';
if(!empty($item_user->avatar)){
echo '<a href="'.$item_user->username.'" class="small_avatar_link"><img src="'.site_url('uploads/avatar_small/'.$item_user->avatar).'" class="activity_thumbnail" /></a>';
}else{
echo '<a href="'.$item_user->username.'" class="small_avatar_link"><img src="'.site_url('assets/'.$theme.'/images/no_picture_small.gif').'" class="activity_thumbnail" /></a>';
}
echo '<a href="'.$item_user->username.'">'.$item_user->first_name.' '.$item_user->last_name.'</a> ';
echo $item->content;
if ($item->type == '3')
{
//echo 'has just signed up. Say hello!';
echo vlang('dashboard_say_hello');
}
echo '<br />';
if ($item->type == '0' || $item->type == '3' || $item->type == '4')
{
echo '<img src="'.site_url('assets/'.$theme.'/images/ico_tiny_user.png').'" class="tiny_icon" />';
}
else
{
echo '<img src="'.site_url('assets/'.$theme.'/images/ico_tiny_comment.png').'" class="tiny_icon" />';
}
echo '<span class="time_nice small_avatar_time_nice">'.$this->misc->time_nice($item->timestamp).'</span>';
if ($item->type != '3' && $item->type != '4')
{
if ($item->type == '0') $parent_type = '1';
if ($item->type == '1') $parent_type = '2';
示例9:
</div>
</div>
</div>
<div class="col-md-6">
<div class="controls">
<div class="h2h">
<div class="label_title"><h3>Privacy Settings</h3></div>
<label class="checkbox"><input type="checkbox" name="private" value="1" <?=set_checkbox('private', '1', (isset($private) && $private==1));?> /> <?=vlang('accountsettings_privacy');?></label>
</div>
</div>
</div>
<div class="col-md-12">
<div class="controls">
<div class="h2h">
<p class="h2hblock"><?=vlang('accountsettings_h2hblock_disclaimer');?></p>
</div>
</div>
</div>
<div class="clearfix"></div>
<input type="hidden" name="lang" value="english" />
<div class="form-actions">
<input class="btn submit submit-btn btn-default" type="submit" value="Save" />
</div>
</form>
</div>
</div>
</div>
</div>
示例10:
<h2><?=$title;?></h2>
<?php
//show error/success messages
if ($this->session->flashdata('success') != '')
{
echo '<div class="alert-message success">'.$this->session->flashdata('success').'</div>';
}
if ($this->session->flashdata('error') != '')
{
echo '<div class="alert-message error">'.$this->session->flashdata('error').'</div>';
}
?>
<?=$body;?>
<form action="" method="post" class="form_login">
<div class="clearfix">
<label><?=vlang('forgotpw_email');?></label>
<div class="input">
<input type="text" name="email" value="<?=set_value('email');?>" />
<?=form_error('email');?>
</div>
</div>
<div class="actions">
<input type="submit" class="btn primary" value="<?=vlang('forgotpw_submit');?>" />
</div>
</form>
<?php $this->load->view($theme.'/footer'); ?>
示例11: add_a_friend
function add_a_friend()
{
$user_b = $this->uri->segment(3);
$redirect = TRUE;
if ($this->input->post('no_redirect') == 'yes')
{
$redirect = FALSE;
}
if (strlen($user_b) > 0)
{
$res = $this->users->add_friendship($this->session->userdata('cid'), $user_b);
if ($res === FALSE)
{
$this->session->set_flashdata('error', 'Unable to create friendship.');
if ($redirect) redirect('friends');
}
else
{
$user_b_data = $this->users->get_by_id($user_b);
if ($res == 'requested')
{
$this->session->set_flashdata('success', vlang('friend_message_request_sent'));
}
else
{
$this->session->set_flashdata('success', vlang('friend_message_now_friends',$user_b_data->first_name.' '.$user_b_data->last_name));
}
if ($redirect) redirect($user_b_data->username);
}
}
else
{
$this->session->set_flashdata('error', vlang('friend_message_request_fail'));
if ($redirect) redirect('friends');
}
}
示例12: get_scoring_breakdown
function get_scoring_breakdown($sport,$breakdown,$template_id = 0) {
if($template_id == 0){
$score_keys = json_decode($this->options->get('scoring'),true);
} else {
$this->db->where('id', $template_id);
$scoring = $this->db->get('scoring_templates')->row_object();
$score_keys = json_decode($scoring->value,true);
}
$sport = strtolower($sport);
$bd=json_decode($breakdown);
$bd = (array)$bd;
$bd = array_map('strval',$bd);
$counts = array_count_values($bd);
$scoring = '';
$total = count($bd);
if(isset($counts["0"])) :
$valid = $total - $counts["0"];
else:
$valid = $total;
endif;
if($valid > 0):
$c=1;
foreach($bd as $k=>$v):
if($v != "0"):
$score_value = $this->isValid($k,(array)$score_keys[strtoupper($sport)]);
if($score_value):
$raw_score = ($v / (float)$score_value);
$raw_score=round($raw_score,2);
$scoring .= '<span class=\'bd_tip\' data-original-title=\''.vlang('league_view_score_bd_'.$k).'\'>'.$raw_score.' '.vlang('league_view_score_bd_abbr_'.$k).'</span>';
else:
//$scoring.=vlang('league_view_score_bd_abbr_'.$k).":".$v;
$num = $v / $score_value;
$scoring.='<span class=\'bd_tip\' data-original-title=\''.vlang('league_view_score_bd_'.$k).'\'>'.$num.' '.vlang('league_view_score_bd_abbr_'.$k).'</span>';
endif;
if($c < $valid) :
$scoring .= ', ';
endif;
$c++;
endif;
endforeach;
else:
$scoring .= 'N/A';
endif;
return $scoring;
}
示例13: if
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<? endif; ?>
<div class="modal fade in" id="lfp_modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header shield">
<button type="button" class="close modal-close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h3>Large Field of Players Breakdown</h3>
</div>
<div class="modal-body">
<p><?=vlang('league_lfp_explanation_text')?></p>
<? if(isset($lfp_modal)) { echo $lfp_modal; } ?>
</div>
<div class="modal-footer">
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</div>
<div class="well">
<?if($league->multi_entry==1 && (isset($user_teams) && (count($user_teams) < $league->multi_entry_limit))):?>
<a href="<?=site_url('league/player_select/'.$league->cid)?>" class="btn btn-large">Join Again</a>
<?endif?>
<a class="btn btn-large" href="<?=site_url('lobby')?>">Enter Other Contests</a>
<? if ($league->first_game_cutoff > time() && count($teams) < $league->size && (($league->visibility == 'private' && $league->commissioner_id == $this->users->id()) || $league->visibility == 'public') //if private league then check if user is the league creator
示例14: checkreceivers
function checkreceivers($receivers)
{
$success = TRUE;
$receivers_arr = $this->messages->receivers_to_array($receivers);
if (count($receivers_arr) == 0)
{
$success = FALSE;
$message = vlang('messages_error_use_commas');
}
if ($success)
{
//check if all usernames exist
$err_usernames = array();
foreach($receivers_arr as $username)
{
$user=$this->users->get_by_username(trim($username));
if (!$user)
{
$err_usernames[] = $username;
$success = FALSE;
}else{
if(!$this->users->check_rules($this->users->ID(),0,'message','send', $user->cid)){
$perm_usernames[]=$username;
$success=FALSE;
}
}
}
if (!$success)
{
$usersnames_str = implode(', ', $err_usernames);
if (count($err_usernames) == 1)
{
//$message = 'We\'re unable to send your message. We can\'t find '.$err_usernames[0].'.';
$message = vlang('messages_error_cant_find',$err_usernames[0]);
}
else
{
//$message = 'We\'re unable to send your message. We can\'t find following users: '.implode(', ', $err_usernames).'.';
$message = vlang('messages_error_cant_find_multi',implode(', ', $err_usernames));
}
if (count($err_usernames) == 1)
{
//$message = 'You don\'t have permission to send a message to '.$perm_usernames[0].'.';
$message = vlang('messages_error_perm',$perm_usernames[0]);
}
else
{
//$message = 'You don\'t have permission to send a message to the following users: '.implode(', ', $perm_usernames).'.';
$message = vlang('messages_error_perm_multi',implode(', ', $perm_usernames));
}
}
}
if ($success)
{
return TRUE;
}
else
{
$this->form_validation->set_message('checkreceivers', $message);
return FALSE;
}
}
示例15:
<input type="hidden" name="action" value="delete" />
<input type="submit" class="btn btn-danger" value="<?=vlang('messages_delete');?>" />
</form>
<?if(isset($from->username) & $from->username != $this->session->userdata('username')):?>
<form action="<?=site_url('message/compose/'.$from->cid);?>" method="post">
<input type="hidden" name="subject_pass" value="RE: <?=$message->subject;?>" />
<input type="hidden" name="message_pass" value="<?="\n";?>
----<?="\n";?>
<?=vlang('messages_on');?> <?=date('m/d/Y h:i a', $message->timestamp);?><?="\n";?>
<?=vlang('messages_from');?> <?=@$from->first_name;?> <?=@$from->last_name;?><?="\n";?>
<?=vlang('messages_to');?> <?=@$to->first_name;?> <?=@$to->last_name;?><?="\n";?>
<?=str_replace('"', '\"', $message->message);?>" />
<input type="submit" class="btn btn-primary" value="<?=vlang('messages_reply');?>"/>
</form>
<?endif;?>
<form action="<?=site_url('message/compose/'.$from->cid);?>" method="post">
<input type="hidden" name="subject_pass" value="FW: <?=$message->subject;?>" />
<input type="hidden" name="message_pass" value="<?="\n";?>
----<?="\n";?>
<?=vlang('messages_on');?> <?=date('m/d/Y h:i a', $message->timestamp);?><?="\n";?>
<?=vlang('messages_from');?> <?=@$from->first_name;?> <?=@$from->last_name;?><?="\n";?>
<?=vlang('messages_to');?> <?=@$to->first_name;?> <?=@$to->last_name;?><?="\n";?>
<?=str_replace('"', '\"', $message->message);?>" />
<input type="submit" class="btn" value="<?=vlang('messages_forward');?>"/>
</form>
</div>
</div>
</div>
<?php $this->load->view($theme.'/footer'); ?>