News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

SSI Karma

Started by ディン1031, August 09, 2007, 10:24:57 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 Karma via SSI includes. Use the SMF Feature Settings for it to work correct.

New Functions:

  • ssi_karma(STRING type, INT topMembers, BOOL onlyTotal, STRING output_method)
  • ssi_karmaHighest(INT topMembers, BOOL onlyTotal, STRING output_method)
  • ssi_karmaLowest(INT topMembers, BOOL onlyTotal, 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.
  • 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 or TinyPortal. To see if it work look into the ssi_examples.php after the install.

Version log:

Version 1.0.0
!*+- First release


Version 1.0.1
! Strange bug in calculation of SQL Query fixed.


Version 1.0.2
! Fix a mistake in the coloring



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

Flying Drupalist


Amun

#2
Very kewl TY!

Just tested it on 1.14 seems to work fine. (Made a php block on tinyportal)
Except I'm wondering is there a karma log? or going to be?
:D :D :D

bassbass

What is this supposed to do exactly?  i installed it on my test forum and don't see anything different!

bassbass

Hey great, i just figured it out.  just in case people like me don't understand how this thing works.  after installation you need to log on to,

www.yourdomain.com/forum/ssi_examples.php

it will show you all kind of stats

Good mod,
Thanks

SA™

yes great mod alltho i dont understand karma lol
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

bassbass

Okay, i am almost there, i get this message, what file i need to put the code into?

To use SSI.php in your page add at the very top of your page before the <html> tag on line 1:

<?php require("/home/myhost/public_html/forum/SSI.php"); ?>

ディン1031

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

SA™

#8
well i use this





<?php
error_reporting
(E_ALL);

// Theme we're going to use
$ssi_theme 9;
// Layers we're going to use
$ssi_layers = array('main');
// Enable GZip compression (saves bandwidth)
$ssi_gzip true;

require(
'forum/SSI.php');

?>


</div>
<div
<table cellspacing="10px" cellpadding="4px" border="0px" width="100%" align="center" style="vertical-align: top;"><tr><td align="justify" valign="top">
<?PHP include 'title.html'; ?>

</table>
<?php


 
// userbox
global $context$settings$options$scripturl$txt$modSettings;

$bullet '<img src="'.$settings['images_url'].'/TPdivider.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet2 '<img src="'.$settings['images_url'].'/TPdivider2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet3 '<img src="'.$settings['images_url'].'/TPdivider3.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet4 '<img src="'.$settings['images_url'].'/tpgoto.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet5 '<img src="'.$settings['images_url'].'/tpmodule2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';


echo '

<div class="clearfix" style="width: 100%;">
<div class="windowbg" style="border: solid 1px #888; float: right; padding: 1em; margin: 2em 1em 1em 1em; width: 30%;">
                  
                 
   <h3>latest member</h3>'
;

// latest news
$id $context['common_stats']['latest_member']['id'];

loadMemberData($id);
loadMemberContext($id);
$avatar $memberContext[$id]['avatar']['image'];
if (!empty(
$avatar))
echo $avatar;
ssi_latestmember();
        echo 

<h3>User Information</h3><p class="gensmall">'
;


// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
'
$txt['hello_member'], ' <b>'$context['user']['name'], '</b>';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
echo ', '$txt[152], ' <a href="'$scripturl'?action=pm">'$context['user']['messages'], ' '$context['user']['messages'] != $txt[153] : $txt[471], '</a>'$txt['newmessages4'], ' '$context['user']['unread_messages'], ' '$context['user']['unread_messages'] == $txt['newmessages0'] : $txt['newmessages1'];
echo '.<br />';

// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
<b>'
$txt[616], '</b><br />';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '
'
$context['unapproved_members'] == $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="'$scripturl'?action=viewmembers;sa=browse;type=approve">'$context['unapproved_members'] == $txt['approve_member'] : $context['unapproved_members'] . ' ' $txt['approve_members'], '</a> '$txt['approve_members_waiting'], '<br />';

echo '
<a href="'
$scripturl'?action=unread">'$txt['unread_since_visit'], '</a><br />
<a href="'
$scripturl'?action=unreadreplies">'$txt['show_unread_replies'], '</a><br />
'
$context['current_time'];
}
// Otherwise they're a guest - so politely ask them to register or login.
else
{
echo '
'
$txt['welcome_guest'], '<br />
'
$context['current_time'], '<br />

<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/sha1.js"></script>

<form action="'
$scripturl'?action=login2" method="post" accept-charset="'$context['character_set'], '" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' $context['session_id'] . '\');"' '''>
<div style="text-align: right;">
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
<select name="cookielength">
<option value="60">'
$txt['smf53'], '</option>
<option value="1440">'
$txt['smf47'], '</option>
<option value="10080">'
$txt['smf48'], '</option>
<option value="43200">'
$txt['smf49'], '</option>
<option value="-1" selected="selected">'
$txt['smf50'], '</option>
</select>
<input type="submit" value="'
$txt[34], '" /><br />
'
$txt['smf52'], '
<input type="hidden" name="hash_passwrd" value="" />
</div>
</form>'
;

}
echo '</p><p class="gensmall">';
$what=ssi_recenttopics(7NULL,  'array');
// Output the topics
echo '
<h3>Recent Topics:</h3>
<ul style="padding: 0 1em; margin: 0;">'
;
foreach($what as $mine){
echo '
<li><span  class="gensmall"><a href="'
.$mine['href'].'">'.$mine['subject'].'</a> ';
if(!$mine['new'])
echo ' <a href="'.$mine['href'].'"><img border="0" src="'.$settings['images_url'].'/english/new.gif" alt="new" /></a> ';

echo ' on '$mine['time'] , ' by ' ,$mine['poster']['link'], '</span></li> ';
}
echo '</ul>';
echo '</p>';








echo '</div>
<div align="left" style="width: 60%;">'
;



echo '<!-- Intro -->
<table cellspacing="10px" cellpadding="4px" border="0px" width="100%" align="left" style="vertical-align: top;"><tr><td align="justify" valign="top">

<h2>Welcome to waynes world online arcade!</h2> 
<h5>Your 1st Stop for the free online arcade fun games chat and more.</h5>

<h3>about this site..</h3>

<p>welcome to waynes world online arcade This site is for arcade game playing With over 2000 games to play and a total of 46 catagorys to choose from you can play for as long as you like
</p>

<h4>what you can do here</h4>
<p>We do have a few other things that you can do here like,
chat in our chat room look at some Pictures or you can even post your own pictures in our Gallery.
If you want to you can leave a link to your site in the our Link System.
and we even have a great list of jokes for you or you can discus stuff in our forums 
and we have a variaty of downloads here for you to download
or you can create your own blog here on this site
so please enjoy yourself here and hope to see you again and again thanks for stopping by.</p>
</p>
<h4>smf tp support/discusions</h4>
we also offer some support for smf tp mods themes and smf arcade so please feel free to post your questions and we will do our best to help






<p>
<br />







<h5>Please visit these links to vote for us! Daily based votes! Vote everyday for us! Thanks</h5>

 <a href="http://tinyadminresources.com/extras/topsites/"><img
src="http://tinyadminresources.com/extras/topsites/button.php?u=wdm2005" alt="TAR
Topsites" border="0" /></a>




<a href="http://www.smftopsite.com/"><img src="http://www.smftopsite.com/button.php?u=wdm2005" alt="SMFTopSite.com" border="0" /></a>


<a href="http://toparcade.ath.cx/index.php?a=in&u=wdm2005"><img src="http://pinklady.ath.cx/topsites//button.php?u=wdm2005" alt="Top Arcade Sites" border="0" /></a>




<a href="http://www.arcadetopsitez.com/">
<img src="http://www.arcadetopsitez.com/button.php?u=wdm2005" alt="Arcade Top Sitez" border="0" />
</a>



<!-- BEGIN TOP SITE LIST PLANET VOTING CODE -->

<a href="http://arcade.top-site-list.com/vote572.html">
<IMG SRC="http://arcade.top-site-list.com/images/voteimage/arcade-1.gif" border=0></a><br><font size=1><a href="http://www.top-site-list.com/"></a></font>

<!-- END TOP SITE LIST PLANET VOTING CODE -->




<a href="http://www.best-arcade.net/"><img src="http://www.best-arcade.net/button.php?u=wdm2005" alt="The Best Arcade Sites on the Net!" border="0" /></a>




<!-- Begin TopGameSites voting code -->
<a href="http://www.topgamesites.net/general" title="Top General Gaming sites" target="_blank"> <img src="http://www.topgamesites.net/images/10.jpg" border="0" alt="Top General Gaming sites" /></a>
<noscript><a href="http://www.topgamesites.net">Private Servers</a></noscript>
<!-- End TopGameSites voting code -->


<!-- Arcade Top Sites -->
<a href="http://www.arcadetopsites.com/index.php?do=votes&id=1263"><img border="0" src="http://www.arcadetopsites.com/button.gif" alt="Arcade Top Sites" /></a>
<!-- /Arcade Top Sites -->


<a href="http://www.arcadetopsite.com/"><img src="http://www.arcadetopsite.com/button.php?u=wdm2005" alt="Arcade Top Site" border="0" /></a>


<a href="http://www.toparcadesite.com/"><img src="http://www.toparcadesite.com/button.php?u=wdm2005" alt="Top Arcade Sites" border="0" /></a>




    
             
          
           



</td></tr></table><br /><br />'
;

echo 
'

</div></div>
<br /><br />'
;



 echo 
'
 </div>
<div cellpadding="0" cellspacing="0" border="0" align="center" >'
;
 echo 
'<a href="http://waynesworld.kicks-ass.net/forum/index.php?action=who"><b><h3>users online</h3></b></a></a>';
ssi_logOnline();  

?>

<center><!-- SiteSearch Google -->
<form method="get" action="http://www.google.com/custom" target="_top">
<table border="0" bgcolor="#">
<tr><td nowrap="nowrap" valign="top" align="left" height="32">
<a href="http://www.google.com/">
<img src="http://www.google.com/logos/Logo_25gry.gif" border="0" alt="Google" align="middle"></img></a>
<br/>
<label for="sbi" style="display: none">Enter your search terms</label>
<input type="text" name="q" size="31" maxlength="255" value="" id="sbi"></input>
<label for="sbb" style="display: none">Submit search form</label>
<input type="submit" name="sa" value="Search" id="sbb"></input>
</td></tr>
<tr>
<td nowrap="nowrap">
<table>
<tr>
<td>
<input type="radio" name="sitesearch" value="" checked id="ss0"></input>
<label for="ss0" title="Search the Web"><font size="-1" color="#ffffff">Web</font></label></td>
<td>
<input type="radio" name="sitesearch" value="waynesworld.kicks-ass.net" id="ss1"></input>
<label for="ss1" title="Search http://waynesworld.kicks-ass.net/"><font size="-1" color="#ffffff">waynesworld.kicks-ass.net</font></label></td>
</tr>
</table>
</form>
<!-- SiteSearch Google -->


<?php

ssi_shutdown
();
?>

<script type="text/javascript">

/******************************************
* Snow Effect Script- By Altan d.o.o. (http://www.altan.hr/snow/index.html)
* Visit Dynamic Drive DHTML code library (http://www.dynamicdrive.com/) for full source code
* Last updated Nov 9th, 05' by DD. This notice must stay intact for use
******************************************/
 
 
  // Configure below to change number of snow to render
  var no = 15;
  // Configure whether snow should disappear after x seconds (0=never):
  var hidesnowtime = 0;
  // Configure how much snow should drop down before fading ("windowheight" or "pageheight")
  var snowdistance = "pageheight";

///////////Stop Config//////////////////////////////////

  var ie4up = (document.all) ? 1 : 0;
  var ns6up = (document.getElementById&&!document.all) ? 1 : 0;

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

  var dx, xp, yp;    // coordinate and position variables
  var am, stx, sty;  // amplitude and step variables
  var i, doc_width = 800, doc_height = 600;
 
  if (ns6up) {
    doc_width = self.innerWidth;
    doc_height = self.innerHeight;
  } else if (ie4up) {
    doc_width = iecompattest().clientWidth;
    doc_height = iecompattest().clientHeight;
  }

  dx = new Array();
  xp = new Array();
  yp = new Array();
  am = new Array();
  stx = new Array();
  sty = new Array();
  snowsrc=(snowsrc.indexOf("dynamicdrive.com")!=-1)? "snow.gif" : snowsrc
  for (i = 0; i < no; ++ i) { 
    dx[i] = 0;                        // set coordinate variables
    xp[i] = Math.random()*(doc_width-50);  // set position variables
    yp[i] = Math.random()*doc_height;
    am[i] = Math.random()*20;         // set amplitude variables
    stx[i] = 0.02 + Math.random()/10; // set step variables
    sty[i] = 0.7 + Math.random();     // set step variables
if (ie4up||ns6up) {
      if (i == 0) {
        document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><a href=\"http://dynamicdrive.com\"><img src='"+snowsrc+"' border=\"0\"><\/a><\/div>");
      } else {
        document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><img src='"+snowsrc+"' border=\"0\"><\/div>");
      }
    }
  }

  function snowIE_NS6() {  // IE and NS6 main animation function
    doc_width = ns6up?window.innerWidth-10 : iecompattest().clientWidth-10;
doc_height=(window.innerHeight && snowdistance=="windowheight")? window.innerHeight : (ie4up && snowdistance=="windowheight")?  iecompattest().clientHeight : (ie4up && !window.opera && snowdistance=="pageheight")? iecompattest().scrollHeight : iecompattest().offsetHeight;
    for (i = 0; i < no; ++ i) {  // iterate for every dot
      yp[i] += sty[i];
      if (yp[i] > doc_height-50) {
        xp[i] = Math.random()*(doc_width-am[i]-30);
        yp[i] = 0;
        stx[i] = 0.02 + Math.random()/10;
        sty[i] = 0.7 + Math.random();
      }
      dx[i] += stx[i];
      document.getElementById("dot"+i).style.top=yp[i]+"px";
      document.getElementById("dot"+i).style.left=xp[i] + am[i]*Math.sin(dx[i])+"px"; 
    }
    snowtimer=setTimeout("snowIE_NS6()", 10);
  }

function hidesnow(){
if (window.snowtimer) clearTimeout(snowtimer)
for (i=0; i<no; i++) document.getElementById("dot"+i).style.visibility="hidden"
}


if (ie4up||ns6up){
    snowIE_NS6();
if (hidesnowtime>0)
setTimeout("hidesnow()", hidesnowtime*1000)
}

</script>



<script type="text/javascript" src="seasons/snow.js">/***********************************************
* Snow Effect without images-by Kurt Grigg at http://www.btinternet.com/~kurt.grigg/javascript
* Script featured & available at Dynamic Drive at http://www.dynamicdrive.com/
* Please keep this notice intact
***********************************************/

</script>


<table width="100% border="0" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
<tr>

</td>
</tr>
</table>
<br>


for my front page
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

ディン1031

oO put somewhere in it
ssi_karmaHighest(); or ssi_karmaLowest();

If you need a array use $karma ssi_karmaHighest(10true'array');

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

SA™

Quote from: ディン1031 on November 09, 2007, 01:27:07 AM
oO put somewhere in it
ssi_karmaHighest(); or ssi_karmaLowest();

If you need a array use $karma ssi_karmaHighest(10true'array');

Bye


DIN1031


same as
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

ディン1031

??? same as what? XD

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

SA™

http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

bassbass

Sorry guys, i still don't know what file i need to put this code in,

<?php require("/home/myhost/public_html/forum/SSI.php"); ?>

ディン1031, thank you for the links but man they are way too much info and too confusing for me.

ディン1031

#14
Oh i see XD somhow i was to tiered to see it xD.

You must create a new file for exampe somefile.php and in this file you must put in the code :X, this stand all in the basic faq of ssi...

http://www.simplemachines.org/community/index.php?topic=12936.0 <- Look here this is the simplest way how to use ssi xD.

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

dream1

Can someone explain how to use this ie: I want to show the karma highest in a block?

Dragooon

First call SSI.php and use one of the 3 functions this mod adds.

dream1

I'm getting this error...

Parse error: syntax error, unexpected '<' in /home/XXXXX/public_html/chat/Sources/Load.php
(1737) : eval()'d code
(35) : eval()'d code
on line 1

I'm using a phpbox and my code is...

<?php 
require("/home/XXXXX/public_html/chat/SSI.php"); 

ssi_karmaHighest();
?>



I also tried...

<?php 
require("/home/XXXXX/public_html/chat/SSI.php"); 

ssi_menubar();
?>


What am I doing wrong?



Dragooon

Don't use <?php and ?> tags.

dream1

#19
I finally got this sorted after much trial and error. I'm using a phpbox and here's my code...

ssi_karmaHighest();

The following line
require("/home/XXXXX/public_html/chat/SSI.php"); is not needed (I am guesing it is already called by SMF somewhere in the source of the page)

Thank for your help Dragooon  :)

P.S. To those asking about a Karma Log, http://custom.simplemachines.org/mods/index.php?mod=192 will install on SMF 1.1.4 and is working fine on my site

Advertisement: