本文整理汇总了PHP中History::getIdFromHash方法的典型用法代码示例。如果您正苦于以下问题:PHP History::getIdFromHash方法的具体用法?PHP History::getIdFromHash怎么用?PHP History::getIdFromHash使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类History
的用法示例。
在下文中一共展示了History::getIdFromHash方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clean
public function clean()
{
if (!isset($this->themeInfo)) {
return;
}
if (!isset($this->themeInfo->hash)) {
return;
}
// don't clean if in DB because it means someone has posted the archive previously, and maybe the current user tries to erase it.
if (USE_DB) {
$history = new History();
$id = $history->getIdFromHash($this->themeInfo->hash);
if (!empty($id)) {
return;
}
}
$zipfilepath = self::hashToPathUpload($this->themeInfo->hash);
$unzippath = TC_ROOTDIR . '/../themecheck_vault/unzip/' . $this->themeInfo->hash;
$unzippath_parent = TC_ROOTDIR . '/../themecheck_vault/unzip/' . $this->themeInfo->hash . '_tc_parentzip';
if (file_exists($zipfilepath)) {
unlink($zipfilepath);
}
if (file_exists($unzippath)) {
ListDirectoryFiles::recursiveRemoveDir($unzippath);
}
if (file_exists($unzippath_parent)) {
ListDirectoryFiles::recursiveRemoveDir($unzippath_parent);
}
}
示例2: render
public function render()
{
if (UserMessage::getCount(ERRORLEVEL_FATAL) == 0 && $this->fileValidator) {
?>
<div class="container">
<br/>
<?php
$themeInfo = $this->fileValidator->themeInfo;
?>
<div class="row text-center">
<div><img style="box-shadow: 0 0 20px #DDD;" src="<?php
echo TC_HTTPDOMAIN . '/' . $themeInfo->hash . '/thumbnail.png';
?>
"></div>
<h1><?php
printf(__("Validation results for <strong>%s</strong>"), htmlspecialchars($themeInfo->zipfilename, defined('ENT_HTML5') ? ENT_QUOTES | ENT_HTML5 : ENT_QUOTES));
?>
</h1>
</div>
<?php
if ($this->fileValidator->themeInfo->isThemeForest) {
?>
<ul class="nav nav-tabs">
<li class="active"><a href="#standard" data-toggle="tab"><?php
echo __("Themecheck rules") . " : ";
$score = $this->fileValidator->themeInfo->score;
$color = 'ff1427';
if ($score > 95) {
$color = 'cbd715';
} else {
if ($score > 80) {
$color = 'ff8214';
}
}
echo '<span style="color:#' . $color . '">' . intval($score) . ' %</span>';
?>
</a></li>
<li><a href="#themeforest" data-toggle="tab"><?php
echo __("Themeforest rules") . " : ";
$score = $this->fileValidator->themeInfo_themeforest->score;
$color = 'ff1427';
if ($score > 95) {
$color = 'cbd715';
} else {
if ($score > 80) {
$color = 'ff8214';
}
}
echo '<span style="color:#' . $color . '">' . intval($score) . ' %</span>';
?>
</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="standard"><?php
$this->renderRulesSet($this->fileValidator->themeInfo, $this->validationResults);
?>
</div>
<div class="tab-pane" id="themeforest"><br/><?php
echo __('This is a ThemeForest theme. Since Themeforest items are all checked by a human before they appear on their website, ThemeForest verification rules are more permissive than themecheck's and can give a better verification score ( <a href="http://support.envato.com/index.php?/Knowledgebase/Article/View/472/85/wordpress-theme-submission-requirements" rel="nofollow">Themeforest requirements</a> ).');
$this->renderRulesSet($this->fileValidator->themeInfo_themeforest, $this->fileValidator->getValidationResultsThemeForest(I18N::getCurLang()));
?>
</div>
</div>
<?php
} else {
$this->renderRulesSet($this->fileValidator->themeInfo, $this->validationResults);
}
?>
</div>
<div class="container">
<div id="disqus_thread" style="margin-top:60px"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'themecheck'; // required: replace example with your forum shortname
var disqus_url = '<?php
echo $this->samepage_i18n[I18N::getCurLang()];
?>
';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink" rel="nofollow">comments powered by <span class="logo-disqus">Disqus</span></a>
<?php
if (USE_DB) {
echo '<hr>';
echo '<h2 style="line-height:100px;color:#888">' . __("Other files checked around the same date") . '</h2>';
$history = new History();
$id = intval($history->getIdFromHash($themeInfo->hash));
for ($i = 1; $i > -4; $i--) {
if ($i == 0) {
$i--;
}
//.........这里部分代码省略.........