[SOLVED] How to int...
 
Notifications
Clear all

[SOLVED] How to integrate custom profile field to profile...

13 Posts
5 Users
0 Reactions
1,988 Views
(@jacynthe)
Posts: 242
Estimable Member
Topic starter
 

Concerning the instructions found on this thread ( https://efiction.org/forums/index.php?topic=3305.0)...

I don't think I got it right because I tried adding the custom avatar field as you instructed and it's just not showing up in the pforile. I mean the field shows just fine in the edit bio page... but it doesn't get added to the profile at all.

I not only copied and pasted exactly what you did and then I tried to change all the info I could with the field I created.

Name: avatar
Title: avatar (enter url)

Custom Form Code:


$output .= "<div><label for='avatar'>".$field['avatar'].":</label><INPUT type='text' class='textbox'  name='af_".$field['avatar']."' maxlength='250' value='".(!empty($user['af_'.$field['13']]) ? $user['af_'.$field['13']] : "")."' size='20'></div>";

Custom Profile Code:


$thisfield = "<img src="'".$field['avatar'"]."'>";

Then, in my profile.tpl file I added {avatar} where I wanted the avatar to show but it's not doing it...
http://library.suethomasfbeye.net/viewuser.php?uid=1

What did I do wrong?


Jacynthe

Archives: http://fanfics.e-authors.net
Version: 3.5.3
Modified? Somewhat...
PHP:  5.3.3
MySQL: 5.0.91-community

 
Posted : 06/08/2007 9:14 pm
Jan_AQ
(@jan_aq)
Posts: 1300
Noble Member
 

The custom profile code is supposed to be:

$thisfield = "<img src="'".$field['info'"]."'>";

You changed info to avatar. Check the first part to make sure you didn't do the same anywhere there too. It's best to copy and paste code for mods to make sure you copied them correctly.


Whoever said nothing is impossible never tried slamming a revolving door.

url: https://www.potionsandsnitches.org/fanfiction
php: 7.4.33 msql: 5.6.51-community GPL
efic version: 3.5.5 latest patches: yes
bridges: none mods: challenges, tracker, story end, beta, word

 
Posted : 06/08/2007 11:51 pm
(@jacynthe)
Posts: 242
Estimable Member
Topic starter
 

I had used info and it wasn't working... and I copied as well the original code that was given but it also did not work which is why I tried changing it to see if it would fix the issue for me.


Jacynthe

Archives: http://fanfics.e-authors.net
Version: 3.5.3
Modified? Somewhat...
PHP:  5.3.3
MySQL: 5.0.91-community

 
Posted : 07/08/2007 1:40 pm
(@jacynthe)
Posts: 242
Estimable Member
Topic starter
 

Okay I got it to work. I actually am the one who made the mistake - not in syntax but in not thinking that everytime I made a change to the custom field, that removed the URL I had inputted so.... because of that it wasn't showing an image because it didn't have a URL to show. *blush*

Sorry about that!


Jacynthe

Archives: http://fanfics.e-authors.net
Version: 3.5.3
Modified? Somewhat...
PHP:  5.3.3
MySQL: 5.0.91-community

 
Posted : 07/08/2007 1:45 pm
(@jacynthe)
Posts: 242
Estimable Member
Topic starter
 

I have one more question, not that the field doesn't work.. but I want to modify something for it. I would like that a predefined image I upload become the default image if no URL is entered in there. And since I turned on image uploading, I guess I should be using the image field since I can't seem to delete that - I end up having both the image field for the URL AND the avatar field I created asking for a URL as well. Just ends up being confusing.

What would be the best way to do this? Using an IF/else argument?


Jacynthe

Archives: http://fanfics.e-authors.net
Version: 3.5.3
Modified? Somewhat...
PHP:  5.3.3
MySQL: 5.0.91-community

 
Posted : 12/09/2007 1:30 pm
(@tammy)
Posts: 2577
Member Moderator
 

Yep.


 
Posted : 13/09/2007 10:24 am
(@fanfictionworld)
Posts: 149
Estimable Member
 

I tried this but all I kept getting in the user bio area was a : for the field name instead of avatar 😕


~Spikey~

my site url: http://www.fanfictionworld.org
efic version:3.5.3

 
Posted : 14/09/2007 4:47 pm
(@michelle)
Posts: 106
Estimable Member
 

*meep* I'm getting the same. A ":" showing and the avatar refuses to show up. Any ideas?


 
Posted : 17/09/2007 3:30 pm
(@jacynthe)
Posts: 242
Estimable Member
Topic starter
 

Hmmm... did you make sure not to make any typos? Cause I got mine working just fine following the instructions given by Tammy.

In the new profile field, I inputted:

Name: Avatar
Title: Avatar (enter URL here)
Field Enabled (checked box)
Type: Custom Code

Custom Form:

$output .= "<div><label for='avatar'>".$field['field_title'].":</label><INPUT type='text' class='textbox'  name='af_".$field['field_name']."' maxlength='250' value='".(!empty($user['af_'.$field['field_id']]) ? $user['af_'.$field['field_id']] : "")."' size='20'></div>";

Custom Profile:

$thisfield = "<img src="'".$field['info'"]."'>";

do NOT use tinyMCE while inputting those codes or it will not work correctly.


Jacynthe

Archives: http://fanfics.e-authors.net
Version: 3.5.3
Modified? Somewhat...
PHP:  5.3.3
MySQL: 5.0.91-community

 
Posted : 17/09/2007 4:48 pm
(@michelle)
Posts: 106
Estimable Member
 

Ha! It works, thanks so much! Seems there really was a typo somewhere in there:)


 
Posted : 18/09/2007 3:22 pm
(@jacynthe)
Posts: 242
Estimable Member
Topic starter
 

Tammy,
Could you please tell me if this coding would be right for the default image thingie?


if($userinfo['image'] == empty)
  $output .= "<img src="'images/lined_noimage.gif'>";"
else $tpl->assign("image", "<img src=""".$userinfo['image'"]."">");

thanks


Jacynthe

Archives: http://fanfics.e-authors.net
Version: 3.5.3
Modified? Somewhat...
PHP:  5.3.3
MySQL: 5.0.91-community

 
Posted : 19/09/2007 7:59 pm
(@jacynthe)
Posts: 242
Estimable Member
Topic starter
 

Obviously that didn't work so I tried something else that kinda worked but kinda not because it doesn't use the image I enter the URL of...


if(!empty($userinfo['image']))
    $tpl->assign("image", "<img src="images/lined_noimg.gif>");"
    else $tpl->assign("image", "<img src=""".$userinfo['image'"]."">");

I had tried using the output instead of the tpl->assign but it put the image grouped with the series - so that obviously wasn't the right thing to do!

so what should I modify to make it work? Anyone has any idea?


Jacynthe

Archives: http://fanfics.e-authors.net
Version: 3.5.3
Modified? Somewhat...
PHP:  5.3.3
MySQL: 5.0.91-community

 
Posted : 19/09/2007 10:39 pm
(@jacynthe)
Posts: 242
Estimable Member
Topic starter
 

I DID it!!!


if($userinfo['image'])
    $tpl->assign("image", "<img src=""".$userinfo['image'"]."">");
else $tpl->assign("image", "<img src="images/lined_noimg.gif>");"

Jacynthe

Archives: http://fanfics.e-authors.net
Version: 3.5.3
Modified? Somewhat...
PHP:  5.3.3
MySQL: 5.0.91-community

 
Posted : 19/09/2007 10:47 pm
Share: