SimplePortal

Customization => Custom Coding => Topic started by: fdr77 on August 17, 2010, 11:27:45 AM

Title: Side by side posts/articles (was: Blocks in Blocks)
Post by: fdr77 on August 17, 2010, 11:27:45 AM
hello i'm an italian boy very interesting this modification but I ask whether you can make it work with the articles .....two articles left and right in the column central
 
 
-------
Originally part of the Blocks in Blocks thread  at http://simpleportal.net/index.php?msg=36355 (http://simpleportal.net/index.php?msg=36355)
Title: Re: Side by side posts/articles
Post by: fdr77 on August 17, 2010, 12:00:36 PM
hy riji the id block.... are changing the same block
for example
discusrewind.net/index.php?action=manageportal;area=portalblocks;sa=edit;block_id=32;sesc=4058a6d8407600d36965be2e04eeff65
32 is the id blok
Title: Re: Side by side posts/articles
Post by: Raji on August 17, 2010, 12:36:14 PM
Thanks FDR77 for your prompt reply. Now please can you tell me how can I use two articles in two blocks?
means i want to use sp in following way

LEFT BLOCK, 1 ARTICLE, 2 ARTICLE, RIGHT BLOCK
LEFT BLOCK, 3 ARTICLE, 4 ARTICLE, RIGHT BLOCK
LEFT BLOCK, 5 ARTICLE.................,  RIGHT BLOCK
LEFT BLOCK, FOOTER BLOCK.........., RIGHT BALOCK

Looking forward for your response

with regards
Raji
Title: Re: Side by side posts/articles
Post by: AngelinaBelle on August 17, 2010, 01:07:16 PM
Raji and fdr77:
 
If I were you, I would divide and conquer these problems.
 
One part of the problem -- get your blocks set up the way you want them. You can use "dummy" blocks to fill the places as you work on this, if you want.
 
Second part of the problem -- create blocks with single posts in them.
 
Then, put the two parts together.
 
This is an interesting problem that should probably be discussed in the customization board.
One possible solution for Raji's problem is the "boxynews" idea I did a little work on a couple of months ago -- it works like board news in blocky-looking blocks, but without the rounded corners because I could not get the CSS to work out just exactly right. http://simpleportal.net/index.php?topic=5248.msg33656#msg33656 (http://simpleportal.net/index.php?topic=5248.msg33656#msg33656)
 
You could do the same with articles, to create an sp_boxyarticles function.
 
With either of these two approaches, you don't need to use blocks within blocks at all.
 
Or, you could fetch individual posts with ssi_fetchPosts. Then you might wind up using blocks within blocks.
Title: Re: Side by side posts/articles
Post by: fdr77 on August 17, 2010, 02:52:25 PM
I'm sorry but I did not understand what it means......if you want you can use "dummy"
Title: Re: Side by side posts/articles
Post by: AngelinaBelle on August 18, 2010, 09:47:58 AM
I'm sorry but I did not understand what it means......if you want you can use "dummy"
"Dummy" a fake thing standing in for the real thing (like manichino). If the blocks for the articles do not exist so far, you can use some other blocks to work your blocks-in-blocks layout.
 
Later, when you have created blocks for each post you want, you can use them in place of the "dummy" blocks.
 
Make sense?
 
However, I think there is an easier way, because you do not want to hand-craft a block for each article.  I think something like boxynews will work better.  Please feel free to take that code and modify it to suit your needs.  http://simpleportal.net/index.php?topic=5248.msg33656#msg33656 (http://simpleportal.net/index.php?topic=5248.msg33656#msg33656)
Title: Re: Side by side posts/articles (was: Blocks in Blocks)
Post by: fdr77 on August 18, 2010, 12:51:48 PM
thank you but are unable to change the php boxy_news in boxy_articoli.
Thanks also
Ps file boxy-news should be put in the root directory or in one of the theme in use
Title: Re: Side by side posts/articles (was: Blocks in Blocks)
Post by: AngelinaBelle on August 18, 2010, 04:31:36 PM
If you put boxynews.php in Sources, then you could make a custom php block
For this custom php block, you should choose no title and no body.
Code: [Select]
$boards=array(1,2,3); // put the board ids of all the boards you want to show
$parameters = array(
     'length' => 250,
     'start' => 0,
     'limit' => 18,
     'per_page' => 9,
     'per_row' => 3,
 
// don't change anything after this point
 
     'board' => implode('|', $boards),
);
 
global $sourcedir;
include_once($sourcedir . '/boxynews.php');
sp_boxyNews($parameters, 0, false);

You can find the ids of the boards you want by clicking on that board and looking at the"board=" part of the url.
 
------
edit: fixed typo in include_once line.
Title: Re: Side by side posts/articles (was: Blocks in Blocks)
Post by: fdr77 on August 19, 2010, 09:17:29 PM
thanks I hope . let you know
Title: Re: Side by side posts/articles (was: Blocks in Blocks)
Post by: fdr77 on August 23, 2010, 07:00:08 PM
in this url where is the id
.....discusrewind.net/index.php/board,38.0.html

the id is "38"

continues to give me syntax error
Title: Re: Side by side posts/articles (was: Blocks in Blocks)
Post by: AngelinaBelle on August 24, 2010, 06:55:03 AM
What is the syntax error, please?
Title: Re: Side by side posts/articles (was: Blocks in Blocks)
Post by: fdr77 on August 24, 2010, 08:12:07 PM
I enter the code in the block and I answered so

Syntax error in block code. Please check the code.

However today I installed pretty urls and the id board I do not see more
How can I do ? :(
Title: Re: Side by side posts/articles (was: Blocks in Blocks)
Post by: AngelinaBelle on August 25, 2010, 09:24:48 AM
What happens when you preview the block?
Can you save the block?
Title: Re: Side by side posts/articles (was: Blocks in Blocks)
Post by: fdr77 on August 25, 2010, 11:03:18 AM
The prewiev of block php

Fatal error: Call to undefined function sp_boxyNews() in /var/www/vhosts/discusrewind.net/httpdocs/Sources/PortalBlocks.php(3444) : eval()'d code on line 16

Boxynews is in /httpdocs/Sources

The file in use is this
Title: Re: Side by side posts/articles (was: Blocks in Blocks)
Post by: AngelinaBelle on August 25, 2010, 04:35:47 PM
This error message tells me the file was not included.
And that's -- because of a typo in my post above.
I've fixed it.  Please try again.
Title: Re: Side by side posts/articles (was: Blocks in Blocks)
Post by: fdr77 on August 25, 2010, 09:18:49 PM
again
Fatal error: Function name must be a string in /var/www/vhosts/discusrewind.net/httpdocs/Sources/boxynews.php on line 40
SimplePortal 2.3.8 © 2008-2024, SimplePortal