本文整理汇总了PHP中Functions::GmtToLocal方法的典型用法代码示例。如果您正苦于以下问题:PHP Functions::GmtToLocal方法的具体用法?PHP Functions::GmtToLocal怎么用?PHP Functions::GmtToLocal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Functions
的用法示例。
在下文中一共展示了Functions::GmtToLocal方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Get
/**
* Extract values from database and set them to object properties
* @param integer $id ID of record to be instantiated
** @return void DB record's fields are loaded into object properties
*/
private function Get($id)
{
$query = 'SELECT * FROM ' . DB_PREFIX . self::$table . ' WHERE ' . self::$id_name . "= {$id}";
$result = $this->db->Query($query);
$row = $this->db->FetchAssoc($result);
foreach ($row as $key => $value) {
$this->{$key} = $value;
}
$this->date_created = Functions::GmtToLocal($this->date_created);
Plugin::Trigger('rating.get');
}
示例2: Get
/**
* Extract values from database and set them to object properties
* @param integer $id ID of record to be instantiated
* @return void
*/
private function Get($id)
{
$query = "SELECT " . DB_PREFIX . self::$table . ".*, " . DB_PREFIX . "users.username FROM " . DB_PREFIX . self::$table . " INNER JOIN " . DB_PREFIX . "users ON " . DB_PREFIX . self::$table . ".user_id = " . DB_PREFIX . "users.user_id WHERE " . self::$id_name . "= {$id}";
$result = $this->db->Query($query);
$row = $this->db->FetchAssoc($result);
foreach ($row as $key => $value) {
$this->{$key} = $value;
}
$this->date_created = Functions::GmtToLocal($this->date_created);
Plugin::Trigger('message.get');
}
示例3: Get
/**
* Extract values from database and set them to object properties
* @param integer $id ID of record to be instantiated
* @return void DB record's fields are loaded into object properties
*/
private function Get($id)
{
$query = "SELECT " . DB_PREFIX . self::$table . ".*, username FROM " . DB_PREFIX . self::$table . " INNER JOIN " . DB_PREFIX . "users on " . DB_PREFIX . self::$table . ".user_id = " . DB_PREFIX . "users.user_id WHERE " . self::$id_name . "= {$id}";
$result = $this->db->Query($query);
$row = $this->db->FetchAssoc($result);
foreach ($row as $key => $value) {
$this->{$key} = $value;
}
// Video Specific values
$this->tags = preg_split('/\\s?,\\s?/', $this->tags);
$this->duration = substr($this->duration, 0, 3) == '00:' ? substr($this->duration, 3) : $this->duration;
$this->slug = Functions::CreateSlug($this->title);
$this->date_created = Functions::GmtToLocal($this->date_created);
$this->url = HOST . '/videos/' . $this->video_id . (!empty($this->slug) ? '/' . $this->slug : '');
Plugin::Trigger('video.get');
}
示例4: Get
/**
* Extract values from database and set them to object properties
* @param integer $id ID of record to be instantiated
* @return void DB record's fields are loaded into object properties
*/
private function Get($id)
{
$query = 'SELECT * FROM ' . DB_PREFIX . self::$table . ' WHERE ' . self::$id_name . "= {$id}";
$result = $this->db->Query($query);
$row = $this->db->FetchAssoc($result);
foreach ($row as $key => $value) {
$this->{$key} = $value;
}
// User specific values
View::InitView();
$this->role = empty($this->role) ? 'user' : $this->role;
$this->avatar_url = empty($this->avatar) ? View::GetFallbackUrl('images/avatar.gif') : HOST . "/cc-content/uploads/avatars/{$this->avatar}";
$this->date_created = Functions::GmtToLocal($this->date_created);
$this->last_login = Functions::GmtToLocal($this->last_login);
$this->video_count = $this->GetVideoCount();
Plugin::Trigger('user.get');
}
示例5: Get
/**
* Extract values from database and set them to object properties
* @param integer $id ID of record to be instantiated
* @return void
*/
private function Get($id)
{
$query = 'SELECT * FROM ' . DB_PREFIX . self::$table . ' WHERE ' . self::$id_name . "= {$id}";
$result = $this->db->Query($query);
$row = $this->db->FetchAssoc($result);
foreach ($row as $key => $value) {
$this->{$key} = $value;
}
// Custom Vars
$this->date_created = Functions::GmtToLocal($this->date_created);
$this->comments_display = nl2br($row['comments']);
if ($this->user_id != 0) {
$user = new User($this->user_id);
$this->name = $user->username;
$this->email = $user->email;
$this->website = HOST . '/members/' . $user->username . '/';
$this->avatar_url = $user->avatar_url;
} else {
View::InitView();
$this->avatar_url = View::GetFallbackUrl('images/avatar.gif');
}
Plugin::Trigger('comment.get');
}