1
burfodus
Code wont work in block
  • 2009/7/10 0:11

  • burfodus

  • Just popping in

  • Posts: 94

  • Since: 2008/9/2 1


Hello again guys.

im trying to put some php in a custom block, and its killing the page or just not displaying at all. Maybe one of you guys can tell me what im doing wrong.

im selecting php script in the custom block options, is that all i need to do?

$artid2 $_GET['artid'];

echo 
'<table>
<tr>
<td class=head>downloads area </td>
</tr>
<tr>
<td>'
;

$getportfolio mysql_query("SELECT * FROM ".$xoopsDB->prefix('dart_gallery')." WHERE artid = '$artid2' AND title = 'portfolio' ");
while (
$row1 mysql_fetch_array($getportfolio)) {
$filename $row1['filename'];
}
echo 
'<div id=buttonpoint><a href="gallery/artist'.$artid2.'/'.$filename.'">Portfolio</a></div>';   

$getshowreal mysql_query("SELECT * FROM ".$xoopsDB->prefix('dart_gallery')." WHERE artid = '$artid2' AND title = 'showreal' ");
while (
$row2 mysql_fetch_array($getshowreal)) {
$filename2 $row2['filename'];
}
echo 
'<div id=buttonpoint><a href="gallery/artist'.$artid2.'/'.$filename2.'">showreal</a></div>';  

$getresume mysql_query("SELECT * FROM ".$xoopsDB->prefix('dart_gallery')." WHERE artid = '$artid2' AND title = 'resume' ");
while (
$row3 mysql_fetch_array($getresume)) {
$filename3 $row3['filename'];
}
echo 
'<div id=buttonpoint><a href="gallery/artist'.$artid2.'/'.$filename3.'">Resumé</a></div>
</td>
</tr>
</table>'
;


thanks guys
XOOPS Version - XOOPS 2.3.2
PHP Version - 5.2.6
MySQL Version - 5.0.67-community
Server API Version - apache2handler
OS Version - WINNT

2
culex
Re: Code wont work in block
  • 2009/7/10 10:52

  • culex

  • Module Developer

  • Posts: 711

  • Since: 2004/9/23


Arabxoops has written a nice tool to make custom php blocks and modules

Try with this
http://www.xoopsnordic.org/modules/xwebtools/index.php?func=Block

together with this
http://www.xoopsnordic.org/modules/xw ... /index.php?func=HelpBlock
Programming is like sex:
One mistake and you have to support it for the rest of your life.

3
trabis
Re: Code wont work in block
  • 2009/7/10 12:51

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Maybe you need to add global $xoopsDB; at the top.

4
burfodus
Re: Code wont work in block
  • 2009/7/11 11:11

  • burfodus

  • Just popping in

  • Posts: 94

  • Since: 2008/9/2 1


yep trabis, that seemed to work, thanks.

sb..
XOOPS Version - XOOPS 2.3.2
PHP Version - 5.2.6
MySQL Version - 5.0.67-community
Server API Version - apache2handler
OS Version - WINNT

Login

Who's Online

55 user(s) are online (40 user(s) are browsing Support Forums)


Members: 0


Guests: 55


more...

Donat-O-Meter

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

Latest GitHub Commits