Wacs Programming Guide

Second Edition

for WACS 0.8.1

B "Beaky" King

22nd August 2008

Abstract

WACS is a tool for building Adult Web Sites; it is equally suitable for managing a private collection or building a commercial web site. It has many best of breed features including dynamic filtering, model catalogs, automatic download and powerful search engine. It comes with a powerful API (application programming interface) implemented in both Perl and PHP5 languages to allow web developers to leverage it's facilities from their own programs.

This book describes the application programming interface provided by WACS, and how to utilise it from perl and Php languages. It provides an extensive introductory tutorial with a large number of worked example programs as well as a complete API reference manual. Additionally it provides a schema reference for the WACS database tables as understanding the fields available to you is central to writing programs that utilitise it. The intended audience is web developers and WACS site managers who wish to tailor an existing WACS installation to meet their precise requirements; people merely wishing to use or manage an existing WACS installation may well find the default configurations provided suffice.


Table of Contents

I. WACS API Programming Tutorial
1. Introduction
Overview
About This Book
About The Examples
2. Basics: Getting Started
Outline
A First WACS Program
Modules: Importing
Configuration And Security
Initialising Database Connection
Fetching Some Records
Showing The Results
Finishing Off
Putting It All Together
Running MySimple
Reviewing The First Program
3. Using More Database Fields
Adding Model Icons
More Model Information
Using HTML tables
Adding The Model Details
Adding Other Icons
Improving Error Reporting
4. Set Display Routines
About Set Display
Sets: The Basic Bones
Adding Icons
Making The Text More Readable
Connecting Sets And Models
Understanding The Data Architecture
Using Relationships With Assoc
An Example Using Assoc
5. The User Interface Toolkit
Introducing WacsUI
Including WacsUI support
WacsUI: DescribeHer
The addkeyicons function
WacsUI: Other Functions
Conclusions
II. WACS API Programming Reference
6. WACS API: Core Module
Core Module: Summary
Core Module: Reference
7. WACS API: User Interface Module
User Interface Module: Summary
User Interface Module: Reference
8. WACS API: Standard Components Module
Standard Components Module: Summary
Standard Components Module: Reference
9. WACS API: Identification Module
Identification Module: Summary
III. WACS Database Schema
10. Schema Reference: Sets
Sets: Schema SQL
Sets: Defined Values
11. Schema Reference: Assoc
Assoc: Schema SQL
Assoc: Defined Values
12. Schema Reference: Idmap
Idmap: Schema SQL
Idmap: Defined Values
13. Schema Reference: Models
Models: Schema SQL
Models: Defined Values
14. Schema Reference: Download
Download: Schema SQL
Download: Defined Values
15. Schema Reference: Photographer
Photographer: Schema SQL
Photographer: Defined Values
16. Schema Reference: Tag
Tag: Schema SQL
Tag: Defined Values
17. Schema Reference: Vendor
Vendor: Schema SQL
Vendor: Defined Values
18. Schema Reference: Conn
Conn: Schema SQL
Conn: Defined Values
19. Schema Reference: Keyword
Keyword: Schema SQL
Keyword: Defined Values
Index

List of Tables

1. The Key WACS Modules
6.1. Function Summary: Core Module
7.1. Function Summary: User Interface Module
8.1. Function Summary: Standard Components Module
9.1. Function Summary: Identification Module
10.1. stype: Type of Set: defined values
10.2. sstatus: Status of Set: defined values
10.3. sauto: Automatic Update of Set Allowed?: defined values
10.4. srating: Overall Rating For The Set: defined values
10.5. stechqual: Technical Quality Rating For The Set: defined values
10.6. svariety: Unusualness Rating For The Set: defined values
10.7. sformat: Format of the File(s) In The Set: defined values
10.8. sidlogo: Presence of Burnt-in Logo: defined values
10.9. serrors: Presence of Known Errors: defined values
10.10. scatflag: Generalised type of the set: defined values
10.11. slocation: generalised description of locations: recommended values
10.12. suscattr: how to generate the 18 USC 2257 declaration: defined values
11.1. astatus: association status: defined values
12.1. istatus: idmap status: defined values
12.2. iactive: model activity status as this identity: defined values
12.3. isite: Some recommended site abbrievations: recommended values
13.1. mstatus: model record status: defined values
13.2. mrating: model rating: defined values
13.3. mpussy: model's normal pubic hair style: defined values
13.4. mflag: special marking flag for models: defined values
13.5. model activites flags: defined values
13.6. mcstatus: accuracy of home country field: defined values
13.7. mrace: race of the model: defined values
13.8. mbuild: body type of the model: defined values
13.9. vital statistics: meanings
14.1. dstatus: download status: defined values
14.2. dtype: download set type: defined values
14.3. dsetflag: Suggested value for scatflag based on parsing result
15.1. pgender: gender of the photographer: defined values
15.2. pregion: geographical location of the photographer: defined values
15.3. prating: overall rating of photographer: defined values
15.4. phardness: rating of how explicit this photographer can be: defined values
15.5. photographer activites covered flags: defined values
15.6. photographer technologies used flags: defined values
16.1. tstatus: tag entry status: defined values
16.2. tflag: tag content type status: defined values
17.1. vcurrent: vendor existance status: defined values
17.2. vshow: vendor index inclusion status: defined values
17.3. vmdiruse et al: vendor URL auto-usuability status: defined values
18.1. cflag: connection type: defined values
18.2. cstatus: connection entry status: defined values
19.1. kflag: active entry status: defined values

List of Examples

2.1. WACS Module Import
2.2. Config and Security
2.3. Database Connection Initialisation
2.4. Database Query
2.5. Outputing The List
2.6. Php: Complete Simple Program
2.7. Perl: Complete Simple Program
3.1. Modified Output Loop with Icon Code
3.2. Modified SQL command for more Model Info
3.3. New version of the loop using tables
3.4. Adding Model Information
3.5. Adding A Rating Icon
3.6. Calling dberror for better error reporting
4.1. The Basic SetDisp Program
4.2. Adding A Set Icon
4.3. Making Camel-Style Text Readable
4.4. Modified Icon Cell
4.5. getmodel Subroutine
4.6. Calling The getmodel Function
5.1. WacsUI initialisation
5.2. Using WacsUI: describeher
5.3. Using AddKeyIcons