Changeset 42 for trunk/bin/module_maker/skel/public.php
- Timestamp:
- Dec 18, 2005 12:16:03 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/module_maker/skel/public.php
r41 r42 1 1 <?php 2 2 /** 3 * %PUBLIC_SCRIPT% 3 * %PUBLIC_SCRIPT% 4 4 * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information 5 5 * … … 18 18 // Titles and navigation header. 19 19 $nav->addPage(_("%TITLE%"), $_SERVER['PHP_SELF']); 20 $nav->setFeature(array('title'=>true)); 20 $nav->setFeature(array('title'=>true)); 21 21 22 22 // Instantiate page numbers. Total items are set and calculation is done in the getRecordList function. … … 32 32 33 33 if (getFormData('%PRIMARY_KEY%', false)) { 34 34 35 35 // Get requested record. 36 36 $qid = DB::query(" … … 52 52 WHERE %PRIMARY_KEY% = '" . addslashes(getFormData('%PRIMARY_KEY%')) . "' 53 53 "); 54 54 55 55 // Set title and main template. 56 56 $nav->addPage($item['<##>']); … … 58 58 59 59 } else { 60 60 61 61 // Get the DEFAULT list. 62 62 $%NAME_SINGULAR%_list = array(); 63 63 $qid = DB::query(" 64 SELECT * 65 FROM %DB_TBL% 66 WHERE publish = 'true' 64 SELECT * 65 FROM %DB_TBL% 66 WHERE publish = 'true' 67 67 " . $so->getSortOrderSQL() . " 68 68 LIMIT 100 … … 71 71 $%NAME_SINGULAR%_list[] = $row; 72 72 } 73 73 74 74 // Set page numbers for default list. 75 75 $page->setTotalItems(sizeof($%NAME_SINGULAR%_list)); 76 76 $page->calculate(); 77 77 78 78 79 79 // Get the FEATURED list. 80 80 $featured_list = array(); 81 81 $qid = DB::query(" 82 SELECT * 83 FROM %DB_TBL% 82 SELECT * 83 FROM %DB_TBL% 84 84 WHERE publish = 'true' 85 85 AND featured = 'true' … … 89 89 $featured_list[] = $row; 90 90 } 91 91 92 92 // Get the POPULAR list. 93 93 $popular_list = array(); 94 94 $qid = DB::query(" 95 SELECT * 96 FROM %DB_TBL% 97 WHERE publish = 'true' 95 SELECT * 96 FROM %DB_TBL% 97 WHERE publish = 'true' 98 98 ORDER BY hit_count DESC LIMIT 10 99 99 "); … … 101 101 $popular_list[] = $row; 102 102 } 103 103 104 104 // Get the RECENT list. 105 105 $recent_list = array(); 106 106 $qid = DB::query(" 107 SELECT * 108 FROM %DB_TBL% 109 WHERE publish = 'true' 107 SELECT * 108 FROM %DB_TBL% 109 WHERE publish = 'true' 110 110 ORDER BY added_datetime DESC LIMIT 10 111 111 "); … … 113 113 $recent_list[] = $row; 114 114 } 115 115 116 116 // Set main template. 117 117 $main_template = '%PUBLIC_LIST_TEMPLATE%'; 118 } 118 } 119 119 120 120 // We have the data, and no errors, so here come the templates.
Note: See TracChangeset
for help on using the changeset viewer.