Decrypt() public method

public Decrypt ( string input ) : string
input string
return string
Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = DBOperations.Instance;
        links = Links.Instance;
        gui = GUIVariables.Instance;
        log = Logger.Instance;
        general = General.Instance;
        engine = ProcessingEngine.Instance;

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.
        string UID = string.Empty;
        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            UID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }
        if (!string.IsNullOrEmpty(UID))
        {
            Response.Redirect(links.FrontPageLink, false);
        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        if (!IsPostBack)
        {
            Control MasterPageLoginTable = this.Master.FindControl("LoginTable");
            MasterPageLoginTable.Visible = false;
        }

        UsernameTB.Focus();
        Page.Form.DefaultButton = SLoginButton.UniqueID;
    }
Beispiel #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        gui = GUIVariables.Instance;
        categories = Categories.Instance;
        engine = ProcessingEngine.Instance;
        imageEngine = ImageEngine.Instance;
        tagger = Tagger.Instance;
        log = Logger.Instance;

        seperator = gui.Seperator;

        //  QueryString Param Names.
        //  ratingID
        //  value

        string iid = string.Empty;
        string value = string.Empty;

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            UID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }
        if (string.IsNullOrEmpty(UID))
        {

        }
        else
        {

        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        if (Request.QueryString != null && Request.QueryString.Count > 0)
        {
            //  ratingID is the Item IID.
            if (!string.IsNullOrEmpty(Request.QueryString["ratingID"]))
            {
                iid = Request.QueryString["ratingID"];
            }
            //  Value is the Rating given by the user. Value: [0, 1, 2, 3, 4]. So add +1 so as to convert Value: [1, 2, 3, 4, 5]
            if (!string.IsNullOrEmpty(Request.QueryString["value"]))
            {
                int intValue = -1;
                value = int.TryParse(Request.QueryString["value"], out intValue) ? (intValue + 1).ToString() : "-1";
            }
        }

        if (!string.IsNullOrEmpty(UID) && !string.IsNullOrEmpty(iid) && !string.IsNullOrEmpty(value))
        {
            UpdateRatings(UID, iid, value);
        }
    }
Beispiel #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = DBOperations.Instance;
        links = Links.Instance;
        gui = GUIVariables.Instance;
        log = Logger.Instance;
        general = General.Instance;
        engine = ProcessingEngine.Instance;

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.
        string UID = string.Empty;
        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            UID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }
        if (!string.IsNullOrEmpty(UID))
        {
            Response.Redirect(links.FrontPageLink, false);
        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists
    }
Beispiel #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        categories = Categories.Instance;
        engine = ProcessingEngine.Instance;
        log = Logger.Instance;

        UID = string.Empty;
        url = string.Empty;

        //  log.Log("PathInfo: " + Request.PathInfo);

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            UID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }

        if (string.IsNullOrEmpty(UID))
        {
            Response.Redirect(links.LoginLink);
        }
        else
        {

        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        //  Update the SavedItems DB
        if (!string.IsNullOrEmpty(UID) && !string.IsNullOrEmpty(Request.QueryString["iid"]))
        {
            string IID = Request.QueryString["iid"];

            //  Make sure that the IID is a valid integer.
            if (general.IsValidInt(IID))
            {
                string date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                string queryString = "INSERT INTO saveditems VALUES ('" + UID + "' , " + IID + " , '" + date + "');";
                int retInt = dbOps.ExecuteNonQuery(queryString);

                //  Also update the getputs.item NSaved Field.
                queryString = "UPDATE item SET NSaved=NSaved+1 WHERE IID=" + IID + ";";
                retInt = dbOps.ExecuteNonQuery(queryString);

                Response.Redirect(Context.Request.UrlReferrer.OriginalString);
            }
            else
            {
                Response.Redirect(links.FrontPageLink);
            }
        }
        else
        {
            Response.Redirect(links.FrontPageLink);
        }
    }
Beispiel #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = (DBOperations)Application["dbOps"];
        links = (Links)Application["links"];
        gui = (GUIVariables)Application["gui"];
        log = (Logger)Application["log"];
        general = (General)Application["general"];
        engine = (ProcessingEngine)Application["engine"];

        #region CookieAlreadyExists
        //  START: If a stoockerCookie with the Username already exists, do not show the Login Page.
        string username = "";
        if (Request.Cookies["stoockerCookie"] != null)
        {
            HttpCookie stoockerCookie = Request.Cookies["stoockerCookie"];
            username = dbOps.Decrypt(stoockerCookie["username"].ToString().Trim());
        }
        if (!string.IsNullOrEmpty(username))
        {
            Response.Redirect(links.HomePageLink);
        }
        //  END: If a stoockerCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        AboutStoockerLabel.Text = gui.GrayFontStart
            + gui.StoocksFont + " is a Stock Recommendation Engine." + gui.LineBreak
            + "Maintain a " + gui.GreenFontStart + "Portfolio" + gui.GreenFontEnd + " of your stocks." + gui.LineBreak
            + "Get updated " + gui.GreenFontStart + "News" + gui.GreenFontEnd + " about the latest happenings in the Stock Market." + gui.LineBreak
            + gui.GreenFontStart + "Predict" + gui.GreenFontEnd + " tomorrows movement of your favorite stocks." + gui.LineBreak
            + "See what the other users " + gui.GreenFontStart + "Recommend" + gui.GreenFontEnd + " about the stock movement for tomorrow."
            + gui.GrayFontEnd;

        yesterday = DateTime.Now.AddDays(-1).ToString(dateFormatString);
        today = DateTime.Now.ToString(dateFormatString);
        tomorrow = DateTime.Now.AddDays(+1).ToString(dateFormatString);
        dayOfWeekTomorrow = DateTime.Now.AddDays(+1).DayOfWeek.ToString();

        //  If Today=Friday Then Tomorrow=Monday. Why? Because Stock Markets are closed on Weekends.
        if (DateTime.Now.DayOfWeek == DayOfWeek.Friday || DateTime.Now.DayOfWeek == DayOfWeek.Saturday || DateTime.Now.DayOfWeek == DayOfWeek.Sunday)
        {
            if (DateTime.Now.DayOfWeek == DayOfWeek.Friday)
            {
                tomorrow = DateTime.Now.AddDays(+3).ToString(dateFormatString);
                dayOfWeekTomorrow = DateTime.Now.AddDays(+3).DayOfWeek.ToString();
            }
            if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday)
            {
                tomorrow = DateTime.Now.AddDays(+2).ToString(dateFormatString);
                dayOfWeekTomorrow = DateTime.Now.AddDays(+2).DayOfWeek.ToString();
            }
            if (DateTime.Now.DayOfWeek == DayOfWeek.Sunday)
            {
                tomorrow = DateTime.Now.AddDays(+1).ToString(dateFormatString);
                dayOfWeekTomorrow = DateTime.Now.AddDays(+1).DayOfWeek.ToString();
            }
        }

        FillRecommendedStocksTable();
    }
Beispiel #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        MessageLabel.Text = string.Empty;

        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        gui = GUIVariables.Instance;
        engine = ProcessingEngine.Instance;

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            UID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }
        if (string.IsNullOrEmpty(UID))
        {
            if (general.IsUserAdministrator(UID))
            {

            }
            else
            {
                Response.Redirect(links.FrontPageLink, false);
            }
        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        //if (!IsPostBack)
        //{
        //    string queryString = @"SELECT * FROM getputs.item;";
        //    PopulateItemGridView(queryString);
        //}

        if(!IsPostBack)
            MaxRowsTB.Text = maxRows.ToString();
    }
Beispiel #7
0
    //  ItemDisplayer.ItemLayoutOptions itemLayoutOptions = ItemDisplayer.ItemLayoutOptions.Columns;
    //  ItemDisplayer.ItemLayoutOptions itemLayoutOptions = ItemDisplayer.ItemLayoutOptions.Categorized;
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        gui = GUIVariables.Instance;
        categories = Categories.Instance;
        engine = ProcessingEngine.Instance;
        imageEngine = ImageEngine.Instance;
        itemDisplayer = ItemDisplayer.Instance;

        seperator = gui.Seperator;

        MyAccountLink.Visible = false;

        if (!string.IsNullOrEmpty(Request.QueryString["startItem"]))
        {
            bool isStartItemInt = int.TryParse(Request.QueryString["startItem"].Trim(), out startItem);
            if (!isStartItemInt)
            {
                startItem = 0;
            }

            if (startItem < 0)
            {
                startItem = 0;
            }
        }
        else
        {
            startItem = 0;
        }

        if (!string.IsNullOrEmpty(Request.QueryString["sort"]))
        {
            string sortStr = Convert.ToString(Request.QueryString["sort"]);
            sort = engine.GetSortType(sortStr);
        }

        if (Request.Cookies["getputsLayoutCookie"] != null)
        {
            HttpCookie getputsLayoutCookie = Request.Cookies["getputsLayoutCookie"];
            itemLayoutOptions = itemDisplayer.GetItemLayoutOptionsType(dbOps.Decrypt(getputsLayoutCookie["layout"].ToString().Trim()));
        }

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            UID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }
        if (string.IsNullOrEmpty(UID))
        {
            Response.Redirect(links.FrontPageLink, false);
        }
        else
        {
            string queryString = "SELECT PreferredCategories FROM user WHERE UID='" + UID + "';";
            MySqlDataReader retList = dbOps.ExecuteReader(queryString);

            string prefferedCategoriesStr = string.Empty;
            if (retList != null && retList.HasRows)
            {
                while (retList.Read())
                {
                    prefferedCategoriesStr = Convert.ToString(retList["PreferredCategories"]);
                }
                retList.Close();
            }

            if (string.IsNullOrEmpty(prefferedCategoriesStr))
            {
                MessageLabel.Text = "Please visit the My Account Page and select the Categories that you would like to read more news from.";
                MyAccountLink.Visible = true;
                MyAccountLink.NavigateUrl = links.UserDetailsPageLink + "?UID=" + UID;
            }
            else
            {
                MyAccountLink.Visible = false;

                List<string> preferredCategoriesList = GetPreferredCategoriesList(prefferedCategoriesStr);
                List<Item> itemList = LoadItemDB(sort, preferredCategoriesList);
                if (itemList != null && itemList.Count > 0)
                {
                    MessageLabel.Text = gui.GreenFontStart + "Personalized Items for " + gui.GreenFontEnd + gui.BlueFontStart + UID + gui.BlueFontEnd;

                    //  LoadItemTable(itemList);

                    ItemDisplayer.ShowItemsOptions itemOptions = ItemDisplayer.ShowItemsOptions.ShowUIDLink
                        | ItemDisplayer.ShowItemsOptions.ShowTime
                        | ItemDisplayer.ShowItemsOptions.ShowCategoryLink
                        | ItemDisplayer.ShowItemsOptions.ShowSaveLink
                        | ItemDisplayer.ShowItemsOptions.ShowEMailLink
                        | ItemDisplayer.ShowItemsOptions.ShowCommentsLink
                        | ItemDisplayer.ShowItemsOptions.ShowImage
                        | ItemDisplayer.ShowItemsOptions.ShowRatings
                        | ItemDisplayer.ShowItemsOptions.ShowTags
                        | ItemDisplayer.ShowItemsOptions.CountClicks
                        | ItemDisplayer.ShowItemsOptions.ShowPreviousNextLinks;
                    string itemTable = itemDisplayer.LoadItemTable(itemList, itemOptions, itemLayoutOptions, startItem, UID, sort, links.MyNewsPageLink.Replace("~\\", ""));
                    ItemDiv.InnerHtml = itemTable;
                }
                else
                {
                    MessageLabel.Text = "getputs did not find anything worth your attention today!";
                }
            }
        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists
    }
Beispiel #8
0
    //  ItemDisplayer.ItemLayoutOptions itemLayoutOptions = ItemDisplayer.ItemLayoutOptions.Columns;
    //  ItemDisplayer.ItemLayoutOptions itemLayoutOptions = ItemDisplayer.ItemLayoutOptions.Categorized;
    protected override void OnInit(EventArgs e)
    {
        // Create dynamic controls here.

        //  Default Search Parameters.
        query = String.Empty;
        sType = SearchEngine.SearchType.Title;
        sCategory = "All Categories";
        sTime = SearchEngine.SearchTime.Today;

        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        gui = GUIVariables.Instance;
        categories = Categories.Instance;
        engine = ProcessingEngine.Instance;
        imageEngine = ImageEngine.Instance;
        searchEngine = SearchEngine.Instance;
        itemDisplayer = ItemDisplayer.Instance;

        seperator = gui.Seperator;

        if (!string.IsNullOrEmpty(Request.QueryString["startItem"]))
        {
            bool isStartItemInt = int.TryParse(Request.QueryString["startItem"].Trim(), out startItem);
            if (!isStartItemInt)
            {
                startItem = 0;
            }

            if (startItem < 0)
            {
                startItem = 0;
            }
        }
        else
        {
            startItem = 0;
        }

        if (!string.IsNullOrEmpty(Request.QueryString["sort"]))
        {
            string sortStr = Convert.ToString(Request.QueryString["sort"]);
            sort = engine.GetSortType(sortStr);
        }

        if (Request.Cookies["getputsLayoutCookie"] != null)
        {
            HttpCookie getputsLayoutCookie = Request.Cookies["getputsLayoutCookie"];
            itemLayoutOptions = itemDisplayer.GetItemLayoutOptionsType(dbOps.Decrypt(getputsLayoutCookie["layout"].ToString().Trim()));
        }

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            UID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }

        if (string.IsNullOrEmpty(UID))
        {

        }
        else
        {

        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        LoadSearchDDL();
        GetQueryParameters();

        if (!string.IsNullOrEmpty(SearchTB.Text))
        {
            query = SearchTB.Text.Trim();
        }

        string sTypeDDLValue = SearchTypeDDL.SelectedValue;
        string sCategoryDDLValue = SearchCategoryDDL.SelectedValue;
        string sTimeDDLValue = SearchTimeDDL.SelectedValue;

        Control MasterPageSearchTable = this.Master.FindControl("SearchTable");
        MasterPageSearchTable.Visible = false;

        SearchTB.Focus();
        Page.Form.DefaultButton = SearchButton.ID;

        if (!string.IsNullOrEmpty(query))
        {
            SearchTB.Text = query;

            if (sType == SearchEngine.SearchType.Comments)
            {
                sType = SearchEngine.SearchType.Title;
                List<Item> itemList = searchEngine.LoadSearchResults(query, sType, sCategory, sTime);
                LoadItemTable(itemList);
            }
            else
            {

                //  List<Item> itemList = searchEngine.LoadSearchResults(query);
                List<Item> itemList = searchEngine.LoadSearchResults(query, sType, sCategory, sTime);

                //  LoadItemTable(itemList);

                ItemDisplayer.ShowItemsOptions itemOptions = ItemDisplayer.ShowItemsOptions.ShowUIDLink
                    | ItemDisplayer.ShowItemsOptions.ShowTime
                    | ItemDisplayer.ShowItemsOptions.ShowCategoryLink
                    | ItemDisplayer.ShowItemsOptions.ShowSaveLink
                    | ItemDisplayer.ShowItemsOptions.ShowEMailLink
                    | ItemDisplayer.ShowItemsOptions.ShowCommentsLink
                    | ItemDisplayer.ShowItemsOptions.ShowImage
                    | ItemDisplayer.ShowItemsOptions.ShowRatings
                    | ItemDisplayer.ShowItemsOptions.ShowTags
                    | ItemDisplayer.ShowItemsOptions.CountClicks
                    | ItemDisplayer.ShowItemsOptions.ShowPreviousNextLinks;

                string itemTable = itemDisplayer.LoadItemTable(itemList, itemOptions, itemLayoutOptions, startItem, UID, sort, links.SearchPageLink.Replace("~\\", ""));
                ItemDiv.InnerHtml = itemTable;

            }
        }

        //
        // CODEGEN: This call is required by the ASP.NET Web Form Designer.
        //
        //  InitializeComponent();
        base.OnInit(e);
    }
