News:

Wondering if this will always be free?  See why free is better.

Main Menu

Custom Profile Field Mod

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

Previous topic - Next topic

john109

I've uninstalled 2.1 through the SMF admin and then installed 2.11 through the admin panel.  All without errors.  I have a custom field enabled.  I set the Joomla/SMF 1.1.3 bridge to use the bridge registration and the custom field still doesn't show up in the registration form.  I set the bridge to use SMF registration, the custom field appears on the registration form but when I submit it I still get the error on line 917.

The becoming unwrapped is a problem because you can't get back to the main website.  You become disconnected from Joomla and the bridge.  The formatting is all off and if you use the logout on the forum it only logs you out of the forums.  You remain logged into the bridge and Joomla.

winrules

Quote from: digit on April 13, 2006, 04:53:39 PM
Quote from: winrules on April 09, 2006, 02:22:08 PM

The data's stored in the themes table. If you want to access it with ssi, you could wait until next version :) or find:

setupThemeContext();


and add after:

require_once($sourcedir . '/Profile.php');
loadThemeOptions($context['user']['id']);


havent tested it though...but it should work.


ok, did that.

Quote from: winrules on April 09, 2006, 02:22:08 PM
when you add that you can use

$context['member']['options'][fieldID]

So you could do something like

if ($context['member']['options']['someoption']=='First Page')
//first page
else
//second page




I get lost with the rest...  where does that code go???  (in ssi_examples.shtml?), or?

My fields are simply named....

Custom Profile Field 1

Custom Profile Field 2

etc. etc.

...  or are they actually named what we name them?

sorry for the confusion.


that code goes in your php page that you want it to display the fields on (you'll have to include ssi.php)
by fieldID, I mean whatever you put in for the field ID in the options page for a particular field. (by default its CP{fieldnumber}, so if the field is Custom Profle Field 1 and you haven't changed the field ID you would use "$context['member']['options']['CP1']")




Quote from: john109 on April 13, 2006, 04:58:01 PM
I've uninstalled 2.1 through the SMF admin and then installed 2.11 through the admin panel.  All without errors.  I have a custom field enabled.  I set the Joomla/SMF 1.1.3 bridge to use the bridge registration and the custom field still doesn't show up in the registration form.  I set the bridge to use SMF registration, the custom field appears on the registration form but when I submit it I still get the error on line 917.

The becoming unwrapped is a problem because you can't get back to the main website.  You become disconnected from Joomla and the bridge.  The formatting is all off and if you use the logout on the forum it only logs you out of the forums.  You remain logged into the bridge and Joomla.
I really don't think the registration error is because of this mod, it's probly a problem with swithching registration to SMF. Are you sure everything is updated to the most recent version? You might want to post in the bridge support board.
About the forum becoming unrapped, what URL does the link to the profile field direct you to?


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


john109

Everything is up to date.  Joomla 1.0.8 + SMF 1.1RC2  and Orstio's 1.1.3 bridge.  I have posted in the bridge support section now.  Hopefully some help can come from that direction.

The link for Custom Profile Field 1 is

Quotehttp://www.mysite.com/smf/index.php?action=featuresettings;sa=profile;cp=1

That is what is in the address bar after I click it as well.

Thanks for all your effort btw winrules.  I know this must be a pain.  :D

Kindred

Сл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."


winrules

Quote from: john109 on April 13, 2006, 05:36:09 PM


Link#1
Quotehttp://www.mysite.com/joomla/index.php?option=com_smf&Itemid=29&action=featuresettings;sa=profile;sesc=528fa4fc1e539a4059f6b6a1f64004ba

Link#2
Quotehttp://www.mysite.com/smf/index.php?action=featuresettings;sa=profile;cp=1

Does that shed some light on this?  I'm a noob at all this so I wouldn't know where to make any modifications. 
Basically the 2nd link isn't getting wrapped. It should be (mabey with the session ID)
Quote
http://www.mysite.com/joomla/index.php?option=com_smf&Itemid=29&action=featuresettings;sa=profile;cp=1
I don't know exactally how the preg_replace (or str_replace, not sure which on the bridge uses) works with the bridge. You could manually code in the option=com_smf&Itemid=29, but that would make upgrades hard.


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


john109

Quote from: Kindred on April 13, 2006, 05:27:06 PM
that is, indeed an unwrapped url.   the wrapped (pregreplace) url should point to http://www.mysite.com/index.php?option=com_smf&Itemid=##&action=featuresettings;sa=profile;cp=1

Well looks like Kindred is saying the bridge uses pregreplace. 

If I type this directly into the address bar it works of course but like you said if I code it in directly it will make upgrading difficult.  I don't even know where to put the code in anyways.

Quotehttp://www.mysite.com/joomla/index.php?option=com_smf&Itemid=29&action=featuresettings;sa=profile;cp=1


Kalimas

I love the mod, everythings working great.

One question:

Is there any way to make it so a certain member group can change fields instead of "admin only"? I only have a slight working knowledge of my way around in the code, and I'd rather not risk breaking something without some advice.

Thanks in advance.

digit

#108
Quote from: winrules on April 13, 2006, 05:04:34 PM
that code goes in your php page that you want it to display the fields on (you'll have to include ssi.php)
by fieldID, I mean whatever you put in for the field ID in the options page for a particular field. (by default its CP{fieldnumber}, so if the field is Custom Profle Field 1 and you haven't changed the field ID you would use "$context['member']['options']['CP1']")

sorry about the confusion....  I have added the snippet to SSI.php...

Then I wrote a php page named members.php

here is the code of that page.....






<?php

include ('SSI.php');

echo 
'
<html>
<title>test</title>
<meta http-equiv=Content-Type content="text/html;  charset=UTF-8">
<head>
</head>
<body>'
;

if (
$context['member']['options']['CP1']=='First Page')
echo 
' test1 ';

else
echo 
' test ';

echo 
'
</body>
</html>
'
;
?>




I am confused about the "=='First page'" here.....

if ($context['member']['options']['CP1']=='First Page')

What is that referencing?

The page above successfully prints "test", not "test1". (I guess you can see that )

...  what I'd REALLY like to do is print a list of all users WHERE ID_GROUP = 4 (charter members), along with a few of your custom fields... "Charter member since" (CP1) "amount contributed" (CP2) etc. etc.

here's an example, of what I'm trying to do....



so I need to do something like....

for each charter member (WHERE ID_GROUP = 4) - print that line.

I have also created two checkbox fields...

"Appear in List?" (CP5)  and "Show Amount Contributed?" (CP6)

I only want their member name to appear in the list IF CP5 is checked...  and only want "amount contributed" (CP2) visible if CP6 is checked. (is THAT doable?)

That brings up a question...  if the field is set so only the admin can see it, is it possible to make it visible though SSI.php? (yikes!)

...  and finally, I would have the same question as Kalimas...  I would like only users from ID_GROUP 4 to be able to view and edit some fields.

Any help would be most appreciated!!!!!!!!!!

Thanks!
Happily using a heavily modified 1.1.16 version of SMF!

2748011 Posts in 320998 Topics by 50986 Members


SOLD my website - thanks it was a good run - they converted to vbadvanced. (and screwed it up good!)

ArkServer

The fields doesnt show up in the registration field
1.1 rc2

www.happyserver.be

Lili_

#110
Hi,

This is a wonderful mod, thank you for making it.

My theme has its own Profile.template.php, PersonalMessage.template.php and Register.template.php.
What changes do I need to make to them to have this feature working?

Also, how can I stop the titles (eg.location) showing in the posts when the field is empty?

Thanks!

perplexed

oh dear I spoke too soon :(

I now have 200 pages of errors in the error log all pertaining to these two errors

http://www.mysite.com/forum/index.php?option=com_smf&amp;Itemid=43&amp;topic=929.msg37445;topicseen
8: Undefined index: CP5_view
File: /home/xxxx/public_html/forum/Themes/default/Display.template.php (main sub template - eval?)
Line: 350
   

http://www.mysite.com/forum/index.php?option=com_smf&amp;Itemid=43&amp;topic=929.msg37445;topicseen
8: Undefined index: CP5_view
File: /home/xxxxx/public_html/forum/Themes/default/Display.template.php (main sub template - eval?)
Line: 451

CP4 and CP5 are the only two fields that I have content in and are displaying on posts  and only I am using it at the moment,so all those errors are for me alone :(

winrules

Kalimas, I'll put that in for my list for next version

digit, the 'first page' is the vaule of the field. So it would only go through that if statment if CP1 was set to 'First Page'. If you just wanted to display it, you could use

echo '$context['member']['options']['CP1']';

about having options for show in list and stuff, you could just do

if ($context['member']['options']['CP6'])
{
     //code for showing in list
}

Hope you can get what you want to do to work.

ArkServer, are you using a custom theme?

Lil_, look in the modification.xml file of this mod for what to find.

perplexed, can you try going into the configuration screen for field 5, check that there is a checkbox for only allowing admins to view it, and then press save. If that doesn't work, try going to this URL:

http://www.yoursite.com/smfdir/index.php?action=featuresettings;sa=profile;addfield=5


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


digit

Quote from: winrules on April 14, 2006, 03:54:49 PM

digit, the 'first page' is the vaule of the field. So it would only go through that if statment if CP1 was set to 'First Page'. If you just wanted to display it, you could use

echo '$context['member']['options']['CP1']';

about having options for show in list and stuff, you could just do

if ($context['member']['options']['CP6'])
{
     //code for showing in list
}

Hope you can get what you want to do to work.

nope.  still isn't working.

I wonder if this is incorrect in SSI.php


Quote from: winrules on April 09, 2006, 02:22:08 PM

The data's stored in the themes table. If you want to access it with ssi, you could wait until next version :) or find:

setupThemeContext();


and add after:

require_once($sourcedir . '/Profile.php');
loadThemeOptions($context['user']['id']);


havent tested it though...but it should work.

Happily using a heavily modified 1.1.16 version of SMF!

2748011 Posts in 320998 Topics by 50986 Members


SOLD my website - thanks it was a good run - they converted to vbadvanced. (and screwed it up good!)

ArkServer

Quote from: winrules on April 14, 2006, 03:54:49 PM
Kalimas, I'll put that in for my list for next version

digit, the 'first page' is the vaule of the field. So it would only go through that if statment if CP1 was set to 'First Page'. If you just wanted to display it, you could use

echo '$context['member']['options']['CP1']';

about having options for show in list and stuff, you could just do

if ($context['member']['options']['CP6'])
{
     //code for showing in list
}

Hope you can get what you want to do to work.

ArkServer, are you using a custom theme?

Lil_, look in the modification.xml file of this mod for what to find.

perplexed, can you try going into the configuration screen for field 5, check that there is a checkbox for only allowing admins to view it, and then press save. If that doesn't work, try going to this URL:

http://www.yoursite.com/smfdir/index.php?action=featuresettings;sa=profile;addfield=5


Nope default, but changed some colors etc

winrules

Quote from: digit on April 14, 2006, 04:21:21 PM
Quote from: winrules on April 14, 2006, 03:54:49 PM

digit, the 'first page' is the vaule of the field. So it would only go through that if statment if CP1 was set to 'First Page'. If you just wanted to display it, you could use

echo '$context['member']['options']['CP1']';

about having options for show in list and stuff, you could just do

if ($context['member']['options']['CP6'])
{
     //code for showing in list
}

Hope you can get what you want to do to work.

nope.  still isn't working.

I wonder if this is incorrect in SSI.php


Quote from: winrules on April 09, 2006, 02:22:08 PM

The data's stored in the themes table. If you want to access it with ssi, you could wait until next version :) or find:

setupThemeContext();


and add after:

require_once($sourcedir . '/Profile.php');
loadThemeOptions($context['user']['id']);


havent tested it though...but it should work.


Can you post what code your using?



Quote from: ArkServer on April 14, 2006, 04:35:49 PM
Quote from: winrules on April 14, 2006, 03:54:49 PM
Kalimas, I'll put that in for my list for next version

digit, the 'first page' is the vaule of the field. So it would only go through that if statment if CP1 was set to 'First Page'. If you just wanted to display it, you could use

echo '$context['member']['options']['CP1']';

about having options for show in list and stuff, you could just do

if ($context['member']['options']['CP6'])
{
     //code for showing in list
}

Hope you can get what you want to do to work.

ArkServer, are you using a custom theme?

Lil_, look in the modification.xml file of this mod for what to find.

perplexed, can you try going into the configuration screen for field 5, check that there is a checkbox for only allowing admins to view it, and then press save. If that doesn't work, try going to this URL:

http://www.yoursite.com/smfdir/index.php?action=featuresettings;sa=profile;addfield=5


Nope default, but changed some colors etc
Do the fields show up at all?


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



winrules

Quote from: ArkServer on April 14, 2006, 06:07:27 PM
profiles yes, registration no
any errors on install?
also are you sure you've enabled show on registration?


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


ArkServer

Quote from: winrules on April 14, 2006, 06:09:08 PM
Quote from: ArkServer on April 14, 2006, 06:07:27 PM
profiles yes, registration no
any errors on install?
also are you sure you've enabled show on registration?

Yup no install errors, the problem is this:
admin etc.. custom profiles -> "Show field on regristration?" when i click öptional input" and save its still on "dont show" the same as "show in posts" i just wont save. i tried it with 2 Custom Profile Fields both same results.

atm no one can register because you need to fill in the information but it isnt shown in the registration field.

winrules

Quote from: ArkServer on April 14, 2006, 06:13:17 PM
Quote from: winrules on April 14, 2006, 06:09:08 PM
Quote from: ArkServer on April 14, 2006, 06:07:27 PM
profiles yes, registration no
any errors on install?
also are you sure you've enabled show on registration?

Yup no install errors, the problem is this:
admin etc.. custom profiles -> "Show field on regristration?" when i click öptional input" and save its still on "dont show" the same as "show in posts" i just wont save. i tried it with 2 Custom Profile Fields both same results.

atm no one can register because you need to fill in the information but it isnt shown in the registration field.
At what version of this mod did you initially install?


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


Advertisement: