Exemple #1
0
        public static void Initialize(IDatabaseAccess access)
        {
            DatabaseAccess = access;

            Account = new Account();
            Character = new Character();
            Clan = new Clan();
            Convoy = new Convoy();
            Item = new Item();
            Realmlist = new Realmlist();
            Social = new Social();
            Vehicle = new Vehicle();
        }
    string makeUrl(Social social)
    {
        string template = string.Empty;
        switch (social)
        {
            case Social.VK:
                template = vkTemplate;
                break;
            case Social.Facebook:
                template = facebookTemplate;
                break;
            case Social.Twitter:
                template = twitterTemplate;
                break;
            case Social.Odnoklassniki:
                template = odnoklassnikiTemplate;
                break;
            default:
                break;
        }

        return string.Format(template, EscapeURL(Title), EscapeURL(Description), EscapeURL(Image), EscapeURL(URL));
    }
Exemple #3
0
 public static void PostScore(string leaderboardID, float score)
 {
     Social.ReportScore((long)score, leaderboardID, success => { });
 }
 public static void UnlockAchievement(string id)
 {
     Social.ReportProgress(id, 100, success => { });
 }
        private static Message ConvertCoreMessageToServicesMessage(int PortalID, int UserID, MessageRecipient coreMessageRecipeint, Social.Messaging.Message coreMessage)
        {
            var message = new Message { AllowReply = true, Body = coreMessage.Body, FromUserID = coreMessage.SenderUserID, MessageDate = coreMessage.CreatedOnDate, PortalID = PortalID };

            switch (coreMessageRecipeint.Read)
            {
                case true:
                    message.Status = MessageStatusType.Read;
                    break;
                case false:
                    message.Status = MessageStatusType.Unread;
                    break;
            }

            message.ToUserID = UserID;
            return message;
        }
 public void UpdateHonorableDefenderAchievement()
 {
     Social.ReportProgress(GooglePlayIds.achievement_honorable_defender, 100.0, OnProgressAchievement);
     Debug.Log("Gave honorable defender achievement");
 }
Exemple #7
0
    public void OnAddAchievement(string achieveID)
    {
        if (!SystemManager.Instance.isGPSCheck)
        {
            Debug.Log("구글 로그인이 되지 않았습니다.");
            return;
        }
        switch (achieveID)
        {
        case "Start":
            Social.ReportProgress(GPGSIds.achievement, 100.0f, (bool bSuccess) =>
            {
                if (bSuccess)
                {
                    Debug.Log("Start AddAchievement Success");
                }
                else
                {
                    Debug.Log("Start AddAchievement Fall");
                }
            });
            break;

        case "Chapter1":
            Social.ReportProgress(GPGSIds.achievement_2, 100.0f, (bool bSuccess) =>
            {
                if (bSuccess)
                {
                    Debug.Log("1 Stage AddAchievement Success");
                }
                else
                {
                    Debug.Log("1 Stage AddAchievement Fall");
                }
            });
            break;

        case "Chapter2":
            Social.ReportProgress(GPGSIds.achievement_3, 100.0f, (bool bSuccess) =>
            {
                if (bSuccess)
                {
                    Debug.Log("2 Stage AddAchievement Success");
                }
                else
                {
                    Debug.Log("2 Stage AddAchievement Fall");
                }
            });
            break;

        case "Chapter3":
            Social.ReportProgress(GPGSIds.achievement_4, 100.0f, (bool bSuccess) =>
            {
                if (bSuccess)
                {
                    Debug.Log("3 Stage AddAchievement Success");
                }
                else
                {
                    Debug.Log("3 Stage AddAchievement Fall");
                }
            });
            break;
        }
    }
Exemple #8
0
 //method untuk unlock Achievement
 public void UnlockAchievement(int id)      //memiliki parameter "id" untuk membedakan achievement yang akan di Unlock
 {
     if (Social.localUser.authenticated)    //jika sudah login
     {
         if (id == 1)
         {
             Social.ReportProgress(achievement_selamatDatang, 100.0f, (bool success) =>                 //unlock achievement selamat belajar sebanyak 100%
             {
                 if (success)
                 {
                     Debug.Log("Added");
                 }
                 else
                 {
                     Debug.Log("Fail");
                 }
             });
         }
         if (id == 2)
         {
             Social.ReportProgress(achievement_menjawabBenar, 100.0f, (bool success) =>                 //unlock achievement selamat belajar sebanyak 100%
             {
                 if (success)
                 {
                     Debug.Log("Added");
                 }
                 else
                 {
                     Debug.Log("Fail");
                 }
             });
         }
         if (id == 3)
         {
             Social.ReportProgress(achievement_menjawabSalah, 100.0f, (bool success) =>                 //unlock achievement selamat belajar sebanyak 100%
             {
                 if (success)
                 {
                     Debug.Log("Added");
                 }
                 else
                 {
                     Debug.Log("Fail");
                 }
             });
         }
         if (id == 4)
         {
             Social.ReportProgress(achievement_hilangkanAngka, 100.0f, (bool success) =>                 //unlock achievement selamat belajar sebanyak 100%
             {
                 if (success)
                 {
                     Debug.Log("Added");
                 }
                 else
                 {
                     Debug.Log("Fail");
                 }
             });
         }
         if (id == 5)
         {
             Social.ReportProgress(achievement_menang, 100.0f, (bool success) =>                 //unlock achievement selamat belajar sebanyak 100%
             {
                 if (success)
                 {
                     Debug.Log("Added");
                 }
                 else
                 {
                     Debug.Log("Fail");
                 }
             });
         }
     }
 }
 public void GiveGettingStartedAchievement()
 {
     Social.ReportProgress(GooglePlayIds.achievement_getting_started, 100.0, OnProgressAchievement);
     Debug.Log("Gave getting started achievement");
 }
Exemple #10
0
        private void SaveQuickReply()
        {
            int iFloodInterval = MainSettings.FloodInterval;
            if (iFloodInterval > 0)
            {
                UserProfileController upc = new UserProfileController();
                UserProfileInfo upi = upc.Profiles_Get(SiteId, InstanceId, this.UserId);
                if (upi != null)
                {
                    if (SimulateDateDiff.DateDiff(SimulateDateDiff.DateInterval.Second, upi.DateLastPost, DateTime.Now) < iFloodInterval)
                    {
                        Controls.InfoMessage im = new Controls.InfoMessage();
                        im.Message = "<div class=\"afmessage\">" + string.Format(Utilities.GetSharedResource("[RESX:Error:FloodControl]"), iFloodInterval) + "</div>";
                        plhMessage.Controls.Add(im);
                        return;
                    }
                }
            }
            //TODO: Fix for anon
            //If Not Current.Request.IsAuthenticated Then
            //    If Not ctlCaptcha.IsValid Or txtUserName.Value = "" Then
            //        Exit Sub
            //    End If
            //End If
            //Dim ui As New UserProfileInfo
            //If UserId > 0 Then
            //    Dim upc As New UserProfileController
            //    ui = upc.Profiles_Get(PortalId, ForumModuleId, UserId)
            //Else
            //    ui.TopicCount = 0
            //    ui.ReplyCount = 0
            //    ui.RewardPoints = 0
            //    ui.IsMod = False
            //    ui.TrustLevel = -1

            //End If
            ForumController fc = new ForumController();
            Forum forumInfo = fc.Forums_Get(SiteId, InstanceId, ForumId, this.UserId, true, false, TopicId);
            bool UserIsTrusted = false;
            UserIsTrusted = Utilities.IsTrusted((int)forumInfo.DefaultTrustValue, ControlConfig.User.TrustLevel, Permissions.HasPerm(forumInfo.Security.Trust, ForumUser.UserRoles), forumInfo.AutoTrustLevel, ControlConfig.User.PostCount);
            bool isApproved = false;
            isApproved = Convert.ToBoolean(((forumInfo.IsModerated == true) ? false : true));
            if (UserIsTrusted || Permissions.HasPerm(forumInfo.Security.ModApprove, ForumUser.UserRoles))
            {
                isApproved = true;
            }
            ReplyInfo ri = new ReplyInfo();
            Data.Topics db = new Data.Topics();
            //im rc As New ReplyController
            int ReplyId = -1;
            string sUsername = string.Empty;
            if (HttpContext.Current.Request.IsAuthenticated)
            {
                sUsername = ControlConfig.User.DisplayName;
            }
            else
            {
                sUsername = Utilities.CleanString(SiteId, txtUserName.Value, false, EditorTypes.TEXTBOX, true, false, InstanceId, ThemePath, false);
            }

            string sBody = string.Empty;
            //TODO: Check for allowhtml
            bool allowHtml = false;
            //If forumInfo.AllowHTML Then
            //    allowHtml = isHTMLPermitted(forumInfo.EditorPermittedUsers, IsTrusted, forumInfo.Security.ModEdit)
            //End If
            sBody = Utilities.CleanString(SiteId, HttpContext.Current.Request.Form["txtBody"], allowHtml, EditorTypes.TEXTBOX, forumInfo.UseFilter, forumInfo.AllowScript, InstanceId, ThemePath, forumInfo.AllowEmoticons);
            DateTime createDate = DateTime.Now;
            ri.TopicId = TopicId;
            ri.ReplyToId = TopicId;
            ri.Content.AuthorId = UserId;
            ri.Content.AuthorName = sUsername;
            ri.Content.Body = sBody;
            ri.Content.DateCreated = createDate;
            ri.Content.DateUpdated = createDate;
            ri.Content.IsDeleted = false;
            ri.Content.Subject = Subject;
            ri.Content.Summary = string.Empty;
            ri.IsApproved = isApproved;
            ri.IsDeleted = false;
            ri.Content.IPAddress = HttpContext.Current.Request.UserHostAddress;
            ReplyId = db.Reply_Save(ri);
            //Check if is subscribed
            if (HttpContext.Current.Request.Params["chkSubscribe"] != null)
            {
                if (HttpContext.Current.Request.Params["chkSubscribe"] == "1" && UserId > 0)
                {
                    if (!(Subscriptions.IsSubscribed(SiteId, InstanceId, ForumId, TopicId, SubscriptionTypes.Instant, UserId)))
                    {
                        //TODO: Fix Subscriptions
                        //Dim sc As New Data.Tracking
                        //sc.Subscription_Update(SiteId, InstanceId, ForumId, TopicId, 1, UserId)
                    }
                }
            }
            if (isApproved)
            {
                //Send Subscriptions
                try
                {
                    string sURL = Utilities.NavigateUrl(PageId, "", new string[] { ParamKeys.ForumId + "=" + ForumId, ParamKeys.ViewType + "=" + Views.Topic, ParamKeys.TopicId + "=" + TopicId, ParamKeys.ContentJumpId + "=" + ReplyId });
                    Subscriptions.SendSubscriptions(SiteId, InstanceId, PageId, ForumId, TopicId, ReplyId, UserId);

#if !SKU_LITE
                    try
                    {
                        Social oSocial = new Social();
                        oSocial.AddForumItemToJournal(SiteId, InstanceId, UserId, "forumreply", sURL, Subject, sBody);
                    }
                    catch (Exception ex)
                    {
                        DotNetNuke.Services.Exceptions.Exceptions.LogException(ex);
                    }

#endif
                }
                catch (Exception ex)
                {
                    DotNetNuke.Services.Exceptions.Exceptions.ProcessModuleLoadException(this, ex);
                }
                //Redirect to show post
                string fullURL = Utilities.NavigateUrl(PageId, "", new string[] { ParamKeys.ForumId + "=" + ForumId, ParamKeys.ViewType + "=" + Views.Topic, ParamKeys.TopicId + "=" + TopicId, ParamKeys.ContentJumpId + "=" + ReplyId });
                HttpContext.Current.Response.Redirect(fullURL, false);
            }
            else if (isApproved == false)
            {
                Email.SendEmailToModerators(forumInfo.ModNotifyTemplateId, SiteId, ForumId, ri.TopicId, ReplyId, InstanceId, PageId, string.Empty);
                string[] Params = { ParamKeys.ForumId + "=" + ForumId, ParamKeys.ViewType + "=confirmaction", "afmsg=pendingmod", ParamKeys.TopicId + "=" + TopicId };
                HttpContext.Current.Response.Redirect(Utilities.NavigateUrl(PageId, "", Params), false);
            }
            else
            {
                string fullURL = Utilities.NavigateUrl(PageId, "", new string[] { ParamKeys.ForumId + "=" + ForumId, ParamKeys.ViewType + "=" + Views.Topic, ParamKeys.TopicId + "=" + TopicId, ParamKeys.ContentJumpId + "=" + ReplyId });

#if !SKU_LITE
                try
                {
                    Modules.ActiveForums.Social oSocial = new Modules.ActiveForums.Social();
                    oSocial.AddForumItemToJournal(SiteId, InstanceId, UserId, "forumreply", fullURL, Subject, sBody);
                }
                catch (Exception ex)
                {
                    DotNetNuke.Services.Exceptions.Exceptions.LogException(ex);
                }

#endif
                HttpContext.Current.Response.Redirect(fullURL, false);
            }

            //End If


        }
    bool compute_achievements()
    {
                #if USE_MOBILE_LEADERBOARD
        int achievementState = 0;
        int keyValue         = 0;
        int i = 0;
        if (achievements != null)                                                                                                               //are there Achievements?
        {
            foreach (achievement a in achievements)                                                                                             //for each of them

            {
                keyValue = readScoreFromPlayerprefs(a.scoreKey);

                if (keyValue >= a.MinScoreValue)                                                                //and test, if is reached
                {
                    achievementState = PlayerPrefs.GetInt(a.AchievementName + "_state");                        //and already reported.
                    a.__reached      = true;                                                                    //When it is reached
                    if (achievementState == 0 || a.__transmitted == true)                                       //and it is not already reported,
                    {
                        if (a.achievement_message != null)
                        {
                            setAchievmentText(a.achievement_message.text);                                                              //tell the congratulations to the user.
                        }
                        if (a.__transmitRequested == false)                                                                             //Then test, if there was a request for transmit

                        {
                            if (a.__transmitted == false)                                                                                               //and if it was transmitted.
                            {
                                                                #if UNITY_IOS
                                KTGameCenter.SharedCenter().SubmitAchievement(100, a.AchievementID, true);
                                                                #endif
                                                                #if             UNITY_ANDROID
                                Social.ReportProgress(a.AchievementID, 100.0f, (bool success) => {                                      //ok, then we can report it, but:
                                    // handle success or failure
                                    if (success)
                                    {
                                        PlayerPrefs.SetInt(a.AchievementName + "_state", 1);
                                        //achievement_reported = true;

                                        a.__transmitted = true;
                                    }
                                    else
                                    {
                                        //Debug.Log ("no");
                                    }

                                    a.__transmitted = true;
                                });
                                                                #endif
                                a.__transmitted       = true;
                                a.__transmitRequested = true;                                                                                           //memorize, we requested the transmit.
                            }
                            return(false);
                        }
                    }
                }
                i++;
            }
        }
        return(true);
                #else
        return(false);
                #endif
    }
    IEnumerator CheckFrameAchivements()
    {
        Social.LoadAchievements(achievements => {
            if (achievements != null && achievements.Length > 0)
            {
                foreach (IAchievement achievement in achievements)
                {
                    switch (achievement.id)
                    {
                    case GooglePlayActions.longLiveAchiev:
                        PlayerPrefs.SetInt("KingFrame", 1);
                        Debug.Log("KingFrame added");
                        break;

                    case GooglePlayActions.pioneerAchiev:
                        PlayerPrefs.SetInt("PinkFrame", 1);
                        Debug.Log("PinkFrame added");
                        break;

                    case GooglePlayActions.beginnerAdsAchiev:
                        PlayerPrefs.SetInt("MetallFrame", 1);
                        Debug.Log("MetallFrame added");
                        break;

                    case GooglePlayActions.intermAdsAchiev:
                        PlayerPrefs.SetInt("RainbowFrame", 1);
                        Debug.Log("RainbowFrame added");
                        break;

                    case GooglePlayActions.advancedAdsAchiev:
                        PlayerPrefs.SetInt("GotFrame", 1);
                        Debug.Log("GotFrame added");
                        break;

                    case GooglePlayActions.superAdvancedAdsAchiev:
                        PlayerPrefs.SetInt("CarpetFrame", 1);
                        Debug.Log("CarpetFrame added");
                        break;

                    case GooglePlayActions.mindBlowingAdsAchiev:
                        PlayerPrefs.SetInt("GoldenFrame", 1);
                        Debug.Log("GoldenFrame added");
                        break;

                    case GooglePlayActions.superhumanAchiev:
                        PlayerPrefs.SetInt("HeroFrame", 1);
                        Debug.Log("HeroFrame added");
                        break;

                    case GooglePlayActions.davidBlaineAchiev:
                        PlayerPrefs.SetInt("DragonFrame", 1);
                        Debug.Log("DragonFrame added");
                        break;
                    }
                }
            }
            else
            {
                Debug.Log("No achievements returned");
            }
        });
        yield return(null);
    }
Exemple #13
0
    private void EndHunt(bool isClear)
    {
        if (isClear)
        {
            // 클리어 했을 때
            if (DataController.Instance.finalHuntLevel == DataController.Instance.huntLevel)
            {
                RewardManager.Instance.ShowRewardPanel(
                    ruby[DataController.Instance.huntLevel], sapphire[DataController.Instance.huntLevel]);
            }
            else
            {
                RewardManager.Instance.ShowRewardPanel(
                    ruby[DataController.Instance.finalHuntLevel - 1], sapphire[DataController.Instance.finalHuntLevel - 1]);
            }

            if (DataController.Instance.finalHuntLevel == DataController.Instance.huntLevel)
            {
                // 마지막 사냥터 클리어 성공

                DataController.Instance.finalHuntLevel = DataController.Instance.huntLevel + 1;

                print(DataController.Instance.huntLevel + ", " + DataController.Instance.masterSkillIndex);

                if (DataController.Instance.huntLevel == DataController.Instance.masterSkillIndex)
                {
                    if (PlayerPrefs.GetFloat("FirstHuntClear", 0) == 0)
                    {
                        if (Social.localUser.authenticated)
                        {
                            Social.ReportProgress(GPGSIds.achievement_get_projectile, 100f, isSuccess =>
                            {
                                PlayerPrefs.SetFloat("FirstHuntClear", 1);
                            });
                        }
                    }

                    // 마지막 투사체 획득 시점에서 마지막 스테이지
                    print("엉");
                    BallImage.sprite =
                        Resources.Load("Ball1/ball" + (DataController.Instance.huntLevel + 1),
                                       typeof(Sprite)) as Sprite;
                    AvilityText.text = "공격력 + " + 20 * (DataController.Instance.huntLevel + 1) + "%";
                    GetBallPanel.SetActive(true);

                    DataController.Instance.masterSkillIndex = DataController.Instance.huntLevel + 1;
                    print(DataController.Instance.masterSkillIndex);

                    DataController.Instance.UpdateDamage();
                }


                print("마지막 스테이지 클리어");
            }


            PlayerPrefs.SetFloat("HuntCoolTime_" + DataController.Instance.huntLevel, 330);
        }
        else
        {
            RewardManager.Instance.ShowRewardPanel1(0, 0);
        }

        if (Social.localUser.authenticated)
        {
            DataController.Instance.MonsterKillSuccess();
        }
    }
Exemple #14
0
 public void GetBoardValue(string BoardID, string SaveKey)
 {
     Social.LoadScores(BoardID, (result) => {
         PlayerPrefs.SetInt(SaveKey, (int)result[0].value);
     });
 }
Exemple #15
0
 public void OnTap()
 {
     Social.ShowLeaderboardUI();
 }
 public void OnLeaderBoardClick()
 {
     Social.ShowLeaderboardUI();
 }
 void OnMouseUp()
 {
     Social.ShowLeaderboardUI();
 }
Exemple #18
0
        public string BuildForumView(int ForumTemplateId, int CurrentUserId, string ThemePath)
        {
            try
            {
                SettingsInfo MainSettings = DataCache.MainSettings(ModuleId);
                string       sOutput      = string.Empty;
                string       sTemplate;
                int          TemplateCache = MainSettings.TemplateCache;
                if (UseTemplatePath && TemplatePath != string.Empty)
                {
                    DisplayTemplate = Utilities.GetFileContent(TemplatePath + "ForumView.htm");
                    DisplayTemplate = Utilities.ParseSpacer(DisplayTemplate);
                }
                else if (DisplayTemplate == string.Empty)
                {
                    DisplayTemplate = Utilities.GetFileContent(Server.MapPath(ThemePath) + "templates/ForumView.ascx");
                    DisplayTemplate = Utilities.ParseSpacer(DisplayTemplate);
                }

                sTemplate = DisplayTemplate == string.Empty ? DataCache.GetCachedTemplate(TemplateCache, ModuleId, "ForumView", ForumTemplateId) : DisplayTemplate;
                try
                {
                    sTemplate = ParseControls(sTemplate);
                }
                catch (Exception ex)
                {
                    Services.Exceptions.Exceptions.ProcessModuleLoadException(this, ex);
                    sTemplate = ex.Message; //ParseControls(sTemplate)
                }
                if (sTemplate.Contains("[NOTOOLBAR]"))
                {
                    if (HttpContext.Current.Items.Contains("ShowToolbar"))
                    {
                        HttpContext.Current.Items["ShowToolbar"] = false;
                    }
                    else
                    {
                        HttpContext.Current.Items.Add("ShowToolbar", false);
                    }
                    sTemplate = sTemplate.Replace("[NOTOOLBAR]", string.Empty);
                }
                if (sTemplate.Contains("[FORUMS]"))
                {
                    string sGroupSection     = string.Empty;
                    string sGroupSectionTemp = TemplateUtils.GetTemplateSection(sTemplate, "[GROUPSECTION]", "[/GROUPSECTION]");
                    string sGroup            = TemplateUtils.GetTemplateSection(sTemplate, "[GROUP]", "[/GROUP]");
                    string sForums           = string.Empty;
                    string sForumTemp        = TemplateUtils.GetTemplateSection(sTemplate, "[FORUMS]", "[/FORUMS]");
                    string tmpGroup          = string.Empty;
                    //Dim reader As IDataReader = Nothing
                    if (ForumTable == null)
                    {
                        var ds = new DataSet();
                        dtForums = new DataTable();
                        var fc = new ForumController();
                        ForumTable = fc.GetForumView(PortalId, ModuleId, CurrentUserId, UserInfo.IsSuperUser, ForumIds); // KR - added cache retreival
                        //ds = DataProvider.Instance.UI_ForumView(PortalId, ModuleId, CurrentUserId, UserInfo.IsSuperUser, ForumIds)
                        //ForumTable = ds.Tables(0)
                    }
                    string sCrumb     = string.Empty;
                    string sGroupName = string.Empty;
                    //Dim ForumGroupId As Integer = 0
                    if (ForumGroupId != -1)
                    {
                        DataRow tmpDR = null;
                        ForumTable.DefaultView.RowFilter = "ForumGroupId = " + ForumGroupId;
                        if (ForumTable.DefaultView.ToTable().Rows.Count > 0)
                        {
                            tmpDR = ForumTable.DefaultView.ToTable().Rows[0];
                        }
                        if (tmpDR != null)
                        {
                            sGroupName = tmpDR["GroupName"].ToString();
                            sCrumb     = "<div class=\"afcrumb\"><a href=\"" + Utilities.NavigateUrl(TabId) + "\">[RESX:ForumMain]</a>[RESX:BreadCrumbSep]" + tmpDR["GroupName"] + "</div>";
                        }


                        //dtForums.DefaultView.RowFilter = ""
                    }
                    if (ParentForumId != -1)
                    {
                        //SubsOnly = True
                        DataRow tmpDR   = null;
                        string  sFilter = "ForumId = " + ParentForumId + " ";

                        ForumTable.DefaultView.RowFilter = sFilter;
                        if (ForumTable.DefaultView.ToTable().Rows.Count > 0)
                        {
                            tmpDR = ForumTable.DefaultView.ToTable().Rows[0];
                        }
                        ForumTable.DefaultView.RowFilter = "";
                        sGroupName = tmpDR["GroupName"].ToString();
                    }
                    if (MainSettings.UseSkinBreadCrumb && ForumTable.Rows.Count > 0 && SubsOnly == false && ForumGroupId != -1)
                    {
                        Environment.UpdateBreadCrumb(Page.Controls, "<a href=\"" + NavigateUrl(TabId, "", ParamKeys.GroupId + "=" + ForumGroupId) + "\">" + sGroupName + "</a>");
                        sTemplate = sTemplate.Replace("<div class=\"afcrumb\">[FORUMMAINLINK] > [FORUMGROUPLINK]</div>", string.Empty);
                        sTemplate = sTemplate.Replace("[BREADCRUMB]", string.Empty);
                    }
                    else
                    {
                        sTemplate = sTemplate.Replace("[BREADCRUMB]", sCrumb);
                    }

                    int       iForum     = 1;
                    int       ForumCount = 0;
                    bool      hasForums  = false;
                    DataTable rsForums   = ForumTable.DefaultView.ToTable();
                    Forum     fi;
                    int       tmpGroupCount = 0;
                    int       asForumGroupId;
                    var       social = new Social();
                    asForumGroupId = social.GetMasterForumGroup(PortalId, TabId);
                    int groupForumsCount = 0;
                    foreach (DataRow dr in rsForums.Rows)
                    {
                        //If CBool(dr("CanView")) Or (Not CBool(dr("GroupHidden"))) Then ' And Not CBool(dr("CanView"))) Or UserInfo.IsSuperUser Then
                        if (!(asForumGroupId == Convert.ToInt32(dr["ForumGroupId"]) && Convert.ToBoolean(dr["GroupHidden"])))
                        {
                            if (tmpGroup != dr["GroupName"].ToString())
                            {
                                if (tmpGroupCount < Globals.GroupCount)
                                {
                                    ForumTable.DefaultView.RowFilter = "ForumGroupId = " + Convert.ToInt32(dr["ForumGroupId"]) + " AND ParentForumId = 0";

                                    ForumCount = ForumTable.DefaultView.Count;
                                    ForumTable.DefaultView.RowFilter = "";
                                    if (sForums != string.Empty)
                                    {
                                        sGroupSection = TemplateUtils.ReplaceSubSection(sGroupSection, sForums, "[FORUMS]", "[/FORUMS]");
                                        sForums       = string.Empty;
                                    }
                                    int GroupId = Convert.ToInt32(dr["ForumGroupId"]);
                                    sGroupSectionTemp = TemplateUtils.GetTemplateSection(sTemplate, "[GROUPSECTION]", "[/GROUPSECTION]");
                                    sGroupSectionTemp = sGroupSectionTemp.Replace("[GROUPNAME]", dr["GroupName"].ToString());
                                    sGroupSectionTemp = sGroupSectionTemp.Replace("[FORUMGROUPID]", dr["ForumGroupId"].ToString());
                                    sGroupSectionTemp = sGroupSectionTemp.Replace("[GROUPCOLLAPSE]", "<img class=\"afarrow\" id=\"imgGroup" + GroupId.ToString() + "\" onclick=\"toggleGroup(" + GroupId.ToString() + ");\" src=\"" + ThemePath + GetImage(GroupId) + "\" alt=\"[RESX:ToggleGroup]\" />");

                                    //any replacements on the group
                                    string sNewGroup = "<div id=\"group" + GroupId + "\" " + GetDisplay(GroupId) + " class=\"afgroup\">" + sGroup + "</div>";
                                    sGroupSectionTemp = TemplateUtils.ReplaceSubSection(sGroupSectionTemp, sNewGroup, "[GROUP]", "[/GROUP]");
                                    sGroupSection    += sGroupSectionTemp;
                                    tmpGroup          = dr["GroupName"].ToString();
                                    tmpGroupCount    += 1;
                                    iForum            = 1;
                                }
                            }
                            if (iForum <= Globals.ForumCount)
                            {
                                fi = FillForumRow(dr);
                                bool canView = Permissions.HasPerm(fi.Security.View, ForumUser.UserRoles);
                                if (canView || (!fi.Hidden))
                                {
                                    sForumTemp = TemplateUtils.GetTemplateSection(sTemplate, "[FORUMS]", "[/FORUMS]");
                                    hasForums  = true;
                                    if (fi.ParentForumId == 0 || SubsOnly || (SubsOnly == false && fi.ParentForumId > 0 && rsForums.Rows.Count == 1))
                                    {
                                        sForumTemp = ParseForumRow(sForumTemp, fi, iForum, ThemePath, ForumCount);
                                        iForum    += 1;
                                        sForums   += sForumTemp;
                                    }
                                }
                            }
                        }



                        //End If
                    }

                    if (hasForums == false && SubsOnly)
                    {
                        return(string.Empty);
                    }
                    if (sForums != string.Empty)
                    {
                        sGroupSection = TemplateUtils.ReplaceSubSection(sGroupSection, sForums, "[FORUMS]", "[/FORUMS]");
                    }
                    sTemplate = sTemplate.Contains("[GROUPSECTION]") ? TemplateUtils.ReplaceSubSection(sTemplate, sGroupSection, "[GROUPSECTION]", "[/GROUPSECTION]") : sGroupSection;
                    sTemplate = TemplateUtils.ReplaceSubSection(sTemplate, string.Empty, "[FORUMS]", "[/FORUMS]");
                }


                return(sTemplate);
            }
            catch (Exception ex)
            {
                Services.Exceptions.Exceptions.LogException(ex);
                return(string.Empty);
            }
        }
    void checkScore()
    {
        int scoreVal = int.Parse(score.text);

        if (scoreVal == 10)
        {
            Social.ReportProgress("CgkI5aWmsr0QEAIQAg", 100.0f, (bool success) => {
            });
        }
        else if (scoreVal == 15)
        {
            Social.ReportProgress("CgkI5aWmsr0QEAIQDg", 100.0f, (bool success) => {
            });
        }
        else if (scoreVal == 25)
        {
            Social.ReportProgress("CgkI5aWmsr0QEAIQCQ", 100.0f, (bool success) => {
            });
        }
        else if (scoreVal == 50)
        {
            Social.ReportProgress("CgkI5aWmsr0QEAIQBA", 100.0f, (bool success) => {
            });
        }
        else if (scoreVal == 100)
        {
            Social.ReportProgress("CgkI5aWmsr0QEAIQAw", 100.0f, (bool success) => {
            });
        }
        else if (scoreVal == 150)
        {
            Social.ReportProgress("CgkI5aWmsr0QEAIQBQ", 100.0f, (bool success) => {
            });
        }
        else if (scoreVal == 250)
        {
            Social.ReportProgress("CgkI5aWmsr0QEAIQBg", 100.0f, (bool success) => {
            });
        }
        else if (scoreVal == 350)
        {
            Social.ReportProgress("CgkI5aWmsr0QEAIQBw", 100.0f, (bool success) => {
            });
        }
        else if (scoreVal == 450)
        {
            Social.ReportProgress("CgkI5aWmsr0QEAIQCA", 100.0f, (bool success) => {
            });
        }
        else if (scoreVal == 650)
        {
            Social.ReportProgress("CgkI5aWmsr0QEAIQCg", 100.0f, (bool success) => {
            });
        }
        else if (scoreVal == 750)
        {
            Social.ReportProgress("CgkI5aWmsr0QEAIQCw", 100.0f, (bool success) => {
            });
        }
        else if (scoreVal == 1000)
        {
            Social.ReportProgress("CgkI5aWmsr0QEAIQDA", 100.0f, (bool success) => {
            });
        }
    }
Exemple #20
0
 //업적보기
 public void OnShowAchivement()
 {
     Social.ShowAchievementsUI();
 }
Exemple #21
0
 //method membuka achievement
 public void bukaAchievement()
 {
     Social.ShowAchievementsUI();         //menampilkan activity achievement yang sudah kita raih
 }
 public void ShowAchievements()
 {
     Social.ShowAchievementsUI();
 }
 public void ShowAchivementsUI()
 {
     Debug.Log("Showing achievement UI");
     Social.ShowAchievementsUI();
 }
 public void ShowLeaderboards()
 {
     Social.ShowLeaderboardUI();
 }
 public void GiveRookieAchivement()
 {
     Social.ReportProgress(GooglePlayIds.achievement_rookie, 100.0, OnProgressAchievement);
     Debug.Log("Gave rookie achievement");
 }
 public void openUI()
 {
     BtnSound.Play();
     Social.ShowAchievementsUI();
 }
 public void OpenLeaderBoard()
 {
     Social.ShowLeaderboardUI();
 }
 public void AchievementClear(int number)
 {
     if (number == 2)
     {
         Social.ReportProgress(GPGSIds.achievement_2, 100, (bool success) => { });
     }
     else if (number == 3)
     {
         Social.ReportProgress(GPGSIds.achievement_3, 100, (bool success) => { });
     }
     else if (number == 4)
     {
         Social.ReportProgress(GPGSIds.achievement_4, 100, (bool success) => { });
     }
     else if (number == 5)
     {
         Social.ReportProgress(GPGSIds.achievement_5, 100, (bool success) => { });
     }
     else if (number == 6)
     {
         Social.ReportProgress(GPGSIds.achievement_6, 100, (bool success) => { });
     }
     else if (number == 7)
     {
         Social.ReportProgress(GPGSIds.achievement_7, 100, (bool success) => { });
     }
     else if (number == 8)
     {
         Social.ReportProgress(GPGSIds.achievement_8, 100, (bool success) => { });
     }
     else if (number == 9)
     {
         Social.ReportProgress(GPGSIds.achievement_9, 100, (bool success) => { });
     }
     else if (number == 10)
     {
         Social.ReportProgress(GPGSIds.achievement_10, 100, (bool success) => { });
     }
     else if (number == 11)
     {
         Social.ReportProgress(GPGSIds.achievement_11, 100, (bool success) => { });
     }
     else if (number == 12)
     {
         Social.ReportProgress(GPGSIds.achievement_12, 100, (bool success) => { });
     }
     else if (number == 13)
     {
         Social.ReportProgress(GPGSIds.achievement_13, 100, (bool success) => { });
     }
     else if (number == 14)
     {
         Social.ReportProgress(GPGSIds.achievement_14, 100, (bool success) => { });
     }
     else if (number == 15)
     {
         Social.ReportProgress(GPGSIds.achievement_15, 100, (bool success) => { });
     }
     else if (number == 16)
     {
         Social.ReportProgress(GPGSIds.achievement_16, 100, (bool success) => { });
     }
     else if (number == 17)
     {
         Social.ReportProgress(GPGSIds.achievement_17, 100, (bool success) => { });
     }
     else if (number == 18)
     {
         Social.ReportProgress(GPGSIds.achievement_18, 100, (bool success) => { });
     }
 }
    /// <summary>
    /// Shows the leaderboard UI.
    /// </summary>

    public void ShowLeaderboard()
    {
#if UNITY_IOS
        Social.ShowLeaderboardUI();
                #endif
    }
Exemple #30
0
    public void OpenModule(string window)
    {
        Debug.Log("[GameArter Android] → Display external panel : " + window);
        switch (window)
        {
        case "PWA": break;

        case "login": break;

        case "badge":
            Social.ShowAchievementsUI();
            //Application.OpenURL ("https://www.gamearter.com/modules/badges/"+Garter.I.GameId()+"/"+Garter.I._ProjectVersion());
            break;

        case "leaderboard":
            Social.ShowLeaderboardUI();
            break;

        case "profile":
            Application.OpenURL("https://www.gamearter.com/modules/profile/" + Garter.I.GameId());
            break;

        case "share":
            //Application.OpenURL ("https://www.gamearter.com/game_config/badges.php?g="+Garter.I.GameId()+"&u="+Garter.I.UserId());
            break;

        case "offline":                         // enables converstion between local and paco currency
            //Application.OpenURL ("https://www.gamearter.com/game_config/badges.php?g="+Garter.I.GameId()+"&u="+Garter.I.UserId());
            break;

        case "discussion":
            Application.OpenURL("https://www.gamearter.com/modules/comments/" + Garter.I.GameId());
            break;

        case "report":

            break;

        case "development":

            break;

        case "video":
            Application.OpenURL("https://www.gamearter.com/modules/video/" + Garter.I.GameId());

            break;

        case "gameinfo":
            Application.OpenURL("https://www.gamearter.com/modules/controls/" + Garter.I.GameId());

            break;

        case "moregames":

            break;

        default:

            break;
        }
    }
Exemple #31
0
 /*
  * public IEnumerator PropertyNotification(float startTime)
  * {
  *   yield return new WaitForSeconds(startTime);
  *   yield break;
  * }
  */
 public void PostToAchievements(string achievementId, float achievementValue)
 {
     Social.ReportProgress(achievementId, achievementValue, (bool success) => {
         Debug.Log("[GameArter][Google Play Achievement][" + achievementId + "] | value: " + achievementValue + ", success: " + success);
     });
 }
Exemple #32
0
 public void PostToLeaderboard(string leaderboardId, decimal value)
 {
     Social.ReportScore((long)value, leaderboardId, (bool success) => {
         Debug.Log("[GameArter][Google Play Leaderboard][" + leaderboardId + "] | value: " + value + ", success: " + success);
     });
 }
Exemple #33
0
		public string GetNewGrid()
		{
			//Roles
			string[] roles = GetSecureObjectList(Security, 0).Split(';');
			int[] roleIds = new int[roles.Length - 2 + 1];
			int i = 0;
			for (i = 0; i <= roles.Length - 2; i++)
			{
				if (! (string.IsNullOrEmpty(roles[i])))
				{
					roleIds[i] = Convert.ToInt32(roles[i]);
				}
			}
			Array.Sort(roleIds);
			string tmp = string.Empty;
			foreach (int n in roleIds)
			{
				tmp += n.ToString() + ";";
			}
			List<PermissionInfo> pl = new List<PermissionInfo>();

			//litNewGrid.Text = "Roles:" & tmp

			//litNewGrid.Text &= "<br />RolesNames:" & Permissions.GetRolesNVC(tmp)
			NameValueCollection nvc = Permissions.GetRolesNVC(tmp, PortalId);
			foreach (string key in nvc.AllKeys)
			{
				PermissionInfo pi = new PermissionInfo();
				pi.ObjectId = key;
				pi.ObjectName = nvc[key];
				pi.Type = ObjectType.RoleId;
				pl.Add(pi);
			}

			//Users
			string users = GetSecureObjectList(Security, 1);
			string userNames = string.Empty;
			if (! (string.IsNullOrEmpty(users)))
			{
				DotNetNuke.Entities.Users.UserController uc = new DotNetNuke.Entities.Users.UserController();
				foreach (string uid in users.Split(';'))
				{
					if (! (string.IsNullOrEmpty(uid)))
					{
						DotNetNuke.Entities.Users.UserInfo u = uc.GetUser(PortalId, Convert.ToInt32(uid));
						if (u != null)
						{
							PermissionInfo pi = new PermissionInfo();
							pi.ObjectId = u.UserID.ToString();
							pi.ObjectName = u.DisplayName;
							pi.Type = ObjectType.UserId;
							pl.Add(pi);
						}

					}
				}
			}
			//Groups
			string groups = GetSecureObjectList(Security, 2);
			if (! (string.IsNullOrEmpty(groups)))
			{
				foreach (string g in groups.Split(';'))
				{
					if (! (string.IsNullOrEmpty(g)))
					{
						Social uc = new Social();
						string gType = g.Split(':')[1];
						int groupId = Convert.ToInt32(g.Split(':')[0]);
						string groupName = uc.ActiveSocialGetGroup(groupId);
						if (! (string.IsNullOrEmpty(groupName)))
						{
							PermissionInfo pi = new PermissionInfo();
							pi.ObjectId = g;
							pi.ObjectName = groupName;
							pi.Type = ObjectType.GroupId;
							pi.ObjectName += "-" + uc.ActiveSocialGetGroupType(Convert.ToInt32(gType), PortalId);
							pl.Add(pi);
						}
					}
				}
			}

			string[,] grid = new string[pl.Count + 1, 28];
			i = 0;
			foreach (PermissionInfo pi in pl)
			{
				grid[i, 0] = pi.ObjectId;
				grid[i, 1] = pi.ObjectName;
				grid[i, 2] = Convert.ToString(pi.Type);
                grid[i, 3] = Convert.ToString(PermValue((int)pi.Type, pi.ObjectId, Security.View));
                grid[i, 4] = Convert.ToString(PermValue((int)pi.Type, pi.ObjectId, Security.Read));
                grid[i, 5] = Convert.ToString(PermValue((int)pi.Type, pi.ObjectId, Security.Create));
                grid[i, 6] = Convert.ToString(PermValue((int)pi.Type, pi.ObjectId, Security.Reply));
                grid[i, 7] = Convert.ToString(PermValue((int)pi.Type, pi.ObjectId, Security.Edit));
                grid[i, 8] = Convert.ToString(PermValue((int)pi.Type, pi.ObjectId, Security.Delete));
                grid[i, 9] = Convert.ToString(PermValue((int)pi.Type, pi.ObjectId, Security.Lock));
                grid[i, 10] = Convert.ToString(PermValue((int)pi.Type, pi.ObjectId, Security.Pin));
                grid[i, 11] = Convert.ToString(PermValue((int)pi.Type, pi.ObjectId, Security.Attach));
                grid[i, 12] = Convert.ToString(PermValue((int)pi.Type, pi.ObjectId, Security.Poll));
                grid[i, 13] = Convert.ToString(PermValue((int)pi.Type, pi.ObjectId, Security.Block));
                grid[i, 14] = Convert.ToString(PermValue((int)pi.Type, pi.ObjectId, Security.Trust));
                grid[i, 15] = Convert.ToString(PermValue((int)pi.Type, pi.ObjectId, Security.Subscribe));
                grid[i, 16] = Convert.ToString(PermValue((int)pi.Type, pi.ObjectId, Security.Announce));
                grid[i, 17] = Convert.ToString(PermValue((int)pi.Type, pi.ObjectId, Security.Tag));
                grid[i, 18] = Convert.ToString(PermValue((int)pi.Type, pi.ObjectId, Security.Categorize));
                grid[i, 19] = Convert.ToString(PermValue((int)pi.Type, pi.ObjectId, Security.Prioritize));

                grid[i, 20] = Convert.ToString(PermValue((int)pi.Type, pi.ObjectId, Security.ModApprove));
                grid[i, 21] = Convert.ToString(PermValue((int)pi.Type, pi.ObjectId, Security.ModMove));
                grid[i, 22] = Convert.ToString(PermValue((int)pi.Type, pi.ObjectId, Security.ModSplit));
                grid[i, 23] = Convert.ToString(PermValue((int)pi.Type, pi.ObjectId, Security.ModDelete));
                grid[i, 24] = Convert.ToString(PermValue((int)pi.Type, pi.ObjectId, Security.ModUser));
                grid[i, 25] = Convert.ToString(PermValue((int)pi.Type, pi.ObjectId, Security.ModEdit));
                grid[i, 26] = Convert.ToString(PermValue((int)pi.Type, pi.ObjectId, Security.ModLock));
                grid[i, 27] = Convert.ToString(PermValue((int)pi.Type, pi.ObjectId, Security.ModPin));


				i += 1;
			}
			System.Type enumType = typeof(SecureActions);
			Array values = Enum.GetValues(enumType);
			StringBuilder sb = new StringBuilder();
			sb.Append("<table cellpadding=\"0\" cellspacing=\"0\"><tr><td valign=\"top\"><div class=\"afsecobjects\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">");
			sb.Append("<tr><td class=\"afsecobjecthd\" colspan=\"2\">" + Utilities.GetSharedResource("[RESX:SecureObjects]", true) + "</td></tr>");
			string tmpObjectName = string.Empty;
			int secRows = 0;
			for (int x = 0; x < pl.Count; x++)
			{
				sb.Append("<tr><td style=\"width:16px;\"></td><td class=\"afsecobject\" style=\"white-space:nowrap;\"><div class=\"afsecobjecttxt\" title=\"" + grid[x, 1] + "\" onmouseover=\"this.firstChild.style.display='';\" onmouseout=\"this.firstChild.style.display='none';\"><span style=\"width:16px;height:16px;float:right;display:none;\">");
				if ((Convert.ToInt32(grid[x, 2]) == 0 && Convert.ToInt32(grid[x, 0]) > 0) | Convert.ToInt32(grid[x, 2]) > 0)
				{
					if (! ReadOnly)
					{
						sb.Append("<img src=\"" + ImagePath + "mini_del.gif\" alt=\"Remove Object\" style=\"cursor:pointer;z-index:10;\" class=\"afminidel\" onclick=\"securityDelObject(this,'" + grid[x, 0] + "'," + grid[x, 2] + "," + PermissionsId + ");\" />");
					}
				}
				sb.Append("</span>" + grid[x, 1]);
				sb.Append("</div></td></tr>");
			}
			sb.Append("</table></div></td><td valign=\"top\" width=\"94%\"><div class=\"afsecactions\" style=\"overflow-x:auto;overflow-y:hidden;\">");
			//litNewObjects.Text = sb.ToString
			//sb = New StringBuilder

			sb.Append("<table cellpadding=0 cellspacing=0 border=0 width=\"100%\" id=\"tblSecGrid\">");
			sb.Append("<tr>");
			string keyText = string.Empty;
			for (int td = 3; td <= 27; td++)
			{
				keyText = Convert.ToString(Enum.Parse(enumType, values.GetValue(td - 3).ToString()));
				if (keyText.ToLowerInvariant() == "block")
				{
					sb.Append("<td class=\"afsecactionhd\" style=\"display:none;\">");
				}
				else
				{
					sb.Append("<td class=\"afsecactionhd\">");
				}


				sb.Append(keyText);
				sb.Append("</td>");
			}
			sb.Append("</tr>");
			for (int x = 0; x < pl.Count; x++)
			{
				sb.Append("<tr onmouseover=\"this.className='afgridrowover'\" onmouseout=\"this.className='afgridrow'\">");
				for (int r = 3; r <= 27; r++)
				{
					keyText = Convert.ToString(Enum.Parse(enumType, values.GetValue(r - 3).ToString()));
					bool bState = Convert.ToBoolean(grid[x, r]); //Permissions.HasPermission(ForumID, Integer.Parse(dr("ObjectId").ToString), key, Integer.Parse(dr("SecureType").ToString), dt)
					string sState = "<img src=\"" + ImagePath + "admin_stop.png\" alt=\"Disabled\" />";
					if (bState)
					{
						sState = "<img src=\"" + ImagePath + "admin_check.png\" alt=\"Enabled\" />";
					}
					if (keyText.ToLowerInvariant() == "block")
					{
						sb.Append("<td class=\"afsecactionelem\" style=\"text-align:center;display:none;\">");
					}
					else
					{
						sb.Append("<td class=\"afsecactionelem\" style=\"text-align:center;\">");
					}

					sb.Append("<div class=\"afsectoggle\" id=\"" + grid[x, 0] + grid[x, 2] + keyText + "\" ");
					if (! ReadOnly)
					{
						sb.Append("onclick=\"securityToggle(this," + PermissionsId + ",'" + grid[x, 0] + "','" + grid[x, 1] + "'," + grid[x, 2] + ",'" + keyText + "');\"");
					}
					sb.Append(">" + sState + "</div></td>");


				}
				sb.Append("</tr>");
			}
			sb.Append("</table></div></td></tr></table>");
			return sb.ToString();

		}
Exemple #34
0
 public void WeChatLogin()
 {
     isWechatCallback = 1;
     Social.Authorize(Platform.WEIXIN, authcallback);
 }
        public string BuildForumView(int ForumTemplateId, int CurrentUserId, string ThemePath)
        {
            try
            {
                SettingsInfo MainSettings = DataCache.MainSettings(ModuleId);
                string sOutput = string.Empty;
                string sTemplate;
                int TemplateCache = MainSettings.TemplateCache;
                if (UseTemplatePath && TemplatePath != string.Empty)
                {
                    DisplayTemplate = Utilities.GetFileContent(TemplatePath + "ForumView.htm");
                    DisplayTemplate = Utilities.ParseSpacer(DisplayTemplate);
                }
                else if (DisplayTemplate == string.Empty)
                {
                    DisplayTemplate = Utilities.GetFileContent(Server.MapPath(ThemePath) + "templates/ForumView.ascx");
                    DisplayTemplate = Utilities.ParseSpacer(DisplayTemplate);
                }

                sTemplate = DisplayTemplate == string.Empty ? DataCache.GetCachedTemplate(TemplateCache, ModuleId, "ForumView", ForumTemplateId) : DisplayTemplate;
                try
                {
                    sTemplate = ParseControls(sTemplate);
                }
                catch (Exception ex)
                {
                    Services.Exceptions.Exceptions.ProcessModuleLoadException(this, ex);
                    sTemplate = ex.Message; //ParseControls(sTemplate)
                }
                if (sTemplate.Contains("[NOTOOLBAR]"))
                {
                    if (HttpContext.Current.Items.Contains("ShowToolbar"))
                    {
                        HttpContext.Current.Items["ShowToolbar"] = false;
                    }
                    else
                    {
                        HttpContext.Current.Items.Add("ShowToolbar", false);
                    }
                    sTemplate = sTemplate.Replace("[NOTOOLBAR]", string.Empty);
                }
                if (sTemplate.Contains("[FORUMS]"))
                {
                    string sGroupSection = string.Empty;
                    string sGroupSectionTemp = TemplateUtils.GetTemplateSection(sTemplate, "[GROUPSECTION]", "[/GROUPSECTION]");
                    string sGroup = TemplateUtils.GetTemplateSection(sTemplate, "[GROUP]", "[/GROUP]");
                    string sForums = string.Empty;
                    string sForumTemp = TemplateUtils.GetTemplateSection(sTemplate, "[FORUMS]", "[/FORUMS]");
                    string tmpGroup = string.Empty;
                    //Dim reader As IDataReader = Nothing
                    if (ForumTable == null)
                    {
                        var ds = new DataSet();
                        dtForums = new DataTable();
                        var fc = new ForumController();
                        ForumTable = fc.GetForumView(PortalId, ModuleId, CurrentUserId, UserInfo.IsSuperUser, ForumIds); // KR - added cache retreival
                        //ds = DataProvider.Instance.UI_ForumView(PortalId, ModuleId, CurrentUserId, UserInfo.IsSuperUser, ForumIds)
                        //ForumTable = ds.Tables(0)
                    }
                    string sCrumb = string.Empty;
                    string sGroupName = string.Empty;
                    //Dim ForumGroupId As Integer = 0
                    if (ForumGroupId != -1)
                    {
                        DataRow tmpDR = null;
                        ForumTable.DefaultView.RowFilter = "ForumGroupId = " + ForumGroupId;
                        if (ForumTable.DefaultView.ToTable().Rows.Count > 0)
                        {
                            tmpDR = ForumTable.DefaultView.ToTable().Rows[0];
                        }
                        if (tmpDR != null)
                        {
                            sGroupName = tmpDR["GroupName"].ToString();
                            sCrumb = "<div class=\"afcrumb\"><i class=\"fa fa-comments-o fa-grey\"></i>  <a href=\"" + Utilities.NavigateUrl(TabId) + "\">[RESX:ForumMain]</a>  <i class=\"fa fa-long-arrow-right fa-grey\"></i>  " + tmpDR["GroupName"] + "</div>";
                        }

                        //dtForums.DefaultView.RowFilter = ""

                    }
                    if (ParentForumId != -1)
                    {
                        //SubsOnly = True
                        DataRow tmpDR = null;
                        string sFilter = "ForumId = " + ParentForumId + " ";

                        ForumTable.DefaultView.RowFilter = sFilter;
                        if (ForumTable.DefaultView.ToTable().Rows.Count > 0)
                        {
                            tmpDR = ForumTable.DefaultView.ToTable().Rows[0];
                        }
                        ForumTable.DefaultView.RowFilter = "";
                        sGroupName = tmpDR["GroupName"].ToString();

                    }
                    if (MainSettings.UseSkinBreadCrumb && ForumTable.Rows.Count > 0 && SubsOnly == false && ForumGroupId != -1)
                    {
                        Environment.UpdateBreadCrumb(Page.Controls, "<a href=\"" + NavigateUrl(TabId, "", ParamKeys.GroupId + "=" + ForumGroupId) + "\">" + sGroupName + "</a>");
                        sTemplate = sTemplate.Replace("<div class=\"afcrumb\">[FORUMMAINLINK] > [FORUMGROUPLINK]</div>", string.Empty);
                        sTemplate = sTemplate.Replace("[BREADCRUMB]", string.Empty);
                    }
                    else
                    {
                        sTemplate = sTemplate.Replace("[BREADCRUMB]", sCrumb);
                    }

                    int iForum = 1;
                    int ForumCount = 0;
                    bool hasForums = false;
                    DataTable rsForums = ForumTable.DefaultView.ToTable();
                    Forum fi;
                    int tmpGroupCount = 0;
                    int asForumGroupId;
                    var social = new Social();
                    asForumGroupId = social.GetMasterForumGroup(PortalId, TabId);
                    int groupForumsCount = 0;
                    foreach (DataRow dr in rsForums.Rows)
                    {

                        //If CBool(dr("CanView")) Or (Not CBool(dr("GroupHidden"))) Then ' And Not CBool(dr("CanView"))) Or UserInfo.IsSuperUser Then
                        if (!(asForumGroupId == Convert.ToInt32(dr["ForumGroupId"]) && Convert.ToBoolean(dr["GroupHidden"])))
                        {
                            if (tmpGroup != dr["GroupName"].ToString())
                            {
                                if (tmpGroupCount < Globals.GroupCount)
                                {
                                    ForumTable.DefaultView.RowFilter = "ForumGroupId = " + Convert.ToInt32(dr["ForumGroupId"]) + " AND ParentForumId = 0";

                                    ForumCount = ForumTable.DefaultView.Count;
                                    ForumTable.DefaultView.RowFilter = "";
                                    if (sForums != string.Empty)
                                    {
                                        sGroupSection = TemplateUtils.ReplaceSubSection(sGroupSection, sForums, "[FORUMS]", "[/FORUMS]");
                                        sForums = string.Empty;
                                    }
                                    int GroupId = Convert.ToInt32(dr["ForumGroupId"]);
                                    sGroupSectionTemp = TemplateUtils.GetTemplateSection(sTemplate, "[GROUPSECTION]", "[/GROUPSECTION]");
                                    sGroupSectionTemp = sGroupSectionTemp.Replace("[GROUPNAME]", dr["GroupName"].ToString());
                                    sGroupSectionTemp = sGroupSectionTemp.Replace("[FORUMGROUPID]", dr["ForumGroupId"].ToString());
                                    sGroupSectionTemp = sGroupSectionTemp.Replace("[GROUPCOLLAPSE]", "<img class=\"afarrow\" id=\"imgGroup" + GroupId.ToString() + "\" onclick=\"toggleGroup(" + GroupId.ToString() + ");\" src=\"" + ThemePath + GetImage(GroupId) + "\" alt=\"[RESX:ToggleGroup]\" />");

                                    //any replacements on the group
                                    string sNewGroup = "<div id=\"group" + GroupId + "\" " + GetDisplay(GroupId) + " class=\"afgroup\">" + sGroup + "</div>";
                                    sGroupSectionTemp = TemplateUtils.ReplaceSubSection(sGroupSectionTemp, sNewGroup, "[GROUP]", "[/GROUP]");
                                    sGroupSection += sGroupSectionTemp;
                                    tmpGroup = dr["GroupName"].ToString();
                                    tmpGroupCount += 1;
                                    iForum = 1;
                                }

                            }
                            if (iForum <= Globals.ForumCount)
                            {
                                fi = FillForumRow(dr);
                                bool canView = Permissions.HasPerm(fi.Security.View, ForumUser.UserRoles);
                                if (canView || (!fi.Hidden))
                                {
                                    sForumTemp = TemplateUtils.GetTemplateSection(sTemplate, "[FORUMS]", "[/FORUMS]");
                                    hasForums = true;
                                    if (fi.ParentForumId == 0 || SubsOnly || (SubsOnly == false && fi.ParentForumId > 0 && rsForums.Rows.Count == 1))
                                    {
                                        sForumTemp = ParseForumRow(sForumTemp, fi, iForum, ThemePath, ForumCount);
                                        iForum += 1;
                                        sForums += sForumTemp;
                                    }
                                }
                            }
                        }

                        //End If
                    }

                    if (hasForums == false && SubsOnly)
                    {
                        return string.Empty;
                    }
                    if (sForums != string.Empty)
                    {
                        sGroupSection = TemplateUtils.ReplaceSubSection(sGroupSection, sForums, "[FORUMS]", "[/FORUMS]");
                    }
                    sTemplate = sTemplate.Contains("[GROUPSECTION]") ? TemplateUtils.ReplaceSubSection(sTemplate, sGroupSection, "[GROUPSECTION]", "[/GROUPSECTION]") : sGroupSection;
                    sTemplate = TemplateUtils.ReplaceSubSection(sTemplate, string.Empty, "[FORUMS]", "[/FORUMS]");

                }

                return sTemplate;
            }
            catch (Exception ex)
            {
                Services.Exceptions.Exceptions.LogException(ex);
                return string.Empty;
            }
        }
Exemple #36
0
 /// <summary>
 /// 微信分享链接
 /// </summary>
 public void WeChatShareLink(string title, string descripition, string url)
 {
     //isWechatCallback = 1;
     Social.DirectShare(Platform.WEIXIN, descripition, "https://hygg.3399hy.com/pic_resource/HY_NJ_ZQ/" + GlobalData.mHostId + "/icon.png", title, url, sharecallback);
 }
Exemple #37
0
 public Author()
 {
    Social = new Social();
    Badge = new AuthorBadge();
    Avatar = new AuthorAvatar();
 }
		private void BindRoles()
		{
			StringBuilder sb = new StringBuilder();
			sb.Append("<select id=\"drpSecRoles\" class=\"amcptxtbx\" style=\"width:150px;\">");
			sb.Append("<option value=\"\">[RESX:DropDownDefault]</option>");
			sb.Append("<option value=\"-1\">All Users</option>");
			sb.Append("<option value=\"-3\">Unauthenticated Users</option>");
			DotNetNuke.Security.Roles.RoleController rc = new DotNetNuke.Security.Roles.RoleController();
			foreach (DotNetNuke.Security.Roles.RoleInfo ri in rc.GetPortalRoles(PortalId))
			{
				sb.Append("<option value=\"" + ri.RoleID + "\">" + ri.RoleName + "</option>");
			}
			//drpSecRoles.DataTextField = "RoleName"
			//drpSecRoles.DataValueField = "RoleId"
			//drpSecRoles.DataSource = rc.GetPortalRoles(PortalId)
			//drpSecRoles.DataBind()
			//drpSecRoles.Items.Insert(0, New ListItem("[RESX:DropDownDefault]", ""))
			//drpSecRoles.Items.Insert(1, New ListItem("All Users", "-1"))
			//drpSecRoles.Items.Insert(2, New ListItem("Unauthenticated Users", "-3"))
			//drpSecRoles.Items.Insert(3, New ListItem("Topic Author", "-10"))
			string sGroups = string.Empty;

#if !SKU_LITE
			if (System.IO.File.Exists(Server.MapPath("~/bin/active.modules.social.dll")))
			{
				Social social = new Social();
				using (IDataReader dr = social.ActiveSocialListGroups(PortalId))
				{
					while (dr.Read())
					{
						sb.Append("<optgroup label=\"" + dr["GroupName"].ToString() + "\">");
						sb.Append("<option value=\"" + dr["GroupId"].ToString() + ":0\">Group Admin</option>");
						sb.Append("<option value=\"" + dr["GroupId"].ToString() + ":1\">Group Member</option>");
						sb.Append("</optgroup>");

					}
					dr.Close();
				}
			}
#endif
			sb.Append("</select>");
			litRoles.Text = sb.ToString();
		}