No, the cause of the error is that your code is for 3.0.x, not 3.5.0.
Here's your code changed for 3.5.0:
PHP Code:
<?php
require_once("./global.php");
if (!is_member_of($vbulletin->userinfo, 6))
{
print_no_permission();
}
// #############################################################################
// function to allow modifications to add a phrasetype easily
function add_phrase_type($phrasegroup_name, $phrasegroup_title)
{
global $db;
// first lets check if it exists
if ($check = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "phrasetype WHERE fieldname = '$phrasegroup_name'"))
{
return false;
}
else
{ // check max id
$max_rows = $db->query_first("SELECT MAX(phrasetypeid) + 1 AS max FROM " . TABLE_PREFIX . "phrasetype WHERE phrasetypeid < 1000");
$phrasetypeid = $max_rows['max'];
if ($phrasetypeid)
{
$db->query_write("INSERT INTO " . TABLE_PREFIX . "phrasetype (phrasetypeid, fieldname, title, editrows) VALUES ($phrasetypeid, '" . $db->escape_string($phrasegroup_name) . "', '" . $db->escape_string($phrasegroup_title) . "', 3)");
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "language ADD phrasegroup_" . addslashes($phrasegroup_name) . " MEDIUMTEXT NOT NULL");
return $phrasetypeid;
}
}
return false;
}
if ($_REQUEST['name'] AND $_REQUEST['title'])
{
add_phrase_type($_REQUEST['name'], $_REQUEST['title']);
}
?>