• Welcome to Simple Machines Community Forum. Please login or sign up.
December 07, 2021, 01:21:32 AM

News:

Join the Facebook Fan Page.


Custom Profile Field Mod

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

Previous topic - Next topic

Afro

I have a near similar issue here too..The mod installed fine on my heavily modified forum but when i click on the admincpan>>featureas ......it shows error on my modsettings.php file.

"Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/afrowall/public_html/Sources/ModSettings.php on line 126"

why is that?

here is my modsettings file

perplexed

Quote from: EDSucation on June 01, 2009, 12:39:28 AM
I think that this mod is conflicting with my Custom Tab mod because I took a look at the Manual Install Instructions, and where it wants me to place this


'profile' => 'ModifyProfileSettings',
   );

   // By default do the basic settings.
   $_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'basic';
   $context['sub_action'] = $_REQUEST['sa'];



Where this is

);

   // By default do the basic settings.
   $_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'basic';
   $context['sub_action'] = $_REQUEST['sa'];



I get this instead


);

   $subActions['custom'] = 'ModifyCustomTabSettings';

   // By default do the basic settings.
   $_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'basic';
   $context['sub_action'] = $_REQUEST['sa'];



What can I do?
Thanks,
EDSucation



If you are installing it manually or editing that file manually then all it wants you to do is put this

'profile' => 'ModifyProfileSettings',

above where it says this

);

that extra bit of code you have for the other mod is probably preventing it from installing without errors but if you then edit that file manually as per the above then it should be ok.

Remember to always back up all files etc before editing any of them or installing any mods. :)

Garou

Quote from: afrowall.com on June 01, 2009, 01:28:13 PM
I have a near similar issue here too..The mod installed fine on my heavily modified forum but when i click on the admincpan>>featureas ......it shows error on my modsettings.php file.

"Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/afrowall/public_html/Sources/ModSettings.php on line 126"

why is that?

here is my modsettings file

Actually the error is on line 124...
'ultprofile' => 'ModifyUltProfileSettings'
It needs a comma after.
'ultprofile' => 'ModifyUltProfileSettings',

Afro


Angelina Belle

This will hold me until SMF 2.x goes gold!
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

Angelina Belle

Bug
Contents of selection field replace contents of preceding text field

Circumstances
First I added 4 custom profile fields.  Then I added a selection field (CP5).
Logged on as administrator, I edited a regular users's custom profile fields.
As soon as I saved, the contents of the selection field (CP5) replaced the contents of the preceding text field (CP4).
This behavior persisted even if I disabled field CP5, and ceased when I deleted the selection field

Workaround
I added an unneeded text field (CP5), followed by the desired selection field (CP6), then disabled CP5.  I don't care what the contents of CP5 are, as nobody can see the field.  Works fine.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor


Jamie_ATFC

how do you get this mod to work with these profile boxes

hxxp:www.dzinerstudio.com/index.php?topic=2520.0 [nonactive]


because my forum looks like this..

hxxp:i526.photobucket.com/albums/cc343/BMilnez/piccyforum.jpg [nonactive]

thezkitten

June 09, 2009, 04:11:22 PM #2548 Last Edit: June 09, 2009, 04:44:11 PM by thezkitten
ok, I was in the same boat as it seems everyone, but I figured it out
First, you have to find the Custom Profile number (the CP#)
My "Custom Profile Field ID"s were in the database under
"smf_themes"
To find the specific one I needed, I just exported the table, searched for a string that I knew was in the spot I wanted, and I had my number.
If you're still not finding it, then modify a profile with something that is unique (like a limerick or something) you just need it in there long enough to find the CP# you're looking for.


Now, you need to label your new column, I went to "\Themes\default\languages\index.english.php"
and just plugged in
$txt['Etsy1'] = 'Etsy Store';
I don't think it matters where (I put mine under MSN) but do make sure you use a unique code, or it could mess something up!


Then, I went to "\Sources\memberlist.php"
found the columns
// Set up the columns...
$context['columns'] = array(
'isOnline' => array(
'label' => $txt['online8'],
'width' => '20'
),
'realName' => array(
'label' => $txt[35]
),
'emailAddress' => array(
'label' => $txt[307],
'width' => '25'
),
'websiteUrl' => array(
'label' => $txt[96],
'width' => '25'
),
'ICQ' => array(
'label' => $txt[513],
'width' => '25'
),
'AIM' => array(
'label' => $txt[603],
'width' => '25'
),
'YIM' => array(
'label' => $txt[604],
'width' => '25'
),
'MSN' => array(
'label' => $txt['MSN'],
'width' => '25'
),
'ID_GROUP' => array(
'label' => $txt[87]
),
'registered' => array(
'label' => $txt[233]
),
'posts' => array(
'label' => $txt[21],
'width' => '115',
'colspan' => '2'
)
);


and I added mine to the end, making sure that all my parentheses and semi-colons were correct
and also making sure I used the code I plugged into the index file

'posts' => array(
'label' => $txt[21],
'width' => '115',
'colspan' => '2'
),
'CP10' => array(
'label' => $txt['Etsy1'],
'width' => '25',
)
);


Then I went to  "\Themes\default\memberlist.template.php"

And I found where the info was-

// Assuming there are members loop through each one displaying their data.
if (!empty($context['members']))
{
foreach ($context['members'] as $member)
echo '
<tr style="text-align: center;"', empty($member['sort_letter']) ? '' : ' id="letter' . $member['sort_letter'] . '"', '>
<td class="windowbg2">
', $context['can_send_pm'] ? '<a href="' . $member['online']['href'] . '" title="' . $member['online']['text'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $member['online']['image_href'] . '" alt="' . $member['online']['text'] . '" align="middle" />' : $member['online']['label'], $context['can_send_pm'] ? '</a>' : '', '
</td>
<td class="windowbg" align="left">', $member['link'], '</td>
<td class="windowbg2">', $member['hide_email'] ? '' : '<a href="mailto:' . $member['email'] . '"><img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt[69] . '" title="' . $txt[69] . ' ' . $member['name'] . '" /></a>', '</td>
<td class="windowbg">', $member['website']['url'] != '' ? '<a href="' . $member['website']['url'] . '" target="_blank"><img src="' . $settings['images_url'] . '/www.gif" alt="' . $member['website']['title'] . '" title="' . $member['website']['title'] . '" /></a>' : '', '</td>
<td class="windowbg2">', $member['icq']['link'], '</td>
<td class="windowbg2">', $member['aim']['link'], '</td>
<td class="windowbg2">', $member['yim']['link'], '</td>
<td class="windowbg2">', $member['msn']['link'], '</td>
<td class="windowbg" align="left">', empty($member['group']) ? $member['post_group'] : $member['group'], '</td>
<td class="windowbg" align="left">', $member['registered_date'], '</td>
<td class="windowbg2" width="15">', $member['posts'], '</td>
<td class="windowbg" width="100" align="left">
', $member['posts'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $member['post_percent'] . '" height="15" alt="" />' : '', '</td>


and added my code after the posts, and before the closing <tr>
<td class="windowbg2">', !empty($member['options']['CP1']) != '' ? '<a href="' . $member['options']['CP1'] . '" target="_blank"><img src="http://etsysteamteam.com/forum/Themes/default/images/etsystore.gif"></a>' : '', '</td>

at the end

Then (still in Memberlist.template.php) I did a search of all 
colspan="12
and replaced them with
colspan="13"

save & upload your files and you're good.

My code had custom stuff in it, the etsy image specificly. To have something without the image you would just adjust accordingly..
If you have very little knowledge of PHP (like me) then just copy one of the other entries
I'd go with the website one for url links-
<td class="windowbg">', $member['website']['url'] != '' ? '<a href="' . $member['website']['url'] . '" target="_blank"><img src="' . $settings['images_url'] . '/www.gif" alt="' . $member['website']['title'] . '" title="' . $member['website']['title'] . '" /></a>' : '', '</td>

and the group one for text
<td class="windowbg" align="left">', empty($member['group']) ? $member['post_group'] : $member['group'], '</td>


hope I could help!
http://zkitten.com  :|:  http://chaoticlycreative.com  :|:  http://etsysteamteam.com [nofollow]

Lots O Smileys not working for you? This may be it!  Also, Need to Show Custom Fields in Memberlist? this could help! (for 1.1.x)

DirtRider

I am trying to install this one SMF 1.1.9 using the Parse but I cannot find the following in the ModSettings.php



);

// By default do the basic settings.
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'basic';
$context['sub_action'] = $_REQUEST['sa'];



And



);

// Default to core (I assume)
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'basic';



So if one of you fine people could help me with this I would really appreciate it  :D
http://www.triumphtalk.com

"The real question is not whether machines think but whether men do. "

.Vapor

Any way we could add a message above the form ? For instance maybe some special instructions of some sort ? Maybe in new release ?

Garou

DirtRider both lines are in the file but if yours is modified you may have to just do a search through your file for "basic" eventually you should stumble upon it.

V@POR, unfortunately there will be no new release for this. In the future if you want this feature you will have to upgrade to 2.x as it is an included feature of 2.0

DirtRider

I tried that and found where I thought it should go but ended up with an error  :'(
http://www.triumphtalk.com

"The real question is not whether machines think but whether men do. "

Urbanite

Quote from: Garou on June 15, 2009, 11:40:08 AM
unfortunately there will be no new release for this. In the future if you want this feature you will have to upgrade to 2.x as it is an included feature of 2.0

Garou, you saying this won't work in SMF V2?

There is a limitation of 255 characters in the 'in built' version of SMF V2, which is a bit restrictive when you want to use drop-down lists.

Does the 'Custom Profile Field Mod' have a similar limitation?
Just when you finally get it idiot proof ...along comes a bigger idiot!

Garou

DirtRider, don't know what to tell you other then trial and error. It should work, others have gotten it to, me as well on a clean forum just to see if I it was possible. If you are running into problems it has to be due to conflicts with other mods. It will work its just going to take some work.

Urbanite, its been stated in this thread multiple times that there will be no more upgrades to this mod. In the event that there are any major changes in the 1.1.x series of SMF, I'm sure someone might list the fix but nothing new will be added to this mod nor will it be updated to work on 2.x as the functionality is in there.

As for modifying the existing code in 2.x you can ask in the SMF Coding Discussion board for help with it.


Kindred

also note that this functionality is already present in SMF 2.0
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.<br /><br />"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Garou

I mentioned that.  :)

In saying that they should ask in the coding discussion boards, I was referring to the fact that one of the reasons Urbanite and others have an issue with the 2.x feature is the 255 character limitation. Which I now see of course has been addressed in the SMF 2.x Support.
Quote from: regularexpression on February 08, 2009, 02:01:31 PM
the max length is 255 characters.  This is limited by the field type which is set to tinytext (which has max lenght of 255)

That's the reason but a work around hasn't been suggested yet. I would suggest that one change the field type to some other setting but that's a discussion for the other board.    ;D

ehsizzup

June 22, 2009, 03:38:54 PM #2557 Last Edit: July 31, 2009, 12:02:14 AM by ehsizzup
Right now all the Custom fields appear at the bottom of the registration form.

Can the custom fields be sorted within the standard SMF fields? (ie. not all at the bottom of the form)



ehsizzup

June 22, 2009, 03:53:30 PM #2558 Last Edit: June 22, 2009, 07:42:28 PM by ehsizzup
is there a way to limit the length of a custom field?

is the a way to change the size of the text boxes?


Kindred

Quote from: ehsizzup on June 22, 2009, 03:38:54 PM
Right now all the Custom fields appear at the bottom of the registration form.

Can the custom fields be sorted within the standard SMF fields? (ie. not all at the bottom of the form)

not possible with the current implementation
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.<br /><br />"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: