|
From: Paul S. O. <ps...@us...> - 2001-12-17 02:02:58
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv6846
Modified Files:
privmsg.php posting.php
Log Message:
Stupid horrible group by clauses
Index: privmsg.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/privmsg.php,v
retrieving revision 1.64
retrieving revision 1.65
diff -C2 -r1.64 -r1.65
*** privmsg.php 2001/12/16 18:29:20 1.64
--- privmsg.php 2001/12/17 02:02:55 1.65
***************
*** 64,84 ****
}
! $sql = "SELECT *
FROM " . SMILIES_TABLE . "
- GROUP BY emoticon
ORDER BY smilies_id";
if( $result = $db->sql_query($sql) )
{
! if( $num_smilies = $db->sql_numrows($result) )
{
! $rowset = $db->sql_fetchrowset($result);
! $j = 0;
! $s_colspan = 0;
! $smilies_count = ( $mode == 'inline' ) ? min(20, $num_smilies) : $num_smilies;
$smilies_split_row = ( $mode == 'inline' ) ? 3 : 7;
! for($i = 0; $i < $smilies_count; $i++)
{
! if( !$j )
{
$template->assign_block_vars("smilies_row", array());
--- 64,96 ----
}
! $sql = "SELECT emoticon, code, smile_url
FROM " . SMILIES_TABLE . "
ORDER BY smilies_id";
if( $result = $db->sql_query($sql) )
{
! if( $db->sql_numrows($result) )
{
! $rowset = array();
! while( $row = $db->sql_fetchrow($result) )
! {
! if( empty($rowset[$row['smile_url']]) )
! {
! $rowset[$row['smile_url']]['code'] = $row['code'];
! $rowset[$row['smile_url']]['emoticon'] = $row['emoticon'];
! }
! }
! $num_smilies = count($rowset);
!
! $smilies_count = ( $mode == 'inline' ) ? min(19, $num_smilies) : $num_smilies;
$smilies_split_row = ( $mode == 'inline' ) ? 3 : 7;
!
! $s_colspan = 0;
! $row = 0;
! $col = 0;
!
! while( list($smile_url, $data) = @each($rowset) )
{
! if( !$col )
{
$template->assign_block_vars("smilies_row", array());
***************
*** 86,97 ****
$template->assign_block_vars("smilies_row.smilies_col", array(
! "SMILEY_CODE" => $rowset[$i]['code'],
! "SMILEY_IMG" => "images/smiles/" . $rowset[$i]['smile_url'],
! "SMILEY_DESC" => $rowset[$i]['emoticon'])
);
! $s_colspan = max($s_colspan, $j + 1);
! $j = ( $j == $smilies_split_row ) ? 0 : $j + 1;
}
--- 98,121 ----
$template->assign_block_vars("smilies_row.smilies_col", array(
! "SMILEY_CODE" => $data['code'],
! "SMILEY_IMG" => "images/smiles/" . $smile_url,
! "SMILEY_DESC" => $data['emoticon'])
);
! $s_colspan = max($s_colspan, $col + 1);
! if( $col == $smilies_split_row )
! {
! if( $mode == 'inline' && $row == 4 )
! {
! break;
! }
! $col = 0;
! $row++;
! }
! else
! {
! $col++;
! }
}
Index: posting.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/posting.php,v
retrieving revision 1.126
retrieving revision 1.127
diff -C2 -r1.126 -r1.127
*** posting.php 2001/12/16 18:13:33 1.126
--- posting.php 2001/12/17 02:02:55 1.127
***************
*** 594,614 ****
}
! $sql = "SELECT *
FROM " . SMILIES_TABLE . "
- GROUP BY emoticon
ORDER BY smilies_id";
if( $result = $db->sql_query($sql) )
{
! if( $num_smilies = $db->sql_numrows($result) )
{
! $rowset = $db->sql_fetchrowset($result);
! $j = 0;
! $s_colspan = 0;
! $smilies_count = ( $mode == 'inline' ) ? min(20, $num_smilies) : $num_smilies;
$smilies_split_row = ( $mode == 'inline' ) ? 3 : 7;
! for($i = 0; $i < $smilies_count; $i++)
{
! if( !$j )
{
$template->assign_block_vars("smilies_row", array());
--- 594,626 ----
}
! $sql = "SELECT emoticon, code, smile_url
FROM " . SMILIES_TABLE . "
ORDER BY smilies_id";
if( $result = $db->sql_query($sql) )
{
! if( $db->sql_numrows($result) )
{
! $rowset = array();
! while( $row = $db->sql_fetchrow($result) )
! {
! if( empty($rowset[$row['smile_url']]) )
! {
! $rowset[$row['smile_url']]['code'] = $row['code'];
! $rowset[$row['smile_url']]['emoticon'] = $row['emoticon'];
! }
! }
! $num_smilies = count($rowset);
!
! $smilies_count = ( $mode == 'inline' ) ? min(19, $num_smilies) : $num_smilies;
$smilies_split_row = ( $mode == 'inline' ) ? 3 : 7;
!
! $s_colspan = 0;
! $row = 0;
! $col = 0;
!
! while( list($smile_url, $data) = @each($rowset) )
{
! if( !$col )
{
$template->assign_block_vars("smilies_row", array());
***************
*** 616,627 ****
$template->assign_block_vars("smilies_row.smilies_col", array(
! "SMILEY_CODE" => $rowset[$i]['code'],
! "SMILEY_IMG" => "images/smiles/" . $rowset[$i]['smile_url'],
! "SMILEY_DESC" => $rowset[$i]['emoticon'])
);
! $s_colspan = max($s_colspan, $j + 1);
! $j = ( $j == $smilies_split_row ) ? 0 : $j + 1;
}
--- 628,651 ----
$template->assign_block_vars("smilies_row.smilies_col", array(
! "SMILEY_CODE" => $data['code'],
! "SMILEY_IMG" => "images/smiles/" . $smile_url,
! "SMILEY_DESC" => $data['emoticon'])
);
! $s_colspan = max($s_colspan, $col + 1);
! if( $col == $smilies_split_row )
! {
! if( $mode == 'inline' && $row == 4 )
! {
! break;
! }
! $col = 0;
! $row++;
! }
! else
! {
! $col++;
! }
}
|