Snippets for phpBB3
dmzx
Founder
Status:
Offline
User theme: Dark
Posts: 6222 Joined: Jan 13th, '14, 20:45
Post by dmzx » Apr 8th, '14, 18:06
Post
by dmzx » Apr 8th, '14, 18:06
Mchat top poster
this will show a users Mchat post count (Not forum post count)
Open mchat.php
Find This may be a partial find and not the whole line
Add after Add these lines on a new blank line after the preceding line(s) to find Code: Select all
$sql = 'SELECT m.user_id, COUNT(m.message_id) AS post_count, u.username, u.user_colour
FROM ' . MCHAT_TABLE . ' m
LEFT JOIN ' . USERS_TABLE . ' u ON (m.user_id = u.user_id)
GROUP BY u.user_id ORDER BY post_count DESC';
$result = $db->sql_query_limit($sql, 10);
while ($row = $db->sql_fetchrow($result))
{
$template->assign_block_vars('mchaters', array(
'USER_NAME' => get_username_string('no_profile', $row['user_id'], $row['username'], $row['user_colour']) . ' (' . $row['post_count'] . ')',
));
}
$db->sql_freeresult($result);
Open language/en/mods/mchat_lang.php
Find This may be a partial find and not the whole line
Add after Add these lines on a new blank line after the preceding line(s) to find Code: Select all
'MCHAT_TOP_POSTERS' => 'Top Posters',
Open styles/your style/template/mchat_body.html
Find This may be a partial find and not the whole line Code: Select all
<div style="text-align:center;">{L_MCHAT_COPYRIGHT}</div>
Add after Add these lines on a new blank line after the preceding line(s) to find Code: Select all
<!-- IF .mchaters --><p><strong>{L_MCHAT_TOP_POSTERS}</strong><br/>
<!-- BEGIN mchaters -->{mchaters.USER_NAME} <!-- IF not mchaters.S_LAST_ROW -->,<!-- ENDIF --><!-- END mchaters --></p><!-- ENDIF -->
Napster
Users
Status:
Offline
User theme: Dark
Posts: 25 Joined: Sep 15th, '15, 13:35
Post by Napster » Dec 20th, '15, 17:54
Post
by Napster » Dec 20th, '15, 17:54
Hi, would love this but these edits are different on the new mchat extension is it possible to show me where new edits go please.
Sniper_E
VIP
Status:
Offline
User theme: Dark
Posts: 1124 Joined: Oct 14th, '14, 17:01
Post by Sniper_E » Dec 20th, '15, 19:54
Post
by Sniper_E » Dec 20th, '15, 19:54
The edits in the extension are close to the same.
Instead of editing the mchat.php you will edit the core/render_helper.php.
dmzx wrote: Open core/render_helper.php
Find This may be a partial find and not the whole line [ line 1080 ]
Code: Select all
// Run code...
if ($mchat_view)
{
Add after Add these lines on a new blank line after the preceding line(s) to find Code: Select all
$sql = 'SELECT m.user_id, COUNT(m.message_id) AS post_count, u.username, u.user_colour
FROM ' . $this->mchat_table . ' m
LEFT JOIN ' . USERS_TABLE . ' u ON (m.user_id = u.user_id)
GROUP BY u.user_id ORDER BY post_count DESC';
$result = $this->db->sql_query_limit($sql, 10);
while ($row = $this->db->sql_fetchrow($result))
{
$this->template->assign_block_vars('mchaters', array(
'USER_NAME' => get_username_string('no_profile', $row['user_id'], $row['username'], $row['user_colour']) . ' (' . $row['post_count'] . ')',
));
}
$this->db->sql_freeresult($result);
And the edit to the mchat_body.html has a different Find.
dmzx wrote: Open styles/prosilver/template/mchat_body.html
Find This may be a partial find and not the whole line [ line 1080 ]
Add after Add these lines on a new blank line after the preceding line(s) to find Code: Select all
<!-- IF .mchaters --><p><strong>{L_MCHAT_TOP_POSTERS}</strong><br/>
<!-- BEGIN mchaters -->{mchaters.USER_NAME} <!-- IF not mchaters.S_LAST_ROW -->,<!-- ENDIF --><!-- END mchaters --></p><!-- ENDIF -->
The language file edit is the same.
dmzx wrote: Open language/en/common.php
Find This may be a partial find and not the whole line [ line 1080 ]
Code: Select all
//Custom edits
'REPLY_WITH_LIKE' =>'Like This Post',
Add after Add these lines on a new blank line after the preceding line(s) to find Code: Select all
'MCHAT_TOP_POSTERS' => 'Top Posters',
Last edited by Sniper_E on Dec 20th, '15, 20:00, edited 1 time in total.
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!™
Napster
Users
Status:
Offline
User theme: Dark
Posts: 25 Joined: Sep 15th, '15, 13:35
Post by Napster » Dec 20th, '15, 20:04
Post
by Napster » Dec 20th, '15, 20:04
Thank you
alfi0815
Users
Status:
Offline
User theme: Dark
Posts: 120 Joined: Jun 6th, '15, 10:41
Post by alfi0815 » Feb 16th, '16, 18:26
Post
by alfi0815 » Feb 16th, '16, 18:26
Hello,
and for mchat 1.0.0 RC1???
dmzx
Founder
Status:
Offline
User theme: Dark
Posts: 6222 Joined: Jan 13th, '14, 20:45
Post by dmzx » Feb 16th, '16, 18:38
Post
by dmzx » Feb 16th, '16, 18:38
alfi0815 wrote: Feb 16th, '16, 18:26
Hello,
and for mchat 1.0.0 RC1???
There is in this
section
killfrenzy
Users
Status:
Offline
User theme: Dark
Posts: 118 Joined: Feb 6th, '16, 18:22
Post by killfrenzy » Feb 17th, '16, 03:44
Post
by killfrenzy » Feb 17th, '16, 03:44
Sniper_E wrote: Dec 20th, '15, 19:54
The edits in the extension are close to the same.
Instead of editing the mchat.php you will edit the core/render_helper.php.
dmzx wrote: Open core/render_helper.php
Find This may be a partial find and not the whole line [ line 1080 ]
Code: Select all
// Run code...
if ($mchat_view)
{
Add after Add these lines on a new blank line after the preceding line(s) to find Code: Select all
$sql = 'SELECT m.user_id, COUNT(m.message_id) AS post_count, u.username, u.user_colour
FROM ' . $this->mchat_table . ' m
LEFT JOIN ' . USERS_TABLE . ' u ON (m.user_id = u.user_id)
GROUP BY u.user_id ORDER BY post_count DESC';
$result = $this->db->sql_query_limit($sql, 10);
while ($row = $this->db->sql_fetchrow($result))
{
$this->template->assign_block_vars('mchaters', array(
'USER_NAME' => get_username_string('no_profile', $row['user_id'], $row['username'], $row['user_colour']) . ' (' . $row['post_count'] . ')',
));
}
$this->db->sql_freeresult($result);
And the edit to the mchat_body.html has a different Find.
dmzx wrote: Open styles/prosilver/template/mchat_body.html
Find This may be a partial find and not the whole line [ line 1080 ]
Add after Add these lines on a new blank line after the preceding line(s) to find Code: Select all
<!-- IF .mchaters --><p><strong>{L_MCHAT_TOP_POSTERS}</strong><br/>
<!-- BEGIN mchaters -->{mchaters.USER_NAME} <!-- IF not mchaters.S_LAST_ROW -->,<!-- ENDIF --><!-- END mchaters --></p><!-- ENDIF -->
The language file edit is the same.
dmzx wrote: Open language/en/common.php
Find This may be a partial find and not the whole line [ line 1080 ]
Code: Select all
//Custom edits
'REPLY_WITH_LIKE' =>'Like This Post',
Add after Add these lines on a new blank line after the preceding line(s) to find Code: Select all
'MCHAT_TOP_POSTERS' => 'Top Posters',
What version of mchat is this? I can't find render_helper.php in core folder. I'm using mchat 3.4
dmzx
Founder
Status:
Offline
User theme: Dark
Posts: 6222 Joined: Jan 13th, '14, 20:45
Post by dmzx » Feb 17th, '16, 20:05
Post
by dmzx » Feb 17th, '16, 20:05
killfrenzy wrote: Feb 17th, '16, 03:44
Instead of editing the mchat.php you will edit the core/render_helper.php.
The latest version dont use render_helper no more.
There is now an extension for this (addon) to add the Top Poster, no need to edit anything no more.
killfrenzy
Users
Status:
Offline
User theme: Dark
Posts: 118 Joined: Feb 6th, '16, 18:22
Post by killfrenzy » Feb 24th, '16, 15:26
Post
by killfrenzy » Feb 24th, '16, 15:26
dmzx wrote: Feb 17th, '16, 20:05
killfrenzy wrote: Feb 17th, '16, 03:44
Instead of editing the mchat.php you will edit the core/render_helper.php.
The latest version dont use render_helper no more.
There is now an extension for this (addon) to add the Top Poster, no need to edit anything no more.
This is for donators only latest version of mchat?
dmzx
Founder
Status:
Offline
User theme: Dark
Posts: 6222 Joined: Jan 13th, '14, 20:45
Post by dmzx » Feb 24th, '16, 19:14
Post
by dmzx » Feb 24th, '16, 19:14
There is an extension in VIP indeed.
sindyciaray
Users
Status:
Offline
User theme: Dark
Posts: 1 Joined: Sep 15th, '17, 10:46
Post by sindyciaray » Sep 15th, '17, 11:22
Post
by sindyciaray » Sep 15th, '17, 11:22
Seems like the real post here cheers I PROMISE I WONT POST BS LINKS TO FAT SITES NO MORE
edited by martin
dmzx
Founder
Status:
Offline
User theme: Dark
Posts: 6222 Joined: Jan 13th, '14, 20:45
Post by dmzx » Oct 22nd, '17, 09:29
Post
by dmzx » Oct 22nd, '17, 09:29
sindyciaray wrote: Sep 15th, '17, 11:22
Seems like the real post here cheers I PROMISE I WONT POST BS LINKS TO FAT SITES NO MORE
edited by martin
Martin