Home HomePHP Kompendium Programisty Blake Schwendiman PLphp manual pl (2)PHP KompendiumApplications of Digital Signal Processing to Audio and Acoustics Kahrs Mark Brandenburg K 2002McLaughlin Brett Building Java Enterprise Applications Volume I ArchitectureMagia sprzatania Marie KondoChmielewska Joanna HarpieAlfred Szklarski Tomek Wsrod Lowcow GlowClancy Tom Zeby tygrysaSonny Hassell & Ais Interludes (#3)
  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • us5.pev.pl
  •  

    [ Pobierz całość w formacie PDF ]
    .f.qc 12/15/00 15:25 Page 296296 Part IV: Not So Simple Applicationsstage_dsc text,PRIMARY KEY (stage_id));# Table structure for table  content_users#CREATE TABLE content_users (user_id int(11) DEFAULT  0 NOT NULL auto_increment,username varchar(20) DEFAULT   NOT NULL,name varchar(50),email varchar(255),PRIMARY KEY (user_id));## Table structure for table  editing_stories#CREATE TABLE editing_stories (story_id int(11) DEFAULT  0 NOT NULL,UNIQUE story_id (story_id));## Table structure for table  killed_stories#CREATE TABLE killed_stories (story_id int(11) DEFAULT  0 NOT NULL,UNIQUE story_id (story_id));## Table structure for table  live_stories#CREATE TABLE live_stories (story_id int(11) DEFAULT  0 NOT NULL,UNIQUE story_id (story_id));## Table structure for table  proofreading_stories#CREATE TABLE proofreading_stories (story_id int(11) DEFAULT  0 NOT NULL,UNIQUE story_id (story_id) 3537-4 ch11.f.qc 12/15/00 15:25 Page 297Chapter 11: Content Management System 297);## Table structure for table  stories#CREATE TABLE stories (story_id int(11) DEFAULT  0 NOT NULL auto_increment,stage_id int(11) DEFAULT  0 NOT NULL,publish_dt date,headline varchar(255),subtitle varchar(255),byline_prefix varchar(20),summary text,body text,PRIMARY KEY (story_id),KEY story_stage_key (stage_id));## Table structure for table  story_author_map#CREATE TABLE story_author_map (story_id int(11) DEFAULT  0 NOT NULL,author_id int(11) DEFAULT  0 NOT NULL,PRIMARY KEY (story_id),KEY author_story_map_key (author_id));## Table structure for table  story_versions#CREATE TABLE story_versions (story_id int(11) DEFAULT  0 NOT NULL,modify_dt timestamp(14),modify_by varchar(20) DEFAULT   NOT NULL,stage_id int(11) DEFAULT  0 NOT NULL,publish_dt date,headline varchar(255),subtitle varchar(255),byline_prefix varchar(20),summary text,body text,KEY story_version_key (story_id,modify_dt)); 3537-4 ch11.f.qc 12/15/00 15:25 Page 298298 Part IV: Not So Simple Applications## Table structure for table  user_stage_map#CREATE TABLE user_stage_map (user_id int(11) DEFAULT  0 NOT NULL,stage_id int(11) DEFAULT  0 NOT NULL,PRIMARY KEY (user_id,stage_id),KEY stage_user_map_key (stage_id));## Table structure for table  writing_stories#CREATE TABLE writing_stories (story_id int(11) DEFAULT  0 NOT NULL,UNIQUE story_id (story_id));Code OverviewAt this point, we assume that you are getting comfortable with the way the applica-tions in this book have been constructed.You should be familiar with the functionsintroduced in Chapter 8, and the way PHP embeds MySQL commands within thescripts.As you work through, less and less of the code should require explanation.Thus,the descriptions of the code will deal only with those parts that are really newor tricky.Here, most of the newer-looking code will come from assigning the privilegesdiscussed in the previous section.The application sends queries that you haven tused before.Code BreakdownOnce again, the code in this application will make heavy use of the functions in the/functions/ folder.A lot of the code presented here will make calls to those functions.Reusable functionsIn this application, there is only one file with application-specific functions: /content/functions.php. 3537-4 ch11.f.qc 12/15/00 15:25 Page 299Chapter 11: Content Management System 299FUNCTIONS FROM /CONTENT/FUNCTIONS.PHPThese will be used throughout the application.There will be many references toChapter 9 in this section.LIST_STORIES() As mentioned in Chapter 10, in MySQL version 3.23 you canwork MySQL s lack of support for unions by creating temporary tables.However,we developed all of the applications on this book using MySQL version 3.22, whichdoes not support the create temporary table feature.This gets to be a problem whenyou need to print out the contents of two queries within a single table.If you lookat the source code on the CD-ROM, you will see that the pages start by printing allof the stories currently within the workflow that the current user has access to.Following that, if the user has access to live stories, the live stories should beprinted within the same table.To create this table, we need to call this function twice, passing the result iden-tifier of the query as the first argument.If the query has at least one row, the tableheader will be printed, and $in_table will be set to 1.The next time the function iscalled, the value of $in_table will be passed as the second argument.If the value of$in_table is 1 the header will not print.Again, if you are using MySQL version 3.23, use the create temporary table feature [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • syriusz777.pev.pl
  •