1
il_berry
Make a new block for CATADS
  • 2005/11/13 13:46

  • il_berry

  • Just popping in

  • Posts: 7

  • Since: 2005/11/13


Hi to everyone!
I'm trying to create a personalized block. It would have to show one product, random, from the database.
I've written the correct code in php. If I load it, not in a block, it's really ok!
But I don't know how to put the script in the fuction of the block!

Can someone help me, please?

This is the php script:
include '../../../mainfile.php';
include 
XOOPS_ROOT_PATH.'/header.php';

$link '../adsitem.php?ads_id='.$ads_id;

$sql "SELECT * FROM ".$xoopsDB ->prefix ("catads_ads")."  order by rand() limit 1  ";
$rs $xoopsDB ->query ($sql);
$row $xoopsDB ->fetchArray ($rs);
echo 
$row[ads_title]."
"
;
echo 
$row[ads_desc]."
"
;
echo 
".$link.">.$row[photo0].">";


This is the code of an empty block:

function vetrina_show($options) {

$block['content'] = '

'
;
    return 
$block;
}
?>


Thanks, bye.
Ste

2
il_berry
Re: Make a new block for CATADS
  • 2005/11/14 17:11

  • il_berry

  • Just popping in

  • Posts: 7

  • Since: 2005/11/13



I'm trying thousands of solution and reading a lot of topics but I dont't understand how to realize this block.
No one have five minute (I know that is hard) for this problem that I think should interest a lot of XOOPS users.
Searching in Google I don't find any tutorial near this question.
Thanks, bye

Login

Who's Online

472 user(s) are online (65 user(s) are browsing Support Forums)


Members: 0


Guests: 472


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Sep 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits