miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Specific miniBB Support Forums / Specific /   

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

Author floraforum
Registered
#1 | Posted: 29 Aug 2012 19:45 | Edited by: floraforum 
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="{$main_url}/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="{$main_url}/img/p.gif" style="width:1px;height:23px;" alt="" /> </td></tr>
</table>


Is there a another way to do this?


Thanks already

Author tom322
Registered
#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 | Edited by: Paul 
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
Registered
#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 | Edited by: Paul 
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
Registered
#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
Registered
#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 | Edited by: Paul 
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
Registered
#10 | Posted: 31 Aug 2012 18:21 | Edited by: floraforum 
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
Registered
#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 | Edited by: Paul 
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
Registered
#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 Top

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

 Short link for this topic:

 ?
Only registered users are allowed to post here. Please, enter your username/password details upon posting a message, or register first.


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