SimplePortal
Customization => Custom Coding => Topic started 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)
-
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
-
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
-
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.
-
I'm sorry but I did not understand what it means......if you want you can use "dummy"
-
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)
-
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
-
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.
$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.
-
thanks I hope . let you know
-
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
-
What is the syntax error, please?
-
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 ? :(
-
What happens when you preview the block?
Can you save the block?
-
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
-
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.
-
again
Fatal error: Function name must be a string in /var/www/vhosts/discusrewind.net/httpdocs/Sources/boxynews.php on line 40