Username:
Password:
Remember me:
Register

Back to forum: 3DSPlaza Programming


Search forums via Google


0 Users appreciate this thread.

3DSPlaza APIs Early Documentation
Started by SomeLuigi
(2012-05-25 18:20:48)
SomeLuigi (2012-05-25 18:20:48)
PHP-based APIs


Format:

result-type functionName(var-type $var-name = 'default value/optional', ...)
(void=no result)


Filename on server: /lib/general.lib.php
Functions available:
boolean a3_mysqlc(string $database = 'thrdsplamembers'
Connects to the 3DSPlaza MySQL database server and selects the database as named by $database. The default is the main 3DSPlaza Database.

void a3_mysqld()
Disconnects from a MySQL connection opened with a3_mysqlc()

integer a3_nameToID(string $username)
Converts a 3DSPlaza Username into the respective User ID.




/lib/sldbrecord.class.php
class TSLDBRecord ($rec = new TSLDBRecord;)

void cfgcol(array $mysql_columns)
Configures the MySQL Record Object to load/save these columns. Use array('field2', 'field5' etc to create a suitable array.

void myconfig(string $database, string $dbtable, string $mysqlcondition, string $index_col)
Configures the record element where and what it is interested in. MySQL condition is basically WHERE clause. An example is:

myconfig('thrdsplamembers', 'users', 'id=170', 'id';
The index_col setting is added to make sure you cannot edit ID from within the code (failsafe)

void load()
Loads the record from the database.

void save()
Saves the record to the database.

void set(string $column, mixed $value)
Sets a column/field value and MARKS IT AS EDITED.

void get(string $column)
Gets the value from a column/field

void flag(string $column)
Flags a field as MODIFIED.

void unflag(string $column)
Removes the MODIFIED FLAG for that field.

void flagall()
Flags ALL columns as MODIFIED.

boolean ism(string $column)
Indicates whether a field has been flagged as modified. flagall does not count.

boolean isf(string $column)
Identical to isset($this as TSLDBRecord->data[column])
(checks whether it has been initialized)



This post has been edited one or more times, the last time was:
2012-06-01 08:09:13

SomeLuigi is changing in 2015.
NINTENDO64 (2012-05-29 02:26:38)
Same, but I didn't understand it enough! -Shinestar
"If today were the last day of my life, would I want to do what I am about to do today?"
-Steve Jobs

DBS
SomeLuigi (2012-06-07 20:36:50)
*simple* PHP, actually.

Just I'm documenting it in a verbose way. This documentation will be updated later.
SomeLuigi is changing in 2015.
LincolnN9neN9ne (2013-04-19 14:14:53)
Interesting, I understood most of it.
[IMG]http://i.imgur.com/JUs6LzU.jpg[/IMG]
 

Log in to submit a comment

This topic's ID: 17010

Back to forum: 3DSPlaza Programming




Total registered users: 8321
New registered users today: 7
Newest registered user: ElegantVulpes

©  Copyright 2026 3DSPlaza. All Rights Reserved