miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Specific miniBB Support Forums / Specific /   

img code tag inside a custom field

Author Marius
Registered
#1 | Posted: 30 Jan 2007 06:48 
I've read and followed the instructions from here:

Detailed solution on how to add new custom field to user profile.

It seems to works fine, I wanted to use this field for a gamercard image hosted from another site. That's why I can't use the avatar addon for this.

I thought I had it working except that the image is not displayed, but only the html code. What needs to happen for custom fields to show an image on the message board when using html in that custom field?

Kind regards,
Marius

- I feel I'm close, not sure though

Author Paul
Lead Developer
#2 | Posted: 30 Jan 2007 08:34 
What exactly is stored in this custom field as for example?

You should create a function called parseUserInfo_customFieldName() and produce the output basing on this field's input.

For example I recently created something like this for one of my customers...

/* Gamer tag */

function parseUserInfo_user_occ($av){
if($av!='') return '<br /><br /><br /><img src="http://www.glop.org/gamercard/card/'.trim($av).'.png" title="'.$av.'" alt="'.$av.'" />'; else return '<br /><br /><br /><img src="http://www.xbox360lan.co.uk/img/blankgamercard.png" title="" alt="" />';
}

/* -- Gamer tag */


as you see it uses "occupation" field for storing gamer's nickname, but then parses this field and produces the necessary result.

Author Marius
Registered
#3 | Posted: 30 Jan 2007 11:18 
That's perfect...the function fixed everything and more!

kind regards,
Marius

Author Marius
Registered
#4 | Posted: 8 Feb 2007 02:51 | Edited by: Marius 
Hi, I've implemented this idea, which works great:

/* Gamer tag */
function parseUserInfo_user_custombd($av){
if($av!='') return '<a href="http://live.xbox.com/member/'.trim($av).'" title="'.$av.' on xbox.com"><img src="http://www.glop.org/gamercard/card/'.trim($av).'-forum.png" title="'.$av.' on xbox.com" alt="'.$av.'" /></a>'; else return '{$posterName}';
}
/* -- Gamer tag */

I replaced:

<span class="username">{posterName}</span>

for:

<span class="username">{$userInfo_user_custombd[$poster_id]}</span>

within main_posts_cell.html

I was hoping that the following code used above, "else return '{$posterName}';", would generate the posterName if the poster did not register, but it doesn't.

I would like to use this so for the one forum that does not require registration, so it would show 'Guest' or 'Nickname' as poster name instead of the gamertag. All other forums require registration and so there is no concern.

How come this doesn't seem to work? Is it because the above function is only called for registered users?

Kind regards for this small and seemingly irrelevant request,

Marius

Author Paul
Lead Developer
#5 | Posted: 8 Feb 2007 04:41 
That will not work. {$posterName} should be always kept in the template since it indicates guest's or member's nickname on forums, and this is built-in into core minibb functions. What you could achieve with parseUserInfo_ function set, is just to parse additional profile's field and display its value beneath the {$posterName} or in some other part of main_posts_cell.html

Author Marius
Registered
#6 | Posted: 8 Feb 2007 04:58 
Is there a way to parse information of unregistered guests inside the parseUserInfo_ function set?

Author Paul
Lead Developer
#7 | Posted: 8 Feb 2007 09:09 
parseUserInfo_ is designed ONLY for user's profile as I wrote. If user has no profile, his data can not be parsed that way (and in general, his data can not be parsed any way).

Specific miniBB Support Forums / Specific / img code tag inside a custom field Top

Your Reply Click this icon to move up to the quoted message

 Short link for this topic:

 ?
Only registered users are allowed to post here. Please, enter your username/password details upon posting a message, or register first.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
 
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Install the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB