Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: ディン1031 on September 04, 2008, 04:10:58 PM

Title: SSI Automatic Karma
Post by: ディン1031 on September 04, 2008, 04:10:58 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=1368)

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) (http://custom.simplemachines.org/mods/index.php?mod=1121) that this Mod work.

New Functions:

Syntax Description:

If you installed the SSI Member Color Link (http://www.simplemachines.org/community/index.php?topic=32101.0) 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 (http://www.din1031.de/donation/)

Version log:


Version 1.0.0
!*+- First release



Legend:
! Bug fix
*changes
+ New features
- Info Only
Title: Re: SSI Automatic Karma
Post by: Kimmie on September 05, 2008, 11:32:17 PM
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).
Title: Re: SSI Automatic Karma
Post by: ディン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
Title: Re: SSI Automatic Karma
Post by: Kimmie on September 07, 2008, 03:27:48 PM
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:

(http://i38.tinypic.com/2nw3alz.gif)

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);
Title: Re: SSI Automatic Karma
Post by: ディン1031 on September 08, 2008, 12:53:15 AM
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
Title: Re: SSI Automatic Karma
Post by: Kimmie on September 08, 2008, 02:52:35 AM
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?
Title: Re: SSI Automatic Karma
Post by: jdizine on October 30, 2008, 03:45:50 PM
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?
Title: Re: SSI Automatic Karma
Post by: Arantor on January 28, 2014, 01:44:46 PM
Moved to the SSI category.