1
cydud3
PHP in blocks
  • 2005/6/20 4:45

  • cydud3

  • Just popping in

  • Posts: 50

  • Since: 2004/6/10


Hello...I'm trying to execute some php code that will display a random image on a right block on the top page. However, the block doesn't show up. Can the blocks handle PHP? I noticed that you can change the Content Type to PHP so I assume it could. However, I could not even display a simple "Hello World" script.

In particular, I'm trying to use CPMFetch to display my images. On a separate page, it works but when I transfer them to blocks, it doesn't. Has somebody gotten cpmfetch to work properly?

2
Watdehek
Re: PHP in blocks
  • 2005/6/20 5:57

  • Watdehek

  • Friend of XOOPS

  • Posts: 130

  • Since: 2005/2/21


You can use
{php}{/php}


See this manual.

3
m0nty
Re: PHP in blocks
  • 2005/6/20 6:04

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


remove the tags as they aren't needed when selecting block type as php

aren't needed in that case..

4
m0nty
Re: PHP in blocks
  • 2005/6/20 6:14

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


also i have got cpmfetch working to show coppermine gallery random images in a block on xoops.

all i have in the block of XOOPS is

include XOOPS_ROOT_PATH.'/cpmfetch/randomimage.php';


the cpg gallery is in a folder called gallery inside the XOOPS root folder.

cpmfetch is also a subdir of XOOPS root.

u can see it working at http://www.bbtb.co.uk

5
cydud3
Re: PHP in blocks
  • 2005/6/20 6:27

  • cydud3

  • Just popping in

  • Posts: 50

  • Since: 2004/6/10


Thanks for the suggestion of doing an include instead. I tried it and it seems to be working. However, my thumbnails are much smaller than yours. Do you know how I can make this a bit bigger? How big are your thumbnails (in pixels)? It seems to be the right size that I need.

6
m0nty
Re: PHP in blocks
  • 2005/6/20 6:30

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


it uses the thumbnail size defined in your cpg admin.. mine is set at 140

7
cydud3
Re: PHP in blocks
  • 2005/6/20 6:43

  • cydud3

  • Just popping in

  • Posts: 50

  • Since: 2004/6/10


Thank you...I will try that.

By the way, do you know how to make the images display in the center of the block? I tried adding the
<center>center>

codes but they don't seem to work.

8
Daethian
Re: PHP in blocks
  • 2005/7/13 5:56

  • Daethian

  • Quite a regular

  • Posts: 305

  • Since: 2005/3/4 1


I tried both options in this thread and still can't get the images to show up. Any idea what I'm doing wrong??
hhttp://www.artfire.com/daethian
My Artfire store- Vintage Jewelry and New Bead Jewelry

9
Daethian
Re: PHP in blocks
  • 2005/7/13 6:16

  • Daethian

  • Quite a regular

  • Posts: 305

  • Since: 2005/3/4 1


Quote:

m0nty wrote:
also i have got cpmfetch working to show coppermine gallery random images in a block on xoops.

all i have in the block of XOOPS is

include XOOPS_ROOT_PATH.'/cpmfetch/randomimage.php';


the cpg gallery is in a folder called gallery inside the XOOPS root folder.

cpmfetch is also a subdir of XOOPS root.

u can see it working at http://www.bbtb.co.uk


I have my gallery and cpmfetch installed at root level.
hhttp://www.artfire.com/daethian
My Artfire store- Vintage Jewelry and New Bead Jewelry

Login

Who's Online

245 user(s) are online (138 user(s) are browsing Support Forums)


Members: 0


Guests: 245


more...

Donat-O-Meter

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

Latest GitHub Commits