Plugin: Random Background main page

johangafvels / 2010-10-25 13:44:07   

Sorry for the dubbelpost :P

keevin0909 / 2010-10-26 09:12:10   

Hi there, i've downloaded the plugin and and made the changes as per instruction. The random background images worksbut it doesn't cover the whole screen and i'm getting the below javascript error

Webpage error details

Message: 'style' is null or not an object
Line: 9
Char: 5
Code: 0
URI: http://www.darrenbonello.com/ndxz-studio/site/js/full_background.js.

i've check the css the class #the-background has been define, not really sure what going on can someone please help.

www.darenbonello.com

cheers

arsondpi / 2010-10-26 14:03:44   

...this works if you update the current version of jquery - be careful though you may need to update the thickbox plugin cause it won't work.

keevin0909 / 2010-10-26 16:16:35   
  1. function rnd_full_background($folder='')
  2. {
  3.     
  4. ¬†¬†¬†¬†// this is for global file handling:
  5.     
  6. ¬†¬†¬†¬†global $rs;
  7.     
  8. //¬†¬†¬†¬† ¬†¬†¬†¬†the following (inactive) if-rule makes the random image choice affect only the home site "/". 
  9. //¬†¬†¬†¬†¬†¬†¬†¬†if you want this to be the case, uncomment lines 29-30 & don't forget to un-comment the corresponding bit at the end
  10. //¬†¬†¬†¬†¬†¬†¬†¬†of the plugin!¬†¬†¬†¬†¬†¬†¬†¬†
  11.         
  12. ¬†¬†¬†¬†¬†¬†¬†¬†if ($rs['url'] == '/')
  13.         {

//        Here we check whether there is a background defined in indexhibit cms and if so, scale it.
                
        if ($rs['bgimg'] != '') {
        //     here, we get the dimensions of the browser window for the image
            $size = getimagesize(DIRNAME . '/files/' . $rs['bgimg']);
        //    ..and make a html tag of it.    
            return "";
        }    
        
//        if there isn't a set image, well take a rondom one.
        else
        {
            // get the images from the specified folder (thanks, Vaska!)
            $path = DIRNAME . "/$folder/";

            if (is_dir($path))
            {
                if ($fp = opendir($path))
                {
                    while (($module = readdir($fp)) !== false)
                    {
                        if ((eregi("jpg$", $module)) || (eregi("gif$", $module)) || (eregi("png$", $module)))
                        {
                            $images[] = $module;
                        }
                    }
                }
                closedir($fp);
            }

            $image = count($images);
            $rand = rand(0, $image-1);

            $show = BASEURL . "/$folder/" . $images[$rand];

            // get the dimensions (Note the variable show being used for the url to the rnd image)
            $size = getimagesize($show);
            return "";

        // I decided to comment out the output of the $style, since the image is not set as background picture
        // but just a regular . This would be a nice place to input some style, though.
        
            // Vaska says: this 215px setting may need to be adjusted if you have altered your Index in the template
            // $style = "body { background: url($show) no-repeat #333 0 0 }\n";
            // return $style;

// !!! See line 19: Don't forget to un-comment this following bit, (74-76) if you want the randomness only on the main page!!!

//         }
//        else
//        {
        }
        return;
        }

}

Thats the one i'm using isn't it the latest one?

vikki / 2010-12-02 09:55:50   

My site was working perfectly and then I added this plugin. The plugin works perfectly but has somehow disabled my expanding menu and randomly the link to the blog which was added in the post nav text box. Double checked the code for the menu and link to the blog and everything looks the same as it did before I added the background plugin.

Really stuck and no clue why this has happened, any help would be great.

Thxs

http://www.fearlesslyfrank.com/

vikki / 2010-12-02 11:16:31   

In fact no external links work???

carmesine / 2010-12-14 06:09:38   

I've placed the code in the line 28 of my index.php inside the folder sample, inside site...

with this code:



and I placed the plugin on the plugin folder...
and the folder on the root, directly inside my folder Public.

Did I've made something wrong? as it is not working...

Thank you very much for your help and for the template. I love it.

  1. www.carmesine.com<strong></strong><em></em><blockquote></blockquote>
