We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26435
    • 1,193 Posts
    ScottyDelicious Reply #191, 19 years ago
    Quote from: MotSmart at Sep 07, 2007, 07:52 PM

    Here is the Persian language file for WebLoginPE... It is in UTF-8 format. Thanks smiley
    Awesome MotSmart.
    I will contact you with any last minute changes.

    -sD-
    Dr. Scotty Delicious, Scientist.

      Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
      All of the above... in no specific order.


      I send pointless little messages
      • 26435
      • 1,193 Posts
      ScottyDelicious Reply #192, 19 years ago
      @Cobnet:
      What version are you running?
      Looking more closely at the class, all the password comparison code for registration was dumped and replaced by:
      //<?php ...
      		// Check for arrays and that "confirm" fields match.
      		foreach ($_POST as $field => $value)
      		{
      			if (is_array($_POST[$field]))
      			{
      				$_POST[$field] = implode('||', $_POST[$field]);
      			}
      			
      			$confirm = $field.'_confirm';
      			if (isset($_POST[$confirm]))
      			{
      				if ($_POST[$field] !== $_POST[$confirm])
      				{
      					$error = $this->LanguageArray[2].' <br />';
      					$fieldMessage .= str_replace('[+000+]', '"'.$field.'"', $error);
      				}
      			}
      		}
      ...?>
      

      So <input type="password" name="password.confirm" /> should work fine.
      Perhaps I am missing something?
      Any of you PHP experts have time to comment?

      -sD-
      Dr. Scotty Delicious, Scientist DFPA.
        Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
        All of the above... in no specific order.


        I send pointless little messages
        • 26435
        • 1,193 Posts
        ScottyDelicious Reply #193, 19 years ago
        We are getting close to the next version of WLPE  laugh!
        Here is what I have so far.

        1.) A frontend, templateable, fully customizable Manager interface where you can:

        • Edit ANY attribute of ANY user.
        • Delete any user.
        • (Best to keep this one accessible to ONLY Site Admins  wink)

        2.) System Event triggers for almost every possible service in WLPE using standard MODx events whenever possible. Examples are:

        • OnBeforeWebLogin
        • OnWebLogin
        • OnBeforeWebSaveUser (New event)
        • OnViewProfile (New event. Possible uses include counting profile views per user?)
        • These are just some examples. There are MANY more.

        3.) Using the ’active_users’ table I have put a timestamp in for the user’s internal key whenever they interact in any way with a page calling WebLoginPE (any page you have a login form, profile, viewusers, whatever). When viewing users, you can see who has been online (logged in) in the last 15 minutes. Like I said, that timestamp gets updated every time they view a page with WebLoginPE on it, so as long as they are viewing your site, they will show up as "Online". When they log out, or go more than 15 minutes without viewing a page, they show up as "Offline".

        4.) ViewAllUsers() got a MASSIVE overhaul!

        • Now you can have multiple lists per page
        • New parameter &usersList allows you to specify each list format.
        • You can specify "List Name", "Outer Template", "Inner Template", "Sort By", "Sort Order", and "Filters"
        The ViewAllUsers() method has been the most difficult programming I have ever done, but it is very, very versatile.
        The syntax for &usersList looks like this:
        &usersList=`List Name:outerTplChunk:userTplChunk:fieldtosortby:sortorder:filter(value),filter2()`.

        An example you say?
        How about the default!
        [(site_name)] Members:default:default:username:ASC:username()
        This makes a list of web users. The title of this list is "My MODx Site Members".
        It will use the default templates specified in &userTpl and &userOuterTpl.
        It will sort the list by username, Ascending (0-9 then A-Z)
        the filter is "username" so it will remove from the list anyone without a username (no one, I hope)
        The filter part IS optional. I could end the list above with ASC: (the final colon is important!) if I wanted to.

        You are probably wondering about the filter(value) thing, right?
        we could limit our list to only those who have supplied a phone number by using:
        Folks with Phones:default:default:username:ASC:phone()
        even cooler, we could limit our list to only those who have supplied a hotmail email account:
        Hotmail users:default:default:username:ASC:email(hotmail)
        How about if we limit our list to only those who have a website (&customFields) AND are members of the webgroup "Site Admins" by using:
        Admins with websites:default:default:username:ASC:website(),webgroup(Site Admins)
        When you use "webgroup" as a parameter, it searches for all of the members of the webgroup between the parentheses.
        If you specify a filter without a (value), like website() it grabs each user with a value for the website field stored in the database. If we give the filter a value, like website(modxcms) it will only return users who have "modxcms" in some form in the website field of their database table row (it uses strpos to find the string).

        You can have multiple lists by separating them in the call with double pipes (||).
        &usersList=`Admins with websites:default:default:username:ASC:website(),webgroup(Site Admins)||Users online right now:onlineOuterChunk:onlineUsersChunk:internalKey:DESC:online()`
        The online() filter is a freebie that I threw in. It will work without any customFields.

        I also want to make a tool to convert your PPP table for use with WLPE, but I have a lot of work to do, so I will get to that when I can.

        -sD-
        Dr. Scotty Delicious, Scientist DFPA.
          Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
          All of the above... in no specific order.


          I send pointless little messages
          • 6726
          • 7,075 Posts
          Jaw dropping shocked

          AMAZING !

          I mean the templatable manager interface, the powerful &usersList paramater with filters, the active user thing... man, this is really awesome and such a quick update to the already great code you just fed us !

          While I am here, I forgot to say it the first time but amazing job documenting the snippet too grin
          Hats off Dr Scotty !

          Any url for an Amazon wishlist wink ?
            .: COO - Commerce Guys - Community Driven Innovation :.


            MODx est l&#39;outil id
            • 28033
            • 925 Posts
            Yay, custom templates for the User Lists. That’s a feature in PPP that I liked alot --- glad to see it’s being used here too as well. smiley
              My Snippets
              -> PopUpChunk v1.0
              • 31837
              • 59 Posts
              Quote from: Dr. at Sep 04, 2007, 02:26 PM

              Quote from: pixelchutes at Sep 04, 2007, 02:13 PM


              However, I did receive an error trying to create the table that already existed...you may want to alter the CREATE statement SQL to
              CREATE TABLE IF NOT EXISTS ...


              I’m not sure how the CREATE/ALTER portion of your code will be impacted as a result of the param, but may need to consider...
              Excellent!
              Thanks, I will try adding that and see what happens. I want this to be as universally usable as possible, you know?

              -sD-
              Dr. Scotty Delicious, Scientist DFPA.

              Hi DrScotty,

              I was just wondering how this ’if exists’ update was going? I’m sort of ripping my hair out at the moment.

              After a the first few challenges of figuring out what to call the chuck, I managed to get the simple rego page to show up, but then when I hit ok/accept, I get the dreaded ’cannot create table’...

              I’ve got to be honest, I can see how good the potential for this snippet/code is, but for someone who has never seen it before, it has to be the most confusing snippet to use.

              I noticed that you’ve spent a long time making sure all the features are documented well with the various APIs and things, but sample codes as to how to make a simple rego page that explains a step by step part would be soooo wonderful. smiley

              I’ve been nearly ready to give up on this... undecided

              Or, should I just wait a bit longer for the new version?

              Thanks in advance.

              Steve. smiley
                • 26435
                • 1,193 Posts
                ScottyDelicious Reply #197, 19 years ago
                Quote from: vr_driver at Sep 08, 2007, 07:37 AM

                Hi DrScotty,
                I was just wondering how this ’if exists’ update was going? I’m sort of ripping my hair out at the moment.
                Hi Steve.
                It is coming along really well.
                If you don’t mind getting your hands just a little dusty (you don’t even have to get them dirty laugh), you can try opening webloginpe.class.php and looking for this code around line 350:
                //<?...
                
                			$createTable = $modx->db->query("CREATE TABLE ".$this->CustomTable." (id INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, internalKey INT(10) NOT NULL)");
                

                and replace it with this...
                Quote from: vr_driver at Sep 08, 2007, 07:37 AM

                Hi DrScotty,
                I was just wondering how this ’if exists’ update was going? I’m sort of ripping my hair out at the moment.
                Hi Steve.
                It is coming along really well.
                If you don’t mind getting your hands just a little dusty (you don’t even have to get them dirty laugh), you can try opening webloginpe.class.php and looking for this code around line 350:
                //<?...
                			$createTable = $modx->db->query("CREATE TABLE IF NOT EXISTS ".$this->CustomTable." (id INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, internalKey INT(10) NOT NULL)");
                

                Quote from: vr_driver at Sep 08, 2007, 07:37 AM

                After a the first few challenges of figuring out what to call the chuck, I managed to get the simple rego page to show up, but then when I hit ok/accept, I get the dreaded ’cannot create table’...

                I’ve got to be honest, I can see how good the potential for this snippet/code is, but for someone who has never seen it before, it has to be the most confusing snippet to use.
                And I apologize for that. I must admit I wasn’t expecting so much community involvement and feature requesting for this project. It does work like many other MODx snippets, but there are many, many options and I can see how it it very confusing. Hell, I wrote it and it confuses me to look at! laugh

                Quote from: vr_driver at Sep 08, 2007, 07:37 AM

                I noticed that you’ve spent a long time making sure all the features are documented well with the various APIs and things, but sample codes as to how to make a simple rego page that explains a step by step part would be soooo wonderful. smiley
                I will PM you later today and we can work together on getting your installation set up how you want it, then maybe the two of us can figure out the best way to document what we did.
                Quote from: vr_driver at Sep 08, 2007, 07:37 AM

                I’ve been nearly ready to give up on this... undecided

                Or, should I just wait a bit longer for the new version?

                Thanks in advance.

                Steve. smiley
                I would like to believe that each "next version" is going to be trouble free for everyone, but I am not a programmer by profession, just some really, really awesome dude (LOL). I hope that I can help you get this working.

                -sD-
                Dr. Scotty Delicious, Scientist DFPA.
                  Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                  All of the above... in no specific order.


                  I send pointless little messages
                  • 8684
                  • 29 Posts
                  Hi, i’m using webloginpe and when we register , the dob is not saved because it is not converted to timestamp value,
                  so I used the function makeDateForDb and now it works but, it saved another date
                  for ex I type in the dob field: 28-11-1981 and when i view my profile it shows me 11-04-1983
                  does anyone know why?
                    • 26435
                    • 1,193 Posts
                    ScottyDelicious Reply #199, 19 years ago
                    Quote from: elerium at Sep 08, 2007, 12:08 PM

                    Hi, i’m using webloginpe and when we register , the dob is not saved because it is not converted to timestamp value,
                    so I used the function makeDateForDb and now it works but, it saved another date
                    for ex I type in the dob field: 28-11-1981 and when i view my profile it shows me 11-04-1983
                    does anyone know why?
                    It is because the date is expected to be Month, Day, Year (MM-DD-YY).
                    As there is no 28th month, MakeDateForDb is doing some sort of black magic on a nonsensical date format.

                    -sD-
                    Dr. Scotty Delicious, Scientist DFPA.
                      Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                      All of the above... in no specific order.


                      I send pointless little messages
                      • 5568
                      • 35 Posts
                      Quote from: Dr. at Sep 07, 2007, 11:54 PM

                      @Cobnet:
                      What version are you running?
                      Looking more closely at the class, all the password comparison code for registration was dumped and replaced by:
                      //<?php ...
                      		// Check for arrays and that "confirm" fields match.
                      		foreach ($_POST as $field => $value)
                      		{
                      			if (is_array($_POST[$field]))
                      			{
                      				$_POST[$field] = implode('||', $_POST[$field]);
                      			}
                      			
                      			$confirm = $field.'_confirm';
                      			if (isset($_POST[$confirm]))
                      			{
                      				if ($_POST[$field] !== $_POST[$confirm])
                      				{
                      					$error = $this->LanguageArray[2].' <br />';
                      					$fieldMessage .= str_replace('[+000+]', '"'.$field.'"', $error);
                      				}
                      			}
                      		}
                      ...?>
                      

                      So <input type="password" name="password.confirm" /> should work fine.
                      Perhaps I am missing something?
                      Any of you PHP experts have time to comment?

                      -sD-
                      Dr. Scotty Delicious, Scientist DFPA.

                      I am using your latest version from the very 1st post in this message thread. 1.2.0.  The coding I posted comes from the SaveUserProfile() function, a little further down in that function, your coding here does appear.

                      If I am not mistaken the following coding is where a new password is updated to the database?

                      		if (!empty($_POST['password']) && isset($_POST['password']) && isset($_POST['passwordconfirm']))
                      		{
                      			if ($_POST['password'] === $_POST['passwordconfirm'])
                      			{
                      				if (md5($_POST['password']) === md5($modx->db->escape(strip_tags($_POST['password']))))
                      				{
                      					if (strlen($_POST['password']) > 5)
                      					{
                      						$passwordElement = "UPDATE ".$web_users." SET `password`='".md5($modx->db->escape($_POST['password']))."' WHERE `id`='".$internalKey."'";
                      						$saveMyPassword = $modx->db->query($passwordElement);
                      					}
                      					else
                      					{
                      						$this->FormatMessage($this->LanguageArray[3]);
                      						return;
                      					}
                      				}
                      				else
                      				{
                      					$this->FormatMessage($this->LanguageArray[4]);
                      					return;
                      				}
                      			}
                      			else
                      			{
                      				$this->FormatMessage($this->LanguageArray[2]);
                      				return;
                      			}
                      		}
                      


                      Please note the UPDATED message in my very 1st posting to this thread (Currently on page 13).