Extended User Profile v0.1 - Almost Done, Need Help

Register an Account
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 01-08-2008, 09:56 PM
gen3ric's Avatar
Casual Pligger
Pligg Version: 9.X
Pligg Template: Custom
 
Join Date: Jul 2007
Location: Atlanta, GA
Posts: 91
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, 205 views)
Reply With Quote
  #2 (permalink)  
Old 01-09-2008, 03:02 AM
Casual Pligger
Pligg Version: 9.8.2
Pligg Template: none
 
Join Date: Dec 2007
Posts: 32
I'm going to look at this tomorrow when I get off work. Sounds promising.
Reply With Quote
  #3 (permalink)  
Old 01-09-2008, 11:54 AM
redwine's Avatar
Pligg Donor
Pligg Version: 9.8
Pligg Template: custom templat
 
Join Date: Jul 2007
Location: Canada
Posts: 216
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
  #4 (permalink)  
Old 01-09-2008, 02:31 PM
gen3ric's Avatar
Casual Pligger
Pligg Version: 9.X
Pligg Template: Custom
 
Join Date: Jul 2007
Location: Atlanta, GA
Posts: 91
Thank you so much for taking the time to explain that redwine! I'll be giving it a try this evening.
Reply With Quote
  #5 (permalink)  
Old 01-09-2008, 03:13 PM
gen3ric's Avatar
Casual Pligger
Pligg Version: 9.X
Pligg Template: Custom
 
Join Date: Jul 2007
Location: Atlanta, GA
Posts: 91
That worked perfectly redwine! I didn't realize that libs/user.php had to be modified
Reply With Quote
  #6 (permalink)  
Old 01-09-2008, 05:03 PM
Casual Pligger
Pligg Version: 9.8.2
Pligg Template: It was Shredit but I've torn it apart
 
Join Date: Nov 2007
Posts: 35
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, 05:24 PM
modernste's Avatar
Casual Pligger
Pligg Version: 9.8.2
Pligg Template: yget
 
Join Date: Nov 2007
Posts: 34
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, 06:53 PM
Casual Pligger
Pligg Version: 9.8.2
Pligg Template: It was Shredit but I've torn it apart
 
Join Date: Nov 2007
Posts: 35
I made the suggestion on the forum (along with an image example) here:
http://forums.pligg.com/suggestions/...html#post52138
Reply With Quote
  #9 (permalink)  
Old 01-15-2008, 04:15 PM
New Pligger
Pligg Version: last
Pligg Template: none
 
Join Date: Jan 2008
Posts: 1
nice plug i need modify profile yeah
Reply With Quote
  #10 (permalink)  
Old 01-27-2008, 04:28 AM
Casual Pligger
Pligg Version: 9.8.2
Pligg Template: none
 
Join Date: Dec 2007
Posts: 32
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 04:34 AM.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fixes to Profile Extra Fields Module v0.2 and Extended Profile Module v0.1 redwine Questions and Comments 11 12-20-2010 04:18 PM
Extended user profile mod not working pottypotsworth Questions and Comments 0 03-20-2009 06:36 AM
User Profile & Community jacksparrow Questions and Comments 3 03-17-2008 12:56 AM
After successful registration user cannot directed toward profile page aryan3 Questions and Comments 0 11-14-2007 01:58 PM
How can I add new fields to user profile gragland Questions and Comments 0 07-18-2006 01:03 AM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development