Example #1
0
 /**
  * Constructor. Sets up the tag list.
  *
  * @param	bool		Whether to append customer user tags to the tag list
  */
 public function __construct($appendCustomTags = true, $appendSessionHashToImage = false)
 {
     if (!self::$initialized) {
         $response = vB_Api::instanceInternal('bbcode')->initInfo();
         self::$defaultTags = $response['defaultTags'];
         self::$customTags = $response['customTags'];
         self::$defaultOptions = $response['defaultOptions'];
         self::$smilies = $response['smilies'];
         self::$censorship = $response['censorship'];
         self::$sessionUrl = $response['sessionUrl'];
         self::$blankAsciiStrip = $response['blankAsciiStrip'];
         self::$wordWrap = $response['wordWrap'];
         self::$bbUrl = $response['bbUrl'];
         self::$viewAttachedImages = $response['viewAttachedImages'];
         self::$urlNoFollow = $response['urlNoFollow'];
         self::$urlNoFollowWhiteList = $response['urlNoFollowWhiteList'];
         self::$vBHttpHost = $response['vBHttpHost'];
         self::$useFileAvatar = $response['useFileAvatar'];
         self::$sigpicUrl = $response['sigpicUrl'];
         $options = vB::getDatastore()->getValue('options');
         self::$baseurl = preg_replace("#/?core/?\$#", '', $options['bburl']);
         self::$baseurl_core = $options['bburl'];
         self::$frontendurl = $options['frontendurl'];
         self::$initialized = true;
     }
     $this->tag_list = self::$defaultTags;
     if ($appendCustomTags) {
         $this->tag_list = vB_Array::arrayReplaceRecursive($this->tag_list, self::$customTags);
     }
     if (!empty($appendSessionHashToImage)) {
         $session = vB::getCurrentSession();
         if (!empty($session)) {
             $sessionHash = $session->get('dbsessionhash');
             if (!empty($sessionHash)) {
                 // This is going to be part of a URL
                 $this->sessionSuffix = '&s=' . urlencode($sessionHash);
             }
         }
     }
     // Legacy Hook 'bbcode_create' Removed //
 }