Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Number of reactions in Prostats 1.9.6
#1
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!
Reply
#2
No one  Confused ?

I have the code of the Prostats 1.7.7; just need to no 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 ............
Reply
#3
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!
Reply
#4
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?
Reply
#5
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>'),
Reply
#6
Thanks a lot Wildcard, that was indeed the problem! Everything is OK now Smile
Reply
#7
Cool
Reply
#8
@wageral

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

[Image: i27g2o.png]

@wildcard

thanks
MyBB Themes Team - Making more professional themes by the hour. (Retired)
My Mods | Offer me a coffee!
Reply
#9
(03-06-2019, 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
Reply
#10
(03-06-2019, 11:06 PM)canadacommunity Wrote:
(03-06-2019, 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.
MyBB Themes Team - Making more professional themes by the hour. (Retired)
My Mods | Offer me a coffee!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)