Plugin Directory

Changeset 927864


Ignore:
Timestamp:
06/06/2014 04:50:25 PM (12 years ago)
Author:
john ackers
Message:

formatting changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dbview/trunk/readme.txt

    r927853 r927864  
    1616
    1717Show 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]`
    1919
    2020Show 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]`
    2222
    2323Show 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]`
    2525
    2626Show the 'world cities' view without any pagination.
    27 ‘[dbview name='world cities']’
     27`[dbview name='world cities']`
    2828
    2929Show 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]`
    3131
    3232= End User Features =
     
    8080For example, to embed the results of this query:
    8181
    82 ‘select * from cities where country=%s and population > %d’
     82`select * from cities where country=%s and population > %d`
    8383
    8484use:
    8585 
    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]`
    8787
    8888
     
    9393An easier way is to insert a PHP snippet in a column in the first table:
    9494
    95 ‘return DBView::link($value, "name-of-dbview", optional-arg1, optional-arg2);’
     95`return DBView::link($value, "name-of-dbview", optional-arg1, optional-arg2);`
    9696
    9797
     
    102102For example to get the current user and display a table that shows that users information.
    103103
    104 $u=wp_get_current_user();
    105 echo do_shortcode("[dbview  name='show user' arg1=$u->ID]");
     104`$u=wp_get_current_user();
     105echo do_shortcode("[dbview  name='show user' arg1=$u->ID]");`
    106106
    107107The 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`
    109109
    110110
Note: See TracChangeset for help on using the changeset viewer.