本文整理汇总了PHP中userid函数的典型用法代码示例。如果您正苦于以下问题:PHP userid函数的具体用法?PHP userid怎么用?PHP userid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了userid函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: set_cover_photo
function set_cover_photo($pid, $cid, $myaccount = false)
{
global $db, $userquery, $cbphoto;
if (!$this->collection_exists($cid)) {
e(lang('collection_not_exists'));
return false;
}
if (!$this->object_exists($pid)) {
e(lang(sprintf('%s does not exist', $this->objType)));
return false;
}
if (!$this->object_in_collection($pid, $cid)) {
e(sprintf(lang("object_not_in_collect"), $this->objName));
return false;
}
if (!$this->is_collection_owner($cid) || userid() != $cbphoto->get_photo_owner($pid)) {
e(lang('cant_perform_action_collect'));
return false;
}
$fields = tbl_fields(array('p' => get_photo_fields(), 'c' => get_collection_fields()));
$query = ' SELECT ' . $fields . ' FROM ' . tbl('collections') . ' as c';
$query .= " LEFT JOIN " . tbl('photos') . " as p ON c.collection_id = p.collection_id ";
start_where();
add_where(" c.collection_id = '{$cid}' ");
add_where(" p.photo_id = '{$pid}' ");
if (get_where()) {
$query .= ' WHERE ' . get_where();
}
end_where();
$result = db_select($query);
if ($myaccount) {
if ($result['is_avatar'] == 'yes' || $result['is_avatar_collection'] == 'yes') {
return false;
}
}
$cover_photo = json_decode($result['cover_photo'], true);
if ($pid == $cover_photo['photo_id']) {
$update = true;
} else {
//Create array so we can reduce one query per collection YOSH !!!
$result = $result[0];
$cover_photo['photo_id'] = $result['photo_id'];
$cover_photo['photo_key'] = $result['photo_key'];
$cover_photo['filename'] = $result['filename'];
$cover_photo['ext'] = $result['ext'];
$cover_photo['is_collection_cover'] = true;
// This flag will help us make a query to get is_mature for cover photo while displaying
$jecp = json_encode($cover_photo);
$field = array('cover_photo' => $jecp);
$update = db_update(tbl('collections'), $field, " collection_id = '" . $result['collection_id'] . "' ");
}
if ($update) {
return $cover_photo;
} else {
return false;
}
}
开发者ID:yukisky,项目名称:clipbucket,代码行数:57,代码来源:collections.class.php
示例2: update
function update($id_detail)
{
$data = array('id_detail' => $this->input->post('id_detail', TRUE), 'faktur' => $this->input->post('faktur', TRUE), 'id_barang' => $this->input->post('id_barang', TRUE), 'id_satuan' => $this->input->post('id_satuan', TRUE), 'jumlah' => $this->input->post('jumlah', TRUE), 'jumlah_baru' => $this->input->post('jumlah_baru', TRUE), 'id_mitra' => $this->input->post('id_mitra', TRUE), 'id_kandang' => $this->input->post('id_kandang', TRUE), 'user_id' => userid(), 'datetime' => now());
$this->db->where('id_detail', $id_detail);
$this->db->update('penyesuaian_detail', $data);
/*'datetime' => date('Y-m-d H:i:s'),*/
}
开发者ID:roniwahyu,项目名称:Sistem-Informasi-Peternakan,代码行数:7,代码来源:penyesuaian_detail_model.php
示例3: update
function update($id)
{
$data = array('id' => $this->input->post('id', TRUE), 'faktur' => $this->input->post('faktur', TRUE), 'tgl' => $this->input->post('tgl', TRUE), 'tgl_kedaluarsa' => $this->input->post('tgl_kedaluarsa', TRUE), 'tgl_terima' => $this->input->post('tgl_terima', TRUE), 'id_customer' => $this->input->post('id_customer', TRUE), 'id_sales' => $this->input->post('id_sales', TRUE), 'keterangan' => $this->input->post('keterangan', TRUE), 'ref' => $this->input->post('ref', TRUE), 'id_bayar' => $this->input->post('id_bayar', TRUE), 'totalbayar' => $this->input->post('total', TRUE), 'pajak' => $this->input->post('pajak', TRUE), 'total_pajak' => $this->input->post('total_pajak', TRUE), 'grandtotal' => $this->input->post('grandtotal', TRUE), 'uangmuka' => $this->input->post('uangmuka', TRUE), 'sisa' => $this->input->post('sisa', TRUE), 'biaya_lain' => $this->input->post('biayakirim', TRUE), 'status' => $this->input->post('status', TRUE), 'id_user' => userid(), 'datetime' => now());
$this->db->where('id', $id);
$this->db->update('sales_order', $data);
/*'datetime' => date('Y-m-d H:i:s'),*/
}
开发者ID:roniwahyu,项目名称:Sistem-Informasi-Peternakan,代码行数:7,代码来源:sales_order_model.php
示例4: update
function update($id)
{
$data = array('id' => $this->input->post('id', TRUE), 'faktur' => $this->input->post('faktur', TRUE), 'faktur_reff' => $this->input->post('faktur_reff', TRUE), 'faktur_po' => $this->input->post('faktur_po', TRUE), 'id_customer' => $this->input->post('id_customer', TRUE), 'tanggal' => $this->input->post('tanggal', TRUE), 'tanggal_kirim' => $this->input->post('tanggal_kirim', TRUE), 'kirim_via' => $this->input->post('kirim_via', TRUE), 'keterangan' => $this->input->post('keterangan', TRUE), 'alamat_kirim' => $this->input->post('alamat_kirim', TRUE), 'alamat_tagihan' => $this->input->post('alamat_tagihan', TRUE), 'biaya_id' => $this->input->post('biaya_id', TRUE), 'biaya_kirim' => $this->input->post('biaya_kirim', TRUE), 'armada_id' => $this->input->post('armada_id', TRUE), 'is_approved' => $this->input->post('is_approved', TRUE), 'user_id' => userid(), 'datetime' => now());
$this->db->where('id', $id);
$this->db->update('delivery_order', $data);
/*'datetime' => date('Y-m-d H:i:s'),*/
}
开发者ID:roniwahyu,项目名称:Sistem-Informasi-Peternakan,代码行数:7,代码来源:delivery_order_model.php
示例5: confirm_collection_type
function confirm_collection_type($type)
{
global $cbcollection;
if (empty($type)) {
$type = 'photos';
}
if ($type != $cbcollection->types) {
if (VERSION < '3.0') {
// Get Deprecated Types;
$dep_types = $cbcollection->deprecated_types;
$message = 'Collections feature now only support photos';
if (array_key_exists($type, $dep_types)) {
$message .= '. ' . $cbcollection->deprecated_types[$type] . ' support has been dropped since 2.6';
$dep_type = $cbcollection->deprecated_types[$type] . ' ';
}
if (userid() && has_access('admin_access', true)) {
$message .= '. Please upgrade your Clipbucket to <a href="http://clip-bucket.com" target="_blank">latest version</a>';
} else {
$message .= '. Please contact Site Administrator about this.';
}
e(lang($message));
cb_show_page();
}
return $cbcollection->types;
}
return $cbcollection->types;
}
开发者ID:yukisky,项目名称:clipbucket,代码行数:27,代码来源:functions_collections.php
示例6: update
function update($id)
{
$data = array('id' => $this->input->post('id', TRUE), 'faktur' => $this->input->post('faktur', TRUE), 'faktur_reff' => $this->input->post('faktur_reff', TRUE), 'faktur_do' => $this->input->post('faktur_do', TRUE), 'id_supplier' => $this->input->post('id_supplier', TRUE), 'tanggal' => $this->input->post('tanggal', TRUE), 'tanggal_terima' => $this->input->post('tanggal_terima', TRUE), 'kirim_via' => $this->input->post('kirim_via', TRUE), 'keterangan' => $this->input->post('keterangan', TRUE), 'alamat_terima' => $this->input->post('alamat_terima', TRUE), 'id_cabang' => $this->input->post('id_cabang', TRUE), 'id_mitra' => $this->input->post('id_mitra', TRUE), 'id_kandang' => $this->input->post('id_kandang', TRUE), 'id_gudang' => $this->input->post('id_gudang', TRUE), 'nopol_pengirim' => $this->input->post('nopol_pengirim', TRUE), 'nama_pengirim' => $this->input->post('nama_pengirim', TRUE), 'is_approved' => $this->input->post('is_approved', TRUE), 'user_id' => userid(), 'datetime' => now());
$this->db->where('id', $id);
$this->db->update('receive_item', $data);
/*'datetime' => date('Y-m-d H:i:s'),*/
}
开发者ID:roniwahyu,项目名称:Sistem-Informasi-Peternakan,代码行数:7,代码来源:receive_item_model.php
示例7: cropScreen
/**
* Scale & crops a screen image
* @param id - screen id
* @param viewport - dimension (width, height) and position (x,y) of the viewport
* @param dimension - target dimension (width, height)
* @param path - target path
* @return void
*/
function cropScreen($id, $viewport, $dimension, $path)
{
global $db;
$w = $dimension['width'];
$h = $dimension['height'];
$screen = $db->single("SELECT id, project, type, ext FROM screen WHERE id = '" . $id . "' AND (embeddable = 'TRUE' or creator = '" . userid() . "') LIMIT 1");
if (!$screen) {
die;
}
$filename = UPLOAD . 'screens/' . $screen['project'] . '/' . md5($screen['id'] . config('security.general.hash')) . '.' . $screen['ext'];
$target = TERRIFIC . $path;
if (!is_file($target)) {
if (!is_dir(dirname($target))) {
@mkdir(dirname($target), 0777, true);
}
$width = $viewport['width'];
$height = $viewport['height'];
$r = $width / $height;
$newheight = $w / $r;
$newwidth = $w;
switch ($screen['type']) {
case 'image/jpeg':
case 'image/jpg':
$src = imagecreatefromjpeg($filename);
break;
case 'image/png':
$src = imagecreatefrompng($filename);
break;
}
$dst = imagecreatetruecolor($newwidth, $newheight);
imagecopyresampled($dst, $src, 0, 0, $viewport['x'], $viewport['y'], $newwidth, $newheight, $width, $height);
imagepng($dst, $target);
}
}
开发者ID:nicam,项目名称:clarify,代码行数:42,代码来源:image.php
示例8: update
function update($id)
{
$data = array('id' => $this->input->post('id', TRUE), 'faktur' => $this->input->post('faktur', TRUE), 'faktur_reff' => $this->input->post('faktur_reff', TRUE), 'tanggal' => $this->input->post('tanggal', TRUE), 'id_gudang' => $this->input->post('id_gudang', TRUE), 'keterangan' => $this->input->post('keterangan', TRUE), 'akun' => $this->input->post('akun', TRUE), 'total_nilai' => $this->input->post('total_nilai', TRUE), 'user_id' => userid(), 'datetime' => now());
$this->db->where('id', $id);
$this->db->update('penyesuaian', $data);
/*'datetime' => date('Y-m-d H:i:s'),*/
}
开发者ID:roniwahyu,项目名称:Sistem-Informasi-Peternakan,代码行数:7,代码来源:penyesuaian_model.php
示例9: update
function update($id_detail)
{
$data = array('id_detail' => $this->input->post('id_detail', TRUE), 'faktur' => $this->input->post('faktur', TRUE), 'id_so' => $this->input->post('id_so', TRUE), 'id_barang' => $this->input->post('id_barang', TRUE), 'jumlah' => $this->input->post('jumlah', TRUE), 'id_satuan' => $this->input->post('id_satuan', TRUE), 'harga_jual' => $this->input->post('harga_jual', TRUE), 'diskon1' => $this->input->post('diskon1', TRUE), 'diskon2' => $this->input->post('diskon2', TRUE), 'diskon3' => $this->input->post('diskon3', TRUE), 'id_user' => userid(), 'datetime' => now());
$this->db->where('id_detail', $id_detail);
$this->db->update('sales_order_detail', $data);
/*'datetime' => date('Y-m-d H:i:s'),*/
}
开发者ID:roniwahyu,项目名称:Sistem-Informasi-Peternakan,代码行数:7,代码来源:sales_order_detail_model.php
示例10: update
function update($id)
{
$data = array('id' => $this->input->post('id', TRUE), 'faktur' => $this->input->post('faktur', TRUE), 'tanggal' => $this->input->post('tanggal', TRUE), 'tanggal_tempo' => $this->input->post('tanggal_tempo', TRUE), 'id_mitra' => $this->input->post('id_mitra', TRUE), 'id_gudang' => $this->input->post('id_gudang', TRUE), 'id_kandang' => $this->input->post('id_kandang', TRUE), 'keterangan' => $this->input->post('keterangan', TRUE), 'catatan' => $this->input->post('catatan', TRUE), 'user_id' => userid(), 'is_approved' => $this->input->post('is_approved', TRUE), 'datetime' => now());
$this->db->where('id', $id);
$this->db->update('purchase_request', $data);
/*'datetime' => date('Y-m-d H:i:s'),*/
}
开发者ID:roniwahyu,项目名称:Sistem-Informasi-Peternakan,代码行数:7,代码来源:purchase_request_model.php
示例11: login
function login()
{
global $db;
// load project permissions
$owned_projects = $db->data("SELECT id FROM project WHERE creator = '" . userid() . "'");
$projects = array();
foreach ($owned_projects as $project) {
$projects[$project['id']] = 'ADMIN';
}
$collaboration_projects = $db->data("SELECT project, permission FROM project_permission WHERE user = '" . userid() . "'");
foreach ($collaboration_projects as $project) {
$projects[$project['project']] = $project['permission'];
}
$_SESSION['user']['permissions']['project'] = $projects;
}
开发者ID:nicam,项目名称:clarify,代码行数:15,代码来源:core.php
示例12: replace
/**
* Function used to replace content
* of email template with variables
* it can either be email subject or message content
* @param : Content STRING
* @param : array ARRAY => array({somevar}=>$isvar)
*/
function replace($content, $array)
{
//Common Varialbs
$com_array = array('{website_title}' => TITLE, '{baseurl}' => BASEURL, '{website_url}' => BASEURL, '{date_format}' => cbdate(DATE_FORMAT), '{date}' => cbdate(), '{username}' => username(), '{userid}' => userid(), '{date_year}' => cbdate("Y"), '{date_month}' => cbdate("m"), '{date_day}' => cbdate("d"), '{signup_link}' => cblink(array('name' => 'signup')), '{login_link}' => cblink(array('name' => 'login')));
if (is_array($array) && count($array) > 0) {
$array = array_merge($com_array, $array);
} else {
$array = $com_array;
}
foreach ($array as $key => $val) {
$var_array[] = '/' . $key . '/';
$val_array[] = $val;
}
return preg_replace($var_array, $val_array, $content);
}
开发者ID:yukisky,项目名称:clipbucket,代码行数:22,代码来源:cbemail.class.php
示例13: activity_add
/**
* Log activity.
*
* @param $title Activity title
* @param $actor Actor ID
* @param $actor_type Actor type
* @param $verb Verb
* @param $object Object ID
* @param $object_type Object type
* @param $target Target ID
* @param $target_type Target type
*/
function activity_add($title, $actor, $actor_type, $actor_title, $verb, $object, $object_type, $object_title, $target = null, $target_type = null, $target_title = null)
{
global $db;
global $cache;
// create activity object
$activity = array('created' => date('Y-m-d H:i:s'), 'creator' => userid(), 'actor' => $actor, 'actor_type' => $actor_type, 'actor_title' => $actor_title, 'verb' => $verb, 'object' => $object, 'object_type' => $object_type, 'object_title' => $object_title, 'target' => $target, 'target_type' => $target_type, 'target_title' => $target_title, 'title' => $title);
// log activity into database
$id = $db->insert('activity', $activity);
// cache activity in memcache
$cache->set('activity.' . $id, $activity);
// push activity into streams
stream_activity_add($actor_type, $actor, $id);
stream_activity_add($object_type, $object, $id);
if ($target > 0) {
stream_activity_add($target_type, $target, $id);
}
}
开发者ID:nicam,项目名称:clarify,代码行数:29,代码来源:api.php
示例14: call_download_video_function
/**
* Funcion used to call functions
* when video is going to dwnload
* ie in download.php
*/
function call_download_video_function($vdo)
{
global $db;
$funcs = get_functions('download_video_functions');
if (is_array($funcs) && count($funcs) > 0) {
foreach ($funcs as $func) {
if (function_exists($func)) {
$func($vdo);
}
}
}
//Updating Video Downloads
$db->update(tbl("video"), array("downloads"), array("|f|downloads+1"), "videoid = '" . $vdo['videoid'] . "'");
//Updating User Download
if (userid()) {
$db->update(tbl("users"), array("total_downloads"), array("|f|total_downloads+1"), "userid = '" . userid() . "'");
}
}
开发者ID:yukisky,项目名称:clipbucket,代码行数:23,代码来源:functions_filters.php
示例15: is_playlist_viewable
function is_playlist_viewable($list_id)
{
if (is_array($list_id)) {
$playlist = $list_id;
} else {
$playlist = get_playlist($list_id);
}
if (isset($playlist['playlist_id'])) {
if ($playlist['privacy'] == 'private' and $playlist['userid'] != userid()) {
e(lang('User has made this playlist private.'));
return false;
}
$data = cb_do_action('is_playlist_viewable', array('playlist' => $playlist));
if ($data) {
return $data;
}
return true;
}
return true;
}
开发者ID:Coding110,项目名称:cbvideo,代码行数:20,代码来源:functions_playlist.php
示例16: create_page
/**
* Function used to create new page
* @param ARRAY
*/
function create_page($param)
{
global $db;
$name = mysql_clean($param['page_name']);
$title = mysql_clean($param['page_title']);
$content = addslashes($param['page_content']);
if (empty($name)) {
e(lang("page_name_empty"));
}
if (empty($title)) {
e(lang("page_title_empty"));
}
if (empty($content)) {
e(lang("page_content_empty"));
}
if (!error()) {
$db->insert(tbl($this->page_tbl), array("page_name", "page_title", "page_content", "userid", "date_added", "active"), array($name, $title, "|no_mc|" . $content, userid(), now(), "yes"));
e(lang("new_page_added_successfully"), "m");
return false;
}
return false;
}
开发者ID:yukisky,项目名称:clipbucket,代码行数:26,代码来源:cbpage.class.php
示例17: Copyright
<?php
/*
***************************************************************
| Copyright (c) 2007-2010 Clip-Bucket.com. All rights reserved.
| @ Author : ArslanHassan
| @ Software : ClipBucket , © PHPBucket.com
***************************************************************
*/
define("THIS_PAGE", "invite_group");
define("PARENT_PAGE", "groups");
require 'includes/config.inc.php';
$pages->page_redir();
$url = mysql_clean($_GET['url']);
$details = $cbgroup->group_details_url($url);
assign('group', $details);
if (!$cbgroup->is_owner($details)) {
e(lang("you_cant_invite_mems"));
} else {
if ($details) {
assign('friends', $userquery->get_contacts(userid(), 0));
}
//Inviting Friends
if (isset($_POST['invite_friends'])) {
$cbgroup->invite_members($_POST['friend'], $details['group_id']);
}
assign('mode', "invite_group");
template_files('view_group.html');
subtitle(lang("grp_invite_msg"));
display_it();
}
开发者ID:Coding110,项目名称:cbvideo,代码行数:31,代码来源:invite_group.php
示例18: button
<?php
if (userid() || $old_version < 2.3) {
?>
</div>
<div class="nav_des clearfix">
<div class="cb_container">
<h4 style="color:#fff;">Upgrading</h4>
<p style="color:#fff; font-size:13px;">You are now going to upgrade from <?php
echo $old_version;
?>
to <?php
echo VERSION;
?>
, please read <strong>
<a href="http://docs.clip-bucket.com/clipbucket-docs/clipbucket-installation" style="color:#fff;text-decoration:underline;">this documentation</a></strong> for further info and help, please click continue upgrade
</p>
</div><!--cb_container-->
</div><!--nav_des-->
<div id="sub_container" >
<form name="installation" method="post" id="installation">
<input type="hidden" name="mode" value="permission" />
<div style="padding:10px 0px" align="right"><?php
echo button('Continue to upgrade!', ' onclick="$(\'#installation\').submit()" ');
?>
开发者ID:Coding110,项目名称:cbvideo,代码行数:31,代码来源:upgrade.php
示例19: array
$userDetails = array();
foreach ($uDetails as $ud) {
$userDetails[$ud] = $userquery->udetails[$ud];
}
$userDetails['sess_id'] = $_COOKIE['PHPSESSID'];
$userDetails['avatar'] = $video['user_photo'] = $video['displayPic'] = $userquery->avatar($userDetails);
exit(json_encode(array('status' => 'ok', 'userid' => $userquery->userid, 'sess_id' => $_COOKIE['PHPSESSID'], 'details' => $userDetails)));
}
break;
case "getuser":
case "check_auth":
case "is_logged_in":
case "checkauth":
case "isloggedin":
$userid = userid();
if (!userid()) {
exit(json_encode(array('status' => 'failed', 'msg' => 'User is not logged in', 'session' => $_COOKIE['PHPSESSID'])));
} else {
$uDetails = array('username', 'userid', 'email', 'total_videos', 'total_photos', 'total_collections', 'total_groups');
$userDetails = array();
foreach ($uDetails as $ud) {
$userDetails[$ud] = $userquery->udetails[$ud];
}
$userDetails['sess_id'] = $_COOKIE['PHPSESSID'];
$userDetails['avatar'] = $video['user_photo'] = $video['displayPic'] = $userquery->avatar($userDetails);
exit(json_encode($userDetails));
}
break;
case "logout":
$userquery->logout();
if (cb_get_functions('logout')) {
开发者ID:Coding110,项目名称:cbvideo,代码行数:31,代码来源:auth.php
示例20: post
* @author Arslan Hassan
* @license AAL
* @since 3.0
*/
include '../includes/config.inc.php';
//Getting mode..
$mode = post('mode');
if (!$mode) {
$mode = get('mode');
}
$mode = mysql_clean($mode);
switch ($mode) {
case 'send_photo_pm':
$array = $_POST;
$array['is_pm'] = true;
$array['from'] = userid();
$cbpm->send_pm($array);
if (error()) {
$errors = error_list();
$response = array('error' => $errors[0]);
}
if (msg()) {
$success = msg_list();
$response = array('success' => $success[0]);
}
echo json_encode($response);
break;
case 'delete_photo':
$id = mysql_clean($_POST['id']);
$photo = $cbphoto->get_photo($id);
$item = get_collection_item($photo['collection_id'], $photo['photo_id']);
开发者ID:yukisky,项目名称:clipbucket,代码行数:31,代码来源:photos.php
注:本文中的userid函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论