[CDB] Advanced Profile Fields Pack

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Get Involved
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
Locked
User avatar
SalazarAG
Registered User
Posts: 665
Joined: Mon Mar 30, 2015 10:48 am

Re: [DEV] Advanced Profile Fields Pack

Post by SalazarAG » Thu Nov 17, 2016 9:33 pm

javiexin wrote:
SalazarAG wrote:In a test forum I use version 3.1.10.
I will try to explain in a clearer way with every step up the problem (I use kkk translator).

1 - I enable the extension
2 - I create a new profile field of type "Image upload" with the name 'image'
3 - Mark the "Publicly display profile field:" and "Display in user control panel:"
4 - Under "Profile type specific options":
4.1 - In "Minimum dimensions" by default the value is 20x20 px, and in "Maximum dimensions" the default value is 200x200 px.
4.2 - In Maximum dimensions I put 800x500 px and saved.
Assuming that, when you say "saved", you mean going to "Language specific options" and then "Save", this is the correct way to do it.
SalazarAG wrote:4.3 - In "Edit profile", when sending the image in dimensions 700x400 px it returns the error stating that the image must have maximum dimensions of 200x200 px.
I have duplicated the process in my test forum, and it works just fine for me. I tested with images of 800x600 in fields limited to 1000x800, for example.

The problem that I have is with 3.1.10 not allowing to "edit" a profile field. This is a known bug in 3.1.10, that should be fixed for the next rev.

There should be no need to change the defaults in the distribution files (you are welcome to do that, of course), but these should be changeable from the ACP, as you tried. Have you implemented the two tickets that I mentioned? Review the edits (specially for the "flexible step1" ticket), just in case... Try to give me some clues to see if I can be of further help.

Regards,
-javiexin
Hi!

Really, when I go to "Language specific options" and saved changes work! My mistake then! :)

About editing the files, I checked and it seems all right!

About phpbb error when editing profile fields: also occurs here, but with extension profile fields does not occur.
I'm sorry for my English. Google Translator does a bad job. :D

User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: [DEV] Advanced Profile Fields Pack

Post by javiexin » Thu Nov 17, 2016 9:44 pm

SalazarAG wrote:Specific positioning of a CPF.

I read the first page teaching to position the CPF in a certain place of the style with events, but I did not quite understand.

Should one first create a folder for style in aviexin\advancedpf/styles/?

Inside /styles/prosilver/ should contain the folder template/events/name_of_event.html and the code of CPF?
First of all, you do not NEED to do any of this, as the profile fields will be shown "generically", ie, the same as other fields, and according to your selected options (show on profile, memberlist, viewtopic, PM). Only in the cases where you do NOT want the standard placement, but a different one, then you will have to do as follows. Let me try to explain better.

You should create a folder ext/javiexin/advancedpf/styles/mystyle and within that folder, create a template/event subfolder. Each file there will be loaded by the corresponding template event.
So, for example, to place an extra "rank" image under the existing rank image in viewtopic mini profile, you would use the viewtopic_body_postrow_rank_after event by creating a viewtopic_body_postrow_rank_after.html file, and in there, you would put the code to show the profile field. In general, you would use the template variables named S_PROFILE_yourprofilefieldname to check if the field is set for this user, PROFILE_yourprofilefieldname_VALUE for the actual value (already in full HTML format, depending on the type of profile field). So, following with the above example, I would use a construct like the following:

Code: Select all

<!-- IF postrow.S_PROFILE_yourprofilefieldname --><dd class="profile-rank" style="margin-bottom: 0px;">{postrow.PROFILE_yourprofilefieldname_VALUE}</dd><!-- ENDIF -->
Hope this helps. If you still have doubts, continue asking :)
-javiexin

User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: [DEV] Advanced Profile Fields Pack

Post by javiexin » Thu Nov 17, 2016 9:48 pm

SalazarAG wrote:Really, when I go to "Language specific options" and saved changes work! My mistake then! :)

About editing the files, I checked and it seems all right!

About phpbb error when editing profile fields: also occurs here, but with extension profile fields does not occur.
Glad it worked! Your file edits were correct (as far as I can see), but anyhow, now you do not need them.

-javiexin

User avatar
SalazarAG
Registered User
Posts: 665
Joined: Mon Mar 30, 2015 10:48 am

Re: [DEV] Advanced Profile Fields Pack

Post by SalazarAG » Thu Nov 17, 2016 11:33 pm

javiexin wrote:
SalazarAG wrote:Specific positioning of a CPF.

I read the first page teaching to position the CPF in a certain place of the style with events, but I did not quite understand.

Should one first create a folder for style in aviexin\advancedpf/styles/?

Inside /styles/prosilver/ should contain the folder template/events/name_of_event.html and the code of CPF?
First of all, you do not NEED to do any of this, as the profile fields will be shown "generically", ie, the same as other fields, and according to your selected options (show on profile, memberlist, viewtopic, PM). Only in the cases where you do NOT want the standard placement, but a different one, then you will have to do as follows. Let me try to explain better.

You should create a folder ext/javiexin/advancedpf/styles/mystyle and within that folder, create a template/event subfolder. Each file there will be loaded by the corresponding template event.
So, for example, to place an extra "rank" image under the existing rank image in viewtopic mini profile, you would use the viewtopic_body_postrow_rank_after event by creating a viewtopic_body_postrow_rank_after.html file, and in there, you would put the code to show the profile field. In general, you would use the template variables named S_PROFILE_yourprofilefieldname to check if the field is set for this user, PROFILE_yourprofilefieldname_VALUE for the actual value (already in full HTML format, depending on the type of profile field). So, following with the above example, I would use a construct like the following:

Code: Select all

<!-- IF postrow.S_PROFILE_yourprofilefieldname --><dd class="profile-rank" style="margin-bottom: 0px;">{postrow.PROFILE_yourprofilefieldname_VALUE}</dd><!-- ENDIF -->
Hope this helps. If you still have doubts, continue asking :)
-javiexin
Many many thank you
Everything working fine now!
I'm waiting for the next releases! :)

A suggestion, if possible: add permission to those who can use the profile field. I think it useful, other people should also think it.
I'm sorry for my English. Google Translator does a bad job. :D

User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: [DEV] Advanced Profile Fields Pack

Post by javiexin » Sat Nov 19, 2016 1:03 pm

SalazarAG wrote:A suggestion, if possible: add permission to those who can use the profile field. I think it useful, other people should also think it.
What do you mean by "use" the profile field?
Maybe what you want is already possible...

If by "use" you mean "change", then that is easy: you configure the CPF to show on the UCP or not. If you show it on UCP, then the user may change it; if not, then only admins from the ACP may change it. This is selectable per-CPF, but not per-user (all users either are able to change it, or not).

If by "use" you mean "view", then you can control it by where it is shown (what templates), and also, in those templates, put some code to control showing it or not. I kind of recall a mod/extension to add template vars with group membership, so that this might help in controlling what groups see the CPF.

Otherwise, to make the system completely flexible, is quite complex. I will not do that in the short term, I will concentrate on additional types of CPFs, as I think these are more useful to the general audience.

Anyhow, please, explain more in depth what you want to achieve, use case(s), and I will try to be more specific in the response.

Regards,
-javiexin

User avatar
SalazarAG
Registered User
Posts: 665
Joined: Mon Mar 30, 2015 10:48 am

Re: [DEV] Advanced Profile Fields Pack

Post by SalazarAG » Wed Nov 23, 2016 6:16 pm

javiexin wrote:
SalazarAG wrote:A suggestion, if possible: add permission to those who can use the profile field. I think it useful, other people should also think it.
What do you mean by "use" the profile field?
Maybe what you want is already possible...

If by "use" you mean "change", then that is easy: you configure the CPF to show on the UCP or not. If you show it on UCP, then the user may change it; if not, then only admins from the ACP may change it. This is selectable per-CPF, but not per-user (all users either are able to change it, or not).

If by "use" you mean "view", then you can control it by where it is shown (what templates), and also, in those templates, put some code to control showing it or not. I kind of recall a mod/extension to add template vars with group membership, so that this might help in controlling what groups see the CPF.

Otherwise, to make the system completely flexible, is quite complex. I will not do that in the short term, I will concentrate on additional types of CPFs, as I think these are more useful to the general audience.

Anyhow, please, explain more in depth what you want to achieve, use case(s), and I will try to be more specific in the response.

Regards,
-javiexin
Got it :)
Do you remember the name of this vars template extension?
I'm sorry for my English. Google Translator does a bad job. :D

User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: [DEV] Advanced Profile Fields Pack

Post by javiexin » Wed Nov 23, 2016 8:29 pm

SalazarAG wrote:Do you remember the name of this vars template extension?
https://www.phpbb.com/customise/db/exte ... variables/

User avatar
SalazarAG
Registered User
Posts: 665
Joined: Mon Mar 30, 2015 10:48 am

Re: [DEV] Advanced Profile Fields Pack

Post by SalazarAG » Thu Nov 24, 2016 10:38 am

javiexin wrote:
SalazarAG wrote:Do you remember the name of this vars template extension?
https://www.phpbb.com/customise/db/exte ... variables/
Thanks! :D
I'm sorry for my English. Google Translator does a bad job. :D

piotr-linski
Registered User
Posts: 43
Joined: Tue Apr 26, 2016 10:22 am

Re: [DEV] Advanced Profile Fields Pack

Post by piotr-linski » Thu Dec 01, 2016 9:21 am

dear Javiexin,

Some months ago,I integrated the phpbb.com 3.1.9 forum-software with our website http://www.alumnei.nl. Along the way I have configured several custom profile fields and it all works very well.

A few weeks ago I went to the 3.1.10 version. Afterwards I found out that I was not any longer able to access and change existing custom profile fields. Luckily I found and installed a working patch via this forum.

As a next step I tried to install your extension-pack, mainly because of the beautiful multi-selectable CPF-feature where registering users can select several options at once (instead of only 1 option).

When trying to activate your extension, I got the following message:
Fatal error: Call to undefined method phpbb\profilefields\manager::enable_profilefields() in /home/perspectum.nl/public_html/alumnei.nl/linski_forum/ext/javiexin/advancedpf/ext.php on line 30

So I have looked at your work-in-progress at github and swapped the following files:
-- acp_profile.html
-- acp_profile.php
-- type_base
-- type_bool
-- type_dropdown
-- type_interface
-- type_string
-- type_text
Then I have cleaned the cache, and tried to activate your extension again.
I got the same message as above: ..... Fatal error: ...... on line 30.

I would highly appreciate any suggestions to get this working.
Thanks in advance for your reply.

Regards, Piotr

User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: [DEV] Advanced Profile Fields Pack

Post by javiexin » Thu Dec 01, 2016 9:35 am

Look at the first post of this topic. You still have to apply the first two patches mentioned there, as they have not been reviewed and approved yet (more than 18 months!).
Regards,
-javiexin

piotr-linski
Registered User
Posts: 43
Joined: Tue Apr 26, 2016 10:22 am

Re: [DEV] Advanced Profile Fields Pack

Post by piotr-linski » Thu Dec 01, 2016 10:37 am

Hi Javiexin,

oeps, sorry for missing one of your patches.

Now I have installed both patches.
And great, now it is possible to activate your APF-pack.
In the ACP, I can see the new profile fields appear, inluding the multi selections one.

However, if I now try to make a new multiple selections CPF (or a new dropdown box CPF),
the first registration page runs fine. But when moving forward, the second registration page (where one has to specify the "selectable items") does not appear.

I get a red warning message like "no items specified".

Any suggestions how to fix?

Regards, Piotr

User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: [DEV] Advanced Profile Fields Pack

Post by javiexin » Thu Dec 01, 2016 10:55 am

piotr-linski wrote:However, if I now try to make a new multiple selections CPF (or a new dropdown box CPF),
the first registration page runs fine. But when moving forward, the second registration page (where one has to specify the "selectable items") does not appear.

I get a red warning message like "no items specified".
That is because the list of options is defined in the FIRST page, before moving on to the second.
At the very bottom of the page:

Code: Select all

Entries:
Enter your options now, every option in one line.
If you are not seeing this, let me know.
-javiexin

piotr-linski
Registered User
Posts: 43
Joined: Tue Apr 26, 2016 10:22 am

Re: [DEV] Advanced Profile Fields Pack

Post by piotr-linski » Thu Dec 01, 2016 11:07 am

hi Javiexin,

first of all, thanks for your quick response.

That's indeed exactly what is not happening.
I do not get the fields that you mention at the end of the first page.

Regards, PIotr

User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: [DEV] Advanced Profile Fields Pack

Post by javiexin » Thu Dec 01, 2016 11:09 am

That indicates that you might not have applied one of the patches correctly, the one titled something like "Flexible Step 1 configuration". Review the patch installation (ALL files), as the error is probably there.
-javiexin

piotr-linski
Registered User
Posts: 43
Joined: Tue Apr 26, 2016 10:22 am

Re: [DEV] Advanced Profile Fields Pack

Post by piotr-linski » Thu Dec 01, 2016 11:32 am

hi Javiexin,

just to make sure: as I am working with 3.1.10,
Is it correct that I only need:
-- to patch the 8 files from ticket 13853?
-- and to patch the 3 files from ticket 13867?

Or am I missing something else then?

Regards, Piotr

Locked

Return to “Extensions in Development”