openDocs
$ ls .../us_home/resume/_current/7_about/projects/xwords ReadMe.txt /archives/ /doc/ /samples_static/ index.php /images/ config.php init.php /broken/ /sql/ /lib/ demo-xml.php demo.php demo-user-words.php demo-add-words.php xword.info xword.module xword.install xword.test
$ ls .../us_home/resume/_current/7_about/projects/xwords/lib php_crossword_client.class.php xml.php utility.php Snoopy.class.php php_crossword_word.class.php php_crossword_cell.class.php php_crossword_grid.class.php php_crossword.class.php mysql.class.php ../config.php ../init.php
FILE: php_crossword_word.class.php Variables $axis $cells=array(); $fully_crossed=FALSE; $inum=0; $word Methods PHP_Crossword_Word(string $word, int $axis) Constructor getCrossableCells() getCrossAxis() getStartX() getStartY() isFullyCrossed()
FILE: php_crossword_grid.class.php
FILE: php_crossword.class.php
define("_PC_DIR", '_FILE_');
require_once _PC_DIR . "php_crossword_[ grid | cell | word ].class.php";
define("PC_AXIS_H", 1);
define("PC_AXIS_V", 2);
define("PC_AXIS_BOTH", 3);
define("PC_AXIS_NONE", 4);
define("PC_WORDS_FULLY_CROSSED", 10);
CLASS
PHP_Crossword
var $rows = 15, $cols = 15, $grid;
$max_full_tries = 10, $max_words = 15, $max_tries = 50,
$table = "words", $groupid = "common", $db,
$_match_line, $_full_tries = 0, $_tries = 0, $_debug = FALSE, $_items;
FUNCTION
Line Signature Description Example Implementations (File:Line, File:Line)
PHP_Crossword($rows, $cols)
setWordSet($wordset)
setDebug($debug = TRUE)
setMaxWords($max_words)
setMaxFullTries($max_full_tries)
setMaxTries($max_tries)
generate()
reset()
getHTML($params = array())
getWords()
__getItems()
getQuestion($word)
__autoGenerate()
__getWordWithStart(&$cell, $axis)
&__calcStartCell(&$cell, &$start, &$end, $axis, $word, &$pos)
__getWord(&$cell, &$start, &$end, $axis)
__pickWord(&$rs, $regexp)
__getMatchLine(&$cell, &$start, &$end, $axis) Generate word matching line
__getMatchMin($str)
__getMatchLike($str)
__getMatchRegexp($str)
__placeFirstWord()
__loadWords($match, $len_min, $len_max)
__getUsedWordsSql()
__getRandomWord($max_length)
__getWordsCount($where = NULL)
existsWord($word)
insertWord($word, $question)
getXML()
__wordItem2XML($item, $ident)
countWordsInSet($wordset = NULL)
getWordSets()
existsGroupID($groupid)
createTempWordSet()
removeWordSet($wordset = NULL)
generateFromWords($words_list)
DATABASE TABLE MODEL mysql> CREATE TABLE `words` ( `wordset` varchar(30) NOT NULL default 'demo', `word` varchar(30) NOT NULL default '', `question` varchar(255) NOT NULL default '', `clue` varchar(255) default NULL, PRIMARY KEY (`word`,`wordset`), KEY `wordset` (`wordset`), FULLTEXT KEY `fulltext` (`word`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATION=latin1_general_cs;