xoops forums

RJ-45

Just popping in
Posted on: 2007/3/19 18:25
RJ-45
RJ-45 (Show more)
Just popping in
Posts: 53
Since: 2005/1/30
#1

Change image with the module

Hi

I want to divide the site in 2. In the first the data (text, images, buttons) and in the other, a image, but this image is different to each module

I think there are som PHP code that check the module we are, and then change de image, and insert it in the theme html file. However, I don't know PHP :(

The other way I think is to edit the template of each module, but It is a hard work

Thanks ;)
My Blog about Xoops: http://blog.eme3design.es

fooups

Just popping in
Posted on: 2007/3/19 19:11
fooups
fooups (Show more)
Just popping in
Posts: 82
Since: 2004/1/12
#2

Re: Change image with the module

Hi,

the third option is to use the PictureURL module.

Bye.

RJ-45

Just popping in
Posted on: 2007/3/27 15:08
RJ-45
RJ-45 (Show more)
Just popping in
Posts: 53
Since: 2005/1/30
#3

Re: Change image with the module

Thanks you very much

This module is what I'm looking for. However, It doesn't work.

I'm trying with all version, and when I enter in the module and upload some images, the Create image section is empty:

http://img399.imageshack.us/img399/7039/xoopdssstp5.gif

And when I insert the xoops_imageurl variable, then Smarty display an error because this variable is not recognised.

I'm hack the header.php file like help of the module

Can you help me?

Thanks
My Blog about Xoops: http://blog.eme3design.es

rowdie

Just can't stay away
Posted on: 2007/3/27 18:55
rowdie
rowdie (Show more)
Just can't stay away
Posts: 846
Since: 2004/7/21
#4

Re: Change image with the module

You don't need to hack php files, or to use a module With XOOPS 2.0.16 you can do this using Smarty tags in your theme.html file.

e.g. you could use something like this:
<img class="<{$xoops_dirname}>" src="<{$xoops_imageurl}>modules/<{$xoops_dirname}>/logo.png" alt="" />


The <{$xoops_dirname}> tag contains the name of the current module, or 'system' if you are on a non-module page.

So the example above expects to find the image in:

http://yoursite.com/themes/yourtheme/modules/system/logo.png
http://yoursite.com/themes/yourtheme/modules/newbb/logo.png

depending on which modules you have installed and which page you are viewing.

The example also assigns a separate css class for each module, so you can use different style rules for each image if you want to. Just add some css code to an included .css file, something like this:
img.system {
    
put css rules here
}

img.newbb {
    
put css rules here
}

This is just an example to get you started, play with the example until you find the best solution for you

Rowd