Changeset 927864
- Timestamp:
- 06/06/2014 04:50:25 PM (12 years ago)
- File:
-
- 1 edited
-
dbview/trunk/readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dbview/trunk/readme.txt
r927853 r927864 16 16 17 17 Show the 'world cities' view with a page size of 50 rows. 18 ‘[dbview name='world cities' pagesize=50]’ 18 `[dbview name='world cities' pagesize=50]` 19 19 20 20 Show the 'world cities' view initially sorted by column 'city' in ascending order. 21 ‘[dbview name='world cities' sort=city order=asc]’ 21 `[dbview name='world cities' sort=city order=asc]` 22 22 23 23 Show the 'world cities' view initially sorted by column 'population' in descending order. 24 ‘[dbview name='world cities' sort=population order=desc]’24 `[dbview name='world cities' sort=population order=desc]` 25 25 26 26 Show the 'world cities' view without any pagination. 27 ‘[dbview name='world cities']’27 `[dbview name='world cities']` 28 28 29 29 Show the 'world cities' in the US with a population of greater than 5 million. 30 ‘[dbview name=’world cities in country’ sort=city order=asc pagesize=10 arg1=’United States’ arg2=5000000]’30 `[dbview name=`world cities in country` sort=city order=asc pagesize=10 arg1=`United States` arg2=5000000]` 31 31 32 32 = End User Features = … … 80 80 For example, to embed the results of this query: 81 81 82 ‘select * from cities where country=%s and population > %d’ 82 `select * from cities where country=%s and population > %d` 83 83 84 84 use: 85 85 86 ‘[dbview name='world cities in country' sort=city order=asc pagesize=10 arg1='United States' arg2=5000000]’ 86 `[dbview name='world cities in country' sort=city order=asc pagesize=10 arg1='United States' arg2=5000000]` 87 87 88 88 … … 93 93 An easier way is to insert a PHP snippet in a column in the first table: 94 94 95 ‘return DBView::link($value, "name-of-dbview", optional-arg1, optional-arg2);’ 95 `return DBView::link($value, "name-of-dbview", optional-arg1, optional-arg2);` 96 96 97 97 … … 102 102 For example to get the current user and display a table that shows that users information. 103 103 104 ‘$u=wp_get_current_user();105 echo do_shortcode("[dbview name='show user' arg1=$u->ID]"); ’104 `$u=wp_get_current_user(); 105 echo do_shortcode("[dbview name='show user' arg1=$u->ID]");` 106 106 107 107 The corresponding SQL stored in 'show user' is: 108 ‘select ID, user_login, user_email, user_registered, user_status from wp_users where ID=%d’ 108 `select ID, user_login, user_email, user_registered, user_status from wp_users where ID=%d` 109 109 110 110
Note: See TracChangeset
for help on using the changeset viewer.