MyBB Community Forums

Full Version: Number of reactions in Prostats 1.9.6
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
In 1.6.15 I used the Prostats-plugin 1.7.7.

I've got a script to mention the number of reactions behind every thread:


[Image: 9fpamh.jpg]

I did that with the script I received from this community (see link: http://community.mybb.com/showthread.php...e=threaded )

But now I want to do this also in MyBB 1.8 / Prostats 1.9.6

Unfortionally I can't find the place to insert this code, even I don't know If I can use this code in 1.9.6.

Is there anyone with knowledge who can give me the correct code and tell me where to insert it?

Again, tanks al ot in advance!
No one  Confused ?

I have the code of the Prostats 1.7.7; just need to know where to insert it in MyBB 1.9.6.......

Quote:To do that, you'll need to find this line...



PHP Code:
$newestposts_cols .= "<td>".$readstate_icon."<a href=\"".$threadlink."\" title=\"".$subject_long."\">".$subject."</a></td>"; 

and replace it with this one:


PHP Code:
$newestposts_cols .= "<td>".$readstate_icon."<a href=\"".$threadlink."\" title=\"".$subject_long."\">".$subject." (".$newest_threads['replies'].")</a></td>"; 

Hope dat somebody with knowledge can help me ............
If you're using ProStats 1.9.6, replace the line 1005 with this code:


		'template' => $db->escape_string('<td>{$readstate_icon}<a href="{$threadlink}" title="{$subject_long}">{$subject} ({$newest_threads[replies]})</a></td>'),

Then you will need to deactivate and activate the plugin once, so the templates will get updated!
This modification worked fine until I upgraded to PHP7.2. The following error appears:

[Image: prostats7-2.jpg]

Note: I use the last edition of that plugin. (    https://github.com/vintagedaddyo/MyBB_Plugin-Prostats    ) Everyting worked fine, also in PHP 7.2. But as soon I replace line 1005 as SaeedGh wrote, this error appears.

With PHP 5.6 there whas no problem after replacing this line.
Any solutions?
You just need to enclose the array index reference (replies) with quotes:

'template' => $db->escape_string('<td>{$readstate_icon}<a href="{$threadlink}" title="{$subject_long}">{$subject} ({$newest_threads[\'replies\']})</a></td>'),
Thanks a lot Wildcard, that was indeed the problem! Everything is OK now Smile
Cool
@wageral

Your requested modification added: https://github.com/vintagedaddyo/MyBB_Pl...74e35b9bc1

[Image: i27g2o.png]

@wildcard

thanks
(2019-03-06, 09:02 PM)vintagedaddyo Wrote: [ -> ]@wageral

Your requested modification added: https://github.com/vintagedaddyo/MyBB_Pl...74e35b9bc1

[Image: i27g2o.png]

@wildcard

thanks

Thanks alot for the prostats fix, it works perfectly now with php 7.2  Big Grin
(2019-03-06, 11:06 PM)canadacommunity Wrote: [ -> ]
(2019-03-06, 09:02 PM)vintagedaddyo Wrote: [ -> ]@wageral

Your requested modification added: https://github.com/vintagedaddyo/MyBB_Pl...74e35b9bc1

[Image: i27g2o.png]

@wildcard

thanks

Thanks alot for the prostats fix, it works perfectly now with php 7.2  Big Grin

@canadacommunity

No worries, glad it may help some folks. Perhaps if and or when I have the free time to do so I shall look into maybe adding full localization support thus removing all hardcoded text.
Pages: 1 2 3 4