Example #1
0
 private function getThumb($themeInfo)
 {
     $html = '';
     $namesanitized = $themeInfo['namesanitized'];
     $themetype = $themeInfo['themetype'];
     $score = $themeInfo['score'];
     $cmsVersion = $themeInfo['cmsVersion'];
     $themetype_text = '';
     //sprintf(__("Wordpress %s theme"),$themeInfo['cmsVersion']);
     //	if ($themetype == TT_JOOMLA) $themetype_text = sprintf(__("Joomla %s template"), $themeInfo['cmsVersion']);
     if ($themetype == TT_WORDPRESS) {
         if (empty($cmsVersion)) {
             $themetype_text = __("Wordpress theme");
         } else {
             $themetype_text = sprintf(__("Wordpress %s theme"), $cmsVersion);
         }
     } else {
         if ($themetype == TT_WORDPRESS_CHILD) {
             if (empty($cmsVersion)) {
                 $themetype_text = __("Wordpress child theme");
             } else {
                 $themetype_text = sprintf(__("Wordpress %s child theme"), $cmsVersion);
             }
         } else {
             if ($themetype == TT_JOOMLA) {
                 if (empty($cmsVersion)) {
                     $themetype_text = __("Joomla template");
                 } else {
                     $themetype_text = sprintf(__("Joomla %s template"), $cmsVersion);
                 }
             }
         }
     }
     $url = TC_HTTPDOMAIN . '/' . Route::getInstance()->assemble(array("lang" => I18N::getCurLang(), "phpfile" => "results", "namesanitized" => $namesanitized, "themetype" => $themetype));
     $html .= '<div class="validated-theme" data-id="' . $themeInfo['id'] . '">';
     $html .= '<a href="' . $url . '" ><img style="box-shadow: 0 0 20px #DDD;" src="' . TC_HTTPDOMAIN . '/' . $themeInfo['hash'] . '/thumbnail.png"></a>';
     $html .= '<div class="vts">';
     if ($themeInfo["isThemeForest"]) {
         $html .= '<img src="img/logo_themeforest18.png" style="margin-right:2px;float:left;" title="' . __("Themeforest theme") . '" alt="' . __("Themeforest icon") . '">';
     }
     $html .= '<div class="dshield">';
     $html .= getShield($themeInfo, I18N::getCurLang(), 40, $url, TC_HTTPDOMAIN . '/');
     $html .= '</div>';
     if ($themeInfo["isThemeForest"]) {
         $html .= '<span class="stext">' . htmlspecialchars($themeInfo['name']) . '</span><br/><span style="font-size : 12px; color:#AAA;">' . $themetype_text . '</span>';
     } else {
         $html .= '<span class="stext" style="width:170px;">' . htmlspecialchars($themeInfo['name']) . '</span><br/><span style="font-size : 12px; color:#AAA;">' . $themetype_text . '</span>';
     }
     $html .= '</div>';
     $html .= '</div>';
     return $html;
 }
Example #2
0
function displayShield($themeInfo, $lang, $size, $href, $rootdir)
{
    echo getShield($themeInfo, $lang, $size, $href, $rootdir);
}
Example #3
0
    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&#39;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--;
                    }
                    // not the current one
                    $r = $history->getFewInfo($id + $i);
                    if ($r !== false) {
                        $html = '';
                        $namesanitized = $r['namesanitized'];
                        $themetype = $r['themetype'];
                        $score = $r['score'];
                        $themetype_text = sprintf(__("Wordpress %s theme"), $r['cmsVersion']);
                        if ($themetype == TT_JOOMLA) {
                            $themetype_text = sprintf(__("Joomla %s template"), $r['cmsVersion']);
                        }
                        $url = TC_HTTPDOMAIN . '/' . Route::getInstance()->assemble(array("lang" => I18N::getCurLang(), "phpfile" => "results", "namesanitized" => $namesanitized, "themetype" => $themetype));
                        $html .= '<div style="width:220px;height:220px;display:inline-block;text-align:center;margin:10px 32px">';
                        $html .= '<a href="' . $url . '" ><img style="box-shadow: 0 0 20px #DDD;" src="' . TC_HTTPDOMAIN . '/' . $r['hash'] . '/thumbnail.png"></a>';
                        $html .= '<div style="width:220px;height:40px;margin:3px 0 0 0;text-align:left;line-height:18px;padding:0 7px;overflow:hidden;white-space:nowrap;font-size : 12px;">';
                        $html .= '<div style="width:33px;height:40px;float:right;">';
                        $html .= getShield($r, I18N::getCurLang(), 40, $url, TC_HTTPDOMAIN . '/');
                        $html .= '</div>';
                        $html .= htmlspecialchars($r['name']) . '<br/><span style="font-size : 12px; color:#AAA;">' . $themetype_text . '</span>';
                        $html .= '</div>';
                        $html .= '</div>';
                        echo $html;
                    }
                }
                //	$themetype = $r['themetype'];
                //	$score = $r['score'];
            }
        } else {
            if (UserMessage::getCount(ERRORLEVEL_FATAL) > 0) {
                ?>
			<div class="container">
				<br/>
					<div class="row text-center">
							<h1><?php 
                printf(__("Validation results"));
                ?>
</h1>
					</div>
					<div class="row text-center" style="color:#888;font-weight:normal;margin:30px 0 0 0;background:#F8F8F8;border-radius: 3px;">

						<br/>
						<?php 
                $img = 'shieldred240.png';
                $color = 'ff1418';
                $text = __("Validation score : 0 %");
                ?>
								<div class="shield1" style="width:201px;height:240px;background-image:url(<?php 
                echo TC_HTTPDOMAIN;
                ?>
/img/<?php 
                echo $img;
                ?>
);" title="<?php 
                echo $text;
                ?>
">
										<div class="shield2" style="color:#<?php 
                echo $color;
                ?>
;">0</div>	
								</div>
								<?php 
                echo '<p "color:#' . $color . '">' . __("Validation score : 0 %") . '</p>';
                $userMessage = UserMessage::getInstance();
                echo '<div style="margin:5% 10%">' . __("Fatal error") . '<br>' . UserMessage::getInstance()->getMessagesHtml() . '</div>';
                ?>
								<p><?php 
                echo '<a href="' . TC_HTTPDOMAIN . '/' . Route::getInstance()->assemble(array("lang" => I18N::getCurLang(), "phpfile" => "index.php")) . '">' . __("Go to home page to submit a new version") . '</a>';
                ?>
</p>
								<br/>
					</div>
<?php 
            } else {
                $userMessage = UserMessage::getInstance();
                echo '<div class="container">' . UserMessage::getInstance()->getMessagesHtml() . '</div>';
                ?>
					<div class="jumbotron">
						<div class="container">
							<h1><?php 
                echo __('Please send us a theme to check.');
                ?>
</h1>
							<p><?php 
                echo '<a href="' . TC_HTTPDOMAIN . '/' . Route::getInstance()->assemble(array("lang" => I18N::getCurLang(), "phpfile" => "index.php")) . '">' . __("Go to home page") . '</a>&nbsp;';
                ?>
</p>
						</div>
					</div>

					<div class="container">
				<br/>
				<?php 
            }
        }
        ?>
		</div> <!-- /container --> 
		<?php 
    }