Thank you so much for your help. I "learned" PHP about 15 years ago and am trying to get better but it seems so complicated when I am trying to figure out which problems are from php and which are vbulletin related. I have been running my vbulletin site for about 8 years and it has been heavily modified by Tigga (from vbadvanced) for the last 4 years. As much as I love everything he does, occasionally though I want to do something myself and get stuck over and over till I give up and outsource it AGAIN and AGAIN.
What am I supposed to do when I want to run PHP code? For example I want to create a page that has this code in the content area:
Code:
<?php
ini_set("display_errors",1);
require_once '../../../jq-config.php';
// include the driver class
require_once ABSPATH."php/jqGridPdo.php";
// include the jqGrid Class
require_once ABSPATH."php/jqTreeGrid.php";
// Connection to the server
$conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);
// Tell the db that we use utf-8
$conn->query("SET NAMES utf8");
// Create the jqTreeGrid instance
$tree = new jqTreeGrid($conn);
$tree->SelectCommand = "SELECT * FROM nested_category";
// set the table and primary key
$tree->table = 'nested_category';
$tree->setPrimaryKeyId('category_id');
// set tree model and table configuration
$tree->setTreeModel('nested');
$tree->setTableConfig(array('id'=>'category_id', 'left'=>'lft', 'right'=>'rgt'));
// autoloading nodes
$tree->autoLoadNodes = false;
// show any error (if any ) from server
$tree->showError = true;
$tree->setColModel();
$tree->setUrl('treegrid.php');
$tree->dataType = 'json';
// Some nice setting
$tree->setColProperty('name',array("label"=>"Name", "width"=>170));
$tree->setColProperty('price',array("label"=>"Price", "width"=>90, "align"=>"right"));
$tree->setColProperty('qty_onhand',array("label"=>"Qty", "width"=>90, "align"=>"right"));
$tree->setColProperty('color',array("label"=>"Color", "width"=>100));
// hide the not needed fields
$tree->setColProperty('category_id',array("hidden"=>true,"index"=>"accounts.account_id", "width"=>50));
$tree->setColProperty('lft',array("hidden"=>true));
$tree->setColProperty('rgt',array("hidden"=>true));
$tree->setColProperty('level',array("hidden"=>true));
$tree->setColProperty('uiicon',array("hidden"=>true));
$tree->navigator = true;
// Enable only deleting
$tree->setNavOptions('navigator', array("excel"=>true,"add"=>true,"edit"=>true,"del"=>true,"view"=>true, "search"=>true));
// and finaly set the expand column and height to auto
$tree->setGridOptions(array(
"ExpandColumn"=>"name",
"height"=>"auto",
"sortname"=>"account_id"
));
$tree->renderTree('#tree', '#pager', true,null, null, true, true);
?>
As I understand it I could have that page you did, but then I still need to deal with the plugin system and have everything written in the plugin and then do {vb:raw pluginname} instead of just doing this:
<?
include("./globals.php");
include("./header.php");
include("./navbar.php");
// Above code goes here
include("./footer.php");
?>
It just seems like a really complicated way to produce pages with a lot of going back and forth. It is making more sense why I have pages with 3000-4000 lines of code written by my programmer with tons of [if ($_POST['do'] == xxx] statements just to avoid dealing with vbulletin.