ftm / 2011-01-03 06:47:13   

Hello,

Trying to get this plugin to work and stumbled at first hurdle! - where in my root folder do I load my images to? - can't seem to find a background folder.

any help greatly appreciated

thanks!

zema / 2011-01-31 15:15:47   

Hello everyone, great plugin!
I would like to show the background images in every pages of my site, any suggestions?

thanks!

zema / 2011-01-31 15:17:31   

Hello everyone, great plugin!
I would like to show the background images in every pages of my site, any suggestions?

thanks!

noemicaruso / 2011-01-31 15:48:40   

ciao zema could you explain me ho you did your background images???...I'm really bad and I need a step by step!

thanks a lot!

zema / 2011-01-31 16:05:44   

ciao noemi, ho seguito le istruzioni ed è andato.

copia questo

plug:ndxz_rand_bg 'files/rndm_imgs','false' nella pagina index.php del tuo tema

al posto di 'backgrounder'.

'files/rndm_imgs': è il percorso della cartella (rndm_imgs) dove ho messo le immagini, ovvero nella cartella files

'false': è il parametro per non visualizzare lo sfondo ripetuto, se lo vuoi ripetuto devi scrivere 'true'.

spero di esserti stato d'aiuto, io non sono troppo ferrato, non so come ci son riuscito!

cristinatorres / 2011-02-03 05:33:28   

I've had installed the plugin, and It appears this error in my webpage:

Parse error: syntax error, unexpected ':' in /homepages/1/d321491657/htdocs/proves/ndxz-studio/site/plugin/plugin.ndxz_rand_bg.php on line 49

check the web:www.hrsolimar.es

Can somebody help me? thanks!

cristinatorres / 2011-02-03 05:34:10   

I've had installed the plugin, and It appears this error in my webpage:

Parse error: syntax error, unexpected ':' in /homepages/1/d321491657/htdocs/proves/ndxz-studio/site/plugin/plugin.ndxz_rand_bg.php on line 49

check the web:www.hrsolimar.es

Can somebody help me? thanks!

katu / 2011-02-04 16:41:39   


thanks to indexhibit!!! great, I started from zero and came a bit further :-)

my site: www.salonsurplus.org (link under contact)

I installed the random- background- plugin, it works, but I want the background also behind the menu (full- browser), but it doesn´t work. (backgroundcolor is transparent)
any remarks?

katu / 2011-02-04 16:43:19   

oh yeah...the link:

salonsurplus

katu / 2011-02-05 05:56:09   

SORRY...NEVERMIND! I solved it (because I used wrong style- sheet)

gcolefla / 2011-02-17 09:00:10   

I fixed the error in the random background plugin to allow for the correct tiling of images without further modification.

Random Background Fixed

Install information copied and updated from top of this thread.

How to install?
Download and add the plugin into your /ndxz-studio/site/plugin folder.

You need to edit your template's index.php file in a text or code editor.

  1. Replace the 'backgrounder' plugin on line 29 
  2. <plug:backgrounder color='... />
  3. with
  4. <plug:ndxz_rand_bg folder_name,tiling >
  5.  
  1. corect examples would be examples would be 
  2. <plug:ndxz_rand_bg http://yoursite.com/files/randomBG,false /> 
  3. or 
  4. <plug:ndxz_rand_bg /files/randomBG,true /> 
  5.  

in the examples above, /randomBG would be a folder of images created in /files (a folder shown in the root directory

gcolefla / 2011-02-17 09:00:32   

I fixed the error in the random background plugin to allow for the correct tiling of images without further modification.

Random Background Fixed

Install information copied and updated from top of this thread.

How to install?
Download and add the plugin into your /ndxz-studio/site/plugin folder.

You need to edit your template's index.php file in a text or code editor.

  1. Replace the 'backgrounder' plugin on line 29 
  2. <plug:backgrounder color='... />
  3. with
  4. <plug:ndxz_rand_bg folder_name,tiling >
  5.  
  1. corect examples would be examples would be 
  2. <plug:ndxz_rand_bg http://yoursite.com/files/randomBG,false /> 
  3. or 
  4. <plug:ndxz_rand_bg /files/randomBG,true /> 
  5.  

in the examples above, /randomBG would be a folder of images created in /files (a folder shown in the root directory

BrendanRyan / 2011-02-19 03:58:33   

I'm having no luck with this! Is there anyway some other code could be conflicted with it? I can't see how I could have gone wrong on the installation, but have been chipping and adding to the index.php and style.css?

www.brendanryan.ie

BrendanRyan / 2011-02-20 14:32:30   

Nevermind! ROOT FOLDER!!!

The "Fixed" plugin was behaving oddly though so I reverted to the old one & changed the trues to false.

The top half of the image was off screen.

gcolefla / 2011-02-24 18:04:27   

I made an error in the code, I forgot I was playing around with some centering and forgot to revert back to the original. The file has been updated, should work now. It will load a random background at the normal location. Sorry about that, Thanks for testing it for me.

zematz / 2011-05-04 13:24:19   

Hi all,
I just don't get it
Here is my installation but i've nothing

I put "plugin.ndxz_rand_bg.php" here :
mysite.fr/ndxz-studio/site/plugin

I changed the code in this file :
mysite.fr/ndxz-studio/site/sample/index.php

For that in line 28 :
plug:ndxz_rand_bg http://www.mysite.fr/files/rndm_imgs,false

I created a folder here with my random images :
mysite.fr/files/rndm_imgs

I've several images in there but i just don't see them in my main page.

http://www.mathieulagarderephoto.fr/

Any tips ?
Thanks
Mat

albertom / 2011-05-09 11:37:50   
I wrote this code in index.php ,
but I would like the image is not repeated http://www.serenaclessi.com/

Thanks

albertom / 2011-05-09 11:38:55   

I wrote this code in index.php plug:ndxz_rand_bg files/bg,false,
but I would like the image is not repeated http://www.serenaclessi.com/

collie / 2011-05-28 18:40:17   

I still don't understand.

Whenever I look at my index.php text file I can't see what the "old" backgrounder plugin should look like?

I'm looking at the index.php file from the plugins directory, the current snippet of code I'm looking to replace is: (/site/plugin/index.php)

// background image is fixed attachment
function backgrounder($color='', $img='', $tile='')
{
    if (($color == '') && ($img = '')) return;
    
    $style = (strtolower($color) != 'ffffff') ? "background-color: #$color;" : '';
    
    $tile = ($tile != 1) ? 'no-repeat' : 'repeat';
    
    $style .= ($img != '') ? "nbackground-image: url(".BASEURL."/files/$img);nbackground-repeat: $tile;nbackground-position: 215px 0;nbackground-attachment: fixed;n" : '';
    
    // nothing to add
    if ($style == '') return;

    return "nbody { $style }n";
}

So I replace all this with the new piece of code? For example pasting this in:

It doesn't seem to work for me, I can't find any bits of code with plug: in there either?

collie / 2011-05-28 18:52:23   

Basically I can fix this but every index.php file I've looked at I simply cannot find

plug:backgrounder

It's not on line 29??

05531N / 2011-05-30 05:45:53   

Hello, I have already installed the random background image plugin without a problem, but still I can't change the background color, It remains in white even tough I already add the pieces of code posted in this thread before to modify it. Any clues?

Here is the correspondent link:

http://marybijoucabaret.co.cc/main/Webpage

05531N / 2011-05-30 05:46:10   

Hello, I have already installed the random background image plugin without a problem, but still I can't change the background color, It remains in white even tough I already add the pieces of code posted in this thread before to modify it. Any clues?

Here is the correspondent link:

http://marybijoucabaret.co.cc/main/Webpage

collie / 2011-05-30 23:10:30   

Finally! I didn't click that the theme I was working on was the wrong one!

http://christophercollie.com/

However, the image doesn't auto scale? I thought it did?

Soldeus / 2011-06-05 07:16:40   
  1. Hi Vaska, im trying to use this plugin on a website im working on. I did all the things like you say in the installing guide. Uploaded the plugin, changed the Sample/index.php backgrounder plugin to:
  2. <plug:ndxz_rand_bg 'files/image',false />
  3. but it doesnt seem to work. The images have no strange characters(just uppercase, and numbers). Any idea?

Thanks for your help.

pernin / 2011-06-05 07:26:29   

url?

Soldeus / 2011-06-05 07:56:19   
  1. Hi Vaska, im trying to use this plugin on a website im working on. I did all the things like you say in the installing guide. Uploaded the plugin, changed the Sample/index.php backgrounder plugin to:
  2. <plug:ndxz_rand_bg 'files/image',false />
  3. but it doesnt seem to work. The images have no strange characters(just uppercase, and numbers). Any idea?

The website is : www.restaurantecasaagustin.es
Thanks for your help.

Soldeus / 2011-06-05 07:56:33   
  1. Hi Vaska, im trying to use this plugin on a website im working on. I did all the things like you say in the installing guide. Uploaded the plugin, changed the Sample/index.php backgrounder plugin to:
  2. <plug:ndxz_rand_bg 'files/image',false />
  3. but it doesnt seem to work. The images have no strange characters(just uppercase, and numbers). Any idea?

The website is : www.restaurantecasaagustin.es
Thanks for your help.

Soldeus / 2011-06-05 07:56:50   
  1. Hi Vaska, im trying to use this plugin on a website im working on. I did all the things like you say in the installing guide. Uploaded the plugin, changed the Sample/index.php backgrounder plugin to:
  2. <plug:ndxz_rand_bg 'files/image',false />
  3. but it doesnt seem to work. The images have no strange characters(just uppercase, and numbers). Any idea?

The website is : www.restaurantecasaagustin.es
Thanks for your help.

Soldeus / 2011-06-05 07:57:16   
  1. Hi Vaska, im trying to use this plugin on a website im working on. I did all the things like you say in the installing guide. Uploaded the plugin, changed the Sample/index.php backgrounder plugin to:
  2. <plug:ndxz_rand_bg 'files/image',false />
  3. but it doesnt seem to work. The images have no strange characters(just uppercase, and numbers). Any idea?

The website is : www.restaurantecasaagustin.es
Thanks for your help.

Soldeus / 2011-06-05 08:01:22   

omfg, sorry por this uber multipost, first time posting here and appeared and error So I though I didnt post anything :S

hhasan / 2011-07-27 18:39:52   

So I read through all the posts (perhaps not entirely carefully) but I can't find a certain issue I'm having.

My background randomly scales, and I've checked the plugin code as well as the index.php for my template (Sample). If you hit the reload button (or command/control R) and see the reloading action, you'll notice how the images randomly scale. This is annoying, and no one else seems to have this problem.

What do you all think the problem could be? Thanks for all the help, and excellent forum community out there.

My site is at hhasan.com.

gsadesign / 2011-07-29 12:23:10   

Hello all...

I have done everything I can find to make the random background plug-in work on this site - http://www.davidbenzler.com

I am trying to get it to look like this site, with the homepage image rotating - http://alexkopps.com/

The plug-in keeps repeating the background, even though I have it set as 'false'.

Please let me know any ideas you have.
I REALLY appreciate it.

Thanks, Geoff

golgoth13 / 2011-08-04 01:03:57   

@David:
did you edit the original plugin ? line 46
from: $tile = ($tile == true) ? 'repeat' : 'no-repeat' etc.
to: $tile = ($tile == "true") ? 'repeat' : 'no-repeat' etc.

golgoth13 / 2011-08-04 01:04:38   

@David:
did you edit the original plugin ? line 46
from: $tile = ($tile == true) ? 'repeat' : 'no-repeat' etc.
to: $tile = ($tile == "true") ? 'repeat' : 'no-repeat' etc.

golgoth13 / 2011-08-04 02:15:06   

for people like me, having a pain in the ass struggling since days to fix the tiling and white background issues, I attempt to release a 1.0.2 fixed version, following 1.0.1 fixed version by gcolefa.
So there you have to edit the plugin in order to have the desired background color...
Enjoy people !
plugin.ndxz_rand_bg_fixed

danielamr / 2011-08-31 11:18:20   

Hello everybody, hello Vaskia,

I think I follow the instructions, but I don't see it doesn't work on my website

I put "plugin.ndxz_rand_bg.php" in my ftp application :
ndxz-studio/site/plugin

I changed the code in the file :
ndxz-studio/site/sample/index.php

For that in line 28 :
plug:ndxz_rand_bg http://www.mysite.com/files/random,true
I also tried this :
plug:ndxz_rand_bg random,true
and also different combinaisons

I created a folder here with my random images :
mysite.com/files/random

I can't see any image on my main page, and now I even can't see the others sections.
I have this message :
Fatal error: Call to undefined function backgrounder() in /homez.424/danielam/www/ndxz-studio/site/plugin/plugin.ndxz_rand_bg.php on line 54

Do you have an idea please??

Thank you,

www.danielamacerossiter.com

danielamr / 2011-08-31 11:18:36   

Hello everybody, hello Vaskia,

I think I follow the instructions, but I don't see it doesn't work on my website

I put "plugin.ndxz_rand_bg.php" in my ftp application :
ndxz-studio/site/plugin

I changed the code in the file :
ndxz-studio/site/sample/index.php

For that in line 28 :
plug:ndxz_rand_bg http://www.mysite.com/files/random,true
I also tried this :
plug:ndxz_rand_bg random,true
and also different combinaisons

I created a folder here with my random images :
mysite.com/files/random

I can't see any image on my main page, and now I even can't see the others sections.
I have this message :
Fatal error: Call to undefined function backgrounder() in /homez.424/danielam/www/ndxz-studio/site/plugin/plugin.ndxz_rand_bg.php on line 54

Do you have an idea please??

Thank you,

www.danielamacerossiter.com

danielamr / 2011-08-31 11:18:56   

Hello everybody, hello Vaskia,

I think I follow the instructions, but I don't see it doesn't work on my website

I put "plugin.ndxz_rand_bg.php" in my ftp application :
ndxz-studio/site/plugin

I changed the code in the file :
ndxz-studio/site/sample/index.php

For that in line 28 :
plug:ndxz_rand_bg http://www.mysite.com/files/random,true
I also tried this :
plug:ndxz_rand_bg random,true
and also different combinaisons

I created a folder here with my random images :
mysite.com/files/random

I can't see any image on my main page, and now I even can't see the others sections.
I have this message :
Fatal error: Call to undefined function backgrounder() in /homez.424/danielam/www/ndxz-studio/site/plugin/plugin.ndxz_rand_bg.php on line 54

Do you have an idea please??

Thank you,

www.danielamacerossiter.com

danielamr / 2011-08-31 11:19:55   

Hello everybody, hello Vaskia,

I think I follow the instructions, but I don't see it doesn't work on my website

I put "plugin.ndxz_rand_bg.php" in my ftp application :
ndxz-studio/site/plugin

I changed the code in the file :
ndxz-studio/site/sample/index.php

For that in line 28 :
plug:ndxz_rand_bg http://www.mysite.com/files/random,true
I also tried this :
plug:ndxz_rand_bg random,true
and also different combinaisons

I created a folder here with my random images :
mysite.com/files/random

I can't see any image on my main page, and now I even can't see the others sections.
I have this message :
Fatal error: Call to undefined function backgrounder() in /homez.424/danielam/www/ndxz-studio/site/plugin/plugin.ndxz_rand_bg.php on line 54

Do you have an idea please??

Thank you,

www.danielamacerossiter.com

danielamr / 2011-08-31 11:25:47   

...sorry for the "invasion", it didn't look like it was working, now i see it did!

gf / 2011-09-01 00:12:23   

Hi danielamr,
What combination did you put at last for the line 28?
I have some trouble going through my code.
Thanks

Webpage

danielamr / 2011-09-02 07:08:14   
Higf,
i wrote :

do you understand the problem?
thank you!
Nin / 2011-11-20 05:01:49   

Ok, this is so frustrating!!!

I can't get this plugin working!!
My picture is full background but the size is not the good one (it's cropped!?)

I tried to edit the:

  1.  $style = "body { background: url($show) $tile;nbackground-position: 215px 0; }n";
  2.         return $style;
  3. to "0px 0px" but nothing changed!

Here's my website...

If anyone has an answer...

"The exhibition fortmat" ndxz_rand_bg doesn't even show up!

Thx!

This thread has been closed, thank you.