Go Back   Pligg Forum > Pligg Development > Pligg Modules
Reply
 
LinkBack Thread Tools Display Modes
Old 01-08-2008, 07:56 PM   #1
Extended User Profile v0.1 - Almost Done, Need Help
 
gen3ric's Avatar
gen3ric
Constant Pligger
Pligg Version: 9.X
Pligg Template: Custom
Join Date: Jul 2007
Location: Atlanta, GA
Posts: 113

Show Printable Version Email this Page
gen3ric gen3ric is offline 01-08-2008, 07:56 PM
Rating: (2 votes - 4.00 average)

I'm really close to releasing my first module that makes it easier to add extra fields to a user's profile. The module installs fine, stores data, users can edit the extra profile fields by clicking the "Modify" link and the modifications save to the database fine, but I just can't quite get the data retrieved and displayed in the profile view.

I'd appreciate it if someone with a little more experience take a look at what I have so far and lend a hand.

Attached Files
File Type: zip profiles.zip (4.9 KB, 82 views - Who Downloaded?)

__________________
Design Float - Digg For Designers
Views: 2554
Reply With Quote
The Following 4 Users Say Thank You to gen3ric For This Useful Post:
  #2 (permalink)  
Old 01-09-2008, 01:02 AM
mntbikeracer1 mntbikeracer1 is offline
Casual Pligger
Pligg Version: 9.8.2
Pligg Template: none
 
Join Date: Dec 2007
Posts: 46
Downloads: 19
Uploads: 0
Thanks: 0
Thanked 0 Times in 0 Posts
I'm going to look at this tomorrow when I get off work. Sounds promising.
Reply With Quote
  #3 (permalink)  
Old 01-09-2008, 09:54 AM
redwine's Avatar
redwine redwine is offline
Pligg Donor
Pligg Version: 9.8
Pligg Template: custom templat
 
Join Date: Jul 2007
Location: Canada
Posts: 189
Downloads: 22
Uploads: 0
Thanks: 17
Thanked 90 Times in 57 Posts
Extended profile

Quote:
Originally Posted by gen3ric View Post
I'm really close to releasing my first module that makes it easier to add extra fields to a user's profile. The module installs fine, stores data, users can edit the extra profile fields by clicking the "Modify" link and the modifications save to the database fine, but I just can't quite get the data retrieved and displayed in the profile view.

I'd appreciate it if someone with a little more experience take a look at what I have so far and lend a hand.
I will start from the section you need to retrieve the data to the profile and the modify profile:

*** Remember, this is an example for one field, you have to do the same for every field you added to the profile.
To get the data to the user profile.
Open /libs/user.php
Under the Class User { section, add the variables for the fields you added to the profile. Example:
Code:
var $car = '';
Look for function store() { and insert this anywhere after $user_email = $db->escape($this->email);
Code:
$user_car = $db->escape($this->car);
Few lines below where it starts with $sql .= " , user_login=
And insert the following right before the WHERE
Code:
, user_car='$user_car'
Go to function read() { and insert the following anywhere before the line that reads $this->read = true;
Code:
$this->car = $user->user_car;
Look for function fill_smarty($main_smarty, $stats = 1){
And insert this before the line that reads if($stats == 1){
Code:
$main_smarty->assign('user_car', $this->car);
Save and close.
Open /templates/yget/user_center.tpl
Look for <div id="personal_info">
And insert the following anywhere you want them to appear in the profile:

Code:
 
{if $user_car ne ""}
<tr>
<td><strong>{# PLIGG_Visual_User_Car#}:</strong></td>
</tr>
{/if}
Save and close.
Open /profile.php
Look for function show_profile() {
And insert the following before the line // pagename
Code:
$main_smarty->assign('user_car', $user->car);
Look for function save_profile() {
And insert the following before the line // module system hook
Code:
$user->car=cleanit($_POST['car']);
Open /templates/yget/profile_center.tpl
And insert this at the end of the first table before </table> Don’t forget to assign the tabindex
Code:
 
<tr>
<td><label class="req">{#PLIGG_Visual_User_Car#}:</label>
<input type="text" id="car" name="car" value="{$user_car}" class="textinput" size="30" tabindex="" maxlength="128" />
</td>
<td>&nbsp;</td> 
</tr>
Save and close
Reply With Quote
The Following 4 Users Say Thank You to redwine For This Useful Post:
  #4 (permalink)  
Old 01-09-2008, 12:31 PM
gen3ric's Avatar
gen3ric gen3ric is offline
Constant Pligger
Pligg Version: 9.X
Pligg Template: Custom
 
Join Date: Jul 2007
Location: Atlanta, GA
Posts: 113
Downloads: 27
Uploads: 0
Thanks: 22
Thanked 9 Times in 6 Posts
Thank you so much for taking the time to explain that redwine! I'll be giving it a try this evening.
__________________
Design Float - Digg For Designers
Reply With Quote
  #5 (permalink)  
Old 01-09-2008, 01:13 PM
gen3ric's Avatar
gen3ric gen3ric is offline
Constant Pligger
Pligg Version: 9.X
Pligg Template: Custom
 
Join Date: Jul 2007
Location: Atlanta, GA
Posts: 113
Downloads: 27
Uploads: 0
Thanks: 22
Thanked 9 Times in 6 Posts
That worked perfectly redwine! I didn't realize that libs/user.php had to be modified
__________________
Design Float - Digg For Designers
Reply With Quote
  #6 (permalink)  
Old 01-09-2008, 03:03 PM
rwallen rwallen is offline
Casual Pligger
Pligg Version: 9.8.2
Pligg Template: It was Shredit but I've torn it apart
 
Join Date: Nov 2007
Posts: 42
Downloads: 8
Uploads: 0
Thanks: 2
Thanked 1 Time in 1 Post
How is everything going with this? I've had some users ask for more options in their profile. I've actually had a cool request for the ability to setup rss feeds in their profile so they can read news from feeds in their profile, and submit the stories to my site they like from those feeds. Does that make sense? Is that something that can be done do you think?
Reply With Quote
  #7 (permalink)  
Old 01-09-2008, 03:24 PM
modernste's Avatar
modernste modernste is offline
Casual Pligger
Pligg Version: 9.8.2
Pligg Template: yget
 
Join Date: Nov 2007
Posts: 43
Downloads: 4
Uploads: 0
Thanks: 6
Thanked 5 Times in 5 Posts
Quote:
Originally Posted by rwallen View Post
How is everything going with this? I've had some users ask for more options in their profile. I've actually had a cool request for the ability to setup rss feeds in their profile so they can read news from feeds in their profile, and submit the stories to my site they like from those feeds. Does that make sense? Is that something that can be done do you think?
rwallen that's a fantastic idea....... and one I'd like to know as well.

redwine...you are super mega-awesome
Reply With Quote
  #8 (permalink)  
Old 01-09-2008, 04:53 PM
rwallen rwallen is offline
Casual Pligger
Pligg Version: 9.8.2
Pligg Template: It was Shredit but I've torn it apart
 
Join Date: Nov 2007
Posts: 42
Downloads: 8
Uploads: 0
Thanks: 2
Thanked 1 Time in 1 Post
I made the suggestion on the forum (along with an image example) here:
External RSS feeds in users profile
Reply With Quote
  #9 (permalink)  
Old 01-15-2008, 02:15 PM
troglod troglod is offline
New Pligger
Pligg Version: last
Pligg Template: none
 
Join Date: Jan 2008
Posts: 1
Downloads: 3
Uploads: 0
Thanks: 0
Thanked 0 Times in 0 Posts
nice plug i need modify profile yeah
Reply With Quote
  #10 (permalink)  
Old 01-27-2008, 02:28 AM
mntbikeracer1 mntbikeracer1 is offline
Casual Pligger
Pligg Version: 9.8.2
Pligg Template: none
 
Join Date: Dec 2007
Posts: 46
Downloads: 19
Uploads: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Thank you Gen3ric for the mod. And redwine for the great instructions. This will be a great extension to my site.

Last edited by mntbikeracer1 : 01-27-2008 at 02:34 AM.
Reply With Quote
Reply



Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
Newline ability needed for a field in user profile rossoonline General Help 0 09-18-2007 05:23 PM
How to link Extra fields in Profile to pull information from user table in database pliggnewbie Pligg Mods 0 04-12-2007 12:59 AM
Custom user profile fields revolver Suggestions 2 12-05-2006 08:52 PM
How can I add new fields to user profile gragland General Help 0 07-17-2006 11:03 PM
[bug fix] discarded stories are dipalyed in user profile gragland Bug Report 0 07-04-2006 04:18 PM


LinkBacks Enabled by vBSEO 3.0.0