15 years on The Web
miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Master Class miniBB Support Forums / Master Class /   

Getting parsed values of user profile fields specified under $userInfoInPosts

Page  Page 1 of 3:  1  2  3  Next »  
Author gorin
#1 | Posted: 30 Mar 2005 21:42 | Edited by: gorin 
I don't understand what should I do to get this:
user-fields (e.g. $userInfo_user_website) should be displayed under user's nickname ONLY if this field is not emty.

Now I'm using this settings:
In setup_options.php:

And in main_posts_cell.html:
<span class=txtSm><a href="{$userInfo_user_website[$poster_id]}">~www</a></span>

And if some user didn't fill this field during registration i've got a link under his name which pointed to current page. But i want get nothing about this field if it is emty (i don't need even '~www' in this case :)).

Another words I want to implement this as in this forum :)

If i'm clearly understood manual, templates are parsed only for variables substitution. Therefor i can't use 'if' statement inside templates or i'm wrong?

What should I do ?

Author Team
#2 | Posted: 31 Mar 2005 10:52 
Open bb_plugins.php and add that function:

function parseUserInfo_user_website($web){
if($web!='') return "<a href=\"$web\" target=\"_blank\"><span class=txtSm>~www</span></a>"; else return '';

It's not still documented because we still have ZERO time to do complete manuals...

Author Team
#3 | Posted: 31 Mar 2005 10:54 
Yeah, and add simply

<span class=txtSm>{$userInfo_user_website[$poster_id]}</span>

in a template.

Actually, for any specified user_info field, you may write the function with syntax function parseUserInfo_user_info($user_info_value).

Author gorin
#4 | Posted: 31 Mar 2005 23:42 
Thanks - now everything is fine =)

Author andreasm
#5 | Posted: 8 Apr 2005 17:11 | Edited by: andreasm 
Actually, for any specified user_info field, you may write the function with syntax function parseUserInfo_user_info($user_info_value).

I don't understand this !

Author Team
#6 | Posted: 8 Apr 2005 17:18 
Read my message at 31 Mar 2005 10:52.

Author andreasm
#7 | Posted: 8 Apr 2005 17:23 
I've already added the function in bb_plugins.php ....
what else must I modifiy ?

Author andreasm
#8 | Posted: 8 Apr 2005 17:26 
MY main_posts_cell.html:

<tr valign=top class={$bg}>
<td class=caption1><a name="{$anchor}" href="JavaScript:paste_strinL('{$posterName}',2)"><span

class=username>{$posterName}</span></a><br><span class=txtSm>{$viewReg}</span>
<span class=txtSm>{$userInfo_user_website[$poster_id]}</span>

<td class=caption1><span class=txtSm>{$l_posted}: {$postDate}{$editedBy}{$viewIP}<br><script

type="text/javascript">getQuotation('{$posterName}');</script>{$allowe d}</span><br><br>{$posterText}<br><br></td>

Author andreasm
#9 | Posted: 8 Apr 2005 17:27 | Edited by: andreasm 
Where's the error ?

Sorry, but I'm a PHP and MYSQL beginner and from germany ;-)

Author andreasm
#10 | Posted: 8 Apr 2005 17:40 
In which file or template must I call the function "parseUserInfo_user_website" ???

Please help!

Author Fritzek
#11 | Posted: 8 Apr 2005 18:33 
Hi andreasm
there must be something wrong with your setup. Please check again. I will explain what I have done to get this working:
1. copy the code snippet from Team's post to bb_plugins.php
2. copy the $userInfoInPosts=array('user_website'); to setup_options.php
3. copy the <span class=txtSm>{$userInfo_user_website[$poster_id]}</span> to main_posts_cell.html
4. clear you cache or press shift+reload in your browser to really re-read the webpage

if point 1-3 is ok at your site, I believe the point 4 will do the job ;-)
PS: if necessary answer in German. I'm too.

Author andreasm
#12 | Posted: 9 Apr 2005 00:38 
Ok, Deutsch ist besser :-)

mann, ich hab nun den Fehler gefunden: Ich hatte zwar alles richtig implementiert, doch das FTP Programm hat die Dateien nicht überschrieben, da die Dateien auf dem Server neuer waren (irgendwie hat der Server ne andere Zeit eingestellt). An so einfachen Dingen scheitere ich meistens... arghhh :-)

Was ich aber gar nicht verstehe: Wie und wo wird die Funktion parseUserInfo_user_info aufgerufen? Da steht doch nirgends in den Dateien etwas davon drin, oder?

Author Fritzek
#13 | Posted: 9 Apr 2005 01:27 
mach dir keine gedanken darüber. die wird beim parsen der templates ausgeführt. wenn du die option eingeschaltet hast, schaut der template-parser in bb_plugins nach und findet die parse funktion. das is alles.

Author andreasm
#14 | Posted: 10 Apr 2005 14:25 
vielen dank für die erklärung! nun verstehe ich das

Author Anonymous
#15 | Posted: 10 Apr 2005 19:28 
Ok, everything works like it should be, just one question, when I add user_regdate in $userInfoInPosts I get date and time of user registration and I want to show just a date, Is this possible?

Page  Page 1 of 3:  1  2  3  Next » 
Master Class miniBB Support Forums / Master Class / Getting parsed values of user profile fields specified under $userInfoInPosts Top

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

 Short link for this topic:

You are welcome to post anonymously, by entering a nickname with no password (if the similar Username has not been taken yet), or by leaving both fields empty. If you have a forums account, you can also sign in from this page without posting a message, or sign in and post at once.

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
Proceed with the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB