Uutiset:

Wondering if this will always be free?  See why free is better.

Main Menu
Advertisement:

Parse error: parse error, unexpected

Aloittaja Parijs, elokuu 11, 2006, 07:32:21 IP

« edellinen - seuraava »

Parijs

I had to reinstall my theme overtop of itself cause of problems and i redid my mods......only now my Karma wont work properly.  I am getting

Parse error: parse error, unexpected $ in /home/siggypig/public_html/MastersOfWarcraft/Sources/Karma.php on line 863

Can anyone help me out?  I would be so greatful




<?php
/******************************************************************************
* Karma.php                                                                   *
*******************************************************************************
* SMF: Simple Machines Forum                                                  *
* Open-Source Project Inspired by Zef Hemel ([email protected])                *
* =========================================================================== *
* Software Version:           SMF 1.1 RC2                                     *
* Software by:                Simple Machines (http://www.simplemachines.org) *
* Copyright 2001-2005 by:     Lewis Media (http://www.lewismedia.com)         *
* Support, News, Updates at:  http://www.simplemachines.org                   *
*******************************************************************************
* This program is free software; you may redistribute it and/or modify it     *
* under the terms of the provided license as published by Lewis Media.        *
*                                                                             *
* This program is distributed in the hope that it is and will be useful,      *
* but WITHOUT ANY WARRANTIES; without even any implied warranty of            *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                        *
*                                                                             *
* See the "license.txt" file for details of the Simple Machines license.      *
* The latest version can always be found at http://www.simplemachines.org.    *
******************************************************************************/
if (!defined('SMF'))
die('Hacking attempt...');

/* This file contains one humble function, which applauds or smites a user.

void ModifyKarma()
- gives or takes karma from a user.
- redirects back to the referrer afterward, whether by javascript or
  the passed parameters.
- requires the karma_edit permission, and that the user isn't a guest.
- depends on the karmaMode, karmaWaitTime, and karmaTimeRestrictAdmins
  settings.
- is accessed via ?action=modifykarma.
*/

function ModKarm()
{
        global 
$modSettings$db_prefix$txt$ID_MEMBER$user_info$topic;

        
// If the mod is disabled, show an error.
        
if (empty($modSettings['karmaMode']))
                
fatal_lang_error('smf63');

                if (!empty(
$modSettings['karmasurv']))
                
ModKarm();
// If you're a guest or can't do this, blow you off...
        
is_not_guest();
        
isAllowedTo('karma_edit');

        
checkSession('get');

        
// If you don't have enough posts, tough luck.
        // !!! Should this be dropped in favor of post group permissions?  Should this apply to the member you are smiting/applauding?
        
if ($user_info['posts'] < $modSettings['karmaMinPosts'])
                
fatal_error($txt['smf60'] . $modSettings['karmaMinPosts'] . '.');

        
// And you can't modify your own, punk! (use the profile if you need to.)
        
if (empty($_REQUEST['uid']) || (int) $_REQUEST['uid'] == $ID_MEMBER)
                
fatal_lang_error('smf61'false);

        
// The user ID _must_ be a number, no matter what.
        
$_REQUEST['uid'] = (int) $_REQUEST['uid'];

        
// Applauding or smiting?
        
$dir $_REQUEST['sa'] != 'applaud' ? -1;

        
// Users can change karma to only topic starter if you check this function
        
if (!empty($modSettings['karmatopicstarter']))
        {
        
$request db_query("
                        SELECT ID_MEMBER_STARTED
                        FROM 
{$db_prefix}topics
                        WHERE ID_TOPIC = 
$_REQUEST[topic]
                        LIMIT 1"
__FILE____LINE__);
        
$row mysql_fetch_row($request);
                
mysql_free_result($request);
        if (
$_REQUEST['uid'] != $row[0] && $user_info['is_admin']!=1)
              
fatal_lang_error('karma_not_topic_starter'false);
        }

        
// Start off with no change in karma.
        
$action 0;

        (!isset(
$modSettings['karmawhatwrite'])) ? $Description='' $Description=$modSettings['karmawhatwrite'];


          
// Not an administrator... or one who is restricted as well.
        
if (!empty($modSettings['karmaTimeRestrictAdmins']) || !allowedTo('moderate_forum'))
        {
                
// Find out if this user has done this recently...
                
$request db_query("
                        SELECT action
                        FROM 
{$db_prefix}log_karma
                        WHERE ID_TARGET = 
$_REQUEST[uid]
                                AND ID_EXECUTOR = 
$ID_MEMBER
                        LIMIT 1"
__FILE____LINE__);
                if (
mysql_num_rows($request) > 0)
                        list (
$action) = mysql_fetch_row($request);
                
mysql_free_result($request);
        }

        
// They haven't, not before now, anyhow.

/*
        if (empty($action) || empty($modSettings['karmaWaitTime']))
        {
                //Prepare link
                    if (isset ($_REQUEST['topic'])) {
                         $link = ($_REQUEST['topic']).'.msg'.($_REQUEST['m']).'#'.'msg'.($_REQUEST['m']);
                         $link = AddSlashes($link);
                         }
                elseif (isset($_REQUEST['f'])) {
                         $link = 'PM';
                         }

                // Put it in the log.
                db_query("
                        INSERT INTO {$db_prefix}log_karma
                                (action, ID_TARGET, Description, link, ID_EXECUTOR, logTime)
                        VALUES ($dir, $_REQUEST[uid], '$Description', '$link', $ID_MEMBER, ". time()." )
                        ", __FILE__, __LINE__);

                // Change by one.
                updateMemberData($_REQUEST['uid'], array($dir == 1 ? 'karmaGood' : 'karmaBad' => '+'));
        }
        else
        {       $request = db_query("
                                        SELECT logTime
                                        FROM {$db_prefix}log_karma
                                        WHERE ID_TARGET=$_REQUEST[uid]
                                        AND ID_EXECUTOR=$ID_MEMBER
                                        ORDER BY logTime DESC
                                        LIMIT 1
                                        ", __FILE__, __LINE__);
                $row = mysql_fetch_assoc($request);
                mysql_free_result($request);

                $restricttime = time() - $row['logTime'];
                $timelog = (int) ($modSettings['karmaWaitTime'] * 3600);

                // If you are gonna try to repeat.... don't allow it.
                if ($restricttime < $timelog)
                        fatal_error($txt['smf62'] . ' ' . $modSettings['karmaWaitTime'] . ' ' . $txt[578] . '.', false);

                //Prepare link
                    if (isset ($_REQUEST['topic'])) {
                         $link = ($_REQUEST['topic']).'.msg'.($_REQUEST['m']).'#'.'msg'.($_REQUEST['m']);
                         $link = AddSlashes($link);
                         }
                elseif (isset($_REQUEST['f'])) {
                         $link = 'PM';
                         }

                // You decided to go back on your previous choice?
                db_query("
                        INSERT INTO {$db_prefix}log_karma
                                (action, ID_TARGET, Description, link, ID_EXECUTOR, logTime)
                        VALUES ($dir, $_REQUEST[uid], '$Description', '$link', $ID_MEMBER, ". time()." )
                        ", __FILE__, __LINE__);

                
*/
/* They haven't, not before now, anyhow.
           If the key isn't in the array it will return.
           Or if it does exist and it's length is 0 then it will return.
           If Karma Description Mod disable then easy smite or applaud */
if (!empty($modSettings['karmadescmod'])){
if (!
array_key_exists('Description',$_POST) || strlen($_POST["Description"]) == 0){return;}}


{ if ( empty(
$action) || empty($modSettings['karmaWaitTime']))
        { 
$_POST['Description'] = AddSlashes($_POST['Description']);
          if (!empty(
$modSettings['karmacensor']))
          
censorText($_POST['Description']);
      
//Prepare link
    if (isset ($_REQUEST['topic'])) {
                         
$link = ($_REQUEST['topic']).'.msg'.($_REQUEST['m']).'#'.'msg'.($_REQUEST['m']);
                         
$link AddSlashes($link);
                         }
                elseif (isset(
$_REQUEST['f'])) {
                         
$link 'PM';
                         }

// Put it in the log.
                
db_query("
                        INSERT INTO 
{$db_prefix}log_karma
                                (action, ID_TARGET, Description, link, ID_EXECUTOR, logTime)
                        VALUES (
$dir$_REQUEST[uid], '$_POST[Description]', '$link', $ID_MEMBER, "time()." )
                        "
__FILE____LINE__);
// Change by one.
updateMemberData($_REQUEST['uid'], array($dir == 'karmaGood' 'karmaBad' => '+'));
}
else
{
$request db_query("
SELECT logTime
FROM 
{$db_prefix}log_karma
WHERE ID_TARGET=
$_REQUEST[uid]
AND ID_EXECUTOR=
$ID_MEMBER
ORDER BY logTime DESC
LIMIT 1
"
__FILE____LINE__);
$row mysql_fetch_assoc($request);
mysql_free_result($request);

$restricttime time() - $row['logTime'];
$timelog = (int) ($modSettings['karmaWaitTime'] * 3600);

// If you are gonna try to repeat.... don't allow it.
if ($restricttime $timelog)
fatal_error($txt['smf62'] . ' ' $modSettings['karmaWaitTime'] . ' ' $txt[578] . '.'false);

//Prepare link
    if (isset ($_REQUEST['topic'])) {
                         
$link = ($_REQUEST['topic']).'.msg'.($_REQUEST['m']).'#'.'msg'.($_REQUEST['m']);
                         
$link AddSlashes($link);
                         }
                elseif (isset(
$_REQUEST['f'])) {
                         
$link 'PM';
                         }

// You decided to go back on your previous choice?
db_query("
INSERT INTO 
{$db_prefix}log_karma
                                (action, ID_TARGET, Description, link, ID_EXECUTOR, logTime)
                        VALUES (
$dir$_REQUEST[uid], '$_POST[Description]', '$link', $ID_MEMBER, "time()." )
                        "
__FILE____LINE__);

// It was recently changed the OTHER way... so... reverse it!
                
if ($dir == 1)
                        
updateMemberData($_REQUEST['uid'], array('karmaGood' => '+''karmaBad' => '-'));
                else
                        
updateMemberData($_REQUEST['uid'], array('karmaBad' => '+'));
        }

        
// Figure out where to go back to.... the topic?
        
if (isset($topic))
                
redirectexit('topic=' $topic '.' $_REQUEST['start'] . '#msg' $_REQUEST['m']);
        
// Hrm... maybe a personal message?
        
elseif (isset($_REQUEST['f']))
                
redirectexit('action=pm;f=' $_REQUEST['f'] . ';start=' $_REQUEST['start'] . (isset($_REQUEST['l']) ? ';l=' $_REQUEST['l'] : '') . (isset($_REQUEST['pm']) ? '#' $_REQUEST['pm'] : ''));

          else
        {
                echo 
'
<html>
        <head>
                <title>...</title>
                <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
                        history.go(-1);
                // ]'
,']></script>
        </head>
        <body>&laquo;</body>
</html>'
;

                
obExit(false);
        }
}


function 
ModKarm()
{
        global 
$modSettings$db_prefix$txt$ID_MEMBER$user_info$topic;

        
// If the mod is disabled, show an error.
        
if (empty($modSettings['karmaMode']))
                
fatal_lang_error('smf63');

        
// If you're a guest or can't do this, blow you off...
        
is_not_guest();
        
isAllowedTo('karma_edit');

        
checkSession('get');

        
// If you don't have enough posts, tough luck.
        // !!! Should this be dropped in favor of post group permissions?  Should this apply to the member you are smiting/applauding?
        
if ($user_info['posts'] < $modSettings['karmaMinPosts'])
                
fatal_error($txt['smf60'] . $modSettings['karmaMinPosts'] . '.');

        
// And you can't modify your own, punk! (use the profile if you need to.)
        
if (empty($_REQUEST['uid']) || (int) $_REQUEST['uid'] == $ID_MEMBER)
                
fatal_lang_error('smf61'false);

        
// The user ID _must_ be a number, no matter what.
        
$_REQUEST['uid'] = (int) $_REQUEST['uid'];

        
// Applauding or smiting?
        
$dir $_REQUEST['sa'] != 'applaud' ? -1;

        
// Users can change karma to only topic starter if you check this function
        
if (!empty($modSettings['karmatopicstarter']))
        {
        
$request db_query("
                        SELECT ID_MEMBER_STARTED
                        FROM 
{$db_prefix}topics
                        WHERE ID_TOPIC = 
$_REQUEST[topic]
                        LIMIT 1"
__FILE____LINE__);
        
$row mysql_fetch_row($request);
                
mysql_free_result($request);
        if (
$_REQUEST['uid'] != $row[0] && $user_info['is_admin']!=1)
              
fatal_lang_error('karma_not_topic_starter'false);
        }

        
// Start off with no change in karma.
        
$action 0;

        (!isset(
$modSettings['karmawhatwrite'])) ? $Description='' $Description=$modSettings['karmawhatwrite'];


          
// Not an administrator... or one who is restricted as well.
        
if (!empty($modSettings['karmaTimeRestrictAdmins']) || !allowedTo('moderate_forum'))
        {
                
// Find out if this user has done this recently...
                
$request db_query("
                        SELECT action
                        FROM 
{$db_prefix}log_karma
                        WHERE ID_TARGET = 
$_REQUEST[uid]
                                AND ID_EXECUTOR = 
$ID_MEMBER
                        LIMIT 1"
__FILE____LINE__);
                if (
mysql_num_rows($request) > 0)
                        list (
$action) = mysql_fetch_row($request);
                
mysql_free_result($request);
        }

        
// They haven't, not before now, anyhow.
        
if (empty($action) || empty($modSettings['karmaWaitTime']))
        {
                
//Prepare link
                    
if (isset ($_REQUEST['topic'])) {
                         
$link = ($_REQUEST['topic']).'.msg'.($_REQUEST['m']).'#'.'msg'.($_REQUEST['m']);
                         
$link AddSlashes($link);
                         }
                elseif (isset(
$_REQUEST['f'])) {
                         
$link 'PM';
                         }

                
// Put it in the log.
                
db_query("
                        INSERT INTO 
{$db_prefix}log_karma
                                (action, ID_TARGET, Description, link, ID_EXECUTOR, logTime)
                        VALUES (
$dir$_REQUEST[uid], '$Description', '$link', $ID_MEMBER, "time()." )
                        "
__FILE____LINE__);

                
// Change by one.
                
updateMemberData($_REQUEST['uid'], array($dir == 'karmaGood' 'karmaBad' => '+'));
        }
        else
        {       
$request db_query("
                                        SELECT logTime
                                        FROM 
{$db_prefix}log_karma
                                        WHERE ID_TARGET=
$_REQUEST[uid]
                                        AND ID_EXECUTOR=
$ID_MEMBER
                                        ORDER BY logTime DESC
                                        LIMIT 1
                                        "
__FILE____LINE__);
                
$row mysql_fetch_assoc($request);
                
mysql_free_result($request);

                
$restricttime time() - $row['logTime'];
                
$timelog = (int) ($modSettings['karmaWaitTime'] * 3600);

                
// If you are gonna try to repeat.... don't allow it.
                
if ($restricttime $timelog)
                        
fatal_error($txt['smf62'] . ' ' $modSettings['karmaWaitTime'] . ' ' $txt[578] . '.'false);

                
//Prepare link
                    
if (isset ($_REQUEST['topic'])) {
                         
$link = ($_REQUEST['topic']).'.msg'.($_REQUEST['m']).'#'.'msg'.($_REQUEST['m']);
                         
$link AddSlashes($link);
                         }
                elseif (isset(
$_REQUEST['f'])) {
                         
$link 'PM';
                         }

                
// You decided to go back on your previous choice?
                
db_query("
                        INSERT INTO 
{$db_prefix}log_karma
                                (action, ID_TARGET, Description, link, ID_EXECUTOR, logTime)
                        VALUES (
$dir$_REQUEST[uid], '$Description', '$link', $ID_MEMBER, "time()." )
                        "
__FILE____LINE__);

                
// It was recently changed the OTHER way... so... reverse it!
                
if ($dir == 1)
                        
updateMemberData($_REQUEST['uid'], array('karmaGood' => '+''karmaBad' => '-'));
                else
                        
updateMemberData($_REQUEST['uid'], array('karmaBad' => '+'));
        }

        
// Figure out where to go back to.... the topic?
        
if (isset($topic))
                
redirectexit('topic=' $topic '.' $_REQUEST['start'] . '#msg' $_REQUEST['m']);
        
// Hrm... maybe a personal message?
        
elseif (isset($_REQUEST['f']))
                
redirectexit('action=pm;f=' $_REQUEST['f'] . ';start=' $_REQUEST['start'] . (isset($_REQUEST['l']) ? ';l=' $_REQUEST['l'] : '') . (isset($_REQUEST['pm']) ? '#' $_REQUEST['pm'] : ''));

          else
        {
                echo 
'
<html>
        <head>
                <title>...</title>
                <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
                        history.go(-1);
                // ]'
,']></script>
        </head>
        <body>&laquo;</body>
</html>'
;

                
obExit(false);
        }
}


function 
ModKarm()
{
        global 
$modSettings$db_prefix$txt$ID_MEMBER$user_info$topic;

        
// If the mod is disabled, show an error.
        
if (empty($modSettings['karmaMode']))
                
fatal_lang_error('smf63');

        
// If you're a guest or can't do this, blow you off...
        
is_not_guest();
        
isAllowedTo('karma_edit');

        
checkSession('get');

        
// If you don't have enough posts, tough luck.
        // !!! Should this be dropped in favor of post group permissions?  Should this apply to the member you are smiting/applauding?
        
if ($user_info['posts'] < $modSettings['karmaMinPosts'])
                
fatal_error($txt['smf60'] . $modSettings['karmaMinPosts'] . '.');

        
// And you can't modify your own, punk! (use the profile if you need to.)
        
if (empty($_REQUEST['uid']) || (int) $_REQUEST['uid'] == $ID_MEMBER)
                
fatal_lang_error('smf61'false);

        
// The user ID _must_ be a number, no matter what.
        
$_REQUEST['uid'] = (int) $_REQUEST['uid'];

        
// Applauding or smiting?
        
$dir $_REQUEST['sa'] != 'applaud' ? -1;

        
// Users can change karma to only topic starter if you check this function
        
if (!empty($modSettings['karmatopicstarter']))
        {
        
$request db_query("
                        SELECT ID_MEMBER_STARTED
                        FROM 
{$db_prefix}topics
                        WHERE ID_TOPIC = 
$_REQUEST[topic]
                        LIMIT 1"
__FILE____LINE__);
        
$row mysql_fetch_row($request);
                
mysql_free_result($request);
        if (
$_REQUEST['uid'] != $row[0] && $user_info['is_admin']!=1)
              
fatal_lang_error('karma_not_topic_starter'false);
        }

        
// Start off with no change in karma.
        
$action 0;

        (!isset(
$modSettings['karmawhatwrite'])) ? $Description='' $Description=$modSettings['karmawhatwrite'];


          
// Not an administrator... or one who is restricted as well.
        
if (!empty($modSettings['karmaTimeRestrictAdmins']) || !allowedTo('moderate_forum'))
        {
                
// Find out if this user has done this recently...
                
$request db_query("
                        SELECT action
                        FROM 
{$db_prefix}log_karma
                        WHERE ID_TARGET = 
$_REQUEST[uid]
                                AND ID_EXECUTOR = 
$ID_MEMBER
                        LIMIT 1"
__FILE____LINE__);
                if (
mysql_num_rows($request) > 0)
                        list (
$action) = mysql_fetch_row($request);
                
mysql_free_result($request);
        }

        
// They haven't, not before now, anyhow.
        
if (empty($action) || empty($modSettings['karmaWaitTime']))
        {
                
//Prepare link
                    
if (isset ($_REQUEST['topic'])) {
                         
$link = ($_REQUEST['topic']).'.msg'.($_REQUEST['m']).'#'.'msg'.($_REQUEST['m']);
                         
$link AddSlashes($link);
                         }
                elseif (isset(
$_REQUEST['f'])) {
                         
$link 'PM';
                         }

                
// Put it in the log.
                
db_query("
                        INSERT INTO 
{$db_prefix}log_karma
                                (action, ID_TARGET, Description, link, ID_EXECUTOR, logTime)
                        VALUES (
$dir$_REQUEST[uid], '$Description', '$link', $ID_MEMBER, "time()." )
                        "
__FILE____LINE__);

                
// Change by one.
                
updateMemberData($_REQUEST['uid'], array($dir == 'karmaGood' 'karmaBad' => '+'));
        }
        else
        {       
$request db_query("
                                        SELECT logTime
                                        FROM 
{$db_prefix}log_karma
                                        WHERE ID_TARGET=
$_REQUEST[uid]
                                        AND ID_EXECUTOR=
$ID_MEMBER
                                        ORDER BY logTime DESC
                                        LIMIT 1
                                        "
__FILE____LINE__);
                
$row mysql_fetch_assoc($request);
                
mysql_free_result($request);

                
$restricttime time() - $row['logTime'];
                
$timelog = (int) ($modSettings['karmaWaitTime'] * 3600);

                
// If you are gonna try to repeat.... don't allow it.
                
if ($restricttime $timelog)
                        
fatal_error($txt['smf62'] . ' ' $modSettings['karmaWaitTime'] . ' ' $txt[578] . '.'false);

                
//Prepare link
                    
if (isset ($_REQUEST['topic'])) {
                         
$link = ($_REQUEST['topic']).'.msg'.($_REQUEST['m']).'#'.'msg'.($_REQUEST['m']);
                         
$link AddSlashes($link);
                         }
                elseif (isset(
$_REQUEST['f'])) {
                         
$link 'PM';
                         }

                
// You decided to go back on your previous choice?
                
db_query("
                        INSERT INTO 
{$db_prefix}log_karma
                                (action, ID_TARGET, Description, link, ID_EXECUTOR, logTime)
                        VALUES (
$dir$_REQUEST[uid], '$Description', '$link', $ID_MEMBER, "time()." )
                        "
__FILE____LINE__);

                
// It was recently changed the OTHER way... so... reverse it!
                
if ($dir == 1)
                        
updateMemberData($_REQUEST['uid'], array('karmaGood' => '+''karmaBad' => '-'));
                else
                        
updateMemberData($_REQUEST['uid'], array('karmaBad' => '+'));
        }

        
// Figure out where to go back to.... the topic?
        
if (isset($topic))
                
redirectexit('topic=' $topic '.' $_REQUEST['start'] . '#msg' $_REQUEST['m']);
        
// Hrm... maybe a personal message?
        
elseif (isset($_REQUEST['f']))
                
redirectexit('action=pm;f=' $_REQUEST['f'] . ';start=' $_REQUEST['start'] . (isset($_REQUEST['l']) ? ';l=' $_REQUEST['l'] : '') . (isset($_REQUEST['pm']) ? '#' $_REQUEST['pm'] : ''));

          else
        {
                echo 
'
<html>
        <head>
                <title>...</title>
                <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
                        history.go(-1);
                // ]'
,']></script>
        </head>
        <body>&laquo;</body>
</html>'
;

                
obExit(false);
        }
}



//CW: Determine the current user's karma setting. This will be used in templates
//    to control whether the whether karma-related formatting and text should be
//    displayed.
function ShouldRenderKarma()
{
global $modSettings$context$options;

    
$mode $modSettings['karmaMode'];

if ($modSettings['karmaModeUser'] != 0) {
// User-overridable karma modes enabled, use the user's option if specified
if (!empty($options['karma_mode'])) {
// The zero value is reserved for forum default, so the mode values are
// offset by one.

$mode $options['karma_mode'] - 1;
}
}

return $mode;
}

//CW: Render the specified user's karma to a string in the format configured by
//    the board and the current user.
function RenderKarma($member)
{
global $modSettings;
// If the mod is disabled, show an error.
if (empty($modSettings['karmaMode']))
fatal_lang_error('smf63');

$mode ShouldRenderKarma();
$good $member['karma']['good'];
$bad =  $member['karma']['bad'];

// mode will be set to zero if disabled, render display for other settings
switch ($mode) {
case 1: return ($good $bad);
case 2: return '+' $good '/-' $bad;
case 3: return '+' $good '/-' $bad '=' . ($good $bad);
case 4: return ($good $bad) . ' (' . ($good $bad) . ')';
}
}

// Modify a user's karma.
function ModifyKarma()
{
global $modSettings$db_prefix$txt$ID_MEMBER$user_info$topic;

// If the mod is disabled, show an error.
if (empty($modSettings['karmaMode']))
fatal_lang_error('smf63');

        if (!empty($modSettings['karmasurv']))
                
ModKarm();
// If you're a guest or can't do this, blow you off...
is_not_guest();
isAllowedTo('karma_edit');

checkSession('get');

// If you don't have enough posts, tough luck.
// !!! Should this be dropped in favor of post group permissions?  Should this apply to the member you are smiting/applauding?
if ($user_info['posts'] < $modSettings['karmaMinPosts'])
fatal_error($txt['smf60'] . $modSettings['karmaMinPosts'] . '.');

// And you can't modify your own, punk! (use the profile if you need to.)
if (empty($_REQUEST['uid']) || (int) $_REQUEST['uid'] == $ID_MEMBER)
fatal_lang_error('smf61'false);

// The user ID _must_ be a number, no matter what.
$_REQUEST['uid'] = (int) $_REQUEST['uid'];

// Applauding or smiting?
$dir $_REQUEST['sa'] != 'applaud' ? -1;
        
// Users can change karma to only topic starter if you check this function
        
if (!empty($modSettings['karmatopicstarter']))
        {
        
$request db_query("
                        SELECT ID_MEMBER_STARTED
                        FROM 
{$db_prefix}topics
                        WHERE ID_TOPIC = 
$_REQUEST[topic]
                        LIMIT 1"
__FILE____LINE__);
        
$row mysql_fetch_row($request);
                
mysql_free_result($request);
        if (
$_REQUEST['uid'] != $row[0] && $user_info['is_admin']!=1)
              
fatal_lang_error('karma_not_topic_starter'false);
        }

// Delete any older items from the log. (karmaWaitTime is by hour.)
db_query("
DELETE FROM 
{$db_prefix}log_karma
WHERE " 
time() . " - logTime > " . (int) ($modSettings['karmaWaitTime'] * 3600), __FILE____LINE__);

// Start off with no change in karma.
$action 0;

// Not an administrator... or one who is restricted as well.
if (!empty($modSettings['karmaTimeRestrictAdmins']) || !allowedTo('moderate_forum'))
{
// Find out if this user has done this recently...
$request db_query("
SELECT action
FROM 
{$db_prefix}log_karma
WHERE ID_TARGET = 
$_REQUEST[uid]
AND ID_EXECUTOR = 
$ID_MEMBER
LIMIT 1"
__FILE____LINE__);
if (mysql_num_rows($request) > 0)
list ($action) = mysql_fetch_row($request);
mysql_free_result($request);
}

// They haven't, not before now, anyhow.

/*
if (empty($action) || empty($modSettings['karmaWaitTime']))
{
// Put it in the log.
db_query("
REPLACE INTO {$db_prefix}log_karma
(action, ID_TARGET, ID_EXECUTOR, logTime)
VALUES ($dir, $_REQUEST[uid], $ID_MEMBER, " . time() . ')', __FILE__, __LINE__);

// Change by one.
updateMemberData($_REQUEST['uid'], array($dir == 1 ? 'karmaGood' : 'karmaBad' => '+'));
}
else
{
// If you are gonna try to repeat.... don't allow it.
if ($action == $dir)
fatal_error($txt['smf62'] . ' ' . $modSettings['karmaWaitTime'] . ' ' . $txt[578] . '.', false);

// You decided to go back on your previous choice?
db_query("
UPDATE {$db_prefix}log_karma
SET action = $dir, logTime = " . time() . "
WHERE ID_TARGET = $_REQUEST[uid]
AND ID_EXECUTOR = $ID_MEMBER
LIMIT 1", __FILE__, __LINE__);


*/
/* They haven't, not before now, anyhow.
           If the key isn't in the array it will return.
           Or if it does exist and it's length is 0 then it will return.
           If Karma Description Mod disable then easy smite or applaud */
if (!empty($modSettings['karmadescmod'])){
if (!
array_key_exists('Description',$_POST) || strlen($_POST["Description"]) == 0){return;}}


{ if ( empty(
$action) || empty($modSettings['karmaWaitTime']))
        { 
$_POST['Description'] = AddSlashes($_POST['Description']);
          if (!empty(
$modSettings['karmacensor']))
          
censorText($_POST['Description']);
      
//Prepare link
    if (isset ($_REQUEST['topic'])) {
                         
$link = ($_REQUEST['topic']).'.msg'.($_REQUEST['m']).'#'.'msg'.($_REQUEST['m']);
                         
$link AddSlashes($link);
                         }
                elseif (isset(
$_REQUEST['f'])) {
                         
$link 'PM';
                         }

// Put it in the log.
                
db_query("
                        INSERT INTO 
{$db_prefix}log_karma
                                (action, ID_TARGET, Description, link, ID_EXECUTOR, logTime)
                        VALUES (
$dir$_REQUEST[uid], '$_POST[Description]', '$link', $ID_MEMBER, "time()." )
                        "
__FILE____LINE__);
// Change by one.
updateMemberData($_REQUEST['uid'], array($dir == 'karmaGood' 'karmaBad' => '+'));
}
else
{
$request db_query("
SELECT logTime
FROM 
{$db_prefix}log_karma
WHERE ID_TARGET=
$_REQUEST[uid]
AND ID_EXECUTOR=
$ID_MEMBER
ORDER BY logTime DESC
LIMIT 1
"
__FILE____LINE__);
$row mysql_fetch_assoc($request);
mysql_free_result($request);

$restricttime time() - $row['logTime'];
$timelog = (int) ($modSettings['karmaWaitTime'] * 3600);

// If you are gonna try to repeat.... don't allow it.
if ($restricttime $timelog)
fatal_error($txt['smf62'] . ' ' $modSettings['karmaWaitTime'] . ' ' $txt[578] . '.'false);

//Prepare link
    if (isset ($_REQUEST['topic'])) {
                         
$link = ($_REQUEST['topic']).'.msg'.($_REQUEST['m']).'#'.'msg'.($_REQUEST['m']);
                         
$link AddSlashes($link);
                         }
                elseif (isset(
$_REQUEST['f'])) {
                         
$link 'PM';
                         }

// You decided to go back on your previous choice?
db_query("
INSERT INTO 
{$db_prefix}log_karma
                                (action, ID_TARGET, Description, link, ID_EXECUTOR, logTime)
                        VALUES (
$dir$_REQUEST[uid], '$_POST[Description]', '$link', $ID_MEMBER, "time()." )
                        "
__FILE____LINE__);

// It was recently changed the OTHER way... so... reverse it!
if ($dir == 1)
updateMemberData($_REQUEST['uid'], array('karmaGood' => '+''karmaBad' => '-'));
else
updateMemberData($_REQUEST['uid'], array('karmaBad' => '+''karmaGood' => '-'));
}

// Figure out where to go back to.... the topic?
if (isset($topic))
redirectexit('topic=' $topic '.' $_REQUEST['start'] . '#msg' $_REQUEST['m']);
// Hrm... maybe a personal message?
elseif (isset($_REQUEST['f']))
redirectexit('action=pm;f=' $_REQUEST['f'] . ';start=' $_REQUEST['start'] . (isset($_REQUEST['l']) ? ';l=' $_REQUEST['l'] : '') . (isset($_REQUEST['pm']) ? '#' $_REQUEST['pm'] : ''));
// JavaScript as a last resort.
/*

else
{
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>...</title>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
history.go(-1);
// ]]></script>
</head>
<body>&laquo;</body>
</html>';

obExit(false);
}
}

*/
// What's this?  I dunno, what are you talking about?  Never seen this before, nope.  No siree.
function BookOfUnknown()
{
global $context;

if (strpos($_GET['action'], 'mozilla') !== false && !$context['browser']['is_gecko'])
redirectexit('http://www.getfirefox.com/');
elseif (strpos($_GET['action'], 'mozilla') !== false)
redirectexit('about:mozilla');

echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>The Book of Unknown, '
, @$_GET['verse'] == '2:18' '2:18' '4:16''</title>
<style type="text/css">
em
{
font-size: 1.3em;
line-height: 0;
}
</style>
</head>
<body style="background-color: #444455; color: white; font-style: italic; font-family: serif;">
<div style="margin-top: 12%; font-size: 1.1em; line-height: 1.4; text-align: center;">'
;
if (@$_GET['verse'] == '2:18')
echo '
Woe, it was that his name wasn\'t <em>known</em>, that he came in mystery, and was recognized by none.&nbsp;And it became to be in those days <em>something</em>.&nbsp; Something not yet <em id="unknown" name="[Unknown]">unknown</em> to mankind.&nbsp; And thus what was to be known the <em>secret project</em> began into its existence.&nbsp; Henceforth the opposition was only <em>weary</em> and <em>fearful</em>, for now their match was at arms against them.'
;
else
echo '

Deaks

have you tried installing a clean version of the Karma.php, overwritting the old file?

~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

Parijs


Deaks

open your ftp client and upload a new version of Karma.php overwritting  the old one
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

Advertisement: