miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | 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
Partaker
#1 | Posted: 30 Mar 2005 21:42 
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:
$userInfoInPosts=array('user_website');

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
8-)
#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
8-)
#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
Partaker
#4 | Posted: 31 Mar 2005 23:42 
Thanks - now everything is fine =)

Author andreasm
Partaker
#5 | Posted: 8 Apr 2005 17:11 
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
8-)
#6 | Posted: 8 Apr 2005 17:18 
Read my message at 31 Mar 2005 10:52.

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

Author andreasm
Partaker
#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>
<br><br>
<span class=txtSm>{$userInfo_user_website[$poster_id]}</span>

</td>
<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>
</tr>

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

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

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

Please help!

Author Fritzek
Partaker
#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
Partaker
#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
Partaker
#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
Partaker
#14 | Posted: 10 Apr 2005 14:25 
vielen dank für die erklärung! nun verstehe ich das

Author Anonymous
Guest
#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
 Share Topic's Link

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


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Try the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