Mikez Posted May 10, 2008 Share Posted May 10, 2008 Hi, I am using Geeklog (blogg program like php nuke) And I want to put feeds on my front page that are not in side blocks. Geeklog lets you put feeds in side blocks but not in the center of the main page. So what I am doing is trying to let the block pull the feed and hide the block. I got it working somewhat with this code. <?php global $_TABLES; $res = DB_query("SELECT * from {$_TABLES['blocks']} WHERE bid in (25)"); while ($row = DB_fetchArray($res)) { $display .= COM_formatBlock($row); } echo $display; ?> But I don't know how to do more then one and keep it organized. Like in a table. This is what I did so far. <table cellspacing="1" cellpadding="10" width="100%" align="center" summary="" border="1"> <tbody> <tr> <td> <?php global $_TABLES; $res = DB_query("SELECT * from {$_TABLES['blocks']} WHERE bid in (25)"); while ($row = DB_fetchArray($res)) { $display .= COM_formatBlock($row); } echo $display; ?> </td> <td> <?php $res = DB_query("SELECT * from {$_TABLES['blocks']} WHERE bid in (24)"); while ($row = DB_fetchArray($res)) { $display .= COM_formatBlock($row); } echo $display; ?> </td> <td> <?php $res = DB_query("SELECT * from {$_TABLES['blocks']} WHERE bid in (24)"); while ($row = DB_fetchArray($res)) { $display .= COM_formatBlock($row); } echo $display; ?> </td> </tr> </tbody> </table> But it's all over the place. It's adding lines that I don't want. And no there not part of the table. Also there putting the code over and over in blocks. He is a screen shot of how bad it is. http://www.freakworld.com/albums/Freak-s-Pics/bad_php.jpg Can someone please help me.... :'( Link to comment https://forums.phpfreaks.com/topic/105059-can-someone-fix-my-messed-up-code/ Share on other sites More sharing options...
Mikez Posted May 10, 2008 Author Share Posted May 10, 2008 I almost have my code to work!!! But it's putting a line/border on the end of each table. How do I get that out? It's that the table doing it it's the PHP code. ?> <table cellspacing="1" cellpadding="10" width="100%" align="center" summary="" border="1"> <tbody> <tr> <td> <?php global $_TABLES; $res = DB_query("SELECT * from {$_TABLES['blocks']} WHERE bid in (25)"); while ($row = DB_fetchArray($res)) { $display1 .= COM_formatBlock($row); } echo $display1; ?> </td> <td> <?php $res = DB_query("SELECT * from {$_TABLES['blocks']} WHERE bid in (24)"); while ($row = DB_fetchArray($res)) { $display2 .= COM_formatBlock($row); } echo $display2; ?> </td> <td> <?php $res = DB_query("SELECT * from {$_TABLES['blocks']} WHERE bid in (24)"); while ($row = DB_fetchArray($res)) { $display3 .= COM_formatBlock($row); } echo $display3; ?> </td> </tr> </tbody> </table> Link to comment https://forums.phpfreaks.com/topic/105059-can-someone-fix-my-messed-up-code/#findComment-537808 Share on other sites More sharing options...
BlueSkyIS Posted May 10, 2008 Share Posted May 10, 2008 set border = 0. if the table is picking up style from CSS, maybe try setting style='border:0;border-color:#FFFFF', <table cellspacing="1" cellpadding="10" width="100%" align="center" border="0" style='border:0;border-color:#FFFFF'> Link to comment https://forums.phpfreaks.com/topic/105059-can-someone-fix-my-messed-up-code/#findComment-537820 Share on other sites More sharing options...
Mikez Posted May 10, 2008 Author Share Posted May 10, 2008 no it's not the table. It's in the table. It's coming from the PHP code. Just don't know how is all.... If you look at the screen shot on my first post you can see it. I marked it. That's the only problem I have left. Link to comment https://forums.phpfreaks.com/topic/105059-can-someone-fix-my-messed-up-code/#findComment-537824 Share on other sites More sharing options...
BlueSkyIS Posted May 10, 2008 Share Posted May 10, 2008 ah, i see. it must be doing it in COM_formatBlock. where is the code for that function? Link to comment https://forums.phpfreaks.com/topic/105059-can-someone-fix-my-messed-up-code/#findComment-537826 Share on other sites More sharing options...
Mikez Posted May 10, 2008 Author Share Posted May 10, 2008 ya I took it out but all it did was put he word Array in the box. Link to comment https://forums.phpfreaks.com/topic/105059-can-someone-fix-my-messed-up-code/#findComment-537835 Share on other sites More sharing options...
BlueSkyIS Posted May 10, 2008 Share Posted May 10, 2008 where is the code for that function? Link to comment https://forums.phpfreaks.com/topic/105059-can-someone-fix-my-messed-up-code/#findComment-537838 Share on other sites More sharing options...
Mikez Posted May 10, 2008 Author Share Posted May 10, 2008 the only place I can find it is my lib-common. If thats it is there not a way just to take it out? /** * Formats a Geeklog block * * This shows a single block and is typically called from * COM_showBlocks OR from plugin code * * @param array $A Block Record * @param bool $noboxes Set to true if userpref is no blocks * @return string HTML Formated block * */ function COM_formatBlock( $A, $noboxes = false ) { global $_CONF, $_TABLES, $_USER, $LANG21; $retval = ''; if( $A['type'] == 'portal' ) { if( COM_rdfCheck( $A['bid'], $A['rdfurl'], $A['date'], $A['rdflimit'] )) { $A['content'] = DB_getItem( $_TABLES['blocks'], 'content', "bid = '{$A['bid']}'"); } } if( $A['type'] == 'gldefault' ) { $retval .= COM_showBlock( $A['name'], $A['help'], $A['title'] ); } if( $A['type'] == 'phpblock' && !$noboxes ) { if( !( $A['name'] == 'whosonline_block' AND DB_getItem( $_TABLES['blocks'], 'is_enabled', "name='whosonline_block'" ) == 0 )) { $function = $A['phpblockfn']; $blkheader = COM_startBlock( $A['title'], $A['help'], COM_getBlockTemplate( $A['name'], 'header' )); $blkfooter = COM_endBlock( COM_getBlockTemplate( $A['name'], 'footer' )); if( function_exists( $function )) { $fretval = $function(); if( !empty( $fretval )) { $retval .= $blkheader; $retval .= $fretval; $retval .= $blkfooter; } } else { // show error message $retval .= $blkheader; $retval .= sprintf( $LANG21[31], $function ); $retval .= $blkfooter; } } } if( !empty( $A['content'] ) && ( trim( $A['content'] ) != '' ) && !$noboxes ) { $blockcontent = stripslashes( $A['content'] ); Link to comment https://forums.phpfreaks.com/topic/105059-can-someone-fix-my-messed-up-code/#findComment-537844 Share on other sites More sharing options...
Mikez Posted May 11, 2008 Author Share Posted May 11, 2008 :'( Link to comment https://forums.phpfreaks.com/topic/105059-can-someone-fix-my-messed-up-code/#findComment-538170 Share on other sites More sharing options...
Mikez Posted May 11, 2008 Author Share Posted May 11, 2008 Link to comment https://forums.phpfreaks.com/topic/105059-can-someone-fix-my-messed-up-code/#findComment-538342 Share on other sites More sharing options...
Mikez Posted May 12, 2008 Author Share Posted May 12, 2008 I still can't get it. ??? Link to comment https://forums.phpfreaks.com/topic/105059-can-someone-fix-my-messed-up-code/#findComment-538705 Share on other sites More sharing options...
Mikez Posted May 12, 2008 Author Share Posted May 12, 2008 I know were it comes from. formatBlock is pulling up the code from lib-common. From there is calling up code from the CSS to make a block. (Block: The boxes on the left and right of sights made by programs like post nuke and geeklog.) What I don't know is how to take out formatBlock with out breaking the code. The part in the CSS file that it is calling up "block-divider"will also change other themes that need the line. So I can't just change the CSS. Link to comment https://forums.phpfreaks.com/topic/105059-can-someone-fix-my-messed-up-code/#findComment-539543 Share on other sites More sharing options...
Mikez Posted May 13, 2008 Author Share Posted May 13, 2008 :-\ Link to comment https://forums.phpfreaks.com/topic/105059-can-someone-fix-my-messed-up-code/#findComment-540378 Share on other sites More sharing options...
Mikez Posted May 14, 2008 Author Share Posted May 14, 2008 Bump Link to comment https://forums.phpfreaks.com/topic/105059-can-someone-fix-my-messed-up-code/#findComment-541183 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.