Beispiel #1
0
    if (!empty($jTipsCurrentUser->doubleup) and $jTipsCurrentUser->doubleup == $jRound->id and !jTipsGetParam($_REQUEST, 'doubleup', false)) {
        $jTipsCurrentUser->doubleup = null;
        $jTipsCurrentUser->save();
    }
}
$comment = trim(strip_tags(stripslashes(jTipsGetParam($_REQUEST, 'comment', ''))));
$comment = cleanComment(str_replace('\\', '', $comment));
if ($jTips['EnableComments'] == 1 && !empty($comment)) {
    jTipsLogger::_log('saving comment');
    $jComment = new jComment($database);
    $jCommentParams = array('user_id' => $jTipsCurrentUser->id, 'round_id' => $jRound->id);
    $jComment->loadByParams($jCommentParams);
    $jComment->user_id = $jTipsCurrentUser->id;
    $jComment->round_id = $jRound->id;
    $jComment->comment = $comment;
    $jComment->save();
    jTipsLogger::_log('comment saved');
}
$emailResult = '';
if ($jTips['TipsNotifyEnable'] and $jTipsCurrentUser->getPreference('tips_notifications')) {
    if (sendTipsConfirmation($jTipsCurrentUser, $myTips)) {
        $emailResult = '. ' . $jLang['_COM_TIPS_EMAIL_SUCCESS'];
    } else {
        $emailResult = '. ' . $jLang['_COM_TIPS_EMAIL_FAILURE'];
    }
}
// BUG 312 - more JomSocial Integration
if ($jTips['JomSocialActivities'] and $jTips['JomSocialOnSaveTips']) {
    require_once $mosConfig_absolute_path . '/administrator/components/com_jtips/utils/jTipsJomSocial.php';
    jTipsJomSocial::writeOnSaveTips($jTipsCurrentUser->user_id, $isUpdate, $jSeason, $jRound);
}
Beispiel #2
0
<?php

defined('_JEXEC') or defined('_VALID_MOS') or die('Restricted Access');
/**
 * Website: www.jtips.com.au
 * @author Jeremy Roberts
 * @copyright Copyright &copy; 2009, jTips
 * @license Commercial - See website for details
 * 
 * @since 2.1 - 02/10/2008
 * @version 2.1
 * @package jTips
 * 
 * Description: Updates a comment once edited
 */
//check for hack attempt
jTipsSpoofCheck();
global $jTips, $database;
require_once 'components/com_jtips/classes/jcomment.class.php';
$jComment = new jComment($database);
if ($id = jTipsGetParam($_REQUEST, 'id', false)) {
    $jComment->load($id);
}
$jComment->bind($_POST);
if ($jComment->save()) {
    $message = $jlang['_ADMIN_COMMENT_SAVE_SUCCESS'];
} else {
    $message = $jlang['_ADMIN_COMMENT_SAVE_FAILURE'] . " " . $jComment->_error;
}
mosRedirect('index2.php?option=com_jtips&task=list&module=Comments', $message);