SimplePortal

Customization => Custom Coding => Topic started by: impennetrate on November 15, 2009, 11:20:54 AM

Title: How to remove bodybg and titlebg of board news?
Post by: impennetrate on November 15, 2009, 11:20:54 AM
Hello,

How would I go about removing the bodybg and titlebg of a board news block?

Or could I create a custom html/php block that performs the same function as the board news?
Title: Re: How to remove bodybg and titlebg of board news?
Post by: Nathaniel on November 15, 2009, 06:17:25 PM
Do a search for the 'sp_boardNews' function in the 'Sources/PortalBlocks.php' file. The display/template code is at the end of the function, you can make whatever changes you want there or you can copy the code from that function into a Custom PHP block and make your edits there.
Title: Re: How to remove bodybg and titlebg of board news?
Post by: impennetrate on January 10, 2010, 06:02:36 PM
Okay so I want to make a new Boardnews Block, can I make it using php? I want it to look very specific, though... I'll show pictures of what it looks like now, and what I want it to look like (edited image):

What it is now:
(http://i45.tinypic.com/qmxk5v.png)

What I want it to be:
(http://i45.tinypic.com/2rmxe6w.png)

Is this possible?
Title: Re: How to remove bodybg and titlebg of board news?
Post by: giannis_athens on July 25, 2010, 05:45:13 AM
Do a search for the 'sp_boardNews' function in the 'Sources/PortalBlocks.php' file. The display/template code is at the end of the function, you can make whatever changes you want there or you can copy the code from that function into a Custom PHP block and make your edits there.
Ok i tried that part and , actually i didn't know what exactly  i should  fill in the Custom PHP,
 so i put all the 'sp_boardNews'  function to start making some changes

Code: [Select]
function sp_boardNews($parameters, $id, $return_parameters = false)

{
        global $scripturl, $txt, $settings, $modSettings, $context, $smcFunc, $color_profile;

        $block_parameters = array(

'board' => 'boards',

'limit' => 'int',

'start' => 'int',

'length' => 'int',

'avatar' => 'check',

'per_page' => 'int',

);

but, when i preview i get this error :
Parse error: syntax error, unexpected $end in /home/aktorama/public_html/Sources/PortalBlocks.php(6661) : eval()'d code on line 23

Can you please tell me what part of this function i should add at the cutom PHP field
to start editing???
Title: Re: How to remove bodybg and titlebg of board news?
Post by: jamiechaos on August 09, 2010, 02:13:04 PM
I'm no SP expert? but if the code you showed us is what's in the block, then you didn't include the whole function, and that's wht the error message is complaining about.  You need to include it from the first { to the final } (where the next function begins).

Beyond that, I'm useless, but maybe that much will at least be helpful.
Title: Re: How to remove bodybg and titlebg of board news?
Post by: giannis_athens on August 09, 2010, 03:27:35 PM
I'm no SP expert? but if the code you showed us is what's in the block, then you didn't include the whole function, and that's wht the error message is complaining about.  You need to include it from the first { to the final } (where the next function begins).

Beyond that, I'm useless, but maybe that much will at least be helpful.

Thank you very much, you are right about the function, i didnt include it all of it....  :-[

I will check it again and i will inform the topic...
Thank you.
Title: Re: How to remove bodybg and titlebg of board news?
Post by: giannis_athens on August 09, 2010, 04:23:10 PM
Ok i put all this function but i get this error:

Code: [Select]
Fatal error: Cannot redeclare sp_boardnews() (previously declared in /home/aktorama/public_html/Sources/PortalBlocks.php:2511) in /home/aktorama/public_html/Sources/PortalBlocks.php(6661) : eval()'d code on line 505
Forget it...iam toooo noob to deal with that....lets get something else to change...  :)
Title: Re: How to remove bodybg and titlebg of board news?
Post by: Nathaniel on September 21, 2010, 10:22:52 PM
@giannis_athens,
Do a search for the sp_boardnews function in the Sources/PortalBlocks.php file, its already there, you don't need to add a new function. I would suggest that you edit the function that is already there. If you don't want to, then create a Custom PHP block and put the code in there.

Also, you shouldn't have so much whitespace within your function (every line is separated by a newline), if you have used an editor like notepadd, then don't, Notepad++ is far better.
SimplePortal 2.3.8 © 2008-2024, SimplePortal