コード例 #1
0
ファイル: onserver.php プロジェクト: jomadee/hub
<?php

switch (isset($_GET['ac']) ? $_GET['ac'] : '') {
    case 'part':
        jf_insert(PREFIXO . 'usuario_comunidade', array('usuario' => $this->user['id'], 'comunidade' => $this->cmdd['id']));
        header('location: ' . $this->home . '&sapm=comunidade&cmd=' . $this->cmdd['id']);
        break;
    case 'deixar':
        jf_delete(PREFIXO . 'usuario_comunidade', array('usuario' => $this->user['id'], 'comunidade' => $this->cmdd['id']));
        header('location: ' . $this->home . '&sapm=comunidade&cmd=' . $this->cmdd['id']);
        break;
    case 'post':
        jf_insert(PREFIXO . 'comunidade_mensagens', array('data' => time(), 'topico' => $_GET['topico'], 'user' => $this->user['id'], 'mensagem' => $_POST['mensagem']));
        header('location: ' . $this->home . '&sapm=comunidade&sapm=forum&cmd=' . $this->cmdd['id'] . '&topico=' . $_GET['topico'] . '&pag=ultima');
        break;
    case 'editar':
        if ($this->cmdd['adm']) {
            jf_update(PREFIXO . 'comunidade', array('descricao' => $_POST['descricao']), array('id' => $this->cmdd['id']));
        }
        header('location: ' . $this->home . '&sapm=comunidade&cmd=' . $this->cmdd['id']);
        break;
    case 'topico_novo':
        global $jf_ultimo_id;
        jf_insert(PREFIXO . 'comunidade_topicos', array('criador' => $this->user['id'], 'data' => time(), 'comunidade' => $_GET['cmd'], 'nome' => $_POST['titulo']));
        $topico = $jf_ultimo_id;
        jf_insert(PREFIXO . 'comunidade_mensagens', array('data' => time(), 'topico' => $topico, 'user' => $this->user['id'], 'mensagem' => $_POST['mensagem']));
        header('location: ' . $this->home . '&sapm=comunidade&sapm=forum&cmd=' . $this->cmdd['id'] . '&topico=' . $topico);
        break;
}
コード例 #2
0
ファイル: onserver.php プロジェクト: jomadee/hub
        break;
    case 'envi':
        $apigem = new api();
        $apigem->iniciaApi('sciigo');
        $inser['topico'] = $_GET[3];
        $inser['user'] = $_SESSION['sh']['id'];
        $inser['mensagem'] = $_POST['mensagem'];
        $inser['data'] = time();
        if ($erro = jf_insert(PREFIXO . 'comunidade_mensagens', $inser)) {
            echo $erro;
        }
        $query = mysql_query('select * from ' . PREFIXO . 'comunidade_mensagens where topico =  "' . $_GET[3] . '" and user != "' . $_SH['user']['id'] . '" order by id desc limit 12');
        while ($dados = mysql_fetch_assoc($query)) {
            $view[] = $dados['user'];
        }
        $not = new sciigo();
        $not->tipo = 8;
        $not->link = 'comunidade/' . $_GET[1] . '/forum/' . $_GET[3] . '/pag=ultima';
        $not->view = $view;
        $not->var_id = $_GET[1];
        $not->ekig();
        header('location: ' . $shHome . $_GET[1] . '/forum/' . $_GET[3]);
        break;
    case 'dele':
        //print_r($_GET);
        jf_delete(PREFIXO . 'comunidade_topicos', array('id' => $_GET['id']));
        header('location: ' . $shHome . $_GET[1] . '/forum');
        break;
    default:
        break;
}
コード例 #3
0
ファイル: onserverHubs.php プロジェクト: jomadee/hub
			FROM
				' . PREFIXO . 'hub a

				JOIN
					' . PREFIXO . 'comunidade_hubs b
				ON
					b.hub = a.id

			WHERE
				b.id = "' . $jf_ultimo_id . '"
		';
        echo addUni(mysql_fetch_assoc(mysql_query($sql)));
        echo '<script>$(".listCmd").append($("#ac .cmd"));</script>';
        break;
    case 'delhub':
        if ($erro = jf_delete(PREFIXO . 'comunidade_hubs', array('hub' => addslashes($_GET['cmd']), 'comunidade' => addslashes($_GET[1])))) {
            echo $erro;
        }
        break;
    case 'peshub':
        $wherePes = '';
        if (isset($_GET['pes'])) {
            $_GET['pes'] = urldecode($_GET['pes']);
            $pes = explode('+', $_GET['pes']);
            $_GET['pes'] = str_replace('+', ' ', $_GET['pes']);
            $colunas = array('nome');
            $alias = 'a';
            $wherePes .= '(';
            foreach ($pes as $chave => $valor) {
                $wherePes .= $chave == 0 ? '(' : ' and (';
                foreach ($colunas as $chave1 => $valor1) {