Indexhibit
Index + Exhibit

Login:

Created by
Daniel Eatock
Jeffery Vaska
And You

Indexhibit was updated to version 2.1.4 on April 10, 2017.

Plugin: Random Background main page

 

Indexhibit version: Legacy
Thread is not resolved.

Vaska A
UNITED STATES
10 year(s) ago
Permalink Post

I've released the random background for the main page plugin. This is a slightly advanced plugin, but is not difficult to use.

What does it do?
It places a random image into the background on the main page of your site.

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

You need to edit your template in a text editor. Replace the 'backgrounder' plugin with:

<plug:ndxz_rand_bg folder_name,tiling />

folder_name: name of the folder which holds your images (you need to use ftp to place them).

tiling: 'true' for tiling...'false' for no tiling (big images).

Save your changes, test it. Be sure you have the name of the folder correct.

This is a slightly experimental plugin. If it does not work the first place you should check is on the name of the path to your images folder. Some servers may have difficulty finding this folder...if this is the case, use a hard-coded path.

Download @: plugin.ndxz_rand_bg.php.zip

Vaska A
UNITED STATES
10 year(s) ago
Permalink Post

Demo page

Refresh the page a few times.

moodie
AUSTRALIA
10 year(s) ago
Permalink Post

Hey Vaska,

I've played around with this, but so far no luck. this is my code:

I made a folder in the files folder called 'random' which has my images in it, but am unsure as to where I am referencing the folder from? is it from the template file (which i am assuming is my index file in with the theme), or the index.php in the root directory?

thanks, aaron

moodie
AUSTRALIA
10 year(s) ago
Permalink Post

code isn't posting

(plug:ndxz_rand_bg files/random,false /)

Vaska A
UNITED STATES
10 year(s) ago
Permalink Post

Something really isn't right there. It's not even producing the output. You sure the plugin is loaded into the plugin folder?

moodie
AUSTRALIA
10 year(s) ago
Permalink Post

i don't know what i did, but the plugin wasn't there ... its working now, though its tiling body bg and the 'false' isn't working ...

moodie
AUSTRALIA
10 year(s) ago
Permalink Post

vaska, couldn't get the image to stop tiling, so ended up editing the plugin and setting the css in there to 'no-repeat'. also found the image went into the right place by placing the x & y co ordinates in the 'background' css, as opposed to the 'background-position'.

Vaska A
UNITED STATES
10 year(s) ago
Permalink Post

Niiiiiiiiiiiiice....

I made a note about the positioning...it seems you've adjusted your css so that adjustment is necessary. I'll fix the problem with true and false...I see where that is wrong.

Thanks for messing with that...we nabbed a bug in the process. ;)

moodie
AUSTRALIA
10 year(s) ago
Permalink Post

no problems! now I just got to get some images together to make it work properly .. :)

mejo
UNITED KINGDOM
10 year(s) ago
Permalink Post

Hi Vaska,

Followed all instruction carefully.
Images in ndxz-studio/rnd-images
updated template (the index.php in my template folder) so it says

and still nothing.

Ive tried playing with bits of the code and different alternatives but really not that sure what I'm doing.. will keep having a go though! Any ideas would be greatly appreciated.

Thanks,
Will

mejo
UNITED KINGDOM
10 year(s) ago
Permalink Post

to recap on the missing code:

...updated template (the index.php in my template folder) so it says.. plug:ndxz_rand_bg rnd-images,false /

W

Vaska A
UNITED STATES
10 year(s) ago
Permalink Post

Nope...the name of the folder is fine, but the folder should exist in the ROOT of your site. Where you put your 'files' folder...place your 'rnd-images' folder at that level.

Gorcika
FRANCE
10 year(s) ago
Permalink Post

Hi,
sorry but it doesn't work for me I did everything fine but now when I go to my website I have:

Parse error: syntax error, unexpected '(', expecting T_STRING in /home/wb55221/ndxz-studio/site/plugin/plugin.ndxz_rand_bg.php on line 17

and in the 'plugin.ndxz_rand_bg.php (which is the plugin folder), I wrote this:

function plug:ndxz_rand_bg files/image fond/fond boisA.jpg, false /
{
global $rs;

if ($rs['url'] == '/')
{
// get our images
$path = DIRNAME . "files/image fond/fond boisA.jpg";

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];

$tile = ($tile == true) ? 'repeat' : 'no-repeat';

// this 215px setting may need to be adjusted if you have altered your Index in the template
$style = "body { background: url($show) $tile;\nbackground-position: 215px 0; }\n";
return $style;
}
else
{
return backgrounder($rs['color'], $rs['bgimg'], $rs['tiling']);
}

return;
}
WHAT'S WRONG ?
Thanks

Vaska A
UNITED STATES
10 year(s) ago
Permalink Post

Don't touch the plugin itself in the plugin.ndxz_rand_bg.php file. When you add the plugin to your template...in to the space I say to do so...add it like...


<plug:ndxz_rand_bg 'files/image',false />

This is assuming that your images are going into the 'files' folder in another folder called 'image'.

Hope this helps.

alexkickham
UNITED KINGDOM
10 year(s) ago
Permalink Post

Instead of random uploaded images is it possible to use random url's? e.g. ones from your flickr account?

Vaska A
UNITED STATES
10 year(s) ago
Permalink Post

If you write a plugin to do that it's possible. But, not with this one. Although you could try editing it up.

needlnerdz
SWITZERLAND
10 year(s) ago
Permalink Post

Of course I have to want to alter the way things are... and have such little knowledge as to how to do it. Could someone suggest how I might go about limiting the random background selection to only files with 'th-' in the front of them? I am using the main gimgs folder.. however the tiling only really works when it is from the thumbnail.. thus I'd like to filter the plugin to only look at those files. I came close in my altering- but was only able to get it to use the th- then add it to any other file.. so the 'sys' ones caused a blank background.

Any advice would be grand.

cheers

Markuz
UNITED KINGDOM
10 year(s) ago
Permalink Post

moodie said:

vaska, couldn't get the image to stop tiling, so ended up editing the plugin and setting the css in there to 'no-repeat'.

I'm having probs with the image repeating horizontally on wider screens.

Is this something I can edit?

mellotone
UNITED STATES
10 year(s) ago
Permalink Post

Hi Vaska,

I installed the random image plugin and it seems to work no problem.However, now in the very upper left corner of my site is a piece of code showing that looks like the greater than/less than symbols

Here's my site www.russellaustin.com

Seems like this might be an easy fix I'm just not sure where to do this at.

thx

Vaska A
UNITED STATES
10 year(s) ago
Permalink Post

I don't see a link to Indexhibit on your site...sorry...can't help you until you have one.

mellotone
UNITED STATES
10 year(s) ago
Permalink Post

It was not intentional, that exhibit was hidden and now it is not.
Is that the link back to indexhibit that you were referring to?

Thx!

On a side note, I would like to be added to the participants list, if possible.

; )

Vaska A
UNITED STATES
10 year(s) ago
Permalink Post

Whoa...first of all...what version are you using? That's oolllllddd...

Thanks for the link...your links make this project worthwhile for us and everybody.

The problem is pretty simple...in your template it appears that you have something leftover that should note be there...I see this...

I can't show it because I need to upgrade this forum...blah.

Between your '/script' tag and your 'head' tag there are the brackets that you should remove from the template.

The empty brackets should be removed.

;)

mellotone
UNITED STATES
10 year(s) ago
Permalink Post

Right on.

I know, I've been reluctant to run the upgrade out of fear that it might lead to more problems. I just need to get on with it.

Thanks for the bracket tip.

Respect as always!

Vaska A
UNITED STATES
10 year(s) ago
Permalink Post

Yes, wait on the upgrade though...new version soon. Big fundamental changes.

plugimi
UNITED KINGDOM
10 year(s) ago
Permalink Post

hm, where's that template? do you mean 'template.php'? or 'exhibit.backgrounded.php'? cheers, sascha

Vaska A
UNITED STATES
10 year(s) ago
Permalink Post

Eh?

simon
BELGIUM
10 year(s) ago
Permalink Post

The template are located in /ndxz-studio/site/The folder "Eatock" is the one by default but you can use the "Sample" one (who is more customizable) by changing it in the Indexhibit preferences.

If you copy/paste and rename the sample folder, you can have as many templates as you want.

> Settings panel

Gav
UNITED KINGDOM
10 year(s) ago
Permalink Post

Hi Vaska - I can't download the plugin. it doesn't seem to be at the end of the link. can you send it to me or help?

thank you

gav (http://getinvolvedclub.com)

Vaska A
UNITED STATES
10 year(s) ago
Permalink Post

Just go to the downloads page...

Gav
UNITED KINGDOM
10 year(s) ago
Permalink Post

I am officially a dullard. Thank you! I have a feeling I'll be re-reading this thread over the weekend as I try to make the randomizer work. Thanks again. People keep saying they like my site. I keep telling them I made it using indexhibit...

Axel
GERMANY
10 year(s) ago
Permalink Post

Hi Vaska,

i am trying to get the random background plugin into my site - got thru the forum but sitting here with a big question mark over my head...

i don´t understand where "the template" is in which i can change the code?

is it possible to integrate the random backround plugin in a site which uses the eatock theme?
or do i have to create a new theme?

sorry for maybe asking stupid questions ;))
thanx in advance...

Vaska A
UNITED STATES
10 year(s) ago
Permalink Post

No, the Eatock template is embedded into the system. Switch to the Sample template set and then you can edit the file at /ndxz-studio/site/sample/index.php

If you have edited up the style.css file in the Eatock folder simply copy and paste the contents in the style.css file in the Sample folder.

Axel
GERMANY
10 year(s) ago
Permalink Post

when i open the file "index.php" in the folder "Sample" the content is:

•Built with Indexhibit

i understand that i change the look via css-styles but i don´t understand where to implement exactly the code for the background image plugin.

if i should have special php-knowledge to do it - in real life i´m a graphic designer ;)
so please tell me directly if i´m on a wrong path because of missing basic skills.

nickallen
UK
10 year(s) ago
Permalink Post

Hi - can anyone tell me how to change the background colour when using this plugin? Its currently set to white and I'd like to change it to black if possible... Cheers

thesupermarket
UNITED STATES
10 year(s) ago
Permalink Post

hey nickallen,
i'm pretty sure you can change the bg color if you go to the home page of your site (the post/exhibit that comes up first) where the random image is being displayed and edit the background color there.

thesupermarket
UNITED STATES
10 year(s) ago
Permalink Post

alright, my images are loading in a random fashion but they are tiling.
14sf/indexhibit

tried this
plug:ndxz_rand_bg bg,false /
and this
plug:ndxz_rand_bg 'bg',false /
and this
plug:ndxz_rand_bg bg,tile='false' /
nothin'

*******************************************
UPDATE : FIXED
I edited the plugin file and changed all trues to false.

nickallen
UK
10 year(s) ago
Permalink Post

thanks supermarket - I actually already tried changing the background colour from the home page as you suggested but it still displays as white on my site. I am assuming the random background plugin overrides this colour selection option in some way.

Does anyone else have any other ideas by any chance???

Nick

Vaska A
UNITED STATES
10 year(s) ago
Permalink Post

how about showing us?

nickallen
UK
10 year(s) ago
Permalink Post

sorry my site is: nicksbook.net

Arrival
IRELAND
10 year(s) ago
Permalink Post

I have this issue also, where the background colour is now just white, on all sections? Is there something I can edit on my PHP file?

bjw3003
UNITED KINGDOM
9 year(s) ago
Permalink Post

Hi Vaska
Having the same problem with the white background as the guys above - any idea how to fix it?
Many thanks

Vaska A
UNITED STATES
9 year(s) ago
Permalink Post

Guys, it has been posted around the forum many times...keep searching until it pops up.

talz
UNITED STATES
9 year(s) ago
Permalink Post

this plugin is great. only thing I am thinking about now is this.

the size of my random background images are 1280 x 800. when I look at my site from my home computer (which is set to 1280 x 800) it looks great.

however, when I look at my site on another wider monitor (set at 1680 x 1050) the images tile slightly. you can see the image starting to repeat in the corners.

I think if I created the background images even larger (maybe 1680 x 1050 size) it would look ok on any resolution monitor...does that make sense?

Vaska A
UNITED STATES
9 year(s) ago
Permalink Post

There is a trade off here between image size in pixels and in kilobytes. But, most people don't surf the web at 1680 width...it's much closer to 1280. There are stats out there...just do a google on something like "browser size statistsics" and I bet you'll find some helpful info to make your decision.

talz
UNITED STATES
9 year(s) ago
Permalink Post

nice. I'll check it out.

wonder if 1280 x 800 or 1024 x 768 is more common.

cuz at 1024 x 768 it cuts off the image on the right due to the smaller width.

I'll report back!

you can see how it looks on your browser if you like:

talz.ca

UPDATE:

January 2008
Higher:38%
1024x768: 48%
800x600: 8%
640x480: 0%
Unknown: 6%

so, I made all look ok at 1024 x 768 and then it also looked ok at 1280 x 800 (although there is more blank space on the right hand side).          

anoonimo
SWITZERLAND
9 year(s) ago
Permalink Post

Hello, I installed the plugin, I have 3 images on the folder and it works well but once in a while (randomly), it appears a blank background. You can try and refresh, you'll see this happen: www.anoonimo.com.

Could it be a conflict? Can anyone help me?

Thank you

anoonimo
SWITZERLAND
9 year(s) ago
Permalink Post

solved

froeset
CANADA
9 year(s) ago
Permalink Post

This is a great plugin. It works great. I found it easier than I thought to reposition the background start position too!

http://www.tomfroese.com/portfolio

Thanks.

T

aperryz
UNITED STATES
9 year(s) ago
Permalink Post

Question about where the tiling starts. How do you control where the tiling starts? I have it set to "false" on the template but it still tiles. Not the end of the world but the tiling is starting in an annoying place (not the top left).

Example: my site is http://www.aaronperryzucker.com and I would like the image to start where the left menu ends but it seems to be starting farther to the right. Did I screw something up somewhere?

purf
GERMANY
9 year(s) ago
Permalink Post

aperry:

since your menu is not the default 215px wide, you need to adjust the background-position in the ndxz_rand_bg.php to the width of your menu (182?).

Showing 1 - 50 of 218 posts in Forum » Announcements » Plugin: Random Background main page
 

This thread has been closed, thank you.