News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Custom Profile Field Mod

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

Previous topic - Next topic

Kindred

look in the mod package...   find the installation xml and follow the instructions for each of the named files.
Сл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."

cloudee1

Quote from: perplexed on February 15, 2007, 07:10:40 AM
Quote from: Sarke on February 14, 2007, 02:46:49 PM
The information about the profile fields, such as it's name, type, desc, etc are in settings, while the information that each user inputs are in the themes table.  

thanks I'll check again but I couldnt see it yesterday in themes table :)
I've looked in settings and found nothing about the cp1 or 2 that I've got. and I looked in themes and found no long text corresponding to any cp1 or 2. I am creating a members sites page for my main site and I need to know what tables everything is in and I sure don't see it any either of those.

Visit my SCI programmers community [nofollow].
Where we make adventure games using the Sierra Creative Interpreter.
Just like Space Quest, King's Quest, and Leisure Suit Larry!

Sarke

Quote from: cloudee1 on February 16, 2007, 03:21:27 AM
Quote from: perplexed on February 15, 2007, 07:10:40 AM
Quote from: Sarke on February 14, 2007, 02:46:49 PM
The information about the profile fields, such as it's name, type, desc, etc are in settings, while the information that each user inputs are in the themes table.   

thanks I'll check again but I couldnt see it yesterday in themes table :)
I've looked in settings and found nothing about the cp1 or 2 that I've got. and I looked in themes and found no long text corresponding to any cp1 or 2. I am creating a members sites page for my main site and I need to know what tables everything is in and I sure don't see it any either of those.


Try

SELECT * FROM smf_settings WHERE variable LIKE 'CP%'

and

SELECT * FROM smf_themes WHERE variable LIKE 'CP%'

My MODs          Please don't PM me for support, post in the appropriate topic.

mediainvita.de

hi

First things first: Thumbs up! Great Mod :-)

Anyway it misses a feature i really would like to see. I could program it myself, but i need some information first...

How could i realize a multiple selection Box with different ( alphabetically sorted ) Options.

I need it to realize something like a "my offer" selection. Admin offers some options and the user can select several points from the list. ( Normal users are shopowners which offer a wide variety of goods, which need to be selectable )

Any Idea?
 

Bigguy

Would the shop mod not be better suited for this. ???

Quote from: mediainvita.de on February 17, 2007, 10:30:41 AM
hi

First things first: Thumbs up! Great Mod :-)

Anyway it misses a feature i really would like to see. I could program it myself, but i need some information first...

How could i realize a multiple selection Box with different ( alphabetically sorted ) Options.

I need it to realize something like a "my offer" selection. Admin offers some options and the user can select several points from the list. ( Normal users are shopowners which offer a wide variety of goods, which need to be selectable )

Any Idea?
 

drossman

Quote from: JamesWC on February 13, 2007, 05:57:25 PM
Quote from: winrules on February 13, 2007, 05:15:48 PMJamesWC - Try $user_info['options']['CP1'].

That doesn't seem to work, unfortunately. I'm happy to wait for the new version though, so if you could keep this issue in mind when writing it then maybe the solution will become straightforward. Thanks. :)

This works for me ..
global $sourcedir;
$p_id=$_GET['u'];

require($sourcedir . '/Profile.php');

loadThemeOptions($p_id);

echo "CP1 = " . $context['member']['options']['CP1'];


http://www.simplemachines.org/community/index.php?topic=86793.msg966176#msg966176


cloudee1

But I want to do it from outside of the forum folder. So I can't use all of the context stuff. Assuming I have the user id, which I will from pulling the website title and url from the members table, what would the sql using the member id  need to be to pull the information for CP1.

SELECT CP1 FROM ?????? WHERE ?????? ='9'

I figured asking this way would solve the trouble of convincing me it's where everyone says it is.  
Visit my SCI programmers community [nofollow].
Where we make adventure games using the Sierra Creative Interpreter.
Just like Space Quest, King's Quest, and Leisure Suit Larry!

mediainvita.de

Quote from: Bigguy on February 17, 2007, 09:31:30 PM
Would the shop mod not be better suited for this. ???

Quote from: mediainvita.de on February 17, 2007, 10:30:41 AM
hi

First things first: Thumbs up! Great Mod :-)

Anyway it misses a feature i really would like to see. I could program it myself, but i need some information first...

How could i realize a multiple selection Box with different ( alphabetically sorted ) Options.

I need it to realize something like a "my offer" selection. Admin offers some options and the user can select several points from the list. ( Normal users are shopowners which offer a wide variety of goods, which need to be selectable )

Any Idea?
 

Actually the site i am developing is not a shop. It is a shoplist. The Users are Shopowners with a wide variety of goods and services. And i need to offer them a possibility to fill in their shopoffers into their profile? I dont know if this works with the shopmodule...as most of the things i need are already within the custom profile mod.

JamesWC

Quote from: drossman on February 17, 2007, 09:59:46 PM
Quote from: JamesWC on February 13, 2007, 05:57:25 PM
Quote from: winrules on February 13, 2007, 05:15:48 PMJamesWC - Try $user_info['options']['CP1'].

That doesn't seem to work, unfortunately. I'm happy to wait for the new version though, so if you could keep this issue in mind when writing it then maybe the solution will become straightforward. Thanks. :)

This works for me ..
global $sourcedir;
$p_id=$_GET['u'];

require($sourcedir . '/Profile.php');

loadThemeOptions($p_id);

echo "CP1 = " . $context['member']['options']['CP1'];


http://www.simplemachines.org/community/index.php?topic=86793.msg966176#msg966176

That gives me the following error in my custom action:

QuoteYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 4
File: /home/mysite/public_html/forums/Sources/Profile.php
Line: 3263

winterlok

#949
I feel fairly stupid, but I cannot figure out why they wont show in the profile area. I would like to update my "character's" profile, but when I go to fill out the profile fields I just added, they aren't showing up in the profile to be filled out. It also isn't showing up on my registration page, for my users to fill out when they sign up. I hope this makes sense to whomever reads it. Please let me know what I'm doing wrong.

Thanks!

drossman

#950
Quote from: cloudee1 on February 18, 2007, 03:14:50 AM
But I want to do it from outside of the forum folder. So I can't use all of the context stuff. Assuming I have the user id, which I will from pulling the website title and url from the members table, what would the sql using the member id  need to be to pull the information for CP1.

SELECT CP1 FROM ?????? WHERE ?????? ='9'

I figured asking this way would solve the trouble of convincing me it's where everyone says it is. 

select value from smf_themes where variable='CP1' and ID_MEMBER=the id of the member

I'm also doing things outside of the forum folder.  I'm creating a separate library that sources in the smf include files, so that I can use all of the smf variables.  Really all you have to do is require the smf php include files that you want to use.

drossman

Quote from: JamesWC on February 18, 2007, 07:14:11 AM
Quote from: drossman on February 17, 2007, 09:59:46 PM
Quote from: JamesWC on February 13, 2007, 05:57:25 PM
Quote from: winrules on February 13, 2007, 05:15:48 PMJamesWC - Try $user_info['options']['CP1'].

That doesn't seem to work, unfortunately. I'm happy to wait for the new version though, so if you could keep this issue in mind when writing it then maybe the solution will become straightforward. Thanks. :)

This works for me ..
global $sourcedir;
$p_id=$_GET['u'];

require($sourcedir . '/Profile.php');

loadThemeOptions($p_id);

echo "CP1 = " . $context['member']['options']['CP1'];


http://www.simplemachines.org/community/index.php?topic=86793.msg966176#msg966176

That gives me the following error in my custom action:

QuoteYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 4
File: /home/mysite/public_html/forums/Sources/Profile.php
Line: 3263

:shrug:

Have you  modified Profile.php?  What is the content of CP1 ??

JamesWC

Quote from: drossman on February 18, 2007, 11:06:49 AM
Quote from: JamesWC on February 18, 2007, 07:14:11 AM
Quote from: drossman on February 17, 2007, 09:59:46 PM
Quote from: JamesWC on February 13, 2007, 05:57:25 PM
Quote from: winrules on February 13, 2007, 05:15:48 PMJamesWC - Try $user_info['options']['CP1'].

That doesn't seem to work, unfortunately. I'm happy to wait for the new version though, so if you could keep this issue in mind when writing it then maybe the solution will become straightforward. Thanks. :)

This works for me ..
global $sourcedir;
$p_id=$_GET['u'];

require($sourcedir . '/Profile.php');

loadThemeOptions($p_id);

echo "CP1 = " . $context['member']['options']['CP1'];


http://www.simplemachines.org/community/index.php?topic=86793.msg966176#msg966176

That gives me the following error in my custom action:

QuoteYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 4
File: /home/mysite/public_html/forums/Sources/Profile.php
Line: 3263

:shrug:

Have you  modified Profile.php?  What is the content of CP1 ??

CP1 is a text field - in my account it contains "2".

I have a few packages that may have altered Profile.php:

Custom Profile Field
MySpace Field (redundant now of course)
Profile Comments
Profile User Action

I have no trouble retrieving non-custom profile fields though.

drossman

My example is assuming that you add ;u=ID_MEMBER (as a number) to the query string, so that the action knows which user to get the context for.  I believe you'll get that error if you don't add it.

So, try this.. http://yoursite/index.php?action=youraction;u=yourmember

JamesWC


drossman

sweet...and thanks winrules for the great mods... (linuxrules)!

winterlok

Decided to update my issue, in the hopes that maybe someone would understand by looking at screenshots of what is going on.

I have no errors at all, but basically when I make a custom profile field nothing happens in the profile itself.





You can tell by looking at a copy of my profile that they aren't showing up. Could it be because of my template?

More Information
Template Name: Endar
Website URL: http://www.winterlok.com [nofollow]
Version: 1.1.2

drossman

Did you apply the mod changes to your template?

winterlok

I'm real new to SMF, I generally use Invision Power Boards, but my license ran out, so I'm not sure how all of it works. I had the template installed and in use when I uploaded this mod, but I don't know if I applied them to my template. If I haven't, how would I go about doing so?

drossman

Switch to the default theme and verify that it works, then do a search on adding mods to other themes :)  I use the default template, so I haven't had to aply changes manually.

Advertisement: