
05-16-2006, 12:35 PM
|
 |
|
|
Join Date: Jun 2004
Location: Seattle
Posts: 1,719
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
Quote:
Originally Posted by aussiev8
nah it didn't work either.
and version 3.5
below is a snippet of code, its going to be an encyclopedia that i'm going to share here. It was working on 3.0 and i'm rewriting it for 3.5 (now i have some spare time) and all the other scripts in my vb dir have $DB_site.
PHP Code:
// #################### DEFINE IMPORTANT CONSTANTS ####################### define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'encyclopedia');
// ################### PRE-CACHE TEMPLATES AND DATA ###################### // get special phrase groups $phrasegroups = array( 'user', 'cpglobal' );
// get special data templates from the datastore $specialtemplates = array();
// pre-cache templates used by all actions $globaltemplates = array( 'ENCYCLOPEDIA', );
// pre-cache templates used by specific actions $actiontemplates = array();
// ######################### REQUIRE BACK-END ############################ require_once('./global.php'); require_once('./includes/functions_bbcodeparse.php'); require_once('./includes/functions_user.php'); require_once('./includes/adminfunctions.php');
// ####################################################################### // ######################## START MAIN SCRIPT ############################ // #######################################################################
if (empty($_REQUEST['do'])) { $_REQUEST['do'] = 'list'; } global $vbulletin; $r = $vbulletin->db->query_write( "select * from encyclopedia");
$alpha = array ("A","B","C","D","E","F","G","H","I","J","K","L","M", "N","O","P","Q","R","S","T","U","V","W","X","Y","Z"); $num = count($alpha); for($x = 0; $x < $num; $x++) { $ltr = $alpha[$x]; $sql = $vbulletin->$db->query("SELECT COUNT( * ) AS texts FROM encyclopedia_text WHERE title LIKE '$ltr%'"); $numrows = $vbulletin->$db->fetch_Array($sql);
|
Also, you don't want the second $:
wrong: $vbulletin->$db
right: $vbulletin->db
|