Пример #1
0
            $result = mysql_query($iSQL) or die('');
            $hdid = mysql_insert_id();
            yjl_addlog('[uid]创建活动:<a href="active-' . $hxqid . '-' . $hdid . '.html">' . $name . '</a>', md5('cjhd|' . $user_id . '|' . $user_id . '|' . $hdid));
            if ($hxqid > 0) {
                $uSQL = sprintf('update %s set c_hd=c_hd+1 where xqid=%s', $yjl_dbprefix . 'xq', $hxqid);
                $result = mysql_query($uSQL) or die('');
            }
            $iSQL = sprintf('insert into %s (uid, hdid, datetime) values (%s, %s, %s)', $yjl_dbprefix . 'hd_user', $user_id, $hdid, time());
            $result = mysql_query($iSQL) or die('');
            $app_a = yjl_app('活动 ' . $name, $hdid, $yjl_url . 'active-' . $hxqid . '-' . $hdid . '.html', 'hd');
            $uSQL = sprintf('update %s set app_id=%s where hdid=%s', $yjl_dbprefix . 'hd', $app_a[0], $hdid);
            $result = mysql_query($uSQL) or die('');
            require_once 'lib/jishigouapi.class.php';
            $JishiGouAPI = new JishiGouAPI($yjl_url . $yjl_tpath . 'api.php', $app_a[1], $app_a[2], $udb['nickname'], md5($udb['nickname'] . $udb['password']));
            $content = '添加活动:' . $_POST['name'] . ' ' . $yjl_url . 'active-' . $hxqid . '-' . $hdid . '.html';
            $jsg_result = $JishiGouAPI->AddTopic($content);
            if (!isset($jsg_result['error']) && isset($jsg_result['result']['tid'])) {
                $tid = $jsg_result['result']['tid'];
                $uSQL = sprintf('update %s set tid=%s, uname=%s where hdid=%s', $yjl_dbprefix . 'hd', $tid, yjl_SQLString($udb['username'], 'text'), $hdid);
                $result = mysql_query($uSQL) or die('');
                yjl_uwb($user_id, $content . ' ' . $yjl_url . 'active-' . $hxqid . '-' . $hdid . '.html', $tid);
            }
            echo '<script type="text/javascript">location.href=\'' . $f . '?xqid=' . $hxqid . '&id=' . $hdid . '\';</script>';
        } else {
            echo '<script type="text/javascript">location.href=\'' . $f . '?xqid=' . $xqid . '\';</script>';
        }
        exit;
    }
    $is_mce = 1;
    $js_c .= '
	$(\'#form_text\').tinymce({