Jump to content

User Profiles for PW


Khan
 Share

Recommended Posts

Hey khan great, thanks for sharing your module. I created also various bits of it in templates and not as a module to stay flexible with forms and code.

Just by taking a quick look at code, it would be nice to have it translatable. Also it would be nicer to build forms with PW API inputfields. This would make it much easier for styling and such. Keep up the good work.

  • Like 1
Link to comment
Share on other sites

  • 3 months later...

Hi,

installed the "User-Profiles-for-PW" - Module and got an error message:

Error:     Call to a member function size() on a non-object (line 449 of
../../site/modules/FrontendUserProfile.module)

If I give an individual Avatar to the User everything works fine. I checked the access of the no-avatar.jpg. It is ok!
Couldn't find the problem quickly.

btw: I would also recommend to make the module translatable.

good to have a module like this.

kixe
 

Link to comment
Share on other sites

... no answer. I decided to help myself and hope somebody else will profit from it. I changed the following lines (450 ff) in the module-file from:
 

 if ($this->user->avatar) {
    $cropped_avatar = $this->user->avatar->first()->size(150);
    $avatar = $cropped_avatar->url;
 }

to:
 

if ($this->user->avatar->first()->url) {
    $cropped_avatar = $this->user->avatar->first()->size(150);
    $avatar = $cropped_avatar->url;
}

Now its working.

About security:
After logging-in each user can reach every profile about other users via profile/info/username.
 

I think I will make some modifications for my personal use in this line (481):

if($this->user->isLoggedin() && $this->input->urlSegment1 == 'info' && $this->sanitizer->name($this->input->urlSegment2)) {

 

I would also recommend to include a field which inquires the old password before giving the allowence to set a new one in the edit-area.

Until going deeper in PW I like it more and more and can image how big the potential for the future is.

kixe

  • Like 4
Link to comment
Share on other sites

Sorry that you got no answer. I'm glad that you managed to solve it by yourself.

if ($this->user->avatar->first()->url) {


Is this a multiple image field? Because I would expect it to be single. Anyway, for multiple images fields this has been recommended:

if ($this->user->avatar->count() > 0) {

But I think it would be better just to give limit 1 in the avatar field settings.

--

$this->sanitizer->name($this->input->urlSegment2)

What does this do? Is it only checking if the segment is a valid name? Didn't you mean to check it against the user name or something like that?

$this->sanitizer->name($this->input->urlSegment2) == $user->name
Link to comment
Share on other sites

  • 1 month later...

Khan:

   Great module!

   I see someone has already reported the problem with the avatar attribute already existing on a profile, but has no value (line 449)

     I encountered the problem on a new install, with no users but what comes by default.   I'm currently logged in as the admin on the admin pages, and went to the main site and used the "profile" link that was added to the top menu.   Someone above tried a solution, but I haven't yet -- perhaps checking for the length of the url > 0?

Also, on the checkinstall, it is checking twice for the birthdate field, and skipped checking for the gender (lines 685 and 688).

 I hope that helps you and others!

  Thanks again!

  • Like 1
Link to comment
Share on other sites

  • 9 months later...
  • 1 month later...

Hello, I am very new to ProcessWire and am still at the research part. That means I haven't even tried to do a install, I am just collecting some info to find out if it will be right for a possible project. One potential aspect of this project may be member accounts. Are there any examples of sites someone can provide that uses this module or other ways to achieve this feature using ProcessWire?

Link to comment
Share on other sites

  • 2 months later...

Hi all,

I'm new to Processwire and love it already (for someone without much PHP knowledge it looks understandable).  :) I've been trying to install this module but with no success. I tried installing it through the Modules section in the back-end, and by downloading/uploading the files through FTP, but both methods don't work for this module.

When I try with FTP I can't see the new module (after clicking "Check for new modules").

When I try through the Modules section in the back-end the files get downloaded and I can install the module. Once I click the button "Install" I'm being redirected to the modules page, but without getting a green confirmation (or error messages) at the top of the page, and the module is not in the list of other modules (although the files are succesfully downloaded onto the server).

I'm using Processwire 2.4 (downloaded a week ago from the main website) and I'm using the latest version of the module (downloaded yesterday). I've already successfully downloaded and intalled some other modules (through FTP and through the Modules page).

Does anyone knows how to fix it?

Link to comment
Share on other sites

I would try to again manually download the file or install via the Admin backend by going to the Modules Tab and clicking the New Tab and typing in "FrontendUserProfile".

  

When I try through the Modules section in the back-end the files get downloaded and I can install the module. Once I click the button "Install" I'm being redirected to the modules page, but without getting a green confirmation (or error messages) at the top of the page, and the module is not in the list of other modules (although the files are succesfully downloaded onto the server).

If the files are present in the Modules directory (/site/modules/) and you have faithfully followed the Install and Configuration directions for this module, I would send a PM to @Khan to see if this module is compatible with the current version of ProcessWire.  On the listing for this module, it shows only version 2.2 as being compatible.

Good Luck.

Link to comment
Share on other sites

Thanks cstevensjr so far for your help. :lol:  I tried installing the module manually and through the Admin backend each about 10 times to no success. The module seems to not get noticed by Processwire.

I sent Khan a PM but noticed he hasn't been on the forum for a few months so I hope he will see it in time. I will rewrite my problem more clearly just in case someone else is able to help me (and maybe others who will read this) get this module to work.

I first succesfully installed the required dropdown module.

  • Method 1) When I go to Admin > Modules > New and type in the class of "FrontendUserProfile" the module is found. I have the option to download the module. I get the confirmation "Downloaded ZIP file: https://github.com/orkhan/FrontendUserProfilesPW/archive/master.zip" and "Successfully copied files to new directory: /site/modules/FrontendUserProfile".

    I now get the message "FrontendUserProfile is ready to install" and a button "Install now". I click the button and am being redirected to the Admin > Modules > New page. The files are installed on the server but the module doesn't appear in the list with other modules I installed on the Admin > Modules > Site page.
  • Method 2) I download the zip file from the Processwire website, unzip it, and upload it to the server with FTP. Then I go to Admin > Modules and click "Check for New Modules". None are found.

I guess something is wrong with the module being noticed by Processwire or something. Does someone (with experience in building modules) maybe know how to fix this? I'm looking forward to using this module.  :lol: 

Thanks in advance!
Ben

 

Link to comment
Share on other sites

Please go to /sites/assets/cache/ and remove any .cache files that you see.  They should be recreated, as necessary.

I had a problem lately with the Module Manager not seeing new updates and that's how I got that working again.  I really don't know if this will completely clear up your issue of not recognizing the new module.

Link to comment
Share on other sites

No offense intended to Khan, but in its current state, that module has several bugs. It also has a lot more than most people/sites need.

I would recommend building your own using these posts as help:

http://processwire.com/talk/topic/1716-integrating-a-member-visitor-login-form/

http://processwire.com/talk/topic/107-custom-login/

http://processwire.com/talk/topic/2937-creating-a-front-end-admin/

  • Like 1
Link to comment
Share on other sites

I agree with adrian. No offense Khan but there are issues with this module.

Within the zip that's downloaded is a "site" folder which contains a templates folder and a modules folder containing both the frontend user profile module and the required select dropdown module.

Simply uploading the whole thing to the modules directory won't work (the module itself is nested: modules > FrontendUserProfiles > site > modules > FrontendUserProfiles) which is why it can't be found. After I deleted everything including the select drop down (since I'd already installed that manually after reading the instructions that noted it was required) I was able to find the new module in the admin but when I attempted to install it I got this error:

Unable to install module 'FrontendUserProfile': SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'profile-1' for key 2

I would like to see an easy to integrate, configurable user registration module but I don't think this is it, at least not in it's present form.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...