Custom Profile Field Mod

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

Previous topic - Next topic

JamesWC

Quote from: Sarke on February 28, 2007, 12:48:40 AM
cloudee1, are you just trying to get one profile field from one member, or something else (not sure why you have the loop in there when the SQL you're trying to do will only return it for one member)?

If it's the former, here's how you do it:


<?phpTh

$sql 
"SELECT value
FROM smf_themes
WHERE ID_MEMBER = '
$memberid' AND variable = 'CP2'
LIMIT 1"
;

$result mysql_query($sql);

if (
$row mysql_fetch_array($result))
$customfield2 $row['value'];
else
$customfield2 '(empty)';

echo 
$customfield2;

?>



I haven't tested it, but it should work.

Sarke, I don't care if it's anatomically possible, I want to have your children. 8) That's the code I've been needing for a long time, so what I've been working on now finally works. Thanks!

I'd been getting bogged down in $context variables which, on some sites, might be necessary for lightening the load, but for me this straightforward SQL does the job well enough!

naitram

Quote from: JamesWC on February 28, 2007, 03:07:57 PM
Quote from: Sarke on February 28, 2007, 12:48:40 AM
cloudee1, are you just trying to get one profile field from one member, or something else (not sure why you have the loop in there when the SQL you're trying to do will only return it for one member)?

If it's the former, here's how you do it:


<?phpTh

$sql 
"SELECT value
FROM smf_themes
WHERE ID_MEMBER = '
$memberid' AND variable = 'CP2'
LIMIT 1"
;

$result mysql_query($sql);

if (
$row mysql_fetch_array($result))
$customfield2 $row['value'];
else
$customfield2 '(empty)';

echo 
$customfield2;

?>



I haven't tested it, but it should work.

Sarke, I don't care if it's anatomically possible, I want to have your children. 8) That's the code I've been needing for a long time, so what I've been working on now finally works. Thanks!

I'd been getting bogged down in $context variables which, on some sites, might be necessary for lightening the load, but for me this straightforward SQL does the job well enough!


just need to echo the same comment here, this works great and no more flood of "undefined" errors

ibpnyc

Quote from: perplexed on February 28, 2007, 07:38:21 AM
read this thread it might help you


I went thru the thread you linked and it mentioned 2 items.

1 - repair_settings.php file which links to converters

2 -  SMF Arcade fix....

im not sure which of these 2 would fix my problem.   Sorry for being so ignorant to what is going on with all the coding and such but I am still trying to figure out how to understand all the "lingo" going on.  Could it be that my forum is not in a ........../forum directory?  If so can I simply relocate all the files into a /forum directory or will this cause other issues?


thanks in advance for all input...I really appreciate it..

wm

I'm setting up a site that will have 300+ members and 8 or more custom fields - that would add 2400+ rows to smf_themes.  I'm wondering about the impact of having that many rows in that table.

I'm in the process of making some changes to this mod anyway (we want some of the fields on the Account page and we want to allow the user to hide some of them).  Should I create a separate table for the field data?

Thanks,
William

naitram

i've got over 3000 membere and 5 custome fields, havent had any issues

charipie0519

Using SMF 1.1.2 & TinyPortal 0.9.7

i uploaded and applied customprofile3-16 mod.

i get this message when i click the Features after applying the mod:



Fatal error: Cannot redeclare modifyprofilesettings() (previously declared in /home/yjobzcom/public_html/forum/Sources/ModSettings.php:314) in /home/yjobzcom/public_html/forum/Sources/ModSettings.php on line 319


NEMINI

open up modsettings.php and find the code that starts on line 314 and duplicated again starting on line 319 ... delete one instance of the entire duplicated section.
signatures are boring.

charipie0519

what kind of text editor must i use to view the modsettings.php where i can see the line numbers?

Bigguy

This is a very nice one. It will show you the line numbers. If you have php installed it will also debug for you to ;)

http://www.mpsoftware.dk/phpdesigner.php

Davey D.

Reply #835 - any help here?

charipie0519

Quote from: Bigguy on March 04, 2007, 01:30:18 AM
This is a very nice one. It will show you the line numbers. If you have php installed it will also debug for you to ;)

http://www.mpsoftware.dk/phpdesigner.php [nofollow]

thanks.

Bigguy

#1011
That's really not telling us much or giving us anything to go on. :)

Quote from: davidkirk on March 04, 2007, 09:41:55 AM
Reply #835 - any help here?

Davey D.

Quote from: davidkirk on January 23, 2007, 11:09:45 AM
I'm willing to get dirty so if someone could give me some direction I would appreciate it.

This Web site is for professionals collaborating from all over the country, and I've already realized most of them never used a message board and don't understand (funny) "username" only. A small problem that will have to be fixed later is some have entered, "john smith" or "John Smith" or just "John" or "J. Smith."

This mod works because it will force them to realize they must enter First and Last name and a company or organization name. Unfortunately, and I realize the "username" is a required input, some have complained about the redundant field, and why is the "First" and "Last" name fields at the bottom of the form (under the CAPTCHA).

The screenshot shows how it looks right now.

Any help with this please?

UPDATE:

Okay. Can I rename "username" to "First and Last Name" and change the description under this to read, "Please enter your full name, ie., Jane Smith?"

The only issue then would be how to get the "Company/Organization" field moved up to under the name field.

My question actually started on #833, to which I never received a working answer. I just started asking every page and referring to my post #835 hoping someone would look back to that topic instead of me copy/pasting the same stuff every page.

I just want to know if it is possible to move the fields I create with this MOD under the "Username" field.

charipie0519

hello again,

i have deleted the duplicate entries as what Bigguy told me to do with the help of that software.

now, my problem is, whatever additional field i enable and show on the registration agreement, it displays two copies of the block.

for example, Real Name box, there are two Real Name boxes on the Registration Form.


Sarke

Sounds like you've managed to install the mod twice.   

My MODs          Please don't PM me for support, post in the appropriate topic.

charipie0519


charipie0519

there was only one installation of the mod.
maybe there's another reason why i got two boxes.

Sarke

The list of installed packages is probably wrong.  Maybe you deleted it before uninstalling it, and then installed it again.  I can't think of another reason why the code would be duplicated.  Either way, you'll have to uninstall it manually.

My MODs          Please don't PM me for support, post in the appropriate topic.

WifiGamer

Ok with 68 pages on this mod that is a lot to fish through to report this error.  I did read through some of them and didn't see it so I'm hoping it's new.

The mod works perfectly except 1 little glitch.  I created 5 custom TEXT fields and then 1 check mark box.  I wanted the check mark at the very top so I used the [Move Up] link and moved it up to the top.  However, what happened then is that all of my Field Description boxes changed to match the one that was in the custom field check box's field.

IE

I created 5 fields and the field description were character 1, character 2, character 3, char , and char 5. Then I made a check box field and that field description said "Founder".  Finally I clicked the [Move Up] link to move the check box field to the top.  Then I saved and tested it.  I noticed that ALL the custom fields then had the same Field Description of "Founder".  When I checked the admin panel, sure enough, all of the Descriptions changed.

JamesWC

Quote from: WifiGamer on March 06, 2007, 10:08:28 AM
Ok with 68 pages on this mod that is a lot to fish through to report this error.  I did read through some of them and didn't see it so I'm hoping it's new.

The mod works perfectly except 1 little glitch.  I created 5 custom TEXT fields and then 1 check mark box.  I wanted the check mark at the very top so I used the [Move Up] link and moved it up to the top.  However, what happened then is that all of my Field Description boxes changed to match the one that was in the custom field check box's field.

IE

I created 5 fields and the field description were character 1, character 2, character 3, char , and char 5. Then I made a check box field and that field description said "Founder".  Finally I clicked the [Move Up] link to move the check box field to the top.  Then I saved and tested it.  I noticed that ALL the custom fields then had the same Field Description of "Founder".  When I checked the admin panel, sure enough, all of the Descriptions changed.

This happened to me as well, so I just got into the habit of jotting down all my field descriptions before moving anything. Not an ideal solution, but it wasn't worth waiting for a new version of the mod.

Advertisement: