showkarma && $kunena_my->id != "" && $kunena_my->id != 0 && $do != '' && $userid != '') { $time = CKunenaTools::fbGetInternalTime(); if ($kunena_my->id != $userid) { // This checkes to see if it's not too soon for a new karma change if (!$is_Moderator) { $kunena_db->setQuery("SELECT karma_time FROM #__fb_users WHERE userid='{$kunena_my->id}'"); $karma_time_old = $kunena_db->loadResult(); $karma_time_diff = $time - $karma_time_old; } if ($is_Moderator || $karma_time_diff >= $karma_min_seconds) { if ($do == "increase") { $kunena_db->setQuery('UPDATE #__fb_users SET karma_time=' . $time . ' WHERE userid=' . $kunena_my->id . ''); $kunena_db->query() or trigger_dberror("Unable to update karma."); $kunena_db->setQuery('UPDATE #__fb_users SET karma=karma+1 WHERE userid=' . $userid . ''); $kunena_db->query() or trigger_dberror("Unable to update karma."); echo _KARMA_INCREASED . '
' . _POST_CLICK . '.'; if ($pid) { echo CKunenaLink::GetAutoRedirectHTML(JRoute::_(KUNENA_LIVEURLREL.'&func=view&catid='.$catid.'&id='.$pid), 3500); } else { echo CKunenaLink::GetAutoRedirectHTML(CKunenaLink::GetProfileURL($userid), 3500); } } else if ($do == "decrease") { $kunena_db->setQuery('UPDATE #__fb_users SET karma_time=' . $time . ' WHERE userid=' . $kunena_my->id . ''); $kunena_db->query() or trigger_dberror("Unable to update karma."); $kunena_db->setQuery('UPDATE #__fb_users SET karma=karma-1 WHERE userid=' . $userid . ''); $kunena_db->query() or trigger_dberror("Unable to update karma."); echo _KARMA_DECREASED . '
' . _POST_CLICK . '.'; if ($pid) { echo CKunenaLink::GetAutoRedirectHTML(JRoute::_(KUNENA_LIVEURLREL.'&func=view&catid='.$catid.'&id='.$pid), 3500); } else { echo CKunenaLink::GetAutoRedirectHTML(CKunenaLink::GetProfileURL($userid), 3500); } } else { //you got me there... don't know what to $do echo _USER_ERROR_A; echo _USER_ERROR_B . "

"; echo _USER_ERROR_C . "

" . _USER_ERROR_D . ": fb001-karma-02NoDO

"; } } else echo _KARMA_WAIT . '
' . _KARMA_BACK . ' ' . _POST_CLICK . '.'; } else if ($kunena_my->id == $userid) // In case the user tries modifing his own karma by changing the userid from the URL... { if ($do == "increase") // Seriously decrease his karma if he tries to increase it { $kunena_db->setQuery('UPDATE #__fb_users SET karma=karma-10, karma_time=' . $time . ' WHERE userid=' . $kunena_my->id . ''); $kunena_db->query() or trigger_dberror("Unable to update karma."); echo _KARMA_SELF_INCREASE . '
' . _KARMA_BACK . ' ' . _POST_CLICK . '.'; } if ($do == "decrease") // Stop him from decreasing his karma but still update karma_time { $kunena_db->setQuery('UPDATE #__fb_users SET karma_time=' . $time . ' WHERE userid=' . $kunena_my->id . ''); $kunena_db->query() or trigger_dberror("Unable to update karma."); echo _KARMA_SELF_DECREASE . '
' . _KARMA_BACK . ' ' . _POST_CLICK . '.'; } } } else { //get outa here, you fraud! echo _USER_ERROR_A; echo _USER_ERROR_B . "

"; echo _USER_ERROR_C . "

" . _USER_ERROR_D . ": fb001-karma-01NLO

"; //that should scare 'em off enough... ;-) } ?>