Example #1
0
function forum_install()
{
    mysql_all_query('CREATE TABLE IF NOT EXISTS `forum_categorias` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL,
  `desc` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


CREATE TABLE IF NOT EXISTS `forum_respostas` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `topic` int(11) NOT NULL,
  `owner` int(11) NOT NULL,
  `text` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


CREATE TABLE IF NOT EXISTS `forum_topics` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `cat` int(11) NOT NULL,
  `owner` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `text` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;');
    addmenu("Fórum", "forum");
}
Example #2
0
function chat_install()
{
    mysql_all_query("CREATE TABLE IF NOT EXISTS `chat` (\n  `id` int(11) NOT NULL AUTO_INCREMENT,\n  `owner` int(11) NOT NULL,\n  `room` int(11) NOT NULL,\n  `text` text NOT NULL,\n  PRIMARY KEY (`id`)\n) ENGINE=MyISAM DEFAULT CHARSET=latin1;\n\n\nCREATE TABLE IF NOT EXISTS `chat_rooms` (\n  `id` int(11) NOT NULL AUTO_INCREMENT,\n  `nome` varchar(255) NOT NULL,\n  PRIMARY KEY (`id`)\n) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
    addmenu("Chat", "chat");
}
Example #3
0
 //从wx_wechat_module_type中查找类型ID
 $sql_typeId = "select id from wx_wechat_module_type where name='{$menuTypeName}'";
 $res_typeId = $db->getrow($sql_typeId);
 $menuType = $res_typeId['id'];
 //将菜单信息保存在wx_wechat_module表中
 $seq = $secondMenuNum + 1;
 //菜单排序默认为自增一
 $sql_insert_first = "insert into wx_wechat_module (name,parentId,seq,menuType,urlPC,urlWechat) values ('{$menuName}','{$menuParentId}','{$seq}','{$menuType}','{$urlPC}','{$urlWechat}')";
 $res_insert_first = $db->execsql($sql_insert_first);
 if (mysql_affected_rows() > 0) {
     /******************菜单添加成功后,根据选项为菜单添加功能************************/
     $menuId = mysql_insert_id();
     //添加的菜单的moduleId
     //为菜单添加功能
     $secondError = true;
     $secondError = addmenu($menuName, $menuFirstType, $menusecondType, $menuId);
     if ($secondError && $error) {
         $add['id'] = $menuId;
         //添加的菜单的moduleId
         $add['error'] = 1;
         //添加成功
     } else {
         /*****************若菜单功能未添加成功,则删除菜单***********************/
         $add['error'] = 0;
         //添加失败
         $sql_del = "delete from wx_wechat_module where id='{$menuId}'";
         $res_del = $db->execsql($sql_del);
     }
 } else {
     $add['error'] = 0;
     //添加失败
Example #4
0
function search_install()
{
    addmenu("Busca", "search");
}
Example #5
0
$valid = validate_request($guid, $userid);
if (!$valid['success']) {
    error_log('Request failed: ' . $valid['message']);
    die;
}
$vegetarian = 0;
if ($query) {
    $action = $query->request->intent->name;
    if ($action == "GetVegetarian") {
        $vegetarian = 1;
    }
    # Get a suggestion for dinner
    if ($action == 'GetVegetarian' || $action == 'GetMenu') {
        $response = getmenu($db, $vegetarian);
    } elseif ($action == 'AddMenu') {
        $response = addmenu($db, $query);
    } elseif ($action == 'GetRecipe') {
        $response = getrecipe($db, $query);
    } else {
        # if ( $action == 'AMAZON.HelpIntent' ) {
        $response = $help;
    }
} else {
    $response = $help;
}
sendresponse($response, $me);
echo json_encode($response);
/*
    Get a menu recommendation

    getmenu( $db, $vegetarian );
Example #6
0
function minijogos_install()
{
    addmenu("Jogos", "minijogos");
}
Example #7
0
function comu_install()
{
    mysql_all_query("DROP TABLE IF EXISTS `comunidade`;\nCREATE TABLE `comunidade` (\n  `id` int(11) NOT NULL AUTO_INCREMENT,\n  `tipo` char(1) NOT NULL COMMENT 'm ou t',\n  `nome` varchar(255) NOT NULL,\n  `descricao` text,\n  `imagem` varchar(255) NOT NULL,\n  `link` varchar(255) NOT NULL,\n  `user` varchar(255) NOT NULL,\n  PRIMARY KEY (`id`)\n) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
    addmenu("Módulos e temas", "comu");
}