1
daniminas
PHP in a block
  • 2006/9/6 13:42

  • daniminas

  • Just popping in

  • Posts: 4

  • Since: 2006/8/11


Hi I need to make a php include() in a block.. i been try it the 'Php Script' block type, but the block don't appear!..

Please Help!

Thanks!

2
[suspendTempri[suspended]
Re: PHP in a block

Problem is probably in the path you inserted into include() function.

3
daniminas
Re: PHP in a block
  • 2006/9/7 12:35

  • daniminas

  • Just popping in

  • Posts: 4

  • Since: 2006/8/11


Not, if a use a empty block, or sample text.. etc.. NOTHING APPEARS!

PLEASE HELP

4
[suspendTempri[suspended]
Re: PHP in a block

Did you insert <?php ?> tags into block? Because they shouldn't be there.

5
Shelia
Re: PHP in a block
  • 2006/9/8 0:35

  • Shelia

  • Not too shy to talk

  • Posts: 140

  • Since: 2003/6/22


I too have tried to include php below in a custom block. If I removed <?php & ?> with php script enabled I'm sent back to the admin menu. If I leave it in and do a preview I see my block title and nothing else. The block doesn't show up.

<?php
include "./gallery/plugins/cpmfetch/cpmfetch.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_viewRandomMedia(6,1,2);
$objCpm->cpm_close();
?>

BTW - gallery is in my root directory not xoops

6
snow77
Re: PHP in a block
  • 2006/9/8 0:48

  • snow77

  • Just can't stay away

  • Posts: 864

  • Since: 2003/7/23


if you were to include the banner code in there it would be as php like this:

echo xoops_getbanner();


it works fine in this example. maybe you need to readjust the code just a little
www.polymorphee.com
www.xoopsdesign.com

7
Shelia
Re: PHP in a block
  • 2006/9/8 2:22

  • Shelia

  • Not too shy to talk

  • Posts: 140

  • Since: 2003/6/22


snow77,

I tried to troubleshoot my problem by placing XOOPS code in a custom block - it does work. I just can't get an a php include to work. I don't know enough about php coding to attempt to readjust the code, which is why I'm here asking for advice.

8
Shelia
Re: PHP in a block
  • 2006/9/10 20:00

  • Shelia

  • Not too shy to talk

  • Posts: 140

  • Since: 2003/6/22


Can anyone tell me why this code doesn't work?

include "./gallery/plugins/cpmfetch/cpmfetch.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_viewRandomMedia(6,1,2);
$objCpm->cpm_close();

Gallery is in root and I want to put the code in a custom block that shows 6 random images in a column.

9
[suspendTempri[suspended]
Re: PHP in a block

I see you didn't include file that contains functions. You can't just include all the functions etc of this gallery. I suggest you making a new query in a block that shows those pictures.

10
Shelia
Re: PHP in a block
  • 2006/9/12 16:45

  • Shelia

  • Not too shy to talk

  • Posts: 140

  • Since: 2003/6/22


Quote:
by Tempri on 2006/9/10 16:46:19 I see you didn't include file that contains functions. You can't just include all the functions etc of this gallery. I suggest you making a new query in a block that shows those pictures.


I don't understand what you're saying to me... the functions are in the cpmfetch.php file.

Login

Who's Online

217 user(s) are online (140 user(s) are browsing Support Forums)


Members: 0


Guests: 217


more...

Donat-O-Meter

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

Latest GitHub Commits