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 2 of 3:  « Previous  1  2  3  Next »

Author Team
8-)
#16 | Posted: 11 Apr 2005 10:47 
Yes, this is possible, and the function in bb_plugins.php must be like that:

function parseUserInfo_user_regdate($date){
return substr($date,0,10);
}

And in main_posts_cell.html:

{$userInfo_user_regdate[$poster_id]}

It should return date like '2004-02-03'

Author Vishal
Partaker
#17 | Posted: 18 Jul 2005 13:37 
Team
function parseUserInfo_user_website($web){
if($web!='') return "<a href=\"$web\" target=\"_blank\"><span class=txtSm>~www</span></a>"; else return '';
}


Is it possible to display the website based on the length of the post? I mean display website only if the post length made by the uesr is greater than or equal to 300 chracters.

Author Team
8-)
#18 | Posted: 18 Jul 2005 13:58 
Try:

function parseUserInfo_user_website($web){
if($web!='' and strlen($GLOBALS['posterText'])>=300) return "<a href=\"$web\" target=\"_blank\"><span class=txtSm>~www</span></a>"; else return '';
}

Author Vishal
Partaker
#19 | Posted: 18 Jul 2005 14:10 
No it's not working. I think the above expression should be:

if($web!='' && strlen($GLOBALS['posterText'])>=300)

I tried that too.

Author Team
8-)
#20 | Posted: 18 Jul 2005 16:22 
`&&` = `and` in this case.

Don't you forget to list this field in $userInfoInPosts array?

Author Vishal
Partaker
#21 | Posted: 18 Jul 2005 16:42 
Which field? user_website?

Here's my field in setup_options.php
$userInfoInPosts=array('num_posts','user_regdate','user_website');

It's displaying the website without the "and strlen($GLOBALS['posterText'])>=300" condition.

Author Team
8-)
#22 | Posted: 18 Jul 2005 17:20 
Oh yeah... I've checked this, and it will not work, unfortunatelly. 'user info in posts' is not related to the post text in any way. There is a workaround in the function parseMessage(), but in that case, you WWW link will be added after the message itself.

Author Vishal
Partaker
#23 | Posted: 19 Jul 2005 07:31 
Yes, I would like to know how as I display the website as a signature after the message.

Author Team
8-)
#24 | Posted: 19 Jul 2005 10:35 
So, this is an example of:

function parseMessage(){

$return='';

if(strlen($GLOBALS['posterText'])<300) $GLOBALS['userInfo_user_website'][$GLOBALS['poster_id']
]=''; else $GLOBALS['userInfo_user_website'][$GLOBALS['poster_id']
]='<br>'.$GLOBA LS['userInfo_user_website']
[$GLOBALS['poster_id']];

$return.=$GLOBALS['userInfo_user_website'][$GLOBALS['poster_id']];

}

Author ezkim0x
Partaker
#25 | Posted: 25 Jun 2006 04:23 
I changed ICQ to display aim instead.. but I can't get the links to work correctly.. when people have spaces in their SN it needs to add a + instead of the space.. so I tried using str_replace.. but it's just not working.

example:

if($icq!='') return "<a href=\"aim:goim?screenname=\"".str_replace(' ', '+', $icq)."\"&message=hey+qt\" target=\"_blank\"><img height=\"15\" width=\"15\" border=\"0\" src=\"http://jonindie.com/img/aim.gif\"></a>"; else return '';

do you see what's wrong there? it's just displaying the url as

"aim:goim?screenname="

without the name.

Author Paul
Lead Developer 
#26 | Posted: 25 Jun 2006 08:06 
You have spare \" before "message=hey+..."

Author ezkim0x
Partaker
#27 | Posted: 26 Jun 2006 04:16 
I ended up changing it to this and got it work.

$aim = str_replace(' ', '+', $icq);

if($aim!='') return "<a href=\"aim:goim?screenname=$aim&message=hey+qt\"><img height=\"15\" width=\"15\" border=\"0\" src=\"http://jonindie.com/img/aim.gif\"></a>"; else return '';

Author Helmet
Guest
#28 | Posted: 17 Feb 2008 19:51 
I hope this hasn't been answered, and unfortunately it's going to be a slightly vague question, but I have a synchronized installation of the BB with my own accounts table, one field of which is "thumbname" which is just an image name. I'd like this to show under the username in their posting (the avatar plugin is more than I need as all image management is through my own code) but I can't get it, or any other non-BB field in my accounts database to show up. In setup_options.php I have:

$dbUserSheme=array('thumbname'=>array(44,'thumbname','')); (among others)
$userInfoInPosts=array('thumbname');


And in main_posts_cell.html:

{$userInfo_thumbname[$poster_id]}

.. but this outputs nothing, and I can't figure out why. Have I missed/misconfigured something? Any suggestions would be greatly appreciated.. this is my first time working with MiniBB.

Thanks,
H

Author Helmet
Guest
#29 | Posted: 17 Feb 2008 21:52 
After re-reading the manual, it seems clear that the only thing I need to display a table field is to add it to the userInfoInPosts array, which I have done, yet I am still seeing nothing with {$userInfo_thumbname[$poster_id]}. I've tried tracking this problem backwards but without any error reporting, I can't figure it out..

Author Helmet
Guest
#30 | Posted: 17 Feb 2008 22:57 
Thanks to lines 44 & 45 of setup_mysql.php:

//if($sus==0 and function_exists('parseSql')) $sql=parseSql($sql);
//echo "!-- ".$sql." --><br />";

I discovered that the query was referencing the wrong column name for the user id, so I updated that in the config.

Now the last problem I have is that I would like to add a function to output an age for the user based on year, month, day in this format: 1975-09-15. I have a PHP function for this already, but how can I call this function and have it output for each poster in a thread?

Page  Page 2 of 3:  « Previous  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
Check out the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