Wacs Programming Guide

Eighth Edition

for WACS 0.9.0

B "Beaky" King

This work is licensed under the Creative Commons Attribution License. To view a copy of this license, visit http://creativecommons.org/licenses/by/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Tuesday 10th April 2012

Revision History
Revision Eighth EditionMarch 2012
  • Added new selections chapter detailing how to suppress unwanted records and how interlinks work
  • API Core reference updated for new functions in Wacs 0.9.x including conf_dosubs and loadattrvalues

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.

The WACS source code and other documentation and support tools can all be found at the WACS website at Sourceforge and on the WACS page at Launchpad.net. The WACS demonstration site can be found at PinkMetallic.com - the site will initially be free but a charge maybe applied later to help fund additional content. Commercial add-ons and support options can be purchased from Bevtec Communications Ltd, see their website at Bevtec Communications.


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. Making The Right Selections
Why Discuss Selections?
Avoiding Placeholder Models
Avoiding Duplicate and Alternative Sets
Understanding Link Relations
Illustrating How Link Relations Work
Coding For Link Relations
About Preference Exclusions
Fetching The Preference Exclusions Information
Using The Preference Exclusions
6. The User Interface Toolkit
Introducing WacsUI
Including WacsUI support
WacsUI: DescribeHer
The whatshedoes function
The addkeyicons function
iconlink: WacsUI's Most Important Function
WacsUI: Other Functions
Conclusions
7. Wacs-PHP: The Skins
Introduction To PHP Skins
Wacs-PHP: The Simple Skin
Styling Wacs-PHP Skins
WACS and Web 2.0
II. WACS API Programming Reference
8. WACS API: Core Module
Core Module: Summary
Core Module: Reference
9. WACS API: User Interface Module
User Interface Module: Summary
User Interface Module: Reference
10. WACS API: Standard Components Module
Standard Components Module: Summary
Standard Components Module: Reference
11. WACS API: Identification Module
Identification Module: Summary
III. WACS Database Schema
12. Schema Reference: Sets
Sets: Schema SQL
Sets: Defined Values
13. Schema Reference: Assoc
Assoc: Schema SQL
Assoc: Defined Values
14. Schema Reference: Idmap
Idmap: Schema SQL
Idmap: Defined Values
15. Schema Reference: Models
Models: Schema SQL
Models: Defined Values
16. Schema Reference: Download
Download: Schema SQL
Download: Defined Values
17. Schema Reference: Photographer
Photographer: Schema SQL
Photographer: Defined Values
18. Schema Reference: Tag
Tag: Schema SQL
Tag: Defined Values
19. Schema Reference: Vendor
Vendor: Schema SQL
Vendor: Defined Values
20. Schema Reference: Conn
Conn: Schema SQL
Conn: Defined Values
21. Schema Reference: Keyword
Keyword: Schema SQL
Keyword: Defined Values
22. Schema Reference: User
User: Schema SQL
User: Defined Values
23. Schema Reference: Attrib
Attrib: Schema SQL
Attrib: Defined Values
24. Schema Reference: Notes
Notes: Schema SQL
Notes: Defined Values
Index

List of Tables

7.1. Simple Skin: Components
2. The Key WACS Modules
8.1. Function Summary: Core Module
9.1. Function Summary: User Interface Module
10.1. Function Summary: Standard Components Module
11.1. Function Summary: Identification Module
12.1. stype: Type of Set: defined values
12.2. sstatus: Status of Set: defined values
12.3. sauto: Automatic Update of Set Allowed?: defined values
12.4. srating: Overall Rating For The Set: defined values
12.5. stechqual: Technical Quality Rating For The Set: defined values
12.6. svariety: Unusualness Rating For The Set: defined values
12.7. sformat: Format of the File(s) In The Set: defined values
12.8. sidlogo: Presence of Burnt-in Logo: defined values
12.9. sinter: Progressive or Interlaced Video Structure
12.10. serrors: Presence of Known Errors: defined values
12.11. scatflag: Generalised type of the set: defined values
12.12. srank: role and position of set: defined values
12.13. slocation: generalised description of locations: recommended values
12.14. sattire: generalised description of model's clothing: recommended values
12.15. suscattr: how to generate the 18 USC 2257 declaration: defined values
13.1. astatus: association status: defined values
14.1. istatus: idmap status: defined values
14.2. iactive: model activity status as this identity: defined values
14.3. isite: Some recommended site abbrievations: recommended values
15.1. mstatus: model record status: defined values
15.2. mrating: model rating: defined values
15.3. mpussy: model's normal pubic hair style: defined values
15.4. mflag: special marking flag for models: defined values
15.5. model activites flags: defined values
15.6. mcstatus: accuracy of home country field: defined values
15.7. mrace: race of the model: defined values
15.8. mbuild: body type of the model: defined values
15.9. mlabia: about the model's labia: defined values
15.10. mstarsign: The models astrological star sign
15.11. vital statistics: meanings
16.1. dstatus: download status: defined values
16.2. dtype: download set type: defined values
16.3. dsetflag: Suggested value for scatflag based on parsing result
17.1. pgender: gender of the photographer: defined values
17.2. pregion: geographical location of the photographer: defined values
17.3. prating: overall rating of photographer: defined values
17.4. phardness: rating of how explicit this photographer can be: defined values
17.5. photographer activites covered flags: defined values
17.6. photographer technologies used flags: defined values
18.1. tstatus: tag entry status: defined values
18.2. tflag: tag content type status: defined values
19.1. vcurrent: vendor existance status: defined values
19.2. vshow: vendor index inclusion status: defined values
19.3. vmdiruse et al: vendor URL auto-usuability status: defined values
20.1. cflag: connection type: defined values
20.2. cstatus: connection entry status: defined values
21.1. kflag: active entry status: defined values
22.1. ustatus: User Account Status: defined values
22.2. utype: User Type: defined values
22.3. uclass: User Class: defined values
24.1. ntype: notes type: 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
6.1. WacsUI initialisation
6.2. Using WacsUI: describeher
6.3. Using WacsUI: whatshedoes
6.4. Using AddKeyIcons
6.5. Using the iconlink function