[geeklog-cvs] Geeklog-1.x/public_html lib-common.php,1.643,1.644
Blaine Lang
blaine at qs1489.pair.com
Sun Jul 22 21:36:13 EDT 2007
Update of /cvsroot/geeklog/Geeklog-1.x/public_html
In directory qs1489.pair.com:/tmp/cvs-serv38517/public_html
Modified Files:
lib-common.php
Log Message:
Change to support MSSQL , block content was being truncated in MSSQL. Need to implement separate sql for mssql AND mysql.
Index: lib-common.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/lib-common.php,v
retrieving revision 1.643
retrieving revision 1.644
diff -C2 -d -r1.643 -r1.644
*** lib-common.php 23 Jul 2007 00:29:31 -0000 1.643
--- lib-common.php 23 Jul 2007 01:36:11 -0000 1.644
***************
*** 3192,3210 ****
}
! $sql = "SELECT *,UNIX_TIMESTAMP(rdfupdated) AS date "
! . "FROM {$_TABLES['blocks']} WHERE is_enabled = 1";
if( $side == 'left' )
{
! $sql .= " AND onleft = 1";
}
else
{
! $sql .= " AND onleft = 0";
}
if( !empty( $topic ))
{
! $sql .= " AND (tid = '$topic' OR tid = 'all')";
}
else
--- 3192,3215 ----
}
! $blocksql['mssql'] = "SELECT bid, is_enabled, name, type, title, tid, blockorder, cast(content as text) as content, ";
! $blocksql['mssql'] .= "rdfurl, rdfupdated, rdflimit, onleft, phpblockfn, help, owner_id, ";
! $blocksql['mssql'] .= "group_id, perm_owner, perm_group, perm_members, perm_anon, allow_autotags,UNIX_TIMESTAMP(rdfupdated) AS date ";
!
! $blocksql['mysql'] = "SELECT *,UNIX_TIMESTAMP(rdfupdated) AS date ";
!
! $commonsql = "FROM {$_TABLES['blocks']} WHERE is_enabled = 1";
if( $side == 'left' )
{
! $commonsql .= " AND onleft = 1";
}
else
{
! $commonsql .= " AND onleft = 0";
}
if( !empty( $topic ))
{
! $commonsql .= " AND (tid = '$topic' OR tid = 'all')";
}
else
***************
*** 3212,3220 ****
if( COM_onFrontpage() )
{
! $sql .= " AND (tid = 'homeonly' OR tid = 'all')";
}
else
{
! $sql .= " AND (tid = 'all')";
}
}
--- 3217,3225 ----
if( COM_onFrontpage() )
{
! $commonsql .= " AND (tid = 'homeonly' OR tid = 'all')";
}
else
{
! $commonsql .= " AND (tid = 'all')";
}
}
***************
*** 3224,3233 ****
$BOXES = str_replace( ' ', ',', $_USER['boxes'] );
! $sql .= " AND (bid NOT IN ($BOXES) OR bid = '-1')";
}
! $sql .= ' ORDER BY blockorder,title asc';
! $result = DB_query( $sql );
$nrows = DB_numRows( $result );
--- 3229,3240 ----
$BOXES = str_replace( ' ', ',', $_USER['boxes'] );
! $commonsql .= " AND (bid NOT IN ($BOXES) OR bid = '-1')";
}
! $commonsql .= ' ORDER BY blockorder,title asc';
! $blocksql['mysql'] .= $commonsql;
! $blocksql['mssql'] .= $commonsql;
! $result = DB_query( $blocksql );
$nrows = DB_numRows( $result );
More information about the geeklog-cvs
mailing list