Final Fantasy Republic Forums  
 Home | Forums | Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
     
    
        
     
 
Final Fantasy Republic Forums  
Username:

Password:
CAPTCHA:
  
        
Closed Thread
 
LinkBack Thread Tools Display Modes
  Velocd
 
 
Velocd's Avatar
Vanguard De Novo
 
Posts: 58
 
Reg: Apr 26 2002
 
ID: 659
 
RP: 0
 
Suikoden 2
Jpop/rock/stuff
anime: Kenshin OVA
Heart of Darkness.. j/k
PC
     
 
Default  PHP & Classes: do you use them?
09.22.02, 00:12:04
  Post #1 (permalink)
 
     

Has anybody used classes in PHP yet? For a quick explanation, classes basically allow functions and variables to be categorized in certain groups so that only certain calls/functions with permissions can access them, like by public or private. I remember them mostly from C++, but didn't really know they even existed in PHP till I read through them in my book a couple weeks back.

I'm more interested in why vBulletin software doesn't use classes, as it would be a much more organized to use mostly in the admin/functions.php area. Then again, I'm probably wrong and maybe it likely doesn't need it. I wonder though if vBulletin3 will use them...

Anyhow..I'm just curious if anybody else here with experience in PHP has ever had a need to use classes.
______________________________________



[anime forums]-[get involved]
  Velocd is offline
View Velocds Profile! Find more posts by Velocd! Visit Velocds Homepage!  
  rake
 
 
rake's Avatar
Sorceror|Supreme
 
Posts: 1,269
 
Reg: Jan 15 2002
 
ID: 4
 
RP: 0
 
None
None
None
None
     
 
Default  09.22.02, 06:03:09
  Post #2 (permalink)
 
     

$DB_site is a class, if i'm not mistaking.
______________________________________


Send a message via ICQ to rake Send a message via AIM to rake   rake is offline
View rakes Profile! Find more posts by rake! Visit rakes Homepage!  
  Velocd
 
 
Velocd's Avatar
Vanguard De Novo
 
Posts: 58
 
Reg: Apr 26 2002
 
ID: 659
 
RP: 0
 
Suikoden 2
Jpop/rock/stuff
anime: Kenshin OVA
Heart of Darkness.. j/k
PC
     
 
Default  09.23.02, 21:13:55
  Post #3 (permalink)
 
     

I was curious, so I searched for the initial code of $DB_site, and found this in admin/global.php:

Code:
$dbservertype = strtolower($dbservertype);
$dbclassname="./db_$dbservertype.php";
require($dbclassname);

$DB_site=new DB_Sql_vb;

$DB_site->appname="vBulletin Control Panel";
$DB_site->appshortname="vBulletin (cp)";
$DB_site->database=$dbname;
$DB_site->server=$servername;
$DB_site->user=$dbusername;
$DB_site->password=$dbpassword;

$DB_site->connect();

$dbpassword="";
$DB_site->password="";
// end init db

// load options
$optionstemp=$DB_site->query_first("SELECT template FROM template WHERE title='options'");
eval($optionstemp[template]);
$versionnumber=$templateversion;
I had thought $DB_site-> was just similar to the PHP function mysql_query(), to query a database...but it does seem like it could be a class, since in the functions.php, certain functions call for globals, which usually refers to classes...and $DB_site is included as a global..
  Velocd is offline
View Velocds Profile! Find more posts by Velocd! Visit Velocds Homepage!  
  rake
 
 
rake's Avatar
Sorceror|Supreme
 
Posts: 1,269
 
Reg: Jan 15 2002
 
ID: 4
 
RP: 0
 
None
None
None
None
     
 
Default  09.24.02, 11:58:01
  Post #4 (permalink)
 
     

didn't that db_sql_vb seem strange to you? open up db_mysql.php and look at the first few lines. It's a class allright.
Send a message via ICQ to rake Send a message via AIM to rake   rake is offline
View rakes Profile! Find more posts by rake! Visit rakes Homepage!  
Closed Thread



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
A well thoughtout system of classes for the battle system. Kitsune Midgar Library 18 09.19.02 00:55:24
Battle System Classes - A question. Elmdor Midgar Library 19 09.17.02 13:42:19
PHP Nuke must die Aeris Webmaster's Pub 13 07.27.02 08:04:29
Learning PHP Joshy Webmaster's Pub 21 07.11.02 16:05:07
Someone who knows vB and PHP. AnkisethGallant Webmaster's Pub 0 05.06.02 19:20:20