| Author |
Message |
floobee
Joined: Apr 30, 2004
Posts: 4
Status: Offline
|
Posted:
Apr 30, 2004 - 01:42 PM |
|
hello, good day
well perhaps this is the wrong place to ask but i saw the pretty nice modules and blocks of pnconcept. So i decided to ask a request on a block - a centerblock which would be very helpful.
i am running a book-module for postnuke. It is called the pn-book, and i got it from the site here http://pn-mod-books.sourceforge.net
just want to know if it is possible to run a centerblock with this module.
I want to show more books than only one. Is it possible to show let me say 5 to 6 books
in a centerblock of this module. Like you can see it on the page http://www.preciogasolina.com - with the NukeAmazon-module.
there are the following blocks bundled within the postnuke-module, pn-books. The following ones:
randombook
i-topratedbook
i-lastbooks
popularxbooks
do you think that this is possible ? That would be supergreat! How should i hack a block to get a centerblock that fits the same behaviour like the block on http://www.preciogasolina.com
thanks for any help in advance.
Your Floobee,
here a code of the block that could be used for the hack - if you could give some guidelines or have some ideas that would be very good. I want to show 4 to 6 books in the centerblock! - is that possible.
Again - thanks for any help in advance!!
| Code: |
<?php // $Id: randombook.php,v 1.1 2002/10/05 15:02:27 fredb86 Exp $
// ----------------------------------------------------------------------
// BOOKS module
// Copyright (C) 2002 by Michael Schatz
// Written by Michael Schatz and Jason Levitt and Olivier Guillet
// Get the newest version at http://sourceforge.net/projects/pn-mod-books
// ----------------------------------------------------------------------
// POSTNUKE Content Management System
// Copyright (C) 2002 by the PostNuke Development Team.
// http://www.postnuke.com
// ----------------------------------------------------------------------
$blocks_modules['randombook'] = array(
'func_display' => 'random_books_block',
'text_type' => 'randombook',
'text_type_long' => 'Random Book',
'text_content' => 'Books',
'support_nukecode' => false,
'allow_create' => false,
'allow_delete' => false,
'form_url' => false,
'form_content' => false,
'form_refresh' => false,
'show_preview' => true
);
// Security
pnSecAddSchema('Booksblock::', 'Block title::');
function random_books_block($row) {
if (!pnSecAuthAction(0, 'Booksblock::', "$row[title]::", ACCESS_READ))
{
return;
}
$bookprefix = pnConfigGetVar('prefix');
$BooksModName = "books";
//Retrieve these module variables which were set in
//pninit.php
$booksdir=pnModGetVar('books','booksdir');
$imagesdir=pnModGetVar('books','imagesdir');
$blockcover=pnModGetVar('books', 'emptyimage');
$boxstuff = "<font class=\"pn-normal\"><center>";
$bkresult = mysql_query("select bkid, title, cover from $bookprefix"._books_books." ORDER BY rand() LIMIT 1");
while(list($bkid, $bktitle, $cover)=mysql_fetch_row($bkresult)) {
$bktitle = stripslashes($bktitle);
$transfertitle = ereg_replace (" ", "_", $bktitle);
// If there is no cover image in the database, use the dummy cover
if ($cover == "") {
$coverimg = $imagesdir.'/'.$blockcover;
} else { //Check for URL and fetch that
if (stristr($cover, "http")) {
$coverimg = $cover;
} else { //Use the cover image in the books directory
$coverimg = $booksdir.'/'.$cover;
}
}
$boxstuff .= "<a class=\"pn-menu\" href=\"modules.php?op=modload&name=$BooksModName&file=index&bkid=$bkid&ttitle=$transfertitle\"><img src=\"$coverimg\" border=\"0\" alt=\"\"></a><br>";
$boxstuff .= "<a class=\"pn-menu\" href=\"modules.php?op=modload&name=$BooksModName&file=index&bkid=$bkid&ttitle=$transfertitle\"><b>$bktitle</b></a><br>";
}
$boxstuff .= "</center></font>";
$row[content] = $boxstuff;
themesideblock($row);
}
?>
|
|
|
|
|
 |
Chestnut
Site Admin
Joined: Oct 08, 2003
Posts: 1065
Location: Paris - France
|
  Posted:
Apr 30, 2004 - 04:12 PM |
|
Hi Floobee and thanks for the nice words.
Is this still a need ? I just stumble on this : http://www.portalzine.de/Forum-t2867.html
So I figure you found it before I wake up.  |
_________________ Chestnut !
Administrator
PNConcept.com |
|
 |
 |
floobee
Joined: Apr 30, 2004
Posts: 4
Status: Offline
|
  Posted:
Apr 30, 2004 - 04:57 PM |
|
hello Chestnut,
thanks for the reply.
thanks for the posting - it is still necessary. I am in need of such a center-block.
But i played around with the code and tried to figure out a solution.
i try to verify the hack-solution at the weekend - if it fails then i will come back to get some more infos.
in the meanwhile many thanks !!
floobee, |
|
|
|
 |
|
|
| |