News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

SSI Automatic Karma

Started by ディン1031, September 04, 2008, 04:10:58 PM

Previous topic - Next topic

ディン1031

Link to Mod

This Mod add to the SSI.php some new Options to show a Highest and Lowest Eliana via SSI includes.
You need to install the Automatic Karma (Eliana Mod) that this Mod work.

New Functions:

  • ssi_eliana(STRING type, INT topMembers, BOOL onlyTotal, BOOL showTotal, STRING output_method)
  • ssi_elianaHighest(INT topMembers, BOOL onlyTotal, BOOL showTotal, STRING output_method)
  • ssi_elianaLowest(INT topMembers, BOOL onlyTotal, BOOL showTotal, STRING output_method)

Syntax Description:

  • STRING type: 'good' or 'bad'
  • INT topMembers: Number of Members that should be show, standard = 5
  • BOOL onlyTotal: On true it show only total count highest or lowest.
  • BOOL showTotal: On true it show and output only the total count.
  • STRING output_method - If set to "echo", the function will echo the data, otherwise it will return an array

If you installed the SSI Member Color Link than it will attach the colors of the member group to the link.

Hope it's useful for the user who use SSI includes, Tiny Portal or Simple Portal. To see if it work look into the ssi_examples.php after the install.

If you like to donate me some Money. Click Here

Version log:


Version 1.0.0
!*+- First release



Legend:
! Bug fix
*changes
+ New features
- Info Only
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

Kimmie

#1
so in laymens terms (meaning for those of us who have no idea what you just said in your above post..hehehe), are you saying that this mod allows you to put a block on your portal page that will pull this information and display it?

The reason I ask is, I just installed it (I also have the Eliana mod installed) and I do not have any additional SSI options (see image).

ディン1031

Hmm you can look that it work if you open the ssi_examples.php.

Which portal do you use? :)

Bye
DIN1031
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

Kimmie

#3
Quote from: ディン1031 on September 06, 2008, 04:30:12 AM
Hmm you can look that it work if you open the ssi_examples.php.

Which portal do you use? :)

Bye
DIN1031

I use TinyPortal

It doesnt even show up for me on the default theme:



in the examples file I have this:

<hr />

<h3>Highest Karma Function: &lt;?php ssi_elianaHighest(); ?&gt;</h3>
<?php ssi_elianaHighest(); flush(); ?>

<hr />

<h3>Lowest Karma Function Function: &lt;?php ssi_elianaLowest(); ?&gt;</h3>
<?php ssi_elianaLowest(); flush(); ?>


The only thing in the SSI.php file that pertains to the ELiana mod is this - you can look at it to see if its correct.

//Select the correct sql for the select you made :)
if($onlyTotal)
$sql = "FLOOR(1000000+elianaGood+karmaGood-elianaBad-karmaBad)"; //It look strange... but there is small bug in SQL on negativ results...
else
$sql = "elianaGood+karmaGood";

//Load the Eliana Good Data
$results = db_query("
SELECT realName, elianaGood, elianaBad, karmaGood, karmaBad, ID_MEMBER
FROM {$db_prefix}members
ORDER BY $sql ".($type != 'good' ? 'ASC' : 'DESC')."
LIMIT $topMembers", __FILE__, __LINE__);

$return = array();
$colorids = array();

while($row = mysql_fetch_assoc($results)) {
$return[] = array(
'id' => $row['ID_MEMBER'],
'name' => $row['realName'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>',
'elianaGood' => $row['elianaGood'] + $row['karmaGood'],
'elianaBad' => $row['elianaBad'] + $row['karmaBad'],
'elianaTotal' => $row['elianaGood'] + $row['karmaGood'] - $row['elianaBad'] - $row['karmaBad'],
);
$colorids[$row['ID_MEMBER']] = $row['ID_MEMBER'];
}
mysql_free_result($results);

ディン1031

I testet it and work fine, like [SiNaN] wished for.
And yes there are three function for this mod,that what i discripe above ;).
So i don't understand the probelm... is it onyl because it's not shown in the list?

I don't know how Tiny Portal read it... i can look at it, but normal i insert it as good as possible.

Bye
DIN1031
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

Kimmie

#5
I'm not sure what you tested it on, but the image I showed you is using TinyPortal and its the selections section when making an SSI function box. There are only 2 steps to making it.

1. Select SSI Funtion from the list of blocks you want to make (1st image)
2. Select the type of block its gonna be (the list you see in the 2nd image).

thats the only place I am aware of that it will show up on TP. There is no other place you can tell it to pull that information using SSI. It looks as though the mod code is not compatible with TP. When you tested it, what did you use?

As for the funtions, there are only 2 listed in the examples file (the ones I posted above). Is there supposed to be 3?

jdizine

I get this:
Database Error

Duplicate column name 'elianaBad'
File: /home/jdizines/public_html/gfxunleashed/Packages/temp/install.php
Line: 25

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 1.1.6, while your database is at version 1.1.4. The above error might possibly go away if you execute the latest version of upgrade.php.

I don't know what this means. Can you let me know what to do?



Arantor


Advertisement: