v5:addons:addons_index
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| v5:addons:addons_index [2016/02/02 01:38] – [The xmlrpc library] mnewnham | v5:addons:addons_index [2023/05/12 19:12] (current) – [Paging & Scrolling with ADOdb Pager] move screenshot before code snippet dregad | ||
|---|---|---|---|
| Line 177: | Line 177: | ||
| ------------------------------ | ------------------------------ | ||
| ===== The xmlrpc library ====== | ===== The xmlrpc library ====== | ||
| - | This addon provides an interface between the adodb recordset and the php xmlrpc library. [[v5: | + | This addon provides an interface between the adodb recordset and the php xmlrpc library. [[v5: |
| + | ----------------------------- | ||
| + | |||
| + | ===== Paging & Scrolling with ADOdb Pager ===== | ||
| + | |||
| + | <WRAP right box> | ||
| + | == Requires == | ||
| + | adodb-pager.inc.php | ||
| + | </ | ||
| + | |||
| + | The following code snippet creates a very simple pager like the sample one shown below, allowing you to navigate between pages of a recordset. | ||
| + | |||
| + | {{: | ||
| + | <WRAP clear/> | ||
| + | |||
| + | <code php> | ||
| + | include_once ' | ||
| + | include_once ' | ||
| + | |||
| + | $db = ADONewConnection(' | ||
| + | $db-> | ||
| + | |||
| + | $sql = ' | ||
| + | |||
| + | $pager = new ADODB_Pager($db, | ||
| + | $pager-> | ||
| + | </ | ||
| + | |||
| + | The number of rows to display at one time is controled by the // | ||
| + | |||
| + | You can control the column titles by aliasing them in your SQL (supported by most databases): | ||
| + | <code php> | ||
| + | $sql = ' | ||
| + | | ||
| + | | ||
| + | | ||
| + | from adoxyz'; | ||
| + | </ | ||
| + | |||
| + | The ADODB_Pager code can be adapted by a programmer to improve the layout, e.g. replacing the text links by images, and the dull white background by more interesting colors. | ||
| + | |||
| + | By default, special characters in the displayed data will be escaped to prevent execution of HTML code. If you wish to have them interpreted instead, before calling Render() you can set | ||
| + | <code php> | ||
| + | $pager-> | ||
| + | </ | ||
| + | |||
| + | <WRAP important> | ||
| + | This is a **security risk**, unescaped HTML will leave you vulnerable to Cross-site scripting (XSS) attacks. | ||
| + | Use with caution, and only with trusted data. | ||
| + | </ | ||
v5/addons/addons_index.1454373484.txt.gz · Last modified: (external edit)
