예제 #1
0
파일: Base.php 프로젝트: iversia/3ps_cmfu
 public static function helperUserTitle($user, $allowCustomTitle = true, $withBanner = false)
 {
     $result = parent::helperUserTitle($user, $allowCustomTitle, $withBanner);
     $options = unserialize($user["3ps_cmfu_options"]);
     if (!$options) {
         $options = ThreePointStudio_CustomMarkupForUser_Constants::$defaultOptionsArray;
         XenForo_Model::create("XenForo_Model_User")->insertDefaultCustomMarkup($user["user_id"]);
     }
     if (empty($user["user_id"]) || empty($result)) {
         $html = "{inner}";
     } else {
         $html = ThreePointStudio_CustomMarkupForUser_Helpers::getCustomMarkupHtml($options, "usertitle", $user);
     }
     $finalHTML = str_replace("{inner}", $result, $html);
     return $finalHTML;
 }
예제 #2
0
파일: User.php 프로젝트: iversia/3ps_cmfu
 public function rebuildCustomMarkupCache($userId, $category = null)
 {
     $user = $this->getUserById($userId);
     $options = unserialize($user["3ps_cmfu_options"]);
     /* @var $dr XenForo_Model_DataRegistry */
     $dr = self::create("XenForo_Model_DataRegistry");
     $extraClasses = ThreePointStudio_CustomMarkupForUser_TemplateHelpers::getUserExtraClasses($user);
     if ($category) {
         if (!in_array($category, ThreePointStudio_CustomMarkupForUser_Constants::$categories)) {
             throw new UnexpectedValueException("Unknown category");
         }
         $dr->set("3ps_cmfu_render_cache_" . $userId . "_" . $category, ThreePointStudio_CustomMarkupForUser_Helpers::getCustomMarkupHtml($options, $category, $user, $category == "username" ? $extraClasses : array()));
     } else {
         foreach (ThreePointStudio_CustomMarkupForUser_Constants::$categories as $category) {
             $dr->set("3ps_cmfu_render_cache_" . $userId . "_" . $category, ThreePointStudio_CustomMarkupForUser_Helpers::getCustomMarkupHtml($options, $category, $user, $category == "username" ? $extraClasses : array()));
         }
     }
 }