Custom Profile Field Mod

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

Previous topic - Next topic

winrules

Link to Mod

This mod will add an unlimited number of custom profile fields to SMF. They will be configurable in "Features and Options". The following options are available (when you click on the field name on the main screen):


For text box or text area:
-Name
-Field Description
-Show in profile?
-Show in posts?
-Parse BBC?
-Text to display before field (BBC is ok if enabled above)
-Text to display after field (BBC is ok if enabled above)
-Field ID
-Add a horizontal rule before field in profile?
-Show field on registration?
-Only allow admins to edit field?
-Only allow admins to view field?

For check box:
-Name
-Field Description
-Show in profile?
-show in posts?
-Text to display when box is checked
-Text to display when box isn't checked
-Parse BBC?
-Fields ID
-Add a horizontal rule before field in profile?
-Show field on registration?
-Only allow admins to edit field?
-Only allow admins to view field?

For selection box:
-Name
-Field Description
-Show in profile?
-show in posts?
-Parse BBC?
-Fields ID
-Add a horizontal rule before field in profile?
-Show field on registration?
-Only allow admins to edit field?
-Only allow admins to view field?
-Option 1
-Option 2
-Add an option

In the text to add before and after the field you can type "%1" (without the quotes) and it will replace %1 with the content of the field. Example: If you wanted to make a MySpace Field, you could use [url=http://www.myspace.com/%1] in the before spot and [/url] in the after spot, and it would just show the username but link to the site.


Currently Known Bugs:
- None


Version History:
3.19-Fixed a small bug with fields on registration.
3.18-Fixes a security vulnerability.
3.17-Fixed a bug with moving fields.
3.16-Added compatibility for 1.1 final.
3.15-Fixed bug with moving fields up and down and deleting.
3.14-Security hole fixed (big thanks to HarzeM for discovering it). All users are strongly encouraged to upgrade.
3.13-1.1 RC3 compatibility added, 1.1 RC2 development stopped.
3.12-Fixes a bug with the before and after options on text fields.
3.11-Fixes a bug with adding options, and a bug with moving selection fields.
3.1-Adds an option to reorder and delete fields, some small changes in the admin interface, field descriptions, the text for the admin tab is now stored in language files, adds some more options for horizontal rules, fields are now enabled by default when you create them.
3.02-Fixes a bug with fields on posts.
3.01-Fixes an error with loadLanguage().
3.0-Moved almost everything into a central file for easier upgrades, fixed a bug with check boxes, and moved all the text into the language files.
2.14-Fixed some issues with selection fields.
2.13-Fixes errors in error log, other bugs.
2.12-Fixes bug with Mambo/Joomla, and fixes XHTML compliance bug.
2.11-Fixes bug when forcing field on registration.
2.1-Added permissions to view and edit fields, an option on where to display in posts, and an option to display the fields on registration.
2.0-Adds selection box fields and adds an add a field button.
1.11-Fixes bug with using "%1" in posts.
1.1-Adds "%1" functionality in before and after fields.
1.02-Fixes more compatibility issues.
1.01-Fixes compatibility issue with some other mods (there is no need to upgrade from 1.0 to 1.01 if you already have the mod installed).
1.0-Initial public release.


How to Make "Show in posts?" Work With Custom Themes (last updated for version 3.16):

In Display.template.php
Find:

// Show how many posts they have made.

And Replace With:

global $sourcedir, $messagevars;
$messagevars = $message;
require_once($sourcedir . '/CustomProfile.php');
DisplayFieldPosts();

// Show how many posts they have made.


Find:

<a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['label'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . '.gif" alt="' . $message['member']['online']['label'] . '" border="0" />' : $message['member']['online']['label'], '</a>';

And Replace With:

<a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['label'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . '.gif" alt="' . $message['member']['online']['label'] . '" border="0" />' : $message['member']['online']['label'], '</a>';
DisplayFieldPostsPictures();

Note: If your theme has it's own Profile.template.php or PersonalMessage.template.php or Register.template.php you will have to make changes to those but most themes don't. Also note that this isn't necessary on all themes, but most have their own Display.template.php.


Download Latest Version (3.19)


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


xtremecruiser

Will this do links to other sites too, like blogs, or blog profiles, etc ?
Thanks

xtremecruiser

Got some errors, using Powered by SMF 1.1 RC2 with the latest patch

Install Actions
Installations actions for "Custom Profile Mod":
Installing this package will perform the following actions:
   Type    Action    Description
1.    Execute Modification    ./Sources/ModSettings.php    Test failed
2.    Execute Modification    ./Themes/default/Profile.template.php    Test failed
3.    Execute Modification    ./Themes/default/Display.template.php    Test successful
4.    Execute Modification    ./Themes/default/PersonalMessage.template.php    Test successful
5.    Execute Code    add_settings.php    

daragor

some errors for me too in RC2

nice mod! fix it please
Webscom: Wordpress + SMF
Software Libre, Noticias y Entretenimiento.-

dracomiconia


winrules

xtremecruiser and daragor, do you have any other mods installed?

dracomiconia, I'll might make it for 1.0.7 depending on how much changes I'd have to make.


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


xtremecruiser

#6
Quote from: winrules on March 31, 2006, 08:46:08 AM
xtremecruiser and daragor, do you have any other mods installed?

dracomiconia, I'll might make it for 1.0.7 depending on how much changes I'd have to make.

I have a beta site ( copy of my main one and its loaded with mods )
List is below of all that were on it and whats on it now ( all work except Spoiler Tag    0.2.3 )
My main site is on RC1.1 but I have not updated since RC 1.3 or the final is so close ( and your will not install on RC1.1 )

Mod Name     Version     
1.    The Bar Of Experience    1.1    [ Apply Mod ] [ List Files ] [ Delete ]
2.    Spoiler Tag    0.2.3    [ List Files ] [ Delete ]
3.    Integrated Chat    2.2    [ Apply Mod ] [ List Files ] [ Delete ]
4.    Karma Log    1.0.1    [ Apply Mod ] [ List Files ] [ Delete ]
5.    Spoiler Tag    0.2.3    [ Uninstall ] [ List Files ] [ Delete ]
6.    Custom Profile Mod    1.0    [ Apply Mod ] [ List Files ] [ Delete ]
7.    EmailFlash    1.0    [ Uninstall ] [ List Files ] [ Delete ]
8.    G&S_Sticky    1.0    [ Apply Mod ] [ List Files ] [ Delete ]
9.    Simple_Mood    1.0    [ Uninstall ] [ List Files ] [ Delete ]
12.    MessagePreviewOnHover    1.0    [ Uninstall ] [ List Files ] [ Delete ]
13.    Ad Managment    1.4    [ Uninstall ] [ List Files ] [ Delete ]
14.    TinyPortal    0.84    [ Apply Mod ] [ List Files ] [ Delete ]
15.    OnLine Users Today    1.2    [ Apply Mod ] [ List Files ] [ Delete ]
16.    Board Default Sort    1.23    [ List Files ] [ Delete ]
17.    Faster Parsecode    1.07    [ List Files ] [ Delete ]
18.    Unreplied Topics    1.02    [ List Files ] [ Delete ]
19.    Actions in Profile Display    1.3    [ Apply Mod ] [ List Files ] [ Delete ]
20.    Thank You Mod    1.01    [ Apply Mod ] [ List Files ] [ Delete ]
21.    Visual Warning / Post Moderation    1.21    [ Apply Mod ] [ List Files ] [ Delete ]
22.    Excess Blank Lines    1.02    [ List Files ] [ Delete ]
23.    Hide Tag    1.18    [ Uninstall ] [ List Files ] [ Delete ]
24.    Banner Manager    3.4    [ Apply Mod ] [ List Files ] [ Delete ]
25.    MessagePreview    1.0    [ Apply Mod ] [ List Files ] [ Delete ]
26.    SMF 1.0.7 / 1.1 RC2 Update    1.0    [ Uninstall ] [ List Files ] [ Delete ]
27.    Resample Big Attached Images    0.1    [ Uninstall ] [ List Files ] [ Delete ]

winrules

Wow, that's a lot. I'll try to go through all the main ones there and see if i can find any conflicting modifications.


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


winrules

OK, try version 1.01 i just uploaded, that should atleast fix the Sources/ModSettings.php error.


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


xtremecruiser

Quote from: winrules on March 31, 2006, 09:21:13 AM
OK, try version 1.01 i just uploaded, that should atleast fix the Sources/ModSettings.php error.

Only a few of them are accually installed, I just listed what the older versions of SMF had installed

I got this with the new version

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 failed
3.    Execute Modification    ./Themes/default/Display.template.php    Test successful
4.    Execute Modification    ./Themes/default/PersonalMessage.template.php    Test successful
5.    Execute Code    add_settings.php    

The only active mods are

EmailFlash
Simple_Mood
MessagePreviewOnHover
Ad Managment
Hide Tag
SMF 1.0.7 / 1.1 RC2 Update
Resample Big Attached Images
and Spoiler Tag  0.2.3 that will not work since the update but I think it was because of the Thank You Mod that I modified

winrules

OK, now try 1.02, i just uploaded it, it might fix the other problem.


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


xtremecruiser

Quote from: winrules on March 31, 2006, 09:34:22 AM
OK, now try 1.02, i just uploaded it, it might fix the other problem.

Still the same issue, I am installing another test site with the mods listed
These rae the ones I have to have since I have so many posts with them

MessagePreviewOnHover
Ad Managment
Hide Tag
SMF 1.0.7 / 1.1 RC2 Update
Resample Big Attached Images
and Spoiler Tag  0.2.3

Installations actions for "Custom Profile 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 failed
3.    Execute Modification    ./Themes/default/Display.template.php    Test successful
4.    Execute Modification    ./Themes/default/PersonalMessage.template.php    Test successful
5.    Execute Code    add_settings.php    

Do you need to see my Profile.template.php ?

winrules

Quote from: xtremecruiser on March 31, 2006, 09:42:04 AM
Quote from: winrules on March 31, 2006, 09:34:22 AM
OK, now try 1.02, i just uploaded it, it might fix the other problem.

Still the same issue, I am installing another test site with the mods listed
These rae the ones I have to have since I have so many posts with them

MessagePreviewOnHover
Ad Managment
Hide Tag
SMF 1.0.7 / 1.1 RC2 Update
Resample Big Attached Images
and Spoiler Tag  0.2.3

Installations actions for "Custom Profile 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 failed
3.    Execute Modification    ./Themes/default/Display.template.php    Test successful
4.    Execute Modification    ./Themes/default/PersonalMessage.template.php    Test successful
5.    Execute Code    add_settings.php    

Do you need to see my Profile.template.php ?
Yeah, that would help if you could post it here.


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


xtremecruiser

I got it to work by, updating to Ad Managment 1.5 or removing MessagePreviewOnHover  1.0 and Simple_Mood then installing your mod then reinstalling them ?
Not sure what did it ? I set up a new test forum and everything worked, so I started removing mods for testing

May I ask a silly Q also
I want the mod to use for a link to a blog profile, basically its a website link

IE www.xxxxx.com/Name
I see that I can do the site name   www.xxxxx.com/ and add the name in the field but the whole thing shows up and its too long and I only need the Name to show

And Thanks for all the help !!!

winrules

Quote from: xtremecruiser on March 31, 2006, 10:45:31 AM
I got it to work by, updating to Ad Managment 1.5 or removing MessagePreviewOnHover  1.0 and Simple_Mood then installing your mod then reinstalling them ?
Not sure what did it ? I set up a new test forum and everything worked, so I started removing mods for testing

May I ask a silly Q also
I want the mod to use for a link to a blog profile, basically its a website link

IE www.xxxxx.com/Name
I see that I can do the site name   www.xxxxx.com/ and add the name in the field but the whole thing shows up and its too long and I only need the Name to show

And Thanks for all the help !!!
It was probly the simple mood mod that messed it up, since its the only one that modifies profile.template.php.

You can't currently do that in this version, but I'm working on a way to do that for next version.


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


xtremecruiser

#15
Quote from: winrules on March 31, 2006, 10:51:17 AM
Quote from: xtremecruiser on March 31, 2006, 10:45:31 AM
I got it to work by, updating to Ad Managment 1.5 or removing MessagePreviewOnHover  1.0 and Simple_Mood then installing your mod then reinstalling them ?
Not sure what did it ? I set up a new test forum and everything worked, so I started removing mods for testing

May I ask a silly Q also
I want the mod to use for a link to a blog profile, basically its a website link

IE www.xxxxx.com/Name
I see that I can do the site name   www.xxxxx.com/ and add the name in the field but the whole thing shows up and its too long and I only need the Name to show

And Thanks for all the help !!!
It was probly the simple mood mod that messed it up, since its the only one that modifies profile.template.php.

You can't currently do that in this version, but I'm working on a way to do that for next version.

Thanks I was about to post that that mod was the only one that modified the file too, yours just has to be installed first.

No way to resize the part that shows or make it use 2 lines or hide the "Text to display before field" or maybe a image to use instead :P

Thanks again

I can use BBC code for a image but cant get the name to add in in, a weblink is just too long IE http://www.xxxx.com/BlogLink

[url=http://www.xxxx.com/][img]http://link to image goes here[/img][/url]

winrules

Quote from: xtremecruiser on March 31, 2006, 10:59:43 AM
Quote from: winrules on March 31, 2006, 10:51:17 AM
Quote from: xtremecruiser on March 31, 2006, 10:45:31 AM
I got it to work by, updating to Ad Managment 1.5 or removing MessagePreviewOnHover  1.0 and Simple_Mood then installing your mod then reinstalling them ?
Not sure what did it ? I set up a new test forum and everything worked, so I started removing mods for testing

May I ask a silly Q also
I want the mod to use for a link to a blog profile, basically its a website link

IE www.xxxxx.com/Name
I see that I can do the site name   www.xxxxx.com/ and add the name in the field but the whole thing shows up and its too long and I only need the Name to show

And Thanks for all the help !!!
It was probly the simple mood mod that messed it up, since its the only one that modifies profile.template.php.

You can't currently do that in this version, but I'm working on a way to do that for next version.

Thanks I was about to post that that mod was the only one that modified the file too, yours just has to be installed first.

No way to resize the part that shows or make it use 2 lines or hide the "Text to display before field" or maybe a image to use instead :P

Thanks again

I can use BBC code for a image but cant get the name to add in in, a weblink is just too long IE http://www.xxxx.com/BlogLink

[url=http://www.xxxx.com/][img]http://link to image goes here[/img][/url]
Version 1.1 has been released!

You can now use "%1" in the before and after fielids and it will be substitued with the fields content. Hope that's what you're looking for. :)


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


xtremecruiser


winrules

Version 1.11 has been released, which fixes a bug with using the "%1" feature and displaying the field in posts.


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


xtremecruiser

Quote from: winrules on March 31, 2006, 05:09:20 PM
Version 1.11 has been released, which fixes a bug with using the "%1" feature and displaying the field in posts.

I will give it a good test tonight :P
BTW I am going to use the Awards Mod later tonight also  ;D

Advertisement: