dbview

0

Presents the results a database SQL query in a table. The query can be saved as a named view which can then be embedded as a table in any post using the shortcode [dbview name=name-of-v

Version
Last updated
Active installations
WordPress Version
Tested up to
Rating
Total ratings
Tag
This plugin is outdated and might not be supported anymore.

Description

Presents the results a database SQL query in a table. The query can be saved as a
named view which can then be embedded as a table in any post using the shortcode
[dbview name=name-of-view]. Views can be created and edited in the dashboard.

Shortcode examples

Show the ‘world cities’ view with a page size of 50 rows.
[dbview name=’world cities’ pagesize=50]

Show the ‘world cities’ view initially sorted by column ‘city’ in ascending order.
[dbview name=’world cities’ sort=city order=asc]

Show the ‘world cities’ view initially sorted by column ‘population’ in descending order.
[dbview name=’world cities’ sort=population order=desc]

Show the ‘world cities’ view without any pagination.
[dbview name=’world cities’]

Show the ‘world cities’ in the US with a population of greater than 5 million. See FAQ on passing arguments.
[dbview name=’world cities in country’ sort=city order=asc pagesize=10
arg1=’United States’ arg2=5000000]

End User Features

  • Column sorting on table header. Columns are enabled on each column.
  • Page navigation is on the table footer (from 0.5.3).
  • Tables are loaded using AJAX.

Management Features

  • Each view can be created/edited/deleted and tested under dbview/Settings in the dashboard.
  • Easy view consists of one SQL statement plus an optional PHP snippet associated wthe each column.
  • Sorting on each column can be enabled and disabled.
  • Each column can be manipulated using a PHP snippet. This functionality allows the introduction of permalinks, images and other customisations.
  • Each view is stored in a single serialized object in the wp_options table.

Limitations

  • Tables are not styled; this is left to the theme.
  • The data in the results table(s) cannot be edited.

Security

When the plugin is activated, administrators are given the capability to ‘manage DB views’.
Any other wp user with a different role that needs to create/edit views must be granted that capability.
Only a view that is explicitly checked as public will be visible to non administrators and the public.