當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GDSRHelper::remaining_time_parts方法代碼示例

本文整理匯總了PHP中GDSRHelper::remaining_time_parts方法的典型用法代碼示例。如果您正苦於以下問題:PHP GDSRHelper::remaining_time_parts方法的具體用法?PHP GDSRHelper::remaining_time_parts怎麽用?PHP GDSRHelper::remaining_time_parts使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在GDSRHelper的用法示例。


在下文中一共展示了GDSRHelper::remaining_time_parts方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: render_srt

 function render_srt($template, $rating, $unit_count, $votes, $id, $time_restirctions = "N", $time_remaining = 0, $time_date = '')
 {
     if (($time_restirctions == 'D' || $time_restirctions == 'T') && $time_remaining > 0) {
         $time_parts = GDSRHelper::remaining_time_parts($time_remaining);
         $time_total = GDSRHelper::remaining_time_total($time_remaining);
         $tpl = $template->elm["time_active"];
         $rt = html_entity_decode($tpl);
         $rt = str_replace('%TR_DATE%', $time_date, $rt);
         $rt = str_replace('%TR_YEARS%', $time_parts["year"], $rt);
         $rt = str_replace('%TR_MONTHS%', $time_parts["month"], $rt);
         $rt = str_replace('%TR_DAYS%', $time_parts["day"], $rt);
         $rt = str_replace('%TR_HOURS%', $time_parts["hour"], $rt);
         $rt = str_replace('%TR_MINUTES%', $time_parts["minute"], $rt);
         $rt = str_replace('%TR_SECONDS%', $time_parts["second"], $rt);
         $rt = str_replace('%TOT_DAYS%', $time_total["day"], $rt);
         $rt = str_replace('%TOT_HOURS%', $time_total["hour"], $rt);
         $rt = str_replace('%TOT_MINUTES%', $time_total["minute"], $rt);
     } else {
         if ($time_restirctions == 'D' || $time_restirctions == 'T') {
             $tpl = $template->elm["time_closed"];
         } else {
             $tpl = $template->elm["normal"];
         }
         $rt = html_entity_decode($tpl);
     }
     $rt = str_replace('%RATING%', $rating, $rt);
     $rt = str_replace('%MAX_RATING%', $unit_count, $rt);
     $rt = str_replace('%VOTES%', $votes, $rt);
     $rt = str_replace('%ID%', $id, $rt);
     $word_votes = $template->dep["EWV"];
     $tense = $votes == 1 ? $word_votes->elm["singular"] : $word_votes->elm["plural"];
     $rt = str_replace('%WORD_VOTES%', __($tense), $rt);
     return $rt;
 }
開發者ID:alvaropereyra,項目名稱:shrekcms,代碼行數:34,代碼來源:gd-star-render-t2.php


注:本文中的GDSRHelper::remaining_time_parts方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。