当前位置: 首页>>代码示例>>PHP>>正文


PHP common::date方法代码示例

本文整理汇总了PHP中common::date方法的典型用法代码示例。如果您正苦于以下问题:PHP common::date方法的具体用法?PHP common::date怎么用?PHP common::date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在common的用法示例。


在下文中一共展示了common::date方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: AvailableList

 function AvailableList($show_options = true)
 {
     global $langmessage, $config;
     //search settings
     $this->searchPerPage = 10;
     $this->searchOrderOptions = array();
     $this->searchOrderOptions['modified'] = $langmessage['Recently Updated'];
     $this->searchOrderOptions['rating_score'] = $langmessage['Highest Rated'];
     $this->searchOrderOptions['downloads'] = $langmessage['Most Downloaded'];
     $this->SearchOrder();
     // get addon information for ordering
     admin_tools::VersionData($version_data);
     $version_data = $version_data['packages'];
     // combine remote addon information
     foreach ($this->avail_addons as $theme_id => $info) {
         if (isset($info['id'])) {
             $id = $info['id'];
             if (isset($version_data[$id])) {
                 $info = array_merge($info, $version_data[$id]);
                 $info['rt'] *= 5;
             }
             //use local rating
             if (isset($this->addonReviews[$id])) {
                 $info['rt'] = $this->addonReviews[$id]['rating'];
             }
         } else {
             $info['rt'] = 6;
             //give local themes a high rating to make them appear first, rating won't actually display
         }
         $info += array('dn' => 0, 'rt' => 0);
         //modified time
         if (!isset($info['tm'])) {
             $info['tm'] = self::ModifiedTime($info['full_dir']);
         }
         $this->avail_addons[$theme_id] = $info;
     }
     // sort by
     uasort($this->avail_addons, array('admin_theme_content', 'SortUpdated'));
     switch ($this->searchOrder) {
         case 'downloads':
             uasort($this->avail_addons, array('admin_theme_content', 'SortDownloads'));
             break;
         case 'modified':
             uasort($this->avail_addons, array('admin_theme_content', 'SortRating'));
             uasort($this->avail_addons, array('admin_theme_content', 'SortUpdated'));
             break;
         case 'rating_score':
         default:
             uasort($this->avail_addons, array('admin_theme_content', 'SortRating'));
             break;
     }
     // pagination
     $this->searchMax = count($this->avail_addons);
     if (isset($_REQUEST['page']) && ctype_digit($_REQUEST['page'])) {
         $this->searchPage = $_REQUEST['page'];
     }
     $start = $this->searchPage * $this->searchPerPage;
     $possible = array_slice($this->avail_addons, $start, $this->searchPerPage, true);
     if ($show_options) {
         $this->SearchOptions();
     }
     // show themes
     echo '<div id="gp_avail_themes">';
     foreach ($possible as $theme_id => $info) {
         $theme_label = str_replace('_', ' ', $info['name']);
         $version = '';
         $id = false;
         if (isset($info['version'])) {
             $version = $info['version'];
         }
         if (isset($info['id']) && is_numeric($info['id'])) {
             $id = $info['id'];
         }
         $has_screenshot = file_exists($info['full_dir'] . '/screenshot.png');
         //screenshot
         if ($has_screenshot) {
             echo '<div class="expand_child_click">';
             echo '<b class="gp_theme_head">' . $theme_label . ' ' . $version . '</b>';
             echo '<div style="background-image:url(\'' . common::GetDir($info['rel'] . '/screenshot.png') . '\')">';
         } else {
             echo '<div>';
             echo '<b class="gp_theme_head">' . $theme_label . ' ' . $version . '</b>';
             echo '<div>';
         }
         //options
         echo '<div class="gp_theme_options">';
         //colors
         echo '<b>' . $langmessage['preview'] . '</b>';
         echo '<ul>';
         foreach ($info['colors'] as $color) {
             echo '<li>';
             $q = 'cmd=preview&theme=' . rawurlencode($theme_id . '/' . $color) . $this->searchQuery;
             if ($this->searchPage) {
                 $q .= '&page=' . $this->searchPage;
             }
             echo common::Link('Admin_Theme_Content/Available', str_replace('_', '&nbsp;', $color), $q);
             echo '</li>';
         }
         echo '</ul>';
         ob_start();
//.........这里部分代码省略.........
开发者ID:VTAMAGNO,项目名称:gpEasy-CMS,代码行数:101,代码来源:admin_theme_content.php

示例2: FileInfo

 function FileInfo($file)
 {
     global $langmessage;
     $temp = explode('.', $file);
     if (count($temp) < 3) {
         return '';
     }
     $info = array();
     $info['ext'] = array_pop($temp);
     $info['bits'] = '';
     if (count($temp) >= 3 && is_numeric($temp[0]) && is_numeric($temp[1])) {
         list($time, $exported, $rand) = $temp;
         $info['time'] = common::date($langmessage['strftime_datetime'], $time);
         $info['bits'] = $exported;
         foreach ($this->export_fields as $export_field) {
             $index = $export_field['index'];
             if (($exported & $index) == $index) {
                 $info['exported'][] = $export_field['label'];
             }
         }
         if (empty($info['exported'])) {
             $info['exported'][] = 'Unknown';
         }
     } else {
         $info['time'] = $file;
         $info['exported'][] = 'Unknown';
     }
     return $info;
 }
开发者ID:GedionChang,项目名称:gpEasy-CMS,代码行数:29,代码来源:admin_port.php

示例3: PluginForm

 /**
  * Display a form for uploading CKEditor plugins
  *
  */
 function PluginForm()
 {
     global $langmessage, $page;
     echo '<form method="post" action="' . common::GetUrl($page->requested) . '" enctype="multipart/form-data">';
     echo '<table class="bordered"><tr><th>' . $langmessage['name'] . '</th><th>' . $langmessage['Modified'] . '</th><th>' . $langmessage['options'] . '</th></tr>';
     if (count($this->cke_config['plugins'])) {
         foreach ($this->cke_config['plugins'] as $plugin_name => $plugin_info) {
             echo '<tr><td>';
             echo $plugin_name;
             echo '</td><td>';
             echo common::date($langmessage['strftime_datetime'], $plugin_info['updated']);
             echo '</td><td>';
             $attr = array('data-cmd' => 'postlink', 'class' => 'gpconfirm', 'title' => sprintf($langmessage['generic_delete_confirm'], $plugin_name));
             echo common::Link($page->requested, $langmessage['delete'], 'cmd=rmplugin&plugin=' . rawurlencode($plugin_name), $attr);
             echo '</td></tr>';
         }
     }
     echo '<tr><td>';
     echo '<input type="hidden" name="cmd" value="upload_plugin" />';
     echo '<input type="file" name="plugin" />';
     echo '</td><td>&nbsp;';
     echo '</td><td>';
     echo ' <input type="submit" value="Install Plugin" />';
     echo '</td></tr>';
     echo '</table>';
     echo '</form>';
     //$this->build_config
     if ($this->build_config && isset($this->build_config['plugins'])) {
         $ordered = array();
         $count = 0;
         foreach ($this->build_config['plugins'] as $plugin => $status) {
             if (!$status) {
                 continue;
             }
             $char = strtoupper($plugin[0]);
             $ordered[$char][] = '<a href="http://ckeditor.com/addon/' . $plugin . '" target="_blank">' . ucfirst($plugin) . '</a>';
             $count++;
         }
         //echo '<h3>'.$langmessage['Installed'].'</h3>';
         echo '<p><br/></p>';
         echo '<table class="bordered">';
         echo '<tr><th colspan="2">' . $langmessage['Installed'] . ' (' . $count . ')</th></tr>';
         foreach ($ordered as $char => $plugins) {
             echo '<tr><td>';
             echo '<b>' . $char . '</b>';
             echo '</td><td>';
             echo implode(', ', $plugins);
             echo '</td></tr>';
         }
         echo '</table>';
     }
 }
开发者ID:Knuzen,项目名称:gpEasy-CMS,代码行数:56,代码来源:admin_ckeditor.php

示例4: PluginForm

 /**
  * Display a form for uploading CKEditor plugins
  *
  */
 function PluginForm()
 {
     global $langmessage, $page;
     echo '<form method="post" action="' . common::GetUrl($page->requested) . '" enctype="multipart/form-data">';
     echo '<table class="bordered"><tr><th>' . $langmessage['name'] . '</th><th>' . $langmessage['Modified'] . '</th><th>' . $langmessage['options'] . '</th></tr>';
     if (count($this->cke_config['plugins'])) {
         foreach ($this->cke_config['plugins'] as $plugin_name => $plugin_info) {
             echo '<tr><td>';
             echo $plugin_name;
             echo '</td><td>';
             echo common::date($langmessage['strftime_datetime'], $plugin_info['updated']);
             echo '</td><td>';
             $attr = array('data-cmd' => 'postlink', 'class' => 'gpconfirm', 'title' => sprintf($langmessage['generic_delete_confirm'], $plugin_name));
             echo common::Link($page->requested, $langmessage['delete'], 'cmd=rmplugin&plugin=' . rawurlencode($plugin_name), $attr);
             echo '</td></tr>';
         }
     }
     echo '<tr><td>';
     echo '<input type="hidden" name="cmd" value="upload_plugin" />';
     echo '<input type="file" name="plugin" />';
     echo '</td><td>&nbsp;';
     echo '</td><td>';
     echo ' <input type="submit" value="Install Plugin" />';
     echo '</td></tr>';
     echo '</table>';
     echo '</form>';
 }
开发者ID:Bomberus,项目名称:gpEasy-CMS,代码行数:31,代码来源:admin_ckeditor.php

示例5: FileStats

 function FileStats($key, $title, $is_special)
 {
     global $langmessage, $gp_titles;
     echo '<a>' . $langmessage['Slug/URL'] . ': ' . htmlspecialchars($title) . '</a>';
     echo '<a>' . $langmessage['Content Type'] . ': ' . str_replace(',', ', ', $gp_titles[$key]['type']) . '</a>';
     if (!$is_special) {
         $file = gpFiles::PageFile($title);
         $stats = @stat($file);
         if ($stats) {
             $mtime = $stats['mtime'];
             $size = $stats['size'];
             echo '<a>' . $langmessage['File Size'] . ': ' . admin_tools::FormatBytes($size) . '</a>';
             echo '<a>' . $langmessage['Modified'] . ': ' . common::date($langmessage['strftime_datetime'], $mtime) . '</a>';
         }
     }
     echo '<a>Data Index: ' . $key . '</a>';
 }
开发者ID:GedionChang,项目名称:gpEasy-CMS,代码行数:17,代码来源:admin_menu_new.php

示例6: CheckStatus

 function CheckStatus()
 {
     global $langmessage;
     $diff = time() - $this->data_timestamp;
     if ($this->data_timestamp > 0) {
         echo '<p>';
         echo sprintf($langmessage['Software_updates_checked'], common::date($langmessage['strftime_datetime'], $this->data_timestamp));
         echo '</p>';
     }
     //one hour old
     if ($diff > 3600) {
         echo '<p>';
         echo '<a href="?cmd=checkremote">' . $langmessage['Check Now'] . '</a>';
         echo '</p>';
     }
 }
开发者ID:barbrick,项目名称:gpEasy-CMS,代码行数:16,代码来源:update.php

示例7: ViewRevision

 /**
  * Display the contents of a past revision
  *
  */
 function ViewRevision()
 {
     global $langmessage;
     $time = $_REQUEST['time'];
     $full_path = $this->BackupFile($time);
     if (!$full_path) {
         return false;
     }
     $file_sections = $file_stats = array();
     //if it's a compressed file, we need an uncompressed version
     if (strpos($full_path, '.gze') !== false) {
         ob_start();
         readgzfile($full_path);
         $contents = ob_get_clean();
         $dir = common::DirName($full_path);
         $full_path = tempnam($dir, 'backup');
         gpFiles::Save($full_path, $contents);
         $file_sections = gpFiles::Get($full_path, 'file_sections');
         unlink($full_path);
     } else {
         $file_sections = gpFiles::Get($full_path, 'file_sections');
     }
     $this->contentBuffer = section_content::Render($file_sections, $this->title, gpFiles::$last_stats);
     $date = common::date($langmessage['strftime_datetime'], $time);
     $message = sprintf($langmessage['viewing_revision'], $date);
     $message .= ' <br/> ' . common::Link($this->title, $langmessage['Restore this revision'], 'cmd=use_revision&time=' . $time, array('data-cmd' => 'cnreq'));
     $message .= ' &nbsp; ' . common::Link($this->title, $langmessage['Revision History'], 'cmd=view_history', array('title' => $langmessage['Revision History'], 'data-cmd' => 'gpabox'));
     message($message);
 }
开发者ID:Bomberus,项目名称:gpEasy-CMS,代码行数:33,代码来源:editing_page.php

示例8: SearchDisplayRow

 /**
  * Display row
  *
  */
 function SearchDisplayRow($title)
 {
     global $langmessage, $gpLayouts, $gp_index, $gp_menu;
     $title_index = $gp_index[$title];
     $is_special = common::SpecialOrAdmin($title);
     $file = gpFiles::PageFile($title);
     $stats = @stat($file);
     $mtime = false;
     $size = false;
     $layout = admin_menu_tools::CurrentLayout($title_index);
     $layout_info = $gpLayouts[$layout];
     if ($stats) {
         $mtime = $stats['mtime'];
         $size = $stats['size'];
     }
     echo '<tr><td>';
     $label = common::GetLabel($title);
     echo common::Link($title, common::LabelSpecialChars($label));
     //area only display on mouseover
     echo '<div><div>';
     //style="position:absolute;bottom:0;left:10px;right:10px;"
     echo $this->Link('Admin_Menu', $langmessage['rename/details'], 'cmd=renameform&index=' . urlencode($title_index), array('title' => $langmessage['rename/details'], 'data-cmd' => 'gpajax'));
     echo $this->Link('Admin_Menu', $langmessage['Copy'], 'cmd=copypage&index=' . urlencode($title_index), array('title' => $langmessage['Copy'], 'data-cmd' => 'gpabox'));
     echo '<span>';
     echo $langmessage['layout'] . ': ';
     echo $this->Link('Admin_Menu', $layout_info['label'], 'cmd=layout&index=' . urlencode($title_index), array('title' => $langmessage['layout'], 'data-cmd' => 'gpabox'));
     echo '</span>';
     if (!$is_special) {
         echo $this->Link('Admin_Menu', $langmessage['delete'], 'cmd=trash&index=' . urlencode($title_index), array('title' => $langmessage['delete_page'], 'data-cmd' => 'postlink', 'class' => 'gpconfirm'));
     }
     gpPlugin::Action('MenuPageOptions', array($title, $title_index, false, $layout_info));
     //stats
     if (gpdebug) {
         echo '<span>Data Index: ' . $title_index . '</span>';
     }
     echo '</div>&nbsp;</div>';
     //types
     echo '</td><td>';
     $this->TitleTypes($title_index);
     //children
     echo '</td><td>';
     if (isset($Inherit_Info[$title_index]) && isset($Inherit_Info[$title_index]['children'])) {
         echo $Inherit_Info[$title_index]['children'];
     } elseif (isset($gp_menu[$title_index])) {
         echo '0';
     } else {
         echo $langmessage['Not In Main Menu'];
     }
     //size
     echo '</td><td>';
     if ($size) {
         echo admin_tools::FormatBytes($size);
     }
     //modified
     echo '</td><td>';
     if ($mtime) {
         echo common::date($langmessage['strftime_datetime'], $mtime);
     }
     echo '</td></tr>';
 }
开发者ID:Knuzen,项目名称:gpEasy-CMS,代码行数:64,代码来源:admin_menu_new.php

示例9: RateForm

 function RateForm()
 {
     global $config, $dirPrefix, $langmessage;
     //get appropriate variables
     $id = $this->addon_info['id'];
     if (isset($_REQUEST['rating'])) {
         $rating = $_REQUEST['rating'];
     } elseif (isset($this->addonReviews[$id])) {
         $rating = $this->addonReviews[$id]['rating'];
     } else {
         $rating = 5;
     }
     if (isset($_REQUEST['review'])) {
         $review = $_REQUEST['review'];
     } elseif (isset($this->addonReviews[$id])) {
         $review = $this->addonReviews[$id]['review'];
     } else {
         $review = '';
     }
     echo '<h2>';
     echo $this->addon_info['name'] . ' &#187; ' . 'Rate';
     echo '</h2>';
     if (isset($this->addonReviews[$id])) {
         echo 'You posted the following review on ' . common::date($langmessage['strftime_date'], $this->addonReviews[$id]['time']);
     }
     //echo '<form action="'.common::GetUrl($this->scriptUrl,'cmd=rate&arg='.$this->addon_info['pass_arg']).'" method="post">';
     echo '<form action="' . common::GetUrl($this->scriptUrl) . '" method="post">';
     echo '<input type="hidden" name="arg" value="' . $this->addon_info['pass_arg'] . '"/>';
     echo '<input type="hidden" name="cmd" value="rate" />';
     echo '<table class="rating_table">';
     echo '<tr><td>Rating</td><td>';
     echo '<span class="rating">';
     for ($i = 1; $i < 6; $i++) {
         $class = '';
         if ($i > $rating) {
             $class = ' class="unset"';
         }
         echo '<a data-rating="' . $i . '"' . $class . '></a>';
     }
     echo '<input type="hidden" name="rating" value="' . htmlspecialchars($rating) . '" />';
     echo '</span> ';
     echo '</td></tr>';
     echo '<tr><td>Review</td><td>';
     echo '<textarea name="review" cols="50" rows="7" class="gptextarea">';
     echo htmlspecialchars($review);
     echo '</textarea>';
     echo '</td></tr>';
     echo '<tr><td>From</td><td>';
     $host = $_SERVER['HTTP_HOST'] . $dirPrefix;
     echo '<input type="text" name="host"  size="50" value="' . htmlspecialchars($host) . '" readonly="readonly" class="gpinput gpreadonly" />';
     echo '<br/>';
     echo '<input type="checkbox" name="show_site" value="hidden" /> Click to hide your site information on gpEasy.com.';
     echo '</td></tr>';
     echo '<tr><td></td><td>';
     if (isset($this->addonReviews[$id])) {
         echo '<input type="submit" name="cmd" value="Update Review" class="gppost gpsubmit"/>';
     } else {
         echo '<input type="submit" name="cmd" value="Send Review" class="gppost gpsubmit"/>';
     }
     echo ' ';
     echo '<input type="submit" name="cmd" value="Cancel" class="admin_box_close gpcancel"/>';
     echo '</td></tr>';
     echo '</table>';
     echo '</form>';
     return true;
 }
开发者ID:VTAMAGNO,项目名称:gpEasy-CMS,代码行数:66,代码来源:admin_addons_tool.php

示例10: ViewRevision

 /**
  * Display the contents of a past revision
  *
  */
 public function ViewRevision()
 {
     global $langmessage;
     $time = $_REQUEST['time'];
     $full_path = $this->BackupFile($time);
     if (is_null($full_path)) {
         return false;
     }
     //if it's a compressed file, we need an uncompressed version
     if (strpos($full_path, '.gze') !== false) {
         ob_start();
         readgzfile($full_path);
         $contents = ob_get_clean();
         $dir = common::DirName($full_path);
         $full_path = tempnam($dir, 'backup') . '.php';
         gpFiles::Save($full_path, $contents);
         $file_sections = gpFiles::Get($full_path, 'file_sections');
         unlink($full_path);
     } else {
         $file_sections = gpFiles::Get($full_path, 'file_sections');
     }
     $this->contentBuffer = section_content::Render($file_sections, $this->title, gpFiles::$last_stats);
     $date = common::date($langmessage['strftime_datetime'], $time);
     $message = sprintf($langmessage['viewing_revision'], $date);
     $message .= ' <span class="msg_buttons">';
     $message .= common::Link($this->title, $langmessage['Restore this revision'], 'cmd=UseRevision&time=' . $time, array('data-cmd' => 'cnreq'));
     $message .= common::Link($this->title, $langmessage['Revision History'], 'cmd=ViewHistory', array('data-cmd' => 'gpabox', 'class' => 'msg_view_history'));
     $message .= '</span>';
     msg($message);
 }
开发者ID:AndFer22,项目名称:Typesetter,代码行数:34,代码来源:editing_page.php


注:本文中的common::date方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。