Custom Profile Field Mod

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

Previous topic - Next topic

ElectricSquid

I was wondering the same thing, but while scanning through the UltimateProfile.template, I found a part of the code that says this:


      /*
      // This section is optional. You can paste code and display fields from Custom Profile fields mod.
     
      echo '




So I'm guessing it plays well, since Jovan put that in the code.

I also found this reply over in the Ultimate Profile topic where someone was using this mod to embed a video player.

http://www.simplemachines.org/community/index.php?topic=183574.msg1587711#msg1587711

CG Icon

Excellent Lead !!!!!  THANK YOU!!!! this opens up a ton of possibilities!!

thanks

Kindred

kjparenteau,

that's not what the mod does... and doing so would require a fair amount of conditional and re-write...
(regarding showing one thing on posts and another in profile...   the mod shows the entry in the CPF everywhere, period.)

There has been code posted in this thread regarding adding CPF fields into the memberlist display...  but it does not do so by default... you will have to code it in yourself.  try search?

CG Icon, several people have gotten CPF working with the UP Mod... However, as I understand it, the order of installation matters and some code tweaks are needed. It's been discussed a number of times...   so try search.

and yes, as written, most mods only install into the default theme template files. (for mods for 1.1.x, mods for 2.x work differently)
Сл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."

CG Icon

found the code!,, got em working just fine and found a ton of other "tweaks" as well along the way...

I typically do search,, but often,,I get lazy to like everyone else... in a hurry..

So I do try and be a good little SMF'er  :)

but thanks all

Got the blog, media, custom profile all in there.. and was able to move things around in the profile as I wanted.

uyuy

I use themes  D-NightHawk-Flash and user sms 1,1,5 .im finish modification display.template.php in my themes,but its noting work,so how it?


thanks
klik tes 1 [nofollow] | klik tes 2 [nofollow]

schnups

Hey ,
Im using this great modification and Im trying to add a custom profile field into my roster page which only lists some membergroups and contact info. I read like all the 104 pages which took me about 3 hours and I tried some of the stuff but nothing worked.

This is my code:
global $db_prefix, $scripturl, $txt, $settings, $options;


// These must be in the order you wish them to print out on your roster.
// VERY IMPORTANT!!!! -- they must be exactly the same as the group names in the database, including
// capitalization and spaces.
$rankorder = array(
  'Nameless',
  'High Admin',
  'Multi Admin',
  'Infection Admin',
  'KreedZ Admin',
  'Knife Arena Admin',
  'StarWars Admin',
  'GunGame Admin',
);


$groups = '';
//Does all the real work here for showing groups.
$query = db_query("SELECT ID_GROUP, groupName, onlineColor, stars
  FROM {$db_prefix}membergroups", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($query))
{
  $groups[$row['groupName']]  = array(
    'id' => $row['ID_GROUP'],
    'color' => empty($row['onlineColor']) ? '' : $row['onlineColor'],
    'stars' => empty($row['stars']) ? '' : substr($row['stars'],2),
  );
}
mysql_free_result($query);

foreach ($rankorder as $rank)
{
//Now get all the users
  $query2 = db_query("
     SELECT ID_GROUP, ID_MEMBER, realName, avatar, usertitle,
           emailAddress, hideEmail, lastLogin, location, personalText,
           totalTimeLoggedIn, dateRegistered, ICQ, AIM, YIM, MSN,
           hideEmail, emailAddress
    FROM {$db_prefix}members
    WHERE ID_GROUP = '" . $groups[$rank]['id'] . "' ", __FILE__, __LINE__);

  if(db_affected_rows() != 0)
  {
    echo '<table border="0" cellspacing="1" cellpadding="5" align="center" class="bordercolor">
      <tr><td colspan="7" class="catbg"><font size="4" face="verdana"><b>' . $rank . '</b></font></td></tr>
      <tr><td rowspan="70" width="85" class="profilebg" valign="top">
        <center><img src="' . $settings['images_url'] . '/' . $groups[$rank]['stars'] . '"></center></td>';
      echo '<td class="catinfo" width="270"><b>GAMING ALIAS</b></td>';
      echo '<td class="catinfo" width="130"><b>NAME</b></td>';
      echo '<td class="catinfo" width="170"><b>LAST ONLINE</b></td>';
      echo '<td class="catinfo" width="100"><b>LOCATION</b></td>';
      echo '<td class="catinfo" width="175"><b>CONTACT</b></td></tr><tr>';
      while ($row2 = mysql_fetch_assoc($query2))
      {
echo '<td class="windowbg" height="40"><a href="' . $scripturl . '?action=profile;u=' . $row2['ID_MEMBER'] . '"><b><font color="' . $groups[$rank]['color'] . '" size="3" face="verdana">' . $row2['realName'] . '</b>';

echo '</font></font></a><br><font size="1"> ' . $row2['personalText'] . '</font></a></td><td class="windowbg2">ADD CUSTOM PROFILE FIELD HERE</td>';
        echo '<td class="windowbg">' . timeformat($row2['lastLogin']) . '</td>';
        echo '<td class="windowbg2" align="center">';
        echo '<i>' . $row2['location'] . '</i>';
        echo '</td><td class="windowbg">';

//Send email row
        if($row2['hideEmail'] == 0)
          echo '<a href="mailto:', $row2['emailAddress'], '"><img src="' . $settings['images_url'] . '/email_sm.gif" alt="email" /></a> ';

        if($row2['ICQ'] != '')
          echo '<a href="http://www.icq.com/whitepages/about_me.php?uin=' . $row2['ICQ'] . '" target="_blank"><img src="http://status.icq.com/online.gif?img=5&icq=' . $row2['ICQ'] . '" alt="' . $row2['ICQ'] . '" width="18" height="18" border="0" /></a> ';
        if($row2['AIM'] != '')
          echo '<a href="aim:goim?screenname=' . urlencode(strtr($row2['AIM'], array(' ' => '%20'))) . '&message=' . $txt['aim_default_message'] . '"><img src="' . $settings['images_url'] . '/aim.gif" alt="' . $row2['AIM'] . '" border="0" /></a> ';
        if($row2['YIM'] != '')
          echo '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($row2['YIM']) . '"><img src="http://opi.yahoo.com/online?u=' . urlencode($row2['YIM']) . '&m=g&t=0" alt="' . $row2['YIM'] . '" border="0" /></a> ';
        if($row2['MSN'] != '')
          echo '<a href="http://members.msn.com/' . $row2['MSN'] . '" target="_blank"><img src="' . $settings['images_url'] . '/msntalk.gif" alt="' . $row2['MSN'] . '" border="0" /></a> ';

//Send PM row
        echo '<a href="' . $scripturl . '?action=pm;sa=send;u=' . $row2['ID_MEMBER'] . '"><img src="' . $settings['images_url'] . '/im_on.gif" alt="email" /></a></a>';
        echo '</td>';
        echo '</tr>';
      }
    echo '</table><br>';
  }
}


I need to add my custom profile field where it says "Add CUSTOM PROFILE...." Im a total php noob but I would like to add this.

Thanks for the help

nopity4u

#2066
Overlapping selections apparently..

I am running a football site and I created 2 custom profile fields. Both are selection boxes.

One has 48 entries. Starting at 2008 and going back to 1961. 48 Entries total.
The other has 81 entries. In this format for each entry: Romo, Tony

I did this with the entire Cowboys roster so I would have all 81 players in the selection box.
The problem is, if I go to my profile and set a year and a player name both will wind up having the player name.

So instead of:

Fan since: 1992
Favorite Player: Romo, Tony

I get:

Fan since: Romo, Tony
Favorite Player: Romo,Tony

Any ideas?

EDIT: Nevermind. I am an idiot, I completely overlooked the ID and had them both the same.

CaptainKirk

#2067
OK, I've got the mod installed and updated the registration with items that I want and have done some testing and things appear to be working.  At least when I look at a test 'member profile' I am able to see the information that I entered.

Now what I would like to do is use the entered information in another table outside the SMF forum.  I have looked through the code and haven't seen anything about creating new DB tables or fields for the updated profile fields and haven't seen any changes in my tables in the MySQL DB that was created when I installed SMF in the first place.  I'm very much a newbie to PHP, but am attempting to come up to speed as quickly as I can.  I'll admit that I haven't gone through all 104 pages in this thread and maybe my answer, if there is one, is in here someplace.  I realize that the answer if probably as plain as the nose on my face, but I'm having a hard time even finding my own nose the past couple of weeks  :)

Any help would be appreciated. 

Kindred

try reading through this thread?  This has been discussed.

this mod saves the data in the smf_themes table under the field names CP1, CP2, etc
Сл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."

CaptainKirk

At the risk of being chastised for asking, should I be able to see the added fields when I look at the smf_themes table via phpmyadmin?

Kindred

if the user has actually INPUT something into that field.
Сл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."

CaptainKirk

Oh DUH!! I'll go sit in the corner with the dunce hat now.  I was only displaying 30 fields/page and the information was on the next page. 

:-[

lordtron

#2072
Alright, I am trying to pull information from a Custom Field I created, but I keep getting all the fields getting pulled.

Like if I have 3 Custom Fields then all 3 will print on the page.
How do I get it to pull just 1 value and not all of them?

VainSoftGames.com - New Design To Gaming

nopity4u

Quote from: lordtron on July 23, 2008, 02:05:03 AM
Alright, I am trying to pull information from a Custom Field I created, but I keep getting all the fields getting pulled.

Like if I have 3 Custom Fields then all 3 will print on the page.
How do I get it to pull just 1 value and not all of them?

It's possible you're having the same problem I did. Check up above a few posts. Your ID's might be the same.

lordtron

#2074
Of no, I set them up to have different Field ID"s.

But can you show your code, cause I might be missing something.



Edit: Alright I got it to pull the right variable, but its showing everyone that has something entered in for that variable. How do I also select a certain ID_Member as well?


Figured it out, I needed to use a AND statement..

VainSoftGames.com - New Design To Gaming

Anthony

Hi winrules!

I really like your mod, thank you!

But I need to export a table with the extra fields. Is there a chance to get a table (or any kind of export) ?

Member (ID) | Value of Field1 | Value of Field2 | ...

Thanks, Anthony



Kindred

you can build it...  There is code listed in this thread indicating how to display the fields and the values.    such a report does not exist in the mod, though.
Сл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."

Ncen

I'm using this Mod on a heavily modified forum, is it possible for me to manually correct the moving field-issues? Since i have the version before that, and uninstalling + re-installing is not an option, because that wouldn't be possible because of the modifications (i would have to manually uninstall and reinstall). If so, what changes do i have to do? I tried scaning through the thread for answers reading here and there, but it was just to many posts.

Thanks in advance, Inno.

lordtron

to uninstall manually just goto Custom Field Mod on the right there is "Manual Install Instructions for SMF" select your version and then hit submit. It will show you what files get changed and where.

VainSoftGames.com - New Design To Gaming

Ncen

Would it not be easier to somehow get info about what has changed, and change it? Since i would not be able to install automatically afterwards anyway?

Advertisement: