minibb®
Fight the automated spam - protect your miniBB-forums,
getting the Captcha addon! Click here to read more.
Captcha Addon for miniBB
Community Forum
 | Forums | File Bank | Sign Up | Reply | Search | Statistics | Manual |
Master Class miniBB Community Forum / Master Class /

Getting parsed values of user profile fields specified under $userInfoInPosts

 Page:  ««  1  2  3  »» 
Team
8-)
#16 | Posted: 11 Apr 2005 10:47
Reply 
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'
Vishal
Forums Member
#17 | Posted: 18 Jul 2005 13:37 | Edited by: Vishal
Reply 
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.
Team
8-)
#18 | Posted: 18 Jul 2005 13:58
Reply 
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 '';
}
Vishal
Forums Member
#19 | Posted: 18 Jul 2005 14:10 | Edited by: Vishal
Reply 
No it's not working. I think the above expression should be:

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

I tried that too.
Team
8-)
#20 | Posted: 18 Jul 2005 16:22
Reply 
&& = and in this case.

Don't you forget to list this field in $userInfoInPosts array?
Vishal
Forums Member
#21 | Posted: 18 Jul 2005 16:42
Reply 
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.
Team
8-)
#22 | Posted: 18 Jul 2005 17:20
Reply 
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.
Vishal
Forums Member
#23 | Posted: 19 Jul 2005 07:31
Reply 
Yes, I would like to know how as I display the website as a signature after the message.
Team
8-)
#24 | Posted: 19 Jul 2005 10:35
Reply 
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']];

}
ezkim0x
Forums Member
#25 | Posted: 25 Jun 2006 04:23
Reply 
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.
Paul
CEO
#26 | Posted: 25 Jun 2006 08:06
Reply 
You have spare \" before "message=hey+..."
ezkim0x
Forums Member
#27 | Posted: 26 Jun 2006 04:16
Reply 
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 '';
Helmet
Guest
#28 | Posted: 17 Feb 2008 19:51
Reply 
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
Helmet
Guest
#29 | Posted: 17 Feb 2008 21:52
Reply 
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..
Helmet
Guest
#30 | Posted: 17 Feb 2008 22:57
Reply 
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:  ««  1  2  3  »» 
Your reply
Bold Style  Italic Style  Image Link  URL Link 


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

Before posting, be sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.

 
Online now: Guests - 32
Members - 0
Most users ever online: 191 [24 Dec 2007 14:33]
Guests - 191 / Members - 0

Forums are powered by miniBB®