Beispiel #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //UserDetailsLabel.Visible = false;
        //UpdateUserDetailsTable.Visible = false;

        InterestsCBL.Visible = false;
        AddButton.Visible = false;
        SaveChangesLabel.Visible = false;

        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        gui = GUIVariables.Instance;
        engine = ProcessingEngine.Instance;
        categories = Categories.Instance;

        if (string.IsNullOrEmpty(Request.QueryString["UID"]))
        {

        }
        else
        {
            queryStringUID = Request.QueryString["UID"].Trim().ToLower();
        }

        if (string.IsNullOrEmpty(queryStringUID))
        {
            UserDetailsLabel.Visible = false;
            UpdateUserDetailsTable.Visible = false;

            SubmittedLB.Visible = false;
            CommentedLB.Visible = false;
        }
        else
        {
            UserDetailsLabel.Visible = true;
            UpdateUserDetailsTable.Visible = false;

            string userDetails = string.Empty;
            StringBuilder returnSB = new StringBuilder();

            string date = string.Empty;
            string eMail = string.Empty;
            string about = string.Empty;

            string queryString = "SELECT Date, EMail, About FROM getputs.user where UID='" + queryStringUID + "';";
            MySqlDataReader retList = dbOps.ExecuteReader(queryString);

            if (retList != null && retList.HasRows)
            {
                while (retList.Read())
                {
                    date = Convert.ToString(retList["Date"]);
                    eMail = Convert.ToString(retList["EMail"]);
                    about = Convert.ToString(retList["About"]);

                    date = general.GetFormattedDate(date);

                    returnSB.AppendLine(gui.GrayFontStart + "User: "******"Created: " + gui.GrayFontEnd + date);
                    returnSB.AppendLine(gui.LineBreak);
                    //  //  Keep E-Mail Private.
                    //  returnSB.AppendLine(gui.GrayFontStart + "EMail: " + gui.GrayFontEnd + eMail);
                    //  returnSB.AppendLine(gui.LineBreak);
                    returnSB.AppendLine(gui.GrayFontStart + "About: " + gui.GrayFontEnd + about);

                    userDetails = returnSB.ToString();
                }
                retList.Close();
            }

            if (string.IsNullOrEmpty(userDetails))
            {
                userDetails = gui.RedFontStart + "No such user found." + gui.RedFontEnd;

                SubmittedLB.Visible = false;
                CommentedLB.Visible = false;
                SavedLB.Visible = false;
                RatedLB.Visible = false;
            }

            UserDetailsLabel.Text = userDetails;
        }

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            loggedUID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());

            if (string.IsNullOrEmpty(loggedUID))
            {
                UpdateUserDetailsTable.Visible = false;
            }
            else if (loggedUID.Equals(queryStringUID))
            {
                UserDetailsLabel.Visible = false;
                UpdateUserDetailsTable.Visible = true;

                InterestsCBL.Visible = true;
                AddButton.Visible = true;
                SaveChangesLabel.Visible = true;

                if (!IsPostBack)
                {
                    GetPreferredCategories(loggedUID);

                    StringBuilder returnSB = new StringBuilder();

                    string date = string.Empty;
                    string eMail = string.Empty;
                    string about = string.Empty;

                    string queryString = "SELECT Date, EMail, About FROM getputs.user where UID='" + loggedUID + "';";
                    MySqlDataReader retList = dbOps.ExecuteReader(queryString);

                    if (retList != null && retList.HasRows)
                    {
                        while (retList.Read())
                        {
                            date = Convert.ToString(retList["Date"]);
                            eMail = Convert.ToString(retList["EMail"]);
                            about = Convert.ToString(retList["About"]);

                            date = general.GetFormattedDate(date);

                            UserLabelR.Text = loggedUID;
                            CreatedLabelR.Text = date;

                            AboutTB.Text = about;
                            EMailTB.Text = eMail;

                        }
                        retList.Close();
                    }
                }
            }
        }

        //  Whether to show the SavedLB or not.
        if (!string.IsNullOrEmpty(queryStringUID) && !string.IsNullOrEmpty(loggedUID))
        {
            if (queryStringUID.Equals(loggedUID))
            {
                SavedLB.Visible = true;
                RatedLB.Visible = true;
            }
            else
            {
                SavedLB.Visible = false;
                RatedLB.Visible = false;
            }
        }
        else
        {
            SavedLB.Visible = false;
            RatedLB.Visible = false;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = (DBOperations)Application["dbOps"];
        gui = (GUIVariables)Application["gui"];
        links = (Links)Application["links"];
        general = (General)Application["general"];
        engine = (ProcessingEngine)Application["engine"];

        //  username = Convert.ToString(Session["username"]);

        if (Request.Cookies["stoockerCookie"] != null)
        {
            HttpCookie stoockerCookie = Request.Cookies["stoockerCookie"];
            username = dbOps.Decrypt(stoockerCookie["username"].ToString().Trim());
        }

        if (string.IsNullOrEmpty(username))
        {
            Response.Redirect(links.SessionExpiredPageLink);
        }
        else
        {
            yesterday = DateTime.Now.AddDays(-1).ToString(dateFormatString);
            today = DateTime.Now.ToString(dateFormatString);
            tomorrow = DateTime.Now.AddDays(+1).ToString(dateFormatString);

            UserDetailsLabel.Text = LoadUserData(username);
            LoadUserPredictionHistory();

            interestedStocks = ShowAlreadySelectedStocks(username);
            if (!string.IsNullOrEmpty(alreadySelectedStocks))
            {
                LoadStoockerAccuracy(interestedStocks);
            }

        }
    }
Beispiel #11
0
    int startItem = 0; //  Default Value;

    #endregion Fields

    #region Methods

    //  ItemDisplayer.ItemLayoutOptions itemLayoutOptions = ItemDisplayer.ItemLayoutOptions.Columns;
    //  ItemDisplayer.ItemLayoutOptions itemLayoutOptions = ItemDisplayer.ItemLayoutOptions.Categorized;
    protected void Page_Load(object sender, EventArgs e)
    {
        links = Links.Instance;
        gui = GUIVariables.Instance;
        dbOps = DBOperations.Instance;
        categories = Categories.Instance;
        log = Logger.Instance;
        engine = ProcessingEngine.Instance;
        general = General.Instance;
        imageEngine = ImageEngine.Instance;
        itemDisplayer = ItemDisplayer.Instance;

        seperator = gui.Seperator;

        if (!string.IsNullOrEmpty(Request.QueryString["startItem"]))
        {
            bool isStartItemInt = int.TryParse(Request.QueryString["startItem"].Trim(), out startItem);
            if (!isStartItemInt)
            {
                startItem = 0;
            }

            if (startItem < 0)
            {
                startItem = 0;
            }
        }
        else
        {
            startItem = 0;
        }

        if (Request.Cookies["getputsLayoutCookie"] != null)
        {
            HttpCookie getputsLayoutCookie = Request.Cookies["getputsLayoutCookie"];
            itemLayoutOptions = itemDisplayer.GetItemLayoutOptionsType(dbOps.Decrypt(getputsLayoutCookie["layout"].ToString().Trim()));
        }

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            loggedUID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }

        if (string.IsNullOrEmpty(loggedUID))
        {

        }
        else
        {

        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        if (string.IsNullOrEmpty(Request.QueryString["UID"]))
        {

        }
        else
        {
            queryStringUID = Request.QueryString["UID"].Trim().ToLower();
        }

        string message = string.Empty;
        MessageLabel.Text = string.Empty;
        if (string.IsNullOrEmpty(queryStringUID))
        {
            message = gui.GreenFontStart + "No such User exists." + gui.GreenFontEnd;
        }
        else
        {
            List<Item> itemList = engine.LoadItemDB(sort, queryStringUID);
            if (itemList != null && itemList.Count > 0)
            {
                message = gui.GreenFontStart + "Most recent submissions by " + queryStringUID + gui.GreenFontEnd;

                //  LoadItemTable(itemList);

                ItemDisplayer.ShowItemsOptions itemOptions = ItemDisplayer.ShowItemsOptions.ShowUIDLink
                    | ItemDisplayer.ShowItemsOptions.ShowTime
                    | ItemDisplayer.ShowItemsOptions.ShowCategoryLink
                    | ItemDisplayer.ShowItemsOptions.ShowSaveLink
                    | ItemDisplayer.ShowItemsOptions.ShowEMailLink
                    | ItemDisplayer.ShowItemsOptions.ShowCommentsLink
                    | ItemDisplayer.ShowItemsOptions.ShowImage
                    | ItemDisplayer.ShowItemsOptions.ShowRatings
                    | ItemDisplayer.ShowItemsOptions.ShowTags
                    | ItemDisplayer.ShowItemsOptions.CountClicks
                    | ItemDisplayer.ShowItemsOptions.ShowPreviousNextLinks;

                string itemTable = itemDisplayer.LoadItemTable(itemList, itemOptions, itemLayoutOptions, startItem, queryStringUID, sort, links.SubmittedPageLink.Replace("~\\", "") + "?UID=" + queryStringUID);
                ItemDiv.InnerHtml = itemTable;
            }
            else
            {
                message = gui.GreenFontStart + queryStringUID + " has not made any submissions yet." + gui.GreenFontEnd;
            }
        }
        MessageLabel.Text = message;
    }
Beispiel #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = (DBOperations)Application["dbOps"];
        gui = (GUIVariables)Application["gui"];
        links = (Links)Application["links"];
        engine = (ProcessingEngine)Application["engine"];

        //  username = Convert.ToString(Session["username"]);

        if (Request.Cookies["stoockerCookie"] != null)
        {
            HttpCookie stoockerCookie = Request.Cookies["stoockerCookie"];
            username = dbOps.Decrypt(stoockerCookie["username"].ToString().Trim());
        }

        if (string.IsNullOrEmpty(username))
        {
            Response.Redirect(links.SessionExpiredPageLink);
        }

        FindStockTB.Attributes.Add("onkeypress", "if ((event.which ? event.which : event.keyCode) == 13){document.getElementById('" + FindStockButton.UniqueID + "').click(); }");

        //  InterestsLabel.Text = "Select the Stocks you would like to <font color=\"Red\">Stoock!!<\font>";
        InterestsLabel.Text = "Other User's have been making predictions for the stocks shown."
            + "Select the Stocks you would like to " + gui.StoockFont
            + gui.LineBreak + "(Max. of " + gui.RedFontStart + maxStocksPerUser.ToString() + gui.RedFontEnd + " stocks allowed)";

        string findStockMessage = "Could not find the Symbol you were looking for?"
                + gui.LineBreak + gui.StoocksFont + " only shows the Stocks which other Stoockers have predicted."
                + gui.LineBreak  + "Type the Symbol of the Stock you want to analyze and " + gui.StoocksFont + " will add the Symbol for You.";
        FindStockLabel.Text = findStockMessage;

        if (!Page.IsPostBack)
        {
            FillStocksCBL();
            ShowAlreadySelectedStocks(username);

            //  AlphabeticButton.Attributes.Add("onmouseover", "this.style.backgroundColor='red'");
            //  AlphabeticButton.Attributes.Add("onmouseout", "this.style.backgroundColor='white'");
        }

        for (int i = 0; i < StocksCBL.Items.Count; i++)
        {
            StocksCBL.Items[i].Attributes.Add("onmouseover", "this.style.backgroundColor='red'");
            StocksCBL.Items[i].Attributes.Add("onmouseout", "this.style.backgroundColor='white'");
        }

        FindStockTB.Attributes.Add("onkeypress", "if ((event.which ? event.which : event.keyCode) == 13){var sendElem = document.getElementById(\"FindStockButton\"); if(!sendElem.disabled) FindStockButton_Click(); }");
    }
Beispiel #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = (DBOperations)Application["dbOps"];
        rssReader = (RssReader)Application["rssReader"];
        gui = (GUIVariables)Application["gui"];
        stockService = (StockService)Application["stockService"];
        links = (Links)Application["links"];
        log = (Logger)Application["log"];

        NewsSearchLabel.Text = gui.GreenFontStart + "Enter a Stock Symbol: " + gui.GreenFontEnd;

        if (Request.Cookies["stoockerCookie"] != null)
        {
            HttpCookie stoockerCookie = Request.Cookies["stoockerCookie"];
            username = dbOps.Decrypt(stoockerCookie["username"].ToString().Trim());

            GoBackLink.Text = "Home Page";
            LogoutLink.Visible = true;
        }
        else
        {
            GoBackLink.Text = "Login";
            LogoutLink.Visible = false;
        }

        //  if (!Page.IsPostBack)
        {
            GetNews(newsFeedsTable);
            RenderNews();

            StockTable.Visible = false;
        }
    }
Beispiel #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        gui = GUIVariables.Instance;
        engine = ProcessingEngine.Instance;
        imageEngine = ImageEngine.Instance;

        seperator = gui.Seperator;

        if (string.IsNullOrEmpty(Request.QueryString["IID"]))
        {
            EMailDiv.Visible = false;
            ItemTitleLabel.Text = "No such item found.";
        }
        else
        {
            iid = Request.QueryString["IID"].Trim().ToLower();
        }

        if (!general.IsValidInt(iid))
        {
            EMailDiv.Visible = false;
        }
        else
        {
            item = new Item();

            string queryString = "SELECT Title, Link, Text, Date, UID, NComments, Category FROM item WHERE IID=" + iid + ";";
            MySqlDataReader retList;

            retList = dbOps.ExecuteReader(queryString);

            if (retList != null && retList.HasRows)
            {
                while (retList.Read())
                {
                    item.IID = Convert.ToInt32(iid);
                    item.UID = Convert.ToString(retList["UID"]);
                    item.Title = Convert.ToString(retList["Title"]);
                    item.Link = Convert.ToString(retList["Link"]);
                    item.Text = Convert.ToString(retList["Text"]);
                    item.Date = Convert.ToString(retList["Date"]);
                    item.NComments = Convert.ToInt32(retList["NComments"]);
                    item.Category = Convert.ToString(retList["Category"]);

                    if (!string.IsNullOrEmpty(item.Link))
                    {
                        item.Text = string.Empty;
                    }
                }
                retList.Close();
            }
            ItemTitleLabel.Text = "Title: " + gui.GrayFontStart + item.Title + gui.GrayFontEnd;
        }

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            user = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }
        if (string.IsNullOrEmpty(user))
        {

        }
        else
        {

        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        //  If the user has logged in, populate the 'EMail From' TextBox.
        //  The variable 'user' = Logged in User.

        EMailOutputMessageLabel.Text = string.Empty;
        if (!string.IsNullOrEmpty(user))
        {
            string queryString = "SELECT EMail FROM user WHERE UID='" + user + "';";
            MySqlDataReader retList = dbOps.ExecuteReader(queryString);
            if (retList != null && retList.HasRows)
            {
                while (retList.Read())
                {
                    FromTB.Text = Convert.ToString(retList["EMail"]);
                }
                retList.Close();
            }
        }

        //  If not using ReCaptcha Project, but using the Captcha Library.
        //if (!IsPostBack)
        //{
        //    HttpContext.Current.Session["CaptchaImageText"] = general.GenerateRandomCode();
        //}
    }
Beispiel #15
0
    //  ItemDisplayer.ItemLayoutOptions itemLayoutOptions = ItemDisplayer.ItemLayoutOptions.Columns;
    //  ItemDisplayer.ItemLayoutOptions itemLayoutOptions = ItemDisplayer.ItemLayoutOptions.Categorized;
    protected void Page_Load(object sender, EventArgs e)
    {
        DirectContactButton.Visible = false;

        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        gui = GUIVariables.Instance;
        engine = ProcessingEngine.Instance;
        imageEngine = ImageEngine.Instance;
        categories = Categories.Instance;
        tagger = Tagger.Instance;
        itemDisplayer = ItemDisplayer.Instance;

        seperator = gui.Seperator;

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            user = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }
        if (string.IsNullOrEmpty(user))
        {
            //  Response.Redirect(links.LoginLink, false);
            MessageLabel.Text = gui.RedFontStart + "Please login to enter a comment." + gui.RedFontEnd;
        }
        else
        {

        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        if (string.IsNullOrEmpty(Request.QueryString["IID"]))
        {
            Response.Redirect(links.FrontPageLink, false);
        }
        else
        {
            iid = Request.QueryString["IID"].Trim().ToLower();
        }

        if (!general.IsValidInt(iid))
        {

        }
        else
        {
            LoadItemDetails(iid);
            LoadComments(iid);
        }
    }
Beispiel #16
0
    protected override void OnInit(EventArgs e)
    {
        try
        {
            links = Links.Instance;
            gui = GUIVariables.Instance;
            dbOps = DBOperations.Instance;
            categories = Categories.Instance;
            log = Logger.Instance;
            engine = ProcessingEngine.Instance;
            general = General.Instance;
            imageEngine = ImageEngine.Instance;
            gui = GUIVariables.Instance;
            itemDisplayer = ItemDisplayer.Instance;

            if (Request != null)
            {
                if (!string.IsNullOrEmpty(Request.QueryString["category"]))
                {
                    requestedTag = Request.QueryString["category"].Trim();
                }
            }

            #region CookieAlreadyExists
            //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

            if (Request.Cookies["getputsCookie"] != null)
            {
                HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
                UID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
            }

            //TopAboutLabel.Text = "getputs is a utility for discovering, sharing and recommending user generated content."
            //    + gui.LineBreak
            //    + "Read/Post the latest/hottest news and classified submissions, ask queries, discuss your views!";

            TopAboutLabel.Text = gui.GrayFontStart
                + "getputs is a utility for discovering, sharing, and recommending news."
                + gui.GrayFontEnd;

            if (string.IsNullOrEmpty(UID))
            {
                TopAboutTable.Visible = true;

                //  If the Page is SLogin.aspx, then the LoginTable will not be visible.
                //  Else it is going to be visible in anycase.
                //  LoginTable.Visible = true;

                UsernameTB.Focus();
                Page.Form.DefaultButton = LoginButton.ID;

                //LoginHL.Visible = true;
                //RegisterHL.Visible = true;

                //  SubmitHL.Visible = false;
                SubmitHL.Visible = true;
                SavedHL.Visible = false;
                UserAccountHL.Visible = false;
                MyNewsHL.Visible = false;

                LogoutHL.Visible = false;

                UserWelcomeLabel.Text = "";

                PostItDiv.Visible = true;

            }
            else
            {
                TopAboutTable.Visible = false;

                LoginTable.Visible = false;

                //LoginHL.Visible = false;
                //RegisterHL.Visible = false;

                SubmitHL.Visible = true;
                SavedHL.Visible = true;
                UserAccountHL.Visible = true;
                MyNewsHL.Visible = true;

                LogoutHL.Visible = true;
                UserAccountHL.NavigateUrl = links.UserDetailsPageLink + "?UID=" + UID;

                //  UserWelcomeLabel.Text = gui.GrayFontStart + "Welcome " + UID + gui.GrayFontEnd;
                UserWelcomeLabel.Text = gui.BoldFontStart + gui.GreenFontStart + "Welcome " + UID + gui.GreenFontEnd + gui.BoldFontEnd;

                PostItDiv.Visible = false;

                //  Vatsal Shah | 2009-08-08 | LogVisitor() Throws a lot of errors. Thus commented for now.
                //  LogVisitor(UID);
            }

            //  PopularCategoriesLabel.Visible = false;
            //  CategoryDiv.Visible = false;
            //  MoreHL.Visible = false;

            //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
            #endregion CookieAlreadyExists

            RandomNewsHL.Text = gui.BlueFontStart + "Bored? " + gui.BlueFontEnd
                //  + gui.LineBreak
                + gui.GreenFontStart + "Read random stuff" + gui.GreenFontEnd;

            CopyrightLabel.Text = gui.SmallFontStart + gui.GrayFontStart
                + copyrightText
                + gui.GrayFontEnd + gui.SmallFontEnd;

            #region RandomQuoteFact
            Random randomQuoteFact = new Random();
            int randomQuoteFactInt = randomQuoteFact.Next(0, 100);

            if (randomQuoteFactInt % 2 == 0)    //  Serve Facts
            {
                gp.Files.FileLoader.FilePath = HttpRuntime.AppDomainAppPath + ConfigurationManager.AppSettings["FilesPath"];
                string randomFact = gp.Files.FactDB.Instance.GetRandomFact();
                if (!string.IsNullOrEmpty(randomFact))
                {
                    QuoteFactLiteral.Text = gui.BoldFontStart + gui.GreenFontStart + "getputs Fact: " + gui.GreenFontEnd + gui.BoldFontEnd + gui.LineBreak
                        + gui.GrayFontStart + randomFact + gui.GrayFontEnd;
                }
            }
            else    //  Serve Quotes
            {
                gp.Files.FileLoader.FilePath = HttpRuntime.AppDomainAppPath + ConfigurationManager.AppSettings["FilesPath"];
                string randomQuote = gp.Files.QuoteDB.Instance.GetRandomQuote();
                if (!string.IsNullOrEmpty(randomQuote))
                {
                    randomQuote = randomQuote.Replace("|", gui.LineBreak + " - <i>") + "</i>";
                    QuoteFactLiteral.Text = gui.BoldFontStart + gui.GreenFontStart + "getputs Quote: " + gui.GreenFontEnd + gui.BoldFontEnd + gui.LineBreak
                        + gui.GrayFontStart + randomQuote + gui.GrayFontEnd;
                }
            }
            #endregion RandomQuoteFact

            #region RandomTip

            gp.Files.FileLoader.FilePath = HttpRuntime.AppDomainAppPath + ConfigurationManager.AppSettings["FilesPath"];
            string randomTip = gp.Files.TipsDB.Instance.GetRandomTip();
            if (!string.IsNullOrEmpty(randomTip))
            {
                //  TipLiteral.Text = gui.MediumFontStart + gui.GrayFontStart + randomTip + gui.GrayFontEnd + gui.MediumFontEnd;
                TipLiteral.Text = randomTip;
            }

            #endregion RandomTip

            GetNavigationTableURL();
            LoadCategoryTable(UID);
            AddMouseEffects();

            //  Load the Carousels only for the Front-Page (Default.aspx)
            //  For all other pages CarouselDiv would be invisible.
            CarouselDiv.Visible = false;
            //  Make the TopAboutTable Invisible for any page other than the Front-Page (Default.aspx)
            TopAboutTable.Visible = false;

            StringBuilder strScript = new StringBuilder();
            strScript.Append("var itemImageList = [];");
            strScript.Append("var itemContentList = [];");
            Page.ClientScript.RegisterClientScriptBlock(GetType(), "CarouselJavaScript", strScript.ToString(), true);

            //List<Item> itemList = engine.LoadItemDB(ProcessingEngine.Sort.New);
            //if (itemList != null && itemList.Count > 0)
            //{
            //    LoadItemImageCarousel(itemList);
            //    LoadItemNewsCarousel(itemList);
            //}

            ////  string pagename = System.IO.Path.GetFileName(Request.ServerVariables["SCRIPT_NAME"]);
            //string pagename = Path.GetFileName(System.Web.HttpContext.Current.Request.Url.AbsolutePath);
            //if (links.FrontPageLink.EndsWith(pagename))     //  Load the Carousels only for the Front-Page (Default.aspx)
            //{
            //    List<Item> itemList = engine.LoadItemDB(ProcessingEngine.Sort.New);
            //    if (itemList != null && itemList.Count > 0)
            //    {
            //        LoadItemImageCarousel(itemList);
            //        LoadItemNewsCarousel(itemList);
            //    }

            //}
            //else    //  Do not show the CarouselDiv.
            //{
            //    CarouselDiv.Visible = false;

            //    //  Instantiate Empty JavaScriptLists so as to avoid Client Side Exceptions.
            //    StringBuilder strScript = new StringBuilder();
            //    strScript.Append("var itemImageList = [];");
            //    strScript.Append("var itemContentList = [];");
            //    Page.ClientScript.RegisterClientScriptBlock(GetType(), "CarouselJavaScript", strScript.ToString(), true);

            //    //  Make the TopAboutTable Invisible for any page other than the Front-Page (Default.aspx)
            //    TopAboutTable.Visible = false;
            //}

            //  SearchTB.Attributes.Add("onkeypress", "if ((event.which ? event.which : event.keyCode) == 13){var sendElem = document.getElementById(\"SearchButton\"); if(!sendElem.disabled) DoSearch(); }");
            //  SearchTB.Attributes.Add("onkeypress", "if ((event.which ? event.which : event.keyCode) == 13){document.getElementById('SearchButton').click()}");
            //  SearchTB.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + SearchButton.ID + "').click();return false;}} else {return true}; ");

        }
        catch (Exception ex)
        {
            if (log.isLoggingOn && log.isAppLoggingOn)
            {
                log.Log("Error in getputs.master: OnInit() Method: ");
                log.Log(ex);
            }
        }
    }
Beispiel #17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        gui = GUIVariables.Instance;
        engine = ProcessingEngine.Instance;
        categories = Categories.Instance;
        tokenizer = Tokenizer.Instance;
        tagger =Tagger.Instance;
        imageEngine = ImageEngine.Instance;
        log = Logger.Instance;

        spamDetection = (SpamDetection)Application["spamDetection"];

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            UID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }
        if (string.IsNullOrEmpty(UID))
        {
            Response.Redirect(links.LoginLink, false);
        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        StringBuilder explanationSB = new StringBuilder();

        explanationSB.Append(gui.GreenFontStart);
        explanationSB.Append(gui.BoldFontStart);

        explanationSB.Append("Posting News has never been this easy!");
        explanationSB.Append(gui.LineBreak);

        explanationSB.Append(gui.HTMLTab + "(1) Copy and Paste the Link of the news/webpage you want to Post.");
        explanationSB.Append(gui.LineBreak);
        explanationSB.Append(gui.HTMLTab + "(2) Click on the \"Get Title\" Button to automatically get the Title,");
        explanationSB.Append(gui.LineBreak);
        explanationSB.Append(gui.HTMLTab + "OR, Write a Descriptive Title.");
        explanationSB.Append(gui.LineBreak);
        explanationSB.Append(gui.HTMLTab + "(3) Select an appropriate Category.");
        explanationSB.Append(gui.LineBreak);
        explanationSB.Append("And you are done!");
        explanationSB.Append(gui.LineBreak);

        explanationSB.Append(gui.BoldFontEnd);
        explanationSB.Append(gui.GreenFontEnd);

        explanationSB.Append(gui.LineBreak);
        explanationSB.Append(gui.LineBreak);

        explanationSB.Append("If submitting a link, keep the text section empty.");
        explanationSB.Append(gui.LineBreak);
        explanationSB.Append("If submitting text, keep the link section empty.");
        explanationSB.Append(gui.LineBreak);
        explanationSB.Append("If there is a link, the text section will be ignored.");

        ExplanationLabel.Text = explanationSB.ToString();

        AddTags();

        //  For the Bookmarklet.
        //  Check the Tools.aspx page for matching the Title/Link parameters.
        if (!string.IsNullOrEmpty(Request.QueryString["title"]) && !string.IsNullOrEmpty(Request.QueryString["url"]))
        {
            TitleTB.Text = Request.QueryString["title"].Trim();
            LinkTB.Text = Request.QueryString["url"];
        }

        //  If not using ReCaptcha Project, but using the Captcha Library.
        //if (!IsPostBack)
        //{
        //    HttpContext.Current.Session["CaptchaImageText"] = general.GenerateRandomCode();
        //    //  log.Log("Inside !IsPostBack : " + HttpContext.Current.Session["CaptchaImageText"].ToString());
        //}
    }
Beispiel #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = (DBOperations)Application["dbOps"];
        rssReader = (RssReader)Application["rssReader"];
        gui = (GUIVariables)Application["gui"];
        stockService = (StockService)Application["stockService"];
        links = (Links)Application["links"];
        general = (General)Application["general"];
        engine = (ProcessingEngine)Application["engine"];

        //  username = Convert.ToString(Session["username"]);
        //  username = "******";

        if (Request.Cookies["stoockerCookie"] != null)
        {
            HttpCookie stoockerCookie = Request.Cookies["stoockerCookie"];
            username = dbOps.Decrypt(stoockerCookie["username"].ToString().Trim());
        }

        if (string.IsNullOrEmpty(username))
        {
            Response.Redirect(links.SessionExpiredPageLink);
        }
        else
        {
            upPredict = (int)ProcessingEngine.Movement.Up;
            downPredict = (int)ProcessingEngine.Movement.Down;

            yesterday = DateTime.Now.AddDays(-1).ToString(dateFormatString);
            today = DateTime.Now.ToString(dateFormatString);
            tomorrow = DateTime.Now.AddDays(+1).ToString(dateFormatString);

            //  If Today=Friday Then Tomorrow=Monday. Why? Because Stock Markets are closed on Weekends.
            if (DateTime.Now.DayOfWeek == DayOfWeek.Friday || DateTime.Now.DayOfWeek == DayOfWeek.Saturday || DateTime.Now.DayOfWeek == DayOfWeek.Sunday)
            {
                if (DateTime.Now.DayOfWeek == DayOfWeek.Friday)
                    tomorrow = DateTime.Now.AddDays(+3).ToString(dateFormatString);
                if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday)
                    tomorrow = DateTime.Now.AddDays(+2).ToString(dateFormatString);
                if (DateTime.Now.DayOfWeek == DayOfWeek.Sunday)
                    tomorrow = DateTime.Now.AddDays(+1).ToString(dateFormatString);
            }

            string welcomeMessage = gui.BoldFontStart + "Welcome to" + gui.StoocksFont + gui.BoldFontEnd;
            WelcomeLabel.Text = welcomeMessage;

            //  Trace.Write("Enter LoadCommonIndicesData");
            LoadCommonIndicesData();
            //  Trace.Write("Exit LoadCommonIndicesData");

            Trace.Write("Enter ShowAlreadySelectedStocks");
            interestedStocks = ShowAlreadySelectedStocks(username);
            Trace.Write("Exit ShowAlreadySelectedStocks");

            if (!string.IsNullOrEmpty(alreadySelectedStocks))
            {
                Trace.Write("Enter LoadYahooFinanceBadgeIFrame");
                LoadYahooFinanceBadgeIFrame(alreadySelectedStocks);
                Trace.Write("Exit LoadYahooFinanceBadgeIFrame");
            }

            //  if (!Page.IsPostBack)
            {
                Trace.Write("Enter LoadUserData");
                UserDetailsLabel.Text = LoadUserData(username);
                Trace.Write("Exit LoadUserData");

                if (isShowUserStockData)
                {
                    Trace.Write("Enter LoadCurrentData");
                    LoadCurrentData();
                    Trace.Write("Exit LoadCurrentData");
                }

                MessageLabel.Text = "";

                Trace.Write("Enter LoadNews");
                string newsFeeds = "";
                if (isGenericNews)      //  Show the same News for all Users, Do Cache, Update every 30 minutes.
                {
                    newsFeeds = rssReader.LoadPerStockNews(alreadySelectedStocks);
                }
                else
                {
                    newsFeeds = rssReader.LoadGenericNews("", false);
                }
                Trace.Write("Exit LoadNews");

                if (!string.IsNullOrEmpty(newsFeeds))
                {
                    NewsMessageLabel.Text = gui.BoldFontStart + "Latest News & Recommended Readings from " + gui.StoocksFont + gui.BoldFontEnd;
                    NewsLabel.Text = newsFeeds;
                }
            }
        }
    }
Beispiel #19
0
    //  ItemDisplayer.ItemLayoutOptions itemLayoutOptions = ItemDisplayer.ItemLayoutOptions.Columns;
    //  ItemDisplayer.ItemLayoutOptions itemLayoutOptions = ItemDisplayer.ItemLayoutOptions.Categorized;
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        gui = GUIVariables.Instance;
        categories = Categories.Instance;
        engine = ProcessingEngine.Instance;
        imageEngine = ImageEngine.Instance;
        tagger = Tagger.Instance;
        itemDisplayer = ItemDisplayer.Instance;

        seperator = gui.Seperator;

        if (!string.IsNullOrEmpty(Request.QueryString["tag"]))
        {
            tag = Request.QueryString["tag"].Trim();
        }
        else
        {
            Response.Redirect(links.FrontPageLink, true);
        }

        if (!string.IsNullOrEmpty(Request.QueryString["startItem"]))
        {
            bool isStartItemInt = int.TryParse(Request.QueryString["startItem"].Trim(), out startItem);
            if (!isStartItemInt)
            {
                startItem = 0;
            }

            if (startItem < 0)
            {
                startItem = 0;
            }
        }
        else
        {
            startItem = 0;
        }

        if (!string.IsNullOrEmpty(Request.QueryString["sort"]))
        {
            string sortStr = Convert.ToString(Request.QueryString["sort"]);
            sort = engine.GetSortType(sortStr);
        }

        if (Request.Cookies["getputsLayoutCookie"] != null)
        {
            HttpCookie getputsLayoutCookie = Request.Cookies["getputsLayoutCookie"];
            itemLayoutOptions = itemDisplayer.GetItemLayoutOptionsType(dbOps.Decrypt(getputsLayoutCookie["layout"].ToString().Trim()));
        }

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            UID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }
        if (string.IsNullOrEmpty(UID))
        {

        }
        else
        {

        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        List<Item> itemList = GetSimilarlyTaggedItems(tag);
        if (itemList != null && itemList.Count > 0)
        {
            //  LoadItemTable(itemList);

            ItemDisplayer.ShowItemsOptions itemOptions = ItemDisplayer.ShowItemsOptions.ShowUIDLink
            | ItemDisplayer.ShowItemsOptions.ShowTime
            | ItemDisplayer.ShowItemsOptions.ShowCategoryLink
            | ItemDisplayer.ShowItemsOptions.ShowSaveLink
            | ItemDisplayer.ShowItemsOptions.ShowEMailLink
            | ItemDisplayer.ShowItemsOptions.ShowCommentsLink
            | ItemDisplayer.ShowItemsOptions.ShowImage
            | ItemDisplayer.ShowItemsOptions.ShowRatings
            | ItemDisplayer.ShowItemsOptions.ShowTags
            | ItemDisplayer.ShowItemsOptions.CountClicks
            | ItemDisplayer.ShowItemsOptions.ShowPreviousNextLinks;

            string itemTable = itemDisplayer.LoadItemTable(itemList, itemOptions, itemLayoutOptions, startItem, UID, sort, links.AutoTagPageLink.Replace("~\\", "") + "?tag=" + tag);
            ItemDiv.InnerHtml = itemTable;

            MessageLabel.Text = gui.GreenFontStart + "Items automatically tagged with the tag: " + gui.GreenFontEnd + tag;
        }
        else
        {
            MessageLabel.Text = gui.GreenFontStart + "No items carry the tag: " + gui.GreenFontEnd + tag;
        }
    }
Beispiel #20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        gui = GUIVariables.Instance;
        engine = ProcessingEngine.Instance;
        imageEngine = ImageEngine.Instance;
        categories = Categories.Instance;
        tagger = new Tagger();

        seperator = gui.Seperator;

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            user = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }
        if (string.IsNullOrEmpty(user))
        {
            //  Response.Redirect(links.LoginLink, false);
            MessageLabel.Text = gui.RedFontStart + "Please login to enter a comment." + gui.RedFontEnd;
        }
        else
        {

        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        if (string.IsNullOrEmpty(Request.QueryString["uid"]) || string.IsNullOrEmpty(Request.QueryString["iid"]) || string.IsNullOrEmpty(Request.QueryString["cid"]))
        {
            Response.Redirect(links.FrontPageLink, true);
        }
        else
        {
            uid = Request.QueryString["uid"].Trim();
            iid = Request.QueryString["iid"].Trim();
            cid = Request.QueryString["cid"].Trim();
        }

        if (!general.IsValidInt(iid) || !general.IsValidInt(cid) || !uid.Equals(user))
        {
            Response.Redirect(links.FrontPageLink, true);
        }
        else
        {
            string comment = LoadComment(uid, iid, cid);

            if (string.IsNullOrEmpty(comment))
            {
                Response.Redirect(links.FrontPageLink, true);
            }
            else
            {
                MessageLabel.Text = gui.GreenFontStart + "Your comment cannot be edited."
                    + gui.LineBreak + "However, you can append more details to your previous comment." + gui.GreenFontEnd;

                CurrentCommentLabel.Text = gui.GreenFontStart + "Your comment: " + gui.GreenFontEnd + gui.LineBreak + comment;
            }
        }
    }
Beispiel #21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        categories = Categories.Instance;
        engine = ProcessingEngine.Instance;
        log = Logger.Instance;

        UID = string.Empty;
        url = string.Empty;

        //  log.Log("PathInfo: " + Request.PathInfo);

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            UID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }

        if (string.IsNullOrEmpty(UID))
        {

        }
        else
        {

        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        //  Update the Clicks DB

        //  2008-11-18
        //  Only store clicks which come from Logged In Users.
        //  if (!string.IsNullOrEmpty(UID) && !string.IsNullOrEmpty(Request.QueryString["url"]) && !string.IsNullOrEmpty(Request.QueryString["iid"]))

        //  2009-03-18
        //  Store all clicks. Whether from logged in users or from readers who have not logged in.
        if (!string.IsNullOrEmpty(Request.QueryString["url"]) && !string.IsNullOrEmpty(Request.QueryString["iid"]))
        {
            //  url = Request.QueryString["url"].Trim();
            url = Request.Url.OriginalString.Substring(Request.Url.OriginalString.IndexOf(engine.ItemLinkStartSeperator), Request.Url.OriginalString.IndexOf(engine.ItemLinkEndSeperator) - Request.Url.OriginalString.IndexOf(engine.ItemLinkStartSeperator));
            url = url.Replace(engine.ItemLinkStartSeperator, string.Empty).Replace(engine.ItemLinkEndSeperator, string.Empty);

            bool isIIDInt = int.TryParse(Request.QueryString["iid"].Trim(), out iid);

            string ip = general.GetIP(this.Request);
            if (!general.IsBadIP(ip))   //  Only count the clicks if the IP is OK.
            {
                if (!string.IsNullOrEmpty(url) && isIIDInt && url.StartsWith("~\\"))    //  Internal Redirect.
                {
                    url = url.Replace("~\\", links.DomainLink);
                    engine.UpdateClickDataDictionary(iid, UID, general.GetIP(this.Request), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), 1);

                }
                else if (!string.IsNullOrEmpty(url) && general.IsValidURL(url) && isIIDInt) //  External Redirect.
                {
                    engine.UpdateClickDataDictionary(iid, UID, general.GetIP(this.Request), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), 1);

                }
            }
        }

        //  Redirect
        if (!string.IsNullOrEmpty(Request.QueryString["url"]) && !string.IsNullOrEmpty(Request.QueryString["iid"]))
        {
            //  url = Request.QueryString["url"].Trim();
            url = Request.Url.OriginalString.Substring(Request.Url.OriginalString.IndexOf(engine.ItemLinkStartSeperator), Request.Url.OriginalString.IndexOf(engine.ItemLinkEndSeperator) - Request.Url.OriginalString.IndexOf(engine.ItemLinkStartSeperator));
            url = url.Replace(engine.ItemLinkStartSeperator, string.Empty).Replace(engine.ItemLinkEndSeperator, string.Empty);

            bool isIIDInt = int.TryParse(Request.QueryString["iid"].Trim(), out iid);
            if (!string.IsNullOrEmpty(url) && isIIDInt && url.StartsWith("~\\"))    //  Internal Redirect.
            {
                url = url.Replace("~\\", links.DomainLink);
                Response.Redirect(url, true);
            }
            else if (!string.IsNullOrEmpty(url) && general.IsValidURL(url) && isIIDInt) //  External Redirect.
            {
                Response.Redirect(url, true);
            }
            else
            {
                Response.Redirect(links.FrontPageLink, true);
            }
        }
        else
        {
            Response.Redirect(links.FrontPageLink, true);
        }
    }
Beispiel #22
0
    //  ItemDisplayer.ItemLayoutOptions itemLayoutOptions = ItemDisplayer.ItemLayoutOptions.Columns;
    //  ItemDisplayer.ItemLayoutOptions itemLayoutOptions = ItemDisplayer.ItemLayoutOptions.Categorized;
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        gui = GUIVariables.Instance;
        categories = Categories.Instance;
        engine = ProcessingEngine.Instance;
        imageEngine = ImageEngine.Instance;
        itemDisplayer = ItemDisplayer.Instance;

        seperator = gui.Seperator;

        if (!string.IsNullOrEmpty(Request.QueryString["startItem"]))
        {
            bool isStartItemInt = int.TryParse(Request.QueryString["startItem"].Trim(), out startItem);
            if (!isStartItemInt)
            {
                startItem = 0;
            }

            if (startItem < 0)
            {
                startItem = 0;
            }
        }
        else
        {
            startItem = 0;
        }

        if (!string.IsNullOrEmpty(Request.QueryString["sort"]))
        {
            string sortStr = Convert.ToString(Request.QueryString["sort"]);
            sort = engine.GetSortType(sortStr);
        }

        if (Request.Cookies["getputsLayoutCookie"] != null)
        {
            HttpCookie getputsLayoutCookie = Request.Cookies["getputsLayoutCookie"];
            itemLayoutOptions = itemDisplayer.GetItemLayoutOptionsType(dbOps.Decrypt(getputsLayoutCookie["layout"].ToString().Trim()));
        }

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            UID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }
        if (string.IsNullOrEmpty(UID))
        {
            Response.Redirect(links.LoginLink, false);
        }
        else
        {
            MessageLabel.Text = gui.GreenFontStart + UID + "'s Saved Items" + gui.GreenFontEnd;
        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        LoadItemDB(sort);
    }
Beispiel #23
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = (DBOperations)Application["dbOps"];
        rssReader = (RssReader)Application["rssReader"];
        gui = (GUIVariables)Application["gui"];
        links = (Links)Application["links"];
        engine = (ProcessingEngine)Application["engine"];

        //  username = Convert.ToString(Session["username"]);

        if (Request.Cookies["stoockerCookie"] != null)
        {
            HttpCookie stoockerCookie = Request.Cookies["stoockerCookie"];
            username = dbOps.Decrypt(stoockerCookie["username"].ToString().Trim());
        }

        if (string.IsNullOrEmpty(username))
        {
            Response.Redirect(links.SessionExpiredPageLink);
        }
        else
        {
            upPredict = (int)ProcessingEngine.Movement.Up;
            downPredict = (int)ProcessingEngine.Movement.Down;

            yesterday = DateTime.Now.AddDays(-1).ToString(dateFormatString);
            today = DateTime.Now.ToString(dateFormatString);
            tomorrow = DateTime.Now.AddDays(+1).ToString(dateFormatString);

            //  If Today=Friday Then Tomorrow=Monday. Why? Because Stock Markets are closed on Weekends.
            if (DateTime.Now.DayOfWeek == DayOfWeek.Friday || DateTime.Now.DayOfWeek == DayOfWeek.Saturday || DateTime.Now.DayOfWeek == DayOfWeek.Sunday)
            {
                if (DateTime.Now.DayOfWeek == DayOfWeek.Friday)
                    tomorrow = DateTime.Now.AddDays(+3).ToString(dateFormatString);
                if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday)
                    tomorrow = DateTime.Now.AddDays(+2).ToString(dateFormatString);
                if (DateTime.Now.DayOfWeek == DayOfWeek.Sunday)
                    tomorrow = DateTime.Now.AddDays(+1).ToString(dateFormatString);
            }

            symbol = Convert.ToString(Request.QueryString["stock"]);
            if (string.IsNullOrEmpty(symbol))
            {
                Response.Redirect(links.HomePageLink);
            }
            else
            {
                StockDetailsLabel.Text = LoadStockDetails(symbol);
                LoadYahooFinanceBadgeIFrame(symbol);

                string newsFeeds = rssReader.LoadPerStockNews(symbol);
                if (!string.IsNullOrEmpty(newsFeeds))
                {
                    NewsMessageLabel.Text = gui.BoldFontStart + "Latest News & Recommended Readings from " + gui.StoocksFont + gui.BoldFontEnd;
                    NewsLabel.Text = newsFeeds;
                }
            }
        }
    }
Beispiel #24
0
    //  ItemDisplayer.ItemLayoutOptions itemLayoutOptions = ItemDisplayer.ItemLayoutOptions.Columns;
    //  ItemDisplayer.ItemLayoutOptions itemLayoutOptions = ItemDisplayer.ItemLayoutOptions.Categorized;
    protected void Page_Load(object sender, EventArgs e)
    {
        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        gui = GUIVariables.Instance;
        categories = Categories.Instance;
        engine = ProcessingEngine.Instance;
        imageEngine = ImageEngine.Instance;
        itemDisplayer = ItemDisplayer.Instance;

        seperator = gui.Seperator;

        //  requestedTag = Request.QueryString["category"].Trim();
        requestedCategory = Request.QueryString.Get("category");

        if (!string.IsNullOrEmpty(Request.QueryString["startItem"]))
        {
            bool isStartItemInt = int.TryParse(Request.QueryString["startItem"].Trim(), out startItem);
            if (!isStartItemInt)
            {
                startItem = 0;
            }

            if (startItem < 0)
            {
                startItem = 0;
            }
        }
        else
        {
            startItem = 0;
        }

        if (!string.IsNullOrEmpty(Request.QueryString["sort"]))
        {
            string sortStr = Convert.ToString(Request.QueryString["sort"]);
            sort = engine.GetSortType(sortStr);
        }

        if (Request.Cookies["getputsLayoutCookie"] != null)
        {
            HttpCookie getputsLayoutCookie = Request.Cookies["getputsLayoutCookie"];
            itemLayoutOptions = itemDisplayer.GetItemLayoutOptionsType(dbOps.Decrypt(getputsLayoutCookie["layout"].ToString().Trim()));
        }

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            UID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }
        if (string.IsNullOrEmpty(UID))
        {

        }
        else
        {

        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        if (string.IsNullOrEmpty(requestedCategory))
        {
            LoadGenericCategoryTable();
        }
        else if (!(categories.CategoriesList.Contains(requestedCategory) || categories.CategoriesList.Contains(requestedCategory.ToLower())))
        {
            MessageLabel.Text = gui.RedFontStart + "Invalid Category" + gui.RedFontEnd;
        }
        else
        {
            string currentCategory = requestedCategory;
            if (imageEngine.IsIconsOn)
            {
                string iconLocation = imageEngine.LoadIconLocation(currentCategory);
                if (!string.IsNullOrEmpty(iconLocation))
                {
                    System.Web.UI.WebControls.Image icon = new System.Web.UI.WebControls.Image();
                    //  icon.ImageUrl = links.DomainLink + iconLocation;
                    icon.ImageUrl = iconLocation;
                    icon.ToolTip = currentCategory;
                    CategoryDiv.Controls.Add(icon);
                    CategoryDiv.Controls.Add(new LiteralControl(" "));
                }
            }
            MessageLabel.Text = gui.GreenFontStart + requestedCategory + gui.GreenFontEnd;
            //  MessageLabel.Text = gui.WhiteFontStart + requestedCategory + gui.WhiteFontEnd;
            LoadCategoryTable(requestedCategory, sort);
        }
    }
Beispiel #25
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //dbOps = DBOperations.Instance;
        //links = Links.Instance;
        //general = General.Instance;
        //gui = GUIVariables.Instance;
        //categories = Categories.Instance;
        //engine = ProcessingEngine.Instance;
        //imageEngine = ImageEngine.Instance;
        //tagger =Tagger.Instance;

        dbOps = DBOperations.Instance;
        links = Links.Instance;
        general = General.Instance;
        gui = GUIVariables.Instance;
        categories = Categories.Instance;
        engine = ProcessingEngine.Instance;
        imageEngine = ImageEngine.Instance;
        tagger = Tagger.Instance;
        itemDisplayer = ItemDisplayer.Instance;

        seperator = gui.Seperator;
        //  seperator = gui.BlueFontStart + " | " + gui.BlueFontEnd;

        if (!string.IsNullOrEmpty(Request.QueryString["startItem"]))
        {
            bool isStartItemInt = int.TryParse(Request.QueryString["startItem"].Trim(), out startItem);
            if (!isStartItemInt)
            {
                startItem = 0;
            }

            if (startItem < 0)
            {
                startItem = 0;
            }
        }
        else
        {
            startItem = 0;
        }

        if (!string.IsNullOrEmpty(Request.QueryString["sort"]))
        {
            string sortStr = Convert.ToString(Request.QueryString["sort"]);
            sort = engine.GetSortType(sortStr);
        }

        //if (!string.IsNullOrEmpty(Request.QueryString["layout"]))
        //{
        //    string layoutStr = Convert.ToString(Request.QueryString["layout"]);
        //    itemLayoutOptions = itemDisplayer.GetItemLayoutOptionsType(layoutStr);
        //}

        if (Request.Cookies["getputsLayoutCookie"] != null)
        {
            HttpCookie getputsLayoutCookie = Request.Cookies["getputsLayoutCookie"];
            itemLayoutOptions = itemDisplayer.GetItemLayoutOptionsType(dbOps.Decrypt(getputsLayoutCookie["layout"].ToString().Trim()));
        }

        #region CookieAlreadyExists
        //  START: If a getputsCookie with the Username already exists, do not show the Login Page.

        if (Request.Cookies["getputsCookie"] != null)
        {
            HttpCookie getputsCookie = Request.Cookies["getputsCookie"];
            UID = dbOps.Decrypt(getputsCookie["UID"].ToString().Trim());
        }
        if (string.IsNullOrEmpty(UID))
        {

        }
        else
        {

        }
        //  END: If a getputsCookie with the Username already exists, do not show the Login Page.
        #endregion CookieAlreadyExists

        List<Item> itemList = engine.LoadItemDB(sort);
        //  Using ASP.NET Controls.
        //  LoadItemTable(itemList);

        //  Using HTML
        ItemDisplayer.ShowItemsOptions itemOptions = ItemDisplayer.ShowItemsOptions.ShowUIDLink
            | ItemDisplayer.ShowItemsOptions.ShowTime
            | ItemDisplayer.ShowItemsOptions.ShowCategoryLink
            | ItemDisplayer.ShowItemsOptions.ShowSaveLink
            | ItemDisplayer.ShowItemsOptions.ShowEMailLink
            | ItemDisplayer.ShowItemsOptions.ShowCommentsLink
            | ItemDisplayer.ShowItemsOptions.ShowImage
            | ItemDisplayer.ShowItemsOptions.ShowRatings
            | ItemDisplayer.ShowItemsOptions.ShowTags
            | ItemDisplayer.ShowItemsOptions.CountClicks
            | ItemDisplayer.ShowItemsOptions.ShowPreviousNextLinks;

        string itemTable = itemDisplayer.LoadItemTable(itemList, itemOptions, itemLayoutOptions, startItem, UID, sort, links.FrontPageLink.Replace("~\\", ""));
        ItemDiv.InnerHtml = itemTable;

        //  Master Page ItemImage and ItemContent Carousels are invisble. Make them visible only for this page.
        Control MasterPageCarouselDiv = this.Master.FindControl("CarouselDiv");
        MasterPageCarouselDiv.Visible = true;
        Control MasterPageTopAboutTable = this.Master.FindControl("TopAboutTable");
        MasterPageTopAboutTable.Visible = true;

        //  List<Item> itemList = engine.LoadItemDB(ProcessingEngine.Sort.New);
        if (itemList != null && itemList.Count > 0)
        {
            LoadItemImageCarousel(itemList);
            LoadItemNewsCarousel(itemList);
        }

        //  Load Item Content Carousel JavaScript START
        //if (itemList != null && itemList.Count > 0)
        //{
        //    LoadItemNewsCarousel(itemList);
        //}
        //  Load Item Content Carousel JavaScript END
    }