Custom Profile Field Mod

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

Previous topic - Next topic

Theberge43


S1L1C0N


oneway

HELP! :)

Winrules, I've just installed Awards1-1(RC2.zip on SMF1.1RC2, TP0.86, Epsilon Theme. Had to do it manually as auto install didn't work.

After manual, the Award works in Profile, but NOTHING in posts.

Groan... I've now seen here that Epsilon has its own Display.template.php.

Quote from: 2inrulesHow to Make "Show in posts?" Work With Custom Themes (last updated for version 3.15):

In Display.template.php
Find:

Code:
         // Show how many posts they have made.
And Replace With:

Code:
         global $sourcedir, $messagevars;
         $messagevars = $message;
         require_once($sourcedir . '/CustomProfile.php');
         DisplayFieldPosts();
         
         // Show how many posts they have made.

Find:

Code:
                        <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:

Code:
                        <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.

Okay, I've put the mods in the default Display.template.php. Please, what do I do now? I simply don't know whether to:

1. Take the default Display.template.php back to where it was, or leave it as modified.

2. Then maybe install Awards in Epsilon's Display.template.php?

3. And if so, do I still have to do your 'How to Make "Show in posts?" Work With Custom Themes' instructions above in Epsilon's Display.template.php?

Man am I confused?!!!!!

Maybe there's an easier way to do all that I'm trying to do - which is simply to be able to put BBC code into 'Personal Text' to go into members' Profiles! (I tried copying some of your code to do this, but it didn't work.) *sigh*

winrules

Did you install the awards mod or custom profile field mod. Also in niether of the two mods will you be able to put BBC in personal text.


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


oneway

Quote from: winrules on September 03, 2006, 10:45:50 AM
Did you install the awards mod or custom profile field mod. Also in niether of the two mods will you be able to put BBC in personal text.

Thankyou for your reply winrules! Your Mods are great! (I use Custom Actions all the time and it is SO 'well behaved' so far as html is concerned - far better than using Articles with my version of TP). Okay...

1. I did Awards. I just this minute decided to put the Awards code into the Epsilon Display.template - and Awards now works! Wow!! (wish I'd done that last night).

2. But further to the matter of Personal Text, for it could I use 'parse_bbc' code like I saw in one of your in Mods, for example:

if (!empty($context['member']['blurb']))
{
$blurb = parse_bbc($context['member']['blurb']);
echo '' . $blurb . '';
}


Should that work? Or is other code needed elsewhere to enable 'parse_bbc' to function. I'd much appreciate your comments on that.

Thanks again!

winrules

That should work. You can just use echo $blurb; instead of echo '' . $blurb . '';


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


Bluebair

#526
Quote from: winrules on September 01, 2006, 02:37:30 PM
No, but you can follow [Unknown]'s tutorial..

Thanks for the tip, and special thanks to [unknown] who's tutorial was very clear and most helpfull.

I do have one last question, when you customize big parts of the Profile.template.php how does this behave with upgrades? I did make a copy of the default theme's files and saved them under a different name, but does this mean that an upgrade changes the default files and that I have to upgrade my theme manually?

winrules

Yes, you will have to redo the changes to the theme.


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


fiver

Quote from: winrules on September 02, 2006, 04:45:02 PM
Quote from: fivearts on September 02, 2006, 01:43:14 PM
Hi winrules,

Many thanks for creating this extremely useful mod.

I have an idea which I don't know whether is it possible with Custom Profile Fields, ie. besides text box, check box and selection box, is it possible to add a 4th box for maths?

---- snip ----

All the points are added up and a figure shown in members profile (and/or) under their name in the posts as points (or any name to be worded by admin) - just like the other custom profile fields.

:D

Do you mean so you could ajust the value?


I've created a html mockup, covering as much as I can think of, at this link
http://fivearts.net/temp/autopoints.htm

Perhaps Use existing forum Karma feature can be left out to keep things simple.

Also Setting 5. Use Live autopoints (like Gmail's megabytes count.) is just my imagination. It will be fascinating if that is possible. :D

What do you think?




Harzem

Currently I'm working on a point system (infraction system, advanced karma system, awards system etc...) and if nobody works on your ideas before me, I can seriously consider implementing this type of features to the system.

My system is currently live at http://www.harzem.com/test/rc3/index.php , which is constanly being developed (even right now).

oneway

Quote from: winrules on September 03, 2006, 12:52:00 PM
That should work. You can just use echo $blurb; instead of echo '' . $blurb . '';

I've tried that code for Personal Text. In profile.template.php, the original code was:

// Now print the second column where the members avatar/text is shown.
echo '
<td class="windowbg" valign="middle" align="center" width="150">
', $context['member']['avatar']['image'], '<br /><br />';
', $context['member']['blurb'], '


The new code I've tried is:

// Now print the second column where the members avatar/text is shown.
echo '
<td class="windowbg" valign="middle" align="center" width="150">
', $context['member']['avatar']['image'], '<br /><br />';

if (!empty($context['member']['blurb']))
{
$blurb = parse_bbc($context['member']['blurb']);
echo $blurb;
}


but to my suprise BBC still doesn't work for me after that change??

winrules

Try

// Now print the second column where the members avatar/text is shown.
echo '
<td class="windowbg" valign="middle" align="center" width="150">
', $context['member']['avatar']['image'], '<br /><br />';
', parse_bbc($context['member']['blurb']), '


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


oneway

#532
Quote from: winrules on September 04, 2006, 12:30:00 PM
Try

// Now print the second column where the members avatar/text is shown.
echo '
<td class="windowbg" valign="middle" align="center" width="150">
', $context['member']['avatar']['image'], '<br /><br />';
', parse_bbc($context['member']['blurb']), '


No, php doesn't seem to like that (throws up an error on the parse_bbc line)

I thought this would be easy enough to do, but seems I was wrong. *sighs* How amazing.

winrules



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


oneway

#534
Quote from: winrules on September 04, 2006, 05:26:52 PM
What error does it give?

Oops, sorry winrules, that was badly misleading. Doesn't give an error as such. Just doesn't work, e.g., to bold the word FIRST I put

[b]FIRST[/b]

The result was no bolding: it just displayed as:

[b]FIRST[/b]

winrules

WHat file is that code above in and where are you looking at it?


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


oneway

#536
Quote from: winrules on September 05, 2006, 01:17:32 PM
WHat file is that code above in and where are you looking at it?

The code is in profile.template.php, and with your 'parse_bbc' addition, is:

// Now print the second column where the members avatar/text is shown.
echo '
<td class="windowbg" valign="middle" align="center" width="150">
', $context['member']['avatar']['image'], '<br /><br />
                                        ', parse_bbc($context['member']['blurb']), '


Say I go into Profile and write this as Personal text:

Sometimes it's good to just [b]relax![/b]

it will then display as:

Sometimes it's good to just [b]relax![/b]

You can see this here, straight under the Avatar:

http://connect.twm.cc/index.php?topic=3.msg60#msg60

Edit: it kind of looks to me like this is not the right file to be doing the modifications in - but my search program finds
($context['member']['blurb'])only in profile.template. So it beats me (and I spose I must be missing something somewhere...)

winrules

look for $message['member']['blurb'].


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


oneway

Quote from: winrules on September 05, 2006, 03:19:41 PM
look for $message['member']['blurb'].

Okay, found that in display.template.php and personalmessage.template.php - completely identical coding so far as I can see. So I now have this in both files:

        // Show their personal text?
        if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
        echo '
            ', parse_bbc($message['member']['blurb']), '<br />
        <br />';


but the problem remains: BCC code is ignored as I showed in above post. I've got the code right haven't I? Weird...

Thanks for your help and patience with this, winrules. Greatly appreciated.

winrules

Did you make those changes to the theme you are using too?


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


Advertisement: