miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Specific miniBB Support Forums / Specific /  
 

Not displaying the 'posts' word near the amount of posts for guests

 
Author floraforum
Partaker
#1 | Posted: 29 Aug 2012 19:45 
On my site, registration is not required, but I would like to see the word 'posts' be removed by guests.

Look here look at guest wilma.

The word posts I have put in 'main_post_cell'

Like this

<table class="forumsmb">
<tr>
<td rowspan="3" class="postedLeftCell"><img src="https://www.minibb.com/forums/img/s.gif" style="width:12px;height:9px;padding-top:6px" alt="{$l_author}" /></td>
<td rowspan="3" class="pauthor" style="width:13%"><span class="username">{$pLink1}{$posterName}{$pLink2}</span><span class="txtSm"><br />{$viewReg}<br />{$userInfo_user_custom1[$poster_id]}<br />{$userInfo_num_posts[$poster_id]} posts<br />{$userInfo_user_custompics[$poster_id]} {$userInfo_username[$poster_id]}</span></td>
</tr>
<tr><td class="txtSm" style="padding-left:3pt"><a id="msg{$cols[6]}" name="msg{$cols[6]}" href="#msg{$cols[6]}" class="txtSm" rel="nofollow">#{$anchor2}</a> {$l_sepr} {$l_posted}: {$postDate}{$editedBy}{$viewIP}</td><td class="txtSm txtR"><script type="text/javascript">getQuotation('{$posterNameJs}', 2, {$cols[6]});</script><script type="text/javascript">getQuotation('{$posterNameJs}', 1, {$cols[6]});</script>{$allowed}{$reportMsgLink} {$deleteBox}</td></tr>

<tr><td class="caption1 {$bg} postedTextCell" style="width:87%" colspan="2"><div class="postedText">{$posterText}<br /><br />{$fileUploadData}</div>{$adsense}</td></tr>

<tr><td colspan="4"><img src="https://www.minibb.com/forums/img/p.gif" style="width:1px;height:23px;" alt="" /> </td></tr>
</table>


Is there a another way to do this?


Thanks already

Author tom322
Active Member
#2 | Posted: 29 Aug 2012 22:59 
You can probably look up the function: userInfo_num_posts[$poster_id] (in your bb_plugins.php?) and then just add the word 'Posts' to it (that way it should only be displayed for registered users only).

Author Paul
Lead Developer 
#3 | Posted: 30 Aug 2012 10:29 
tom322 is right. You need to pass this value through a function, and skipping the $user_id==0 condition.
You may check Custom Rankings solution to see how to set up this function; then modify it to provide the output you want.

Author floraforum
Partaker
#4 | Posted: 30 Aug 2012 10:50 
This is the code from bb_plugins.php?
Can you tell me where and how to put the text?


function parseUserInfo_num_posts($val){
if($GLOBALS['action']=='userinfo')return $val-$GLOBALS['row'][10];
else return $val;
}

I've tried everything, but I only get errors.
So I think I'm doing something wrong

Author Paul
Lead Developer 
#5 | Posted: 30 Aug 2012 11:08 
What kind of errors do you get?
Follow the installation readme for this add-on. Install the add-on.
Then modify the function to display different output.

Author floraforum
Partaker
#6 | Posted: 30 Aug 2012 19:48 
Sorry, I do not understand.
I do not know what I need to change.
I keep getting these kind of errors

"Parse error: syntax error, unexpected T_STRING, expecting '{' in /home/.sites/120/site35/web/bb_plugins.php on line 373"

My knowledge of such codes is not sufficient. (I think)
Maybe you can help me just a little more?

this is the code bb_plugins.php.
Where should i change something?

function parseUserInfo_num_posts($val){
if($GLOBALS['action']=='userinfo')return $val-$GLOBALS['row'][10];
else return $val;

}

Author Paul
Lead Developer 
#7 | Posted: 31 Aug 2012 11:55 
It's a correct code. Not sure what do you have on line 373? It appears you have lots of add-ons installed. Not sure what this error is about without seeing the code for it.

Author floraforum
Partaker
#8 | Posted: 31 Aug 2012 15:36 
function parseUserInfo_num_posts($val){
if($GLOBALS['action']=='userinfo')return $val-$GLOBALS['row'][10];
else return $val;

}
The code above in on line 373.
I have tried to put the word "posts" somewhere in the code

Author Paul
Lead Developer 
#9 | Posted: 31 Aug 2012 16:27 
What exactly is on line 373? The code contains 5 lines.
I've pasted this code in my local set-up, and it doesn't show any errors.
Make sure you have pasted this code before the closing ?> php tag.

Author floraforum
Partaker
#10 | Posted: 31 Aug 2012 18:21 
No, you misunderstand me.
The code above works fine.
But when I try to put "posts" somewhere in the code.
Then I get the errors.
I do not understand how and where I the word "posts" should put.

tom322 said I need to change the code, but I do not see how.
Sorry for the misunderstanding

tom322:
You can probably look up the function: userInfo_num_posts[$poster_id] (in your bb_plugins.php?) and then just add the word 'Posts' to it (that way it should only be displayed for registered users only).

Author Paul
Lead Developer 
#11 | Posted: 31 Aug 2012 18:55 
Ok, I'm getting it now.
You are probably about this line of code:

else return $val.' posts';

Author floraforum
Partaker
#12 | Posted: 31 Aug 2012 19:59 
That is the solution!
Thank you very much.
Now it works as I wanted

Author Paul
Lead Developer 
#13 | Posted: 31 Aug 2012 20:03 
floraforum:
That is the solution!
For me it appears, you are overpricing it :) it's called "concatenation of arguments" in PHP. Not truly kind of solution.
Good luck!

Author floraforum
Partaker
#14 | Posted: 31 Aug 2012 20:10 
Well, I am pleased with the way it works now.
Thanks all

Specific miniBB Support Forums / Specific /
 Not displaying the 'posts' word near the amount of posts for guests
 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
Proceed with the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