MyBB Community Forums

Full Version: Reputation levels
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
(2014-12-13, 12:10 PM)Supryk Wrote: [ -> ]
(2014-12-13, 11:18 AM)Rakes Wrote: [ -> ]Just a thing/suggestion, you might want to look into caching the reputation thus not having to load it more than once (Cuz it will somewhat kill bigger boards), both variable wise and using the cache function.

Also, if you don't want to do that I would suggest adding an index to the reputation on the install.

sorry I don'y understand what you mean

http://dev.mysql.com/doc/refman/5.5/en/o...dexes.html
https://www.youtube.com/watch?v=q7I-MnUEUjI

https://github.com/mybb/mybb/blob/featur...acache.php

Basically, insert everytime you edit the rep levels.
global $cache;

$cache->update('rep_levels', ['all the levels, and stuff']);

And fetch,
global $cache;

$levels = $cache->read('rep_levels');

Then use array_filter to do the finding less than part, like

$level = array_slice(array_filter($levels, function($rep, $key) use ($post) {
      return $rep['reputation'] <= $post['reputation'];
}, ARRAY_FILTER_USE_BOTH), 0, 1);
hmmm maybe my method is not very good but is simple and is is work, 1 query for each post on showthread
I must lern more about index

very thanks for interesting my project Smile
Version 1.4
Big optimization
In the previous version of the plugin do one query for each post
for eg
if showthread have 20 post that plugin run 20 query
now plugin run only one query on each showthread
Hi, thanks for the plugin, i want to say that plugin version 1.4 doesn't work to me in mybb 1.8.4 and in the 1.3 version doesn't can see the style.
I don't know if a general problem or just happen to me.
Sorry for my bad english.
(2015-04-01, 03:34 AM)lanzezager Wrote: [ -> ]Hi, thanks for the plugin, i want to say that plugin version 1.4 doesn't work to me in mybb 1.8.4 and in the 1.3 version doesn't can see the style.
I don't know if a general problem or just happen to me.
Sorry for my bad english.

plugin is installed in acp?
show me forum url
and member_profile template
(2015-04-01, 12:04 PM)Supryk Wrote: [ -> ]plugin is installed in acp?
show me forum url
and member_profile template

Yes, is intalled in acp.

This is a url of my forum:
http://foro.animelz.com/

I use the Alpha Gamming theme and this is my member profile template:
<html>
<head>
<title>{$mybb->settings['bbname']} - {$lang->profile}</title>
{$headerinclude}
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/report.js?ver=1800"></script>
</head>
<body>
{$header}
<fieldset>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="75%">
<span class="largetext"><strong>{$formattedname}</strong></span><br />
<span class="smalltext">
({$usertitle})<br />
{$groupimage}
{$userstars}<br />
<br />
<strong>{$lang->registration_date}</strong> {$memregdate}<br />
<strong>{$lang->date_of_birth}</strong> {$membday} {$membdayage}<br />
<strong>{$lang->local_time}</strong> {$localtime}<br />
<strong>{$lang->postbit_status}</strong> {$online_status}
</span>
</td>
<td width="25%" align="right" valign="middle">{$avatar}{$memprofile['reputationlevel']}</td>
</tr>
</table>
</fieldset>
<br />
{$awaybit}{$bannedbit}
<table width="100%" cellspacing="0" cellpadding="0" border="0" align="center">
<tr>
<td width="50%" valign="top">
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td colspan="2" class="thead"><strong>{$lang->users_forum_info}</strong></td>
</tr>
<tr>
<td class="trow1" style="width: 30%;"><strong>{$lang->joined}</strong></td>
<td class="trow1">{$memregdate}</td>
</tr>
<tr>
<td class="trow2"><strong>{$lang->lastvisit}</strong></td>
<td class="trow2">{$memlastvisitdate}</td>
</tr>
<tr>
<td class="trow1"><strong>{$lang->total_posts}</strong></td>
<td class="trow1">{$memprofile['postnum']} ({$lang->ppd_percent_total})<br /><span class="smalltext">(<a href="search.php?action=finduser&amp;uid={$uid}">{$lang->find_posts}</a>)</span></td>
</tr>
<tr>
<td class="trow2"><strong>{$lang->total_threads}</strong></td>
<td class="trow2">{$memprofile['threadnum']} ({$lang->tpd_percent_total})<br /><span class="smalltext">(<a href="search.php?action=finduserthreads&amp;uid={$uid}">{$lang->find_threads}</a>)</span></td>
</tr>
<tr>
<td class="trow1"><strong>{$lang->timeonline}</strong></td>
<td class="trow1">{$timeonline}</td>
</tr>
{$referrals}
{$reputation}
{$warning_level}
</table>
{$contact_details}
</td>
<td>&nbsp;&nbsp;</td>
<td width="50%" valign="top">
{$profilefields}
{$signature}
{$modoptions}
{$adminoptions}
<div style="text-align: center">{$buddy_options}{$ignore_options}{$report_options}</div>
</td>
</tr>
</table>
{$footer}
</body>
</html>

Thanks for the help Blush
plugin work but dont know why miss css
maybe you update mybb and dont reinstall the plugin
try to reinstall it
Already reinstall it like 3 times and style dont work u_u, i'll check the code and i'll see what i can do
(2015-04-01, 08:56 PM)lanzezager Wrote: [ -> ]Already reinstall it like 3 times and style dont work u_u, i'll check the code and i'll see what i can do
now latesst version on mod site is 1.5
install it
if still style don't will be added, add it manual

.reputationlevels_postbit {

    background: url(images/reputationlevels/highlight_faint.png) repeat-x;
    background-position: 0 0;
    font-weight: bold;
    padding: 3px 8px;
    display: inline-block;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px;
    border-style: solid;
    border-width: 1px;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6);
    color: #fff;
    -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset;
    -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset;
    clear: both;
    text-align: center;
    font-size:1.1em;
    padding: 2px 10px !important;
}

.postbit_negative {
    background-color: #D91313;
    border-color: #8C1313;
}

.postbit_neutral {
    background-color: #C0C0C0;
    border-color: #A79D9D;
}

.postbit_positive {
    background-color: #95D913;
    border-color: #638C13;
}

.reputationlevels_member_profile {
    background: url(images/reputationlevels/highlight_faint.png) repeat-x;
    background-position: 0 0;
    font-weight: bold;
    padding: 3px 8px;
    display: inline-block;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px;
    border-style: solid;
    border-width: 1px;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6);
    color: #fff;
    -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset;
    -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset;
    clear: both;
    text-align: center;
    font-size:1.1em;
    padding: 2px 10px !important;
}

.member_profile_negative {
    background-color: #D91313;
    border-color: #8C1313;
}

.member_profile_neutral {
    background-color: #C0C0C0;
    border-color: #A79D9D;
}

.member_profile_positive {
    background-color: #95D913;
    border-color: #638C13;
}
Version 1.6
  • Added reputation levels to
    • preview post
    • announcement
    • private message
  • fix template list (less db query) in member profile and add new locations, change method to do this
  • fix for admin permissions
Pages: 1 2 3 4