Main Menu
collapse

Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

User Info

Welcome Guest.
Please log in.

Who's Online

  • Dot Guests: 1125
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]


Welcome to SimplePortal.net! You can download SimplePortal from the Downloads Area!

Top Stats - Advanced Rep Issue

Started by FrizzleFried, September 05, 2012, 02:46:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

FrizzleFried

I can not use the Advanced Rep options in the Top Stats block... says I don't have Advanced Rep installed,  however I certainly do have the Advanced Rep System installed.  What does it look for to determine if it's installed and is there a way to bypass the check?


phantomm

#1
yeah, this block is outdated :|

You can find in ./Sources/PortalBlocks.php:
Code (Find) Select

'10' => array(
'name' => 'Advanced Reputation System Best',
'mod_id' => 1129,
'field' => '(mem.karmaGood - mem.karmaBad) AS karma, karmaGood, karmaBad',
'order' => 'karma',
'where' => 'mem.karmaGood > mem.karmaBad',
'output_function' => create_function('&$row', '
global $modSettings;
$descriptions = preg_split("/(\r)?\n/", $modSettings["karmaDescriptions"]);
$rep_bars = "";

$points = $row["karma"];
$bars = ($points - ($points % $modSettings["karmaBarPoints"])) / $modSettings["karmaBarPoints"];
$bars = $bars < 1 ? 1 : (($bars > $modSettings["karmaMaxBars"]) ? $modSettings["karmaMaxBars"] : $bars);
$description = $descriptions[$bars - 1];

for($i = 0; $i < $bars; $i++)
$rep_bars .= \'<img src=\"\' . $settings["images_url"] . "/karmaGood_" . ($i < ($modSettings["karmaSuperBar"] - 1) ? "basic" : "super") . \'.gif" title="\' . $row["realName"] . " " . $description . \'" alt="\' . $row["realName"] . " " . $description . \'" />\';

$row += array(
"reputation_bars" => $rep_bars,
"amount" => "+" . $row["karma"],
);
'),
'output_text' => (!empty($txt['karma_power']) ? $txt['karma_power'] : '') . ': %amount%<br />%reputation_bars%',
'enabled' => !empty($modSettings['karma_enabled']) && file_exists($settings['images_url'] . '/karmaBad_basic.gif'),
'error_msg' => $txt['sp_reputation_no_exist'],
),
'11' => array(
'name' => 'Advanced Reputation System Worst',
'mod_id' => 1129,
'field' => '(karmaBad - karmaGood) AS karma, karmaGood, karmaBad',
'order' => 'karma',
'where' => 'mem.karmaBad > mem.karmaGood',
'output_function' => create_function('&$row', '
global $modSettings;
$rep_bars = "";

$points = $row["karma"];
$bars = ($points - ($points % $modSettings["karmaBarPoints"])) / $modSettings["karmaBarPoints"];
$bars = $bars < 1 ? 1 : (($bars > $modSettings["karmaMaxBars"]) ? $modSettings["karmaMaxBars"] : $bars);
$description = $descriptions[$bars - 1];

for($i = 0; $i < $bars; $i++)
$rep_bars .= \'<img src=\"\' . $settings["images_url"] . "/karmaGood_" . ($i < ($modSettings["karmaSuperBar"] - 1) ? "basic" : "super") . \'.gif" title="\' . $row["realName"] . " " . $modSettings["karmaNegativeDescription"] . \'" alt="\' . $row["realName"] . " " . $modSettings["karmaNegativeDescription"] . \'" />\';

$row += array(
"reputation_bars" => $rep_bars,
"amount" => "-" . $row["karma"],
);
'),
'output_text' => (!empty($txt['karma_power']) ? $txt['karma_power'] : '') . ': %amount%<br />%reputation_bars%',
'enabled' => !empty($modSettings['karma_enabled']) && file_exists($settings['images_url'] . '/karmaBad_basic.gif'),
'error_msg' => $txt['sp_reputation_no_exist'],
),


Code (Replace with) Select

'10' => array(
'name' => 'Advanced Reputation System Best',
'mod_id' => 1129,
'field' => '(mem.karma_good - mem.karma_bad) AS karma, karma_good, karma_bad',
'order' => 'karma',
'where' => 'mem.karma_good > mem.karma_bad',
'output_function' => create_function('&$row', '
global $modSettings, $settings;
$descriptions = preg_split("/(\r)?\n/", $modSettings["karmaDescriptions"]);
$rep_bars = "";

$points = $row["karma"];
$bars = ($points - ($points % $modSettings["karmaBarPoints"])) / $modSettings["karmaBarPoints"];
$bars = $bars < 1 ? 1 : (($bars > $modSettings["karmaMaxBars"]) ? $modSettings["karmaMaxBars"] : $bars);
$description = $descriptions[$bars - 1];

for($i = 0; $i < $bars; $i++)
$rep_bars .= \'<img src="\' . $settings["images_url"] . "/karma_good_" . ($i < ($modSettings["karmaSuperBar"] - 1) ? "basic" : "super") . \'.gif" title="\' . $row["real_name"] . " " . $description . \'" alt="\' . $row["real_name"] . " " . $description . \'" />\';

$row += array(
"reputation_bars" => $rep_bars,
"amount" => "+" . $row["karma"],
);
'),
'output_text' => (!empty($txt['karma_power']) ? $txt['karma_power'] : '') . ': %amount%<br />%reputation_bars%',
'enabled' => file_exists($settings['default_theme_dir'] . '/Karma.template.php'),
'error_msg' => $txt['sp_reputation_no_exist'],
),
'11' => array(
'name' => 'Advanced Reputation System Worst',
'mod_id' => 1129,
'field' => '(karma_bad - karma_good) AS karma, karma_good, karma_bad',
'order' => 'karma',
'where' => 'mem.karma_bad > mem.karma_good',
'output_function' => create_function('&$row', '
global $modSettings, $settings;
$rep_bars = "";

$points = $row["karma"];
$bars = ($points - ($points % $modSettings["karmaBarPoints"])) / $modSettings["karmaBarPoints"];
$bars = $bars < 1 ? 1 : (($bars > $modSettings["karmaMaxBars"]) ? $modSettings["karmaMaxBars"] : $bars);
$description = $descriptions[$bars - 1];

for($i = 0; $i < $bars; $i++)
$rep_bars .= \'<img src="\' . $settings[\'images_url\'] . "/karma_good_" . ($i < ($modSettings["karmaSuperBar"] - 1) ? "basic" : "super") . \'.gif" title="\' . $row["real_name"] . " " . $modSettings["karmaNegativeDescription"] . \'" alt="\' . $row["real_name"] . " " . $modSettings["karmaNegativeDescription"] . \'" />\';

$row += array(
"reputation_bars" => $rep_bars,
"amount" => "-" . $row["karma"],
);
'),
'output_text' => (!empty($txt['karma_power']) ? $txt['karma_power'] : '') . ': %amount%<br />%reputation_bars%',
'enabled' => file_exists($settings['default_theme_dir'] . '/Karma.template.php'),
'error_msg' => $txt['sp_reputation_no_exist'],
),


but I wasn't able to fix images :|

somehow I fixed images too :D

//edit:
Reported => http://simpleportal.net/index.php?topic=11766.0

//edit2
added fix from reply #3 :)

FrizzleFried

Unfortunately since making this change I am getting this error:

Quote
http://www.aha-forums.com/index.php?
8: Undefined index: realName
File: /home/ahaforum/public_html/Sources/PortalBlocks.php(745) : runtime-created function
Line: 12

Any way to fix?

ccbtimewiz

Yes, change the instance to "real_name" instead as the naming convention changed from camel case in SMF 1.1 to underscores in SMF 2.0.

AngelinaBelle

Did that work?
phantomm -- can you create the fix for SMF 2.x, and post it in bug reports?
We can make it a bug/feature request on the tracker.

Thanks.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

phantomm


FrizzleFried

Quote from: AngelinaBelle on September 19, 2012, 02:11:04 AM
Did that work?
phantomm -- can you create the fix for SMF 2.x, and post it in bug reports?
We can make it a bug/feature request on the tracker.

Thanks.

Sorry... I thought I'd responded already.  Yes... that fixed the errors.

THANK YOU!

AngelinaBelle

I'm glad that fixed it.  I will mark this topic solved.

Thanks!
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?