xoops forums

hydrO

Not too shy to talk
Posted on: 2006/9/28 16:42
hydrO
hydrO (Show more)
Not too shy to talk
Posts: 105
Since: 2004/1/8 8
#1

Showing a block in one of the template files?

Hi,

I wonder if it is possible for me to display Xcgal random pictures just below every picture. I dont' want it to appear as a block, as I have too many blocks at the moment and I want to place these random pics only under single pictures.


Pictures are displayed using xcgal_display.html template file, and I want to place the random picture codes in that file so it appears just below the picture.

I could't find the right codes from any of the files in the module.

Does anyone have an idea?
Download Dhivehi mp3s
www.gnatoll.com

hydrO

Not too shy to talk
Posted on: 2006/9/29 7:09
hydrO
hydrO (Show more)
Not too shy to talk
Posts: 105
Since: 2004/1/8 8
#2

Re: Showing a block in one of the template files?

bump * * *
Download Dhivehi mp3s
www.gnatoll.com

hydrO

Not too shy to talk
Posted on: 2006/10/23 17:37
hydrO
hydrO (Show more)
Not too shy to talk
Posts: 105
Since: 2004/1/8 8
#3

Re: Showing a random block in xcgal template files?

Just making it a little clear.

There is a feature in xCgal which can be used to show random pics as a block.

I would like to show these random pictures right below each picture.

I know a way to go around by showing the Center blocks below the pictures in the module.

I was wondering if there is an easier way to do this by modifying the codes in xcgal templates file.

Any help would be greatly appreciated.
Download Dhivehi mp3s
www.gnatoll.com

kaotik

Just can't stay away
Posted on: 2006/10/23 17:59
kaotik
kaotik (Show more)
Just can't stay away
Posts: 861
Since: 2004/2/19
#4

Re: Showing a block in one of the template files?

You can do it relativly easy:
place this inside the template where you want the random image to appear:
<img src="<{$random_img}>" alt="<{$random_img_alt}>">

Now go into the php file that calls this template file. You are going to create a function inside this file that will have it's result assigned to $random_img using :
$xoopsTpl->assign('random_img',$random_img);
Open the file that controls the random image block (located in folder xCgal/Blocks, Use that code inside your own function. You might have to change the var that gets returned, remeber that you want an image

This is just a general aproach on how to do it. You will now have to dig into the code to figure out precisly how to make it work.