News:

Wondering if this will always be free?  See why free is better.

Main Menu

Custom Profile Field Mod

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

Previous topic - Next topic

shane is my name

i assumed im runningn it in english. i never changed the language.  how do i determine which one im running? and if im running the wrong english one, how do i change it to regular english?

peteedley

Quote from: KnowNothing on October 14, 2009, 05:54:00 PM
I figured out what it the issue is. Seems like a bug to me, but maybe I don't understand it completely.

In Configuration,
The "Only Allow Admin To Edit Field" check box has to be unchecked.
There has to be a value for the "Text To Display Before Field" field

If either of the above is not true for a custom field, the value for the field entered at registration will not dosplay in the profile.

Thanks,
Mike

OK I had a similar issue to this and found that the fields where I had Only allow admins to edit field? set then they would not be displayed in the profiles.  This is on that I really need as I want to force people to use a real name and membership number on registration to make sure they have access to a members only forum.  But I also want to make sure there real name is visible as this makes them more acountable when their real name appears on everypost.  But if they are allowed to change it after they have registered they only become accountable to the moderators and not their peers which is what i want.

Had this work fine on the previous version this only seems to have happed when upgrading to 1.1.10

Any Ideas how to get round this.

clearblue

Quote from: shane is my name on November 08, 2009, 09:52:15 PM
i assumed im runningn it in english. i never changed the language.  how do i determine which one im running? and if im running the wrong english one, how do i change it to regular english?

You will find a dropdown box at Features and Options - Server Settings

shane is my name

thanks.  i found it, yes mine was running in english utf 8..  whats is this for?  should i just switch to regular english?  whats the difference?

Arantor

English UTF8 is for when the forum is running in UTF8 generally, pretty much essential if you're running a forum with multiple languages.

dannbass

Quote from: drhamad on February 18, 2009, 01:48:57 PM
BINGO:

I've now figured out how to convert this mod's profile fields to 2.0 profile fields.  The data is stored the same exact way.  Therefore, all you need to do is change the variable in smf_themes.

Create the field in 2.0.  DO NOT ENTER ANY DATA.  Go into the database (using phpMyAdmin, or whatever your preferred method is), go into smf_themes and use this query:

UPDATE smf_themes
SET variable = "var1"
where variable = "var2"



Where var1 = the name of the field you just entered
and var2 = the name of the old (1.1) field.

THAT IS IT.


I think I'm missing something... because I cannot find the field I created in 2.0 RC2 over the smf_themes table, is it stored some other place?

Master Zonk

Can't find it anywhere but maybe someone can tell me how to add a membergroup other than admin to the view in profile option....
I am looking in the DisplayFieldsProfile function, but not sure if thats where to start......
Lead me, follow me, or get out of my way.
--George S. Patton Jr.

Arantor

You mean to display more than one membergroup? There's a mod for that for 1.1.x on the mod site.

Master Zonk

no I mean.......if you have 'Only allow admins to view field?' but I want one other membergroup to also view the custom field.
Lead me, follow me, or get out of my way.
--George S. Patton Jr.

Arantor

Ah, that's a bit more complex.

More than one membergroup? Is it a post count group?

Master Zonk

No its a sort of 'members only' group that I personally add people to.....they have access to a lot more stuff than the average user...but no admin privileges...but have the need to see certain custom fields that the average user should not be privy to. 

Using SSI.php I have normally just called up the user_info['groups'] but I don't think that will work in the CustomProfile.php file
Lead me, follow me, or get out of my way.
--George S. Patton Jr.

Arantor

$user_info is declared in Load.php which runs earlier so it should be doable if added to the list of global variables at the start of the function.

Master Zonk

#2792
Yeah that works......
For any one who wants to do this....this is what I did

Modify the CustomProfile.php file in the Sources dir

Find:function DisplayFieldsProfile()
{
        global $context, $modSettings;

and change to:
function DisplayFieldsProfile()
{
        global $context, $modSettings, $user_info;


Then in the same function find:
if ($modSettings['CP' . $i . '_view'] && !$context['user']['is_admin'])
and replace with:
if ($modSettings['CP' . $i . '_view'] && !$context['user']['is_admin'] && !in_array(#, $user_info['groups']))
Of course replace '#' with the membergroup id you wish to view this field along with your admin.
:)
Thanks for the help Arantor and if you get a chance could you check my work!
Lead me, follow me, or get out of my way.
--George S. Patton Jr.

Arantor

First glance it looks right, certainly the syntax is right. If it works for you and doesn't have any side effects you can find, it's probably all you need to do.

Garou

There is also the work around that I posted on another forum and J-Bird re-posted here http://www.simplemachines.org/community/index.php?topic=79004.msg2322565#msg2322565.

Ideally a whole new permission should be created since many people want to allow groups other then the admin to be able view these fields. Since there wont be anymore updates to the mod, either of these will work as a quick fix/hack. The admin just needs to remember that they have implemented one of these workarounds and they don't put the wrong people in the groups that have access.  :)

gastan

#2795
Using default theme on 1.1.10.  Had this mod running good when I decided to upgrade to 2.0 RC2.  Long story but I came back to 1.1.10.  Did a restore of database and overwrote RC2 upgrade files with 1.1.10 upgrade files.  Then re-installed mods.  (Forum is now back to looking and acting how I want it.)

My three added profile fields are still there and working so no problem there.  BUT .... I cannot access the custom profile page to add new fields or edit the ones I have.  In Admin CP > features and options, there are five tabs:

1. Basic Features
2. Layout and options
3. Custom Profile Field
4. Karma (karma is disabled)
5. Custom Tab (links to the front page of the website this forum belongs to)

Clicking on any of the tabs except Custom Profile Field opens the appropriate page for that option.  Clicking on Custom Profile Field always takes me back to the Basic Features page.

During the upgrading and downgrading I suspect the redirect got corrupted somehow.  Any hints on where to look to get the page to open again?

Also, the default font for added fields seems to be bold.  Any way to change that?  Two of the extra fields I have added are on the registration page and are required to be filled in.  I would like the requested info in bold but have added text that explains why I need that info.  I would like that explaination to not be bold.  Possible?

Thanks.

gastan

Bump. 

I don't need to add any fields right now but will need to soon, I think.  Implementing suggestions/requests at my relatively new forum will require new added fields and right now I can't.

nza2k

Hi every one,

I just installed the mod and it seems to work fine.

Thank you very much for the mod.

I'd like to know how can we manualy extract data from custom fields on other parts of the website. I've looked for new fields in smf_members table but I haven't found any...
Avis sur les voyagistes dans le forum de Voyage-Net, propulsé par SMF depuis des années :)

Arantor

The fields are stored in the smf_themes table, one row per member per value.

nza2k

Avis sur les voyagistes dans le forum de Voyage-Net, propulsé par SMF depuis des années :)

Advertisement: