Custom Profile Field Mod

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

Previous topic - Next topic

bposner

Once this package is installed.  The setup has option to "show in posts" and show under post count, show next to image.  I am using custom theme, Phobos (1.1).  These options don't show up, however they do in the default SMF theme.  Again, I am not a coder, nor do I even pretend to be but can follow directions.  I just need to know where in what file,  to put the Field Id, CP1, etc to list under the post count.

Thank  you for your time.

DenDen60

Quote from: Kindred on April 11, 2008, 02:12:42 PM
move the code in regsiter.template.php

Which code is this?

I only see this:

global $sourcedir;
require_once($sourcedir . '/CustomProfile.php');
RegistrationFields();
echo '


Is this the code I need to  mode?

Thanks


perplexed

@JaredBlake1
@bposner
@denden60

Your queries are all very similar, so try this:

use the package parser (link in my signature) and upload the custom profile mod zipped file.  Select the option for themes at the bottom and then follow the instructions for editing custom themes.  You will see the code in there for the template files you need to edit. 

If your theme doesnt have it's own register.template then it will be using the default theme's file, so again use the package parser to upload the mod file and look for the code it adds to the register.template
:)


DenDen60

Very interesting this approach. Does this work with any mods?

Unfortunately, it doesnt seem to resolve my question.  :(

I am using Corto theme, TP version, and I am using the default register.template.php.

Where should I move this code so that the custom profile elements that I have included are just below the "Usename" box?

Thanks


JaredBlake1

#1964
Quiteperplexed, these steps confirmed the correct code to move.
But I still get the following error when I try moving it within the from.
I want the field to appear just under the Username field and not at the bottom.

Once I move the code, I get this error:   Template Parse Error

Please help...Thanks




Kindred

you can't just move code around randomly.

for example:   You can't move the echo ' statement without screwing things up. You can't move the other code into the middle of an echo statement....
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

JaredBlake1

#1966
Quote from: Kindred on April 14, 2008, 04:25:34 PM
you can't just move code around randomly.

for example:   You can't move the echo ' statement without screwing things up. You can't move the other code into the middle of an echo statement....

Kindred, well at least that is an answer and I appreciate it.  Thanks

Not necessarily the answer I wanted but at least now I know.

I still would have to think it's possible but I would need some better PHP skills for the manipulation. At least I was able to change the size of the field box and so now the placement is not that big of a deal.


Thank you...Regards, Jared

mrw1986

Is there anyway to make a popup box sort of thing that has the Custom Fields in it? This popup box would need to show under the User's Info in a Post. A good place to demo it would be here: http://forums.techpowerup.com/showthread.php?t=39758 [nofollow] - If you notice at the bottom of each User's Info on the left of each post there is a popup menu called "System Specs". I want to replicate this exact feature but for SMF. I've tried a few different things but can't get it to work.

MissyNL

Hi!

I now see the costum field that i have added to test, before i installed Ultimate profile, thanks to the code i have received. :D

The only problem is still that i do not see the tab anymore of costum profile, sinds i have installed Ultimate profile :(

See the attached

If somebody wants to see codes.. please tell me wich file

Thanks!!!!!


Sorry for my poor English, but i think it's probably better then your Dutch :)

Kindred

Quote from: mrw1986 on April 18, 2008, 01:53:47 AM
Is there anyway to make a popup box sort of thing that has the Custom Fields in it? This popup box would need to show under the User's Info in a Post. A good place to demo it would be here: http://forums.techpowerup.com/showthread.php?t=39758 - If you notice at the bottom of each User's Info on the left of each post there is a popup menu called "System Specs". I want to replicate this exact feature but for SMF. I've tried a few different things but can't get it to work.

Again, of course the IS a way.  However, the coding of such is WAY beyond the point of the original mod and is fairly involved.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

DenDen60

Ok this is my code now:

Can someone tell me where do I need to insert the custom profile code so that my custom profile appears just after the user name? I have tried a few places but it does not work?

Thanks



<form action="', $scripturl, '?action=register2" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator" onsubmit="return verifyAgree();">
<table border="0" width="100%" cellpadding="3" cellspacing="0" class="tborder">
  <tr class="titlebg">
   <td>', $txt[97], ' - ', $txt[517], '</td>
  </tr><tr class="windowbg">
   <td width="100%">
    <table cellpadding="3" cellspacing="0" border="0" width="100%">
     <tr>
      <td width="40%">
       <b>', $txt[98], ':</b>
       <div class="smalltext">', $txt[520], '</div>
      </td>
      <td>
       <input type="text" name="user" size="20" tabindex="', $context['tabindex']++, '" maxlength="25" />
      </td>
     </tr><tr>
      <td width="40%">
       <b>', $txt[69], ':</b>
      </td>
      <td>
       <input type="text" name="email" size="30" tabindex="', $context['tabindex']++, '" />';
// Are they allowed to hide their email?
if ($context['allow_hide_email'])
  echo '
       <label for="hideEmail"><input type="checkbox" name="hideEmail" id="hideEmail" class="check" /> ', $txt[721], '</label>';
echo '
      </td>
     </tr><tr>
      <td width="40%">
       <b>', $txt[81], ':</b>(règle 8-1-1-1)
                     <div class="smalltext">
      <p style="margin-left: 10px; margin-top: 0; margin-bottom: 0">
      Pour des raisons de sécurité, le mot de passe doit contenir
      <b>huit</b> caractères et être composé d\'au moins <b>un</b>
      chiffre, <b>une</b> majuscule et <b>une</b> minuscule. (ex: ACamus13, aA1bB2ff, )</div>
      </td>
      <td>
       <input type="password" name="passwrd1" size="30" tabindex="', $context['tabindex']++, '" />
      </td>
     </tr><tr>
      <td width="40%">
       <b>', $txt[82], ':</b>
      </td>
      <td>
       <input type="password" name="passwrd2" size="30" tabindex="', $context['tabindex']++, '" />
      </td>
     </tr>';
if ($context['visual_verification'])
{
  echo '
     <tr valign="top">
      <td width="40%" align="top">
       <b>', $txt['visual_verification_label'], ':</b>
       <div class="smalltext">', $txt['visual_verification_description'], '</div>
      </td>
      <td>';
  if ($context['use_graphic_library'])
   echo '
       <img src="', $context['verificiation_image_href'], '" alt="', $txt['visual_verification_description'], '" id="verificiation_image" /><br />';
  else
   echo '
       <img src="', $context['verificiation_image_href'], ';letter=1" alt="', $txt['visual_verification_description'], '" id="verificiation_image_1" />
       <img src="', $context['verificiation_image_href'], ';letter=2" alt="', $txt['visual_verification_description'], '" id="verificiation_image_2" />
       <img src="', $context['verificiation_image_href'], ';letter=3" alt="', $txt['visual_verification_description'], '" id="verificiation_image_3" />
       <img src="', $context['verificiation_image_href'], ';letter=4" alt="', $txt['visual_verification_description'], '" id="verificiation_image_4" />
       <img src="', $context['verificiation_image_href'], ';letter=5" alt="', $txt['visual_verification_description'], '" id="verificiation_image_5" />';
  echo '
       <input type="text" name="visual_verification_code" size="30" tabindex="', $context['tabindex']++, '" />
       <div class="smalltext">
        <a href="', $context['verificiation_image_href'], ';sound" onclick="return reqWin(this.href, 400, 120);">', $txt['visual_verification_sound'], '</a> | <a href="', $scripturl, '?action=register" onclick="refreshImages(); return false;">', $txt['visual_verification_request_new'], '</a>
       </div>
      </td>
     </tr>';
}
// Are there age restrictions in place?
if (!empty($modSettings['coppaAge']))
  echo '
     <tr>
      <td colspan="2" align="center" style="padding-top: 1ex;">
       <label for="skip_coppa"><input type="checkbox" name="skip_coppa" id="skip_coppa" tabindex="', $context['tabindex']++, '" class="check" /> <b>', $context['coppa_desc'], '.</b></label>
      </td>
     </tr>';
global $sourcedir;
require_once($sourcedir . '/CustomProfile.php');
RegistrationFields();
echo '
    </table>
   </td>
  </tr>
</table>';

Kindred

 

<form action="', $scripturl, '?action=register2" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator" onsubmit="return verifyAgree();">
<table border="0" width="100%" cellpadding="3" cellspacing="0" class="tborder">
  <tr class="titlebg">
   <td>', $txt[97], ' - ', $txt[517], '</td>
  </tr><tr class="windowbg">
   <td width="100%">
    <table cellpadding="3" cellspacing="0" border="0" width="100%">
     <tr>
      <td width="40%">
       <b>', $txt[98], ':</b>
       <div class="smalltext">', $txt[520], '</div>
      </td>
      <td>
       <input type="text" name="user" size="20" tabindex="', $context['tabindex']++, '" maxlength="25" />
      </td>
     </tr>';
global $sourcedir;
require_once($sourcedir . '/CustomProfile.php');
RegistrationFields();
echo '
    <tr>
      <td width="40%">
       <b>', $txt[69], ':</b>
      </td>
      <td>
       <input type="text" name="email" size="30" tabindex="', $context['tabindex']++, '" />';
// Are they allowed to hide their email?
if ($context['allow_hide_email'])
  echo '
       <label for="hideEmail"><input type="checkbox" name="hideEmail" id="hideEmail" class="check" /> ', $txt[721], '</label>';
echo '
      </td>
     </tr><tr>
      <td width="40%">
       <b>', $txt[81], ':</b>(règle 8-1-1-1)
                     <div class="smalltext">
      <p style="margin-left: 10px; margin-top: 0; margin-bottom: 0">
      Pour des raisons de sécurité, le mot de passe doit contenir
      <b>huit</b> caractères et être composé d\'au moins <b>un</b>
      chiffre, <b>une</b> majuscule et <b>une</b> minuscule. (ex: ACamus13, aA1bB2ff, )</div>
      </td>
      <td>
       <input type="password" name="passwrd1" size="30" tabindex="', $context['tabindex']++, '" />
      </td>
     </tr><tr>
      <td width="40%">
       <b>', $txt[82], ':</b>
      </td>
      <td>
       <input type="password" name="passwrd2" size="30" tabindex="', $context['tabindex']++, '" />
      </td>
     </tr>';
if ($context['visual_verification'])
{
  echo '
     <tr valign="top">
      <td width="40%" align="top">
       <b>', $txt['visual_verification_label'], ':</b>
       <div class="smalltext">', $txt['visual_verification_description'], '</div>
      </td>
      <td>';
  if ($context['use_graphic_library'])
   echo '
       <img src="', $context['verificiation_image_href'], '" alt="', $txt['visual_verification_description'], '" id="verificiation_image" /><br />';
  else
   echo '
       <img src="', $context['verificiation_image_href'], ';letter=1" alt="', $txt['visual_verification_description'], '" id="verificiation_image_1" />
       <img src="', $context['verificiation_image_href'], ';letter=2" alt="', $txt['visual_verification_description'], '" id="verificiation_image_2" />
       <img src="', $context['verificiation_image_href'], ';letter=3" alt="', $txt['visual_verification_description'], '" id="verificiation_image_3" />
       <img src="', $context['verificiation_image_href'], ';letter=4" alt="', $txt['visual_verification_description'], '" id="verificiation_image_4" />
       <img src="', $context['verificiation_image_href'], ';letter=5" alt="', $txt['visual_verification_description'], '" id="verificiation_image_5" />';
  echo '
       <input type="text" name="visual_verification_code" size="30" tabindex="', $context['tabindex']++, '" />
       <div class="smalltext">
        <a href="', $context['verificiation_image_href'], ';sound" onclick="return reqWin(this.href, 400, 120);">', $txt['visual_verification_sound'], '</a> | <a href="', $scripturl, '?action=register" onclick="refreshImages(); return false;">', $txt['visual_verification_request_new'], '</a>
       </div>
      </td>
     </tr>';
}
// Are there age restrictions in place?
if (!empty($modSettings['coppaAge']))
  echo '
     <tr>
      <td colspan="2" align="center" style="padding-top: 1ex;">
       <label for="skip_coppa"><input type="checkbox" name="skip_coppa" id="skip_coppa" tabindex="', $context['tabindex']++, '" class="check" /> <b>', $context['coppa_desc'], '.</b></label>
      </td>
     </tr>
    </table>
   </td>
  </tr>
</table>';

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

MissyNL

Doesn't nobody knows??   Is it not maybe in a file that regulates the tabs?

Any suggestion is welcom. I have to have my site up and running in 2 weeks..
Sorry for my poor English, but i think it's probably better then your Dutch :)

4LP3RUZ1

#1973
Question, I want to change the name fields, specifically the square brackets around the IDs how can I do it on the following code so that the force check works?

if ($modSettings['enable_CP' . $i . ''] && $modSettings['CP' . $i . '_reg']=='force' && empty($_POST['default_options'][$modSettings['CP' . $i . '_id']]))

edit: nvm, I figured out something different...
Frozen frogs are back :(

DenDen60

Thanks KinDred.

Unfortunately it does not work. When I do what you have suggested, I receive a message saying that the theme is not working properly.


Erreur d\aperçu du thème !
Il semble que le forum rencontre actuellement quelques difficultés avec l'aperçu du thème. Le problème devrait être temporaire; revenez plus tard. Si vous continuez à voir ce message, contactez l'administrateur.
Vous pouvez aussi essayer de recharger cette page.


As you can see it's in French but we can deduct that it's not a coding error per say, or at least it is not viewed as such.


Kindred

sorry, I don't speak french...   what does the error actually say in English?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

phfire

My members love Friendster so much that's why I'm planning to add a friendster email button using the smiley logo of Friendster as the email button. How can I make it work by installing this mod?

Any help is much appreciated.

WRABBIT


How exactly would I make a facebook field?  I just don't really understand how to use this mod....thank you :)

DenDen60

Quote from: Kindred on April 22, 2008, 11:13:33 AM
sorry, I don't speak french...   what does the error actually say in English?

It says the the Forum  seems to have some difficulties in showing the theme. The problem is probably temporary. You can also try to reload the page.

I tried to find the translation in english but I could not find them.


That's it.

Harryf

Hi!

Reading through this has helped me a lot in solving a specific problem I had (English vs English utf-8), but I now have the following problem:

The only custom field I have created shows op 2x on the registration page.

I cannot figure out what I am doing wrong!

I am on 1.1.4, default theme and the only other mod I am using is View Only Boards (http://custom.simplemachines.org/mods/downloads/610/View_Only_Boards_1.0.zip).

Because of this duplication, I uninstalled both mods but had a problem with Source/ModSettings.php which showed as "Failed".  I renamed the ModSettings file, downloaded SMF 1.1.4. onto my hard drive and unpacked the files.  I then uploaded that ModSettings.php file to my server and re-installed the mods in the sequence Custom Profile Field Mod and then View Only Boards.

Both installed successfully.

What can I be doing wrong to cause the custom field to show up TWICE on the registration page? 

Is code duplicated somewhere or am I just missing a trick in the setting up stages?

This is how I do it:


1.  I click on the CUSTOM PROFILE FIELDS Tab under Features and Options and then click on "Add a field"
2.  I keep the tick box in the box opposite the field named Enable Unnamed Field ticked
3.  I choose "Selection Box" from the drop down list and click on Save.
4.  I then click on "Settings"
5.  Here I enter the Name, Description, have "show in profile" enabled, kept "field ID" CP1,
"Add horizontal rule etc" as "don't show" (simply because I have no idea what it means  :))
6.  Show field on registration I have as "show"
7.  Lastly, I added the words "Yes" and "No" to the two Option boxes for the "Selection Box" option and
8.  I click on Save

Then, when I log out as Admin and register as new member, the custom field shows up 2x!

What's wrong, please?

Harry

Men are apt to mistake the strength of their feelings for the strength of their arguments.  The heated mind resents the chill touch and relentless scrutiny of logic. W.E. Gladstone

Advertisement: