Custom Profile Field Mod

Started by winrules, March 30, 2006, 02:21:25 PM

Previous topic - Next topic

Chris™

Quote from: LowBear on April 08, 2007, 05:06:16 PM
Probably a silly question, but I installed the mod, no errors but I can't find a place to set settings or whatsoever, not under options and features or so, what do I do wrong here ?

thanks :)
Features and options :)

LowBear

can someone send me a screen dump of what I should see ??

it's not showing up here ...

tnx !

rgum

winrules,

I know you were working on enabling the ability to sort Custom Profile fields that were added to the Memberlist, but didnt know if this was completed. 

In the meantime, I am trying to join the themes table and sort by one of the custom fields that I created called first_name.

Here's my query:

// Select the members from the database.
$request = db_query("
SELECT hxxp:mem.id [nonactive]_MEMBER
FROM {$db_prefix}members AS mem" . ($_REQUEST['sort'] === 'isOnline' ? "
LEFT JOIN {$db_prefix}log_online AS lo ON (lo.ID_MEMBER = hxxp:mem.id [nonactive]_MEMBER)" : '') . ($_REQUEST['sort'] === 'ID_GROUP' ? "
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, hxxp:mem.id [nonactive]_POST_GROUP, hxxp:mem.id [nonactive]_GROUP))" : '') . "
LEFT JOIN {$db_prefix}themes AS th on (th.ID_MEMBER = hxxp:mem.id [nonactive]_MEMBER)
WHERE hxxp:mem.is [nonactive]_activated = 1" . (empty($where) ? '' : "
AND $where") . "
ORDER BY " . $sort_methods[$_REQUEST['sort']][$context['sort_direction']] . "
LIMIT $limit, $modSettings[defaultMaxMembers]", __FILE__, __LINE__);
printMemberListRows($request);
mysql_free_result($request);

Here's my error:

Unknown column 'th.first_name' in 'order clause'
File: /home/sigmachi/public_html/members/Sources/Memberlist.php
Line: 341

SELECT hxxp:mem.id [nonactive]_MEMBER
FROM smf_members AS mem
LEFT JOIN smf_themes AS th on (th.ID_MEMBER = hxxp:mem.id [nonactive]_MEMBER)
WHERE hxxp:mem.is [nonactive]_activated = 1
ORDER BY th.first_name ASC
LIMIT 0, 50

Any ideas?

rgum

perplexed

Quote from: Kindred on April 05, 2007, 10:08:37 AM
This is not a correct use of the Custom Profile fields, IMO

The link to a user's gallery is fixed, not information that a user should enter.

If I recall correctly, Goosemoose posted a way to modify display.template.php to add a gallery link to the user's coppermine gallery.

I asked there but no one can tell me how to do it :(

rgum

Perplexed,

Actually, I was able to get it to work, but only on one field - so far...

I created a few custom fields using the Custom Profile Field MOD for First Name, Last Name, Address etc...

So, I went into the Memberlist.php file and made the modifications to include my new custom profile fields on the mlist.

Then, I setup the query:

// Select the members from the database.
   $request = db_query("
      SELECT hxxp:mem.id [nonactive]_MEMBER, hxxp:th.id [nonactive]_MEMBER, th.variable, th.value
      FROM {$db_prefix}members AS mem" . ($_REQUEST['sort'] === 'isOnline' ? "
         LEFT JOIN {$db_prefix}log_online AS lo ON (lo.ID_MEMBER = hxxp:mem.id [nonactive]_MEMBER)" : '') . ($_REQUEST['sort'] === 'ID_GROUP' ? "
         LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, hxxp:mem.id [nonactive]_POST_GROUP, hxxp:mem.id [nonactive]_GROUP))" : '') . "
         LEFT JOIN {$db_prefix}themes AS th on (th.ID_MEMBER = hxxp:mem.id [nonactive]_MEMBER AND th.variable = 'first_name')
               WHERE hxxp:mem.is [nonactive]_activated = 1" . (empty($where) ? '' : "
         AND $where") . "
               ORDER BY " . $sort_methods[$_REQUEST['sort']][$context['sort_direction']] . "
      LIMIT $limit, $modSettings[defaultMaxMembers]", __FILE__, __LINE__);
   printMemberListRows($request);
   mysql_free_result($request);

Then I setup the sort methods:

