コード例 #1
0
    /// <summary>
    /// Initializes the control properties
    /// </summary>
    protected override void SetupControl()
    {
        if (StopProcessing)
        {
            // Do not process
        }
        else
        {
            if (UseHTML5)
            {
                StringBuilder sb = new StringBuilder();
                sb.Append("<div class=\"fb-facepile\" data-href=\"", URLHelper.EncodeQueryString(FBPageUrl),
                          "\" data-size=\"", Size, "\" data-max-rows=\"", RowsNumber, "\" data-width=\"",
                          Width, "\" data-colorscheme=\"", ColorScheme, "\"></div>");

                string fbApiKey = FacebookConnectHelper.GetFacebookApiKey(SiteContext.CurrentSiteName);
                if (String.IsNullOrEmpty(fbApiKey))
                {
                    ShowError(lblErrorMessage, "socialnetworking.facebook.apikeynotset");
                }
                // Register Facebook javascript SDK
                ScriptHelper.RegisterFacebookJavascriptSDK(Page, LocalizationContext.PreferredCultureCode, fbApiKey);
                ltlFacePile.Text = sb.ToString();
            }
            else
            {
                // Iframe code
                string query = null;
                string src   = "http://www.facebook.com/plugins/facepile.php";

                query = URLHelper.AddUrlParameter(query, "href", URLHelper.EncodeQueryString(FBPageUrl));
                query = URLHelper.AddUrlParameter(query, "size", Size);
                query = URLHelper.AddUrlParameter(query, "width", Width.ToString());
                query = URLHelper.AddUrlParameter(query, "max_rows", RowsNumber.ToString());
                query = URLHelper.AddUrlParameter(query, "colorscheme", ColorScheme);

                src = URLHelper.EncodeQueryString(URLHelper.AppendQuery(src, query));

                ltlFacePile.Text  = "<iframe src=\"" + src + "\"";
                ltlFacePile.Text += " scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:" + Width + "px;\"></iframe>";
            }
        }
    }
コード例 #2
0
    /// <summary>
    /// Initializes the control properties
    /// </summary>
    protected void SetupControl()
    {
        if (StopProcessing)
        {
            // Do not process
        }
        else
        {
            if (UseHTML5)
            {
                StringBuilder sb = new StringBuilder();
                sb.Append("<div class=\"fb-facepile\" data-href=\"", URLHelper.EncodeQueryString(FBPageUrl),
                          "\" data-size=\"", Size, "\" data-max-rows=\"", RowsNumber, "\" data-width=\"",
                          Width, "\" data-colorscheme=\"", ColorScheme, "\"></div>");

                // Register Facebook javascript SDK
                ScriptHelper.RegisterFacebookJavascriptSDK(Page, CMSContext.PreferredCultureCode);
                ltlLikeBox.Text = sb.ToString();
            }
            else
            {
                // Iframe code
                string query = null;
                string src   = "http://www.facebook.com/plugins/facepile.php";

                query = URLHelper.AddUrlParameter(query, "href", URLHelper.EncodeQueryString(FBPageUrl));
                query = URLHelper.AddUrlParameter(query, "size", Size);
                query = URLHelper.AddUrlParameter(query, "width", Width.ToString());
                query = URLHelper.AddUrlParameter(query, "max_rows", RowsNumber.ToString());
                query = URLHelper.AddUrlParameter(query, "colorscheme", ColorScheme);

                src = URLHelper.EncodeQueryString(URLHelper.AppendQuery(src, query));

                ltlLikeBox.Text  = "<iframe src=\"" + src + "\"";
                ltlLikeBox.Text += " scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:" + Width + "px;\"></iframe>";
            }
        }
    }