[geeklog-cvs] geeklog: added pgsql arrays
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Tue Jan 26 15:53:27 EST 2010
changeset 7620:e26d5f2652f6
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/e26d5f2652f6
user: stan <yankees26an at gmail.com>
date: Fri Jun 19 22:05:20 2009 -0400
description:
added pgsql arrays
diffstat:
plugins/staticpages/services.inc.php | 5 +++++
system/classes/listfactory.class.php | 22 +++++++++-------------
2 files changed, 14 insertions(+), 13 deletions(-)
diffs (69 lines):
diff -r fe4a60bd8e0f -r e26d5f2652f6 plugins/staticpages/services.inc.php
--- a/plugins/staticpages/services.inc.php Fri Jun 19 20:10:53 2009 -0400
+++ b/plugins/staticpages/services.inc.php Fri Jun 19 22:05:20 2009 -0400
@@ -561,6 +561,11 @@
. "sp_help,sp_php,sp_inblock "
. "FROM {$_TABLES['staticpage']} WHERE (sp_id = '$page')"
. $perms;
+ $sql['pgsql'] = "SELECT sp_title,sp_content,sp_hits,sp_date,sp_format,"
+ . "commentcode,owner_id,group_id,perm_owner,perm_group,"
+ . "perm_members,perm_anon,sp_tid,sp_help,sp_php,"
+ . "sp_inblock FROM {$_TABLES['staticpage']} "
+ . "WHERE (sp_id = '$page')" . $perms;
$result = DB_query ($sql);
$count = DB_numRows ($result);
diff -r fe4a60bd8e0f -r e26d5f2652f6 system/classes/listfactory.class.php
--- a/system/classes/listfactory.class.php Fri Jun 19 20:10:53 2009 -0400
+++ b/system/classes/listfactory.class.php Fri Jun 19 22:05:20 2009 -0400
@@ -276,6 +276,9 @@
{
$sql['mysql'] = preg_replace('/SELECT.*FROM/is', 'SELECT COUNT(*) FROM', $sql['mysql']);
$sql['mssql'] = preg_replace('/SELECT.*FROM/is', 'SELECT COUNT(*) FROM', $sql['mssql']);
+ $sql['pgsql'] = preg_replace('/SELECT.*FROM/is', 'SELECT COUNT(*) FROM', $sql['pgsql']);
+
+
}
else
{
@@ -426,11 +429,7 @@
foreach ($this->_fields as $field)
{
if (!is_numeric($field['name']) && $field['name'][0] != '_') {
- if (empty($A[ $field['name'] ])) {
- $col[ $field['name'] ] = 'LF_NULL';
- } else {
- $col[ $field['name'] ] = $A[ $field['name'] ];
- }
+ $col[ $field['name'] ] = $A[ $field['name'] ];
}
}
@@ -448,8 +447,7 @@
$direction = $this->_sort_arr['direction'] == 'asc' ? SORT_ASC : SORT_DESC;
$column = array();
foreach ($rows_arr as $sortarray) {
- $tmp = strip_tags($sortarray[ $this->_sort_arr['field'] ]);
- $column[] = ($tmp == 'LF_NULL' ? 0 : $tmp);
+ $column[] = strip_tags($sortarray[ $this->_sort_arr['field'] ]);
}
array_multisort($column, $direction, $rows_arr);
@@ -603,13 +601,11 @@
$fieldvalue = $row[ $field['name'] ];
}
- if ($fieldvalue != 'LF_NULL') {
- $fieldvalue = sprintf($field['format'], $fieldvalue, $field['title']);
+ $fieldvalue = sprintf($field['format'], $fieldvalue, $field['title']);
- // Write field
- $list_templates->set_var('field_text', $fieldvalue);
- $list_templates->parse('item_field', 'field', true);
- }
+ // Write field
+ $list_templates->set_var('field_text', $fieldvalue);
+ $list_templates->parse('item_field', 'field', true);
}
}
More information about the geeklog-cvs
mailing list