// List out the different sorting methods...
   ),
   'firstName' => array(
   'down' => 'th.value ASC',
   'up' => 'th.value DESC'
   ),
   'lastName' => array(
   'down' => 'th.value ASC',
   'up' => 'th.value DESC'


So far, it works for just one of the variables and blows up when I try to add more than one Custom Profile field to sort on.  But, I am still working on this.  Its pretty cool that I was able to get the first_name field to sort but I need to have the ability to have the rest of my fields sort.



rgum

olandir

Where in the database is this inforamtion stored as far as the user values for the custom fields I create. Someone said the "themse" table but I would like to confirm this and to know exactly how the information is stored... I would like to create some custom fields and pull the data for another web app if possible.

thanks.

VividViews

#1106
Is there a download mirror for this mod? 

http://custom.simplemachines.org/mods/index.php?action=download;mod=319;id=22176

isn't working


EDIT:

It's okay for me now - thanks

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

rgum

olandir

The smf_themes table is the correct table for the Custom Profile MOD.  There are four columns in this table (ID_MEMBER, ID_THEME, variable, value)

When you create a custom profile field, the MOD creates a new row on the variable column for whatever you named your field and the value that is entered into the new field will be stored in the value column.

So, if you created a new field called (first_name) for example, the MOD would create a new row called first_name in the variable table.  If you browse the table it will make more sense.

rgum

This table has

rgum

Perplexed,

I figured out how to add fields from the Custom Profile MOD to the mlist and sort the values.

rgum

Kindred

rgum...   that is not what perplexed is trying to do.

He is trying to add a link from the users profile page and mini-profile in posts to point to the smf gallery...   

Again, I say to you perplexed, that is not how this mod is intended to work. Your best bet is to ignore this mod (since it does not do what you are asking) and put something else in place manually. (BTW: You never said you were using smf gallery, from your original query, it looked like you were talking about the coppermine gallery)

Actually, I would suggest asking how to do what you are asking about in the SMF Gallery mod thread,
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

VividViews

FYI:

It doesn't install via the package manager on a clean SMF 1.1.2 install.


  • Just now I downloaded SMF 1.1.2 and installed it
  • Went to the package manager and browsed "Simple Machines Third-party Mod Site"

  • Located the following
    Quote6. Custom Profile Field Mod [ Download ]
    Package Type:  Modification
    Version:  3.16
  • Clicked download and got back:
    QuoteThe package you are trying to download or install is either corrupt or not compatible with this version of SMF.
  • So I manually downloaded the package, uploaded it to my server and clicked "Apply Mod"
  • Everything in the following looked fine to me:
    QuoteInstallation Readme
    This mod will add an unlimited amount of custom profile fields to SMF. They will be configurable in "Features and options". You can have text fields, text area fields, check boxes and selection boxes.

    Install Actions
    Installations actions for "Custom Profile Field Mod":
    Installing this package will perform the following actions:
       Type    Action    Description
    1.    Execute Modification    ./Sources/ModSettings.php    Test successful
    2.    Execute Modification    ./Themes/default/Profile.template.php    Test successful
    3.    Execute Modification    ./Themes/default/Display.template.php    Test successful
    4.    Execute Modification    ./Themes/default/PersonalMessage.template.php    Test successful
    5.    Execute Modification    ./Themes/default/Register.template.php    Test successful
    6.    Execute Modification    ./Sources/Register.php    Test successful
    7.    Extract File    ./Sources/CustomProfile.php    
    8.    Extract File    ./Themes/default/languages/CustomProfile.english.php

Only then did it actually install

FreeGeezer

#1112
I installed "Custom Profile Field Mod" this afternoon, and everything appeared to go well during the installation. I installed it using the Package Manager. I did have to download the mod to my system first, as the package manager carped about it. My SMF is version 1.1.2 and was freshly installed today. I have no other mods installed.

When I log on as the Administrator and go to "Features and Options," nothing has changed from the initial install. More specifically, there is no place on the 3 tabs presented to define custom profile fields. The 3 tabs are: "Basic Features," "Layout and Options," and "Karma".

Where do I add the custom fields?

Thanks,
Roy

FreeGeezer

#1113
What I'm getting is the following error messages:

71.32.242.112  8: Undefined index: cp_cpfields
File: /home/freegeez/public_html/smf/Sources/ModSettings.php
Line: 142
?action=featuresettings  Today at 08:18:52 PM

71.32.242.112  Unable to load the 'CustomProfile.english-utf8' language file.
?action=featuresettings  Today at 08:18:52 PM

I hope this helps identify the solution to my problem.

Thanks,
Roy

Solution: Changed "Default Forum Language" to "English" rather than "English-Utf8".

How's that for a "stab in the dark"?

topiQ

hey folks!
i wanted to add a Skype-Field to the User profiles, so i tried this mod. i'm NOT using the default theme and additionally i'm using the german language files.
so what do i have to do to make it work with my config?!
thanks in advance,
topiQ

trebul

This thread is huge so this probably already got answered but how can I add "optional" above all the custom fields so they person registering knows they don't have to fill out those.

      Love talking about pets?
      Visit a friendly pet forum!

      Looking for tips to running a forum?
      Trebul's community guide


         

char39

I have a field titled "favorite links".  Is there a way to make this field clickable?  Sorry I don't know the proper term for this.  Example; you are viewing someones favorite links in their profile and you can click on them to go to site.

TrueSatan

Try using BBC in the field...specifically the url tag

topiQ

so what about my question? howto make the mod work for NOT default theme and lang?!
thanks in advance.

Kindred

for making this mod work with other languages and/or themes, you will have to manually edit the necesarry files.

For other languages, Themes/default/languages/modifications.*yourlanguage*.php would have to be updated with all the same strings as modifications.english.php

for other themes, you will have to see what kiles your theme changes fomr the deafult and edit the ones that this mod changes. (probably profile.template.php, register.template.php and/or display.template.php.


But for the Skype field, you might consider using the skyper, ventrillo, myspace mod, since that mod also adds the fields into the memberlist function.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: