View Full Version : Random Images Anywhere
1st of all I really love this plugin stuff.
Now for the Release. Please be gentle as this is my first release ever.
I want to thank Loneranger because I used his XML file as a template for mine. This was fun to make. I hope you guys enjoy it.
This will allow you to display random images anywhere you want.
Features:
Reads from a specified directory.
Only reads files whose filenames contain your specified text delimeter.
Can specify file extensions to display (GIF JPG PNG)
Perfect for babe of the week, etc.
See a working example here: http://www.freaks-network.com/forum/
The header images on the left will change whenever the page is refreshed.
Note: This generates a variable. Just insert the following wherever you want the random image to appear:
$randpic
Xepher
08-16-2005, 01:32 PM
This hack has allowed a different asspect on our site. But you could use it for just about anything.
We diplay multiple games just to give a different look to the site...
Job well done Jugo... :ninja:
Cyricx
08-16-2005, 02:10 PM
That's awesome!!!
Only thing I'd request is a way to do it based on the style rather then a global setting.
That way you can have one style that scrolls through X banners, and another style that scrolls through a whole different set.
Vizionz
08-16-2005, 02:40 PM
good idea :)
jesus likes pie
08-16-2005, 03:17 PM
umm you guys are forgetting to click install i think :P
Indeed it is....AWESOME.
gentle enough for ya? (:P)
Hopefully I can get this to work with the gallery.....so instead of the newest 5 showing...it gets 5 random ones. I'll try it out.
Vizionz
08-16-2005, 03:20 PM
i ddidnt install it cause i have not found a use for it yet but it sounds like a good idea
That's awesome!!!
Only thing I'd request is a way to do it based on the style rather then a global setting.
That way you can have one style that scrolls through X banners, and another style that scrolls through a whole different set.
Hmmm...I'll look for the style specific hook (if there is one). Thanks all.
jesus likes pie
08-16-2005, 03:23 PM
Hey do you mind if I copy some of your images on your site?
Cyricx
08-16-2005, 03:23 PM
If he can make it work on a per style basis rather then a global setting, I'll most definately install it and click install :D
Vizionz
08-16-2005, 03:28 PM
me too cause then i know i could use it :)
ggiersdorf
08-16-2005, 11:38 PM
When you say stle specific vs global? are you talking about templates?
sorry n00b here
If you have 1 style will thsi work fine?
It's set up to work on any style. it will display the same group of random images on whichever style you set it up on.
What they want is a way to specify different sets of random image groups per style. (I working on it but it's a little frustrating).
MRGTB
08-17-2005, 01:17 AM
Great plugin. I would image if you run a portal for example. You could just add the random varable to an empty block and it would display random images there also as well as adding the varable to your forum page.
Correct...that is the beauty of it. That it just creates a global variable that you can pretty much put anywhere.
bonnmac
08-17-2005, 09:00 PM
will this work with flash also .swf thanks
In order for this to work with flash, some modifications would need to be made including the rewrite of the output code to include the oblect embed code required for flash movies.
Brinnie
08-19-2005, 07:40 AM
so can i display it on an extenal page or a completly different website if I wanted?
Living in music
08-19-2005, 09:11 AM
In order to works,how do I declare(means that:to view 2 or 3 image,how I fill that blank) information at Image Filename Delimeter frame for this mod?
b6gm6n
08-19-2005, 10:13 AM
bloody good job!, cheers, clicks install!
-b6
GrendelKhan{TSU
08-19-2005, 11:21 AM
hmm..installed but couldn't get it to work
did I do this right?
for the PATH and URL to Images, I used:
h ttp://ww w.mysitename.com/forums/images/random/
(I created a folder called "random")
then all the images I uploaded to this folder I put
_rand_ at the beginning of the file name.
eg: _rand_STAR.jpg
then stick $randpic in wherever (whatever template) I want the image to appear.
-----------------------
all I got was an X and htt p://w ww.mysite.com/forums/images/random/ file path (notice it didn't actually find an image file :( )
what'd i do wrong? any help would be appreciated?
so can i display it on an extenal page or a completly different website if I wanted?
Ummmm...yes to the top one as long as you include GLOBAL.PHP (correct me if I am wrong Master Coders) :nervous: ..
And no to the second one because it creates the variable for the current page.
In order to works,how do I declare(means that:to view 2 or 3 image,how I fill that blank) information at Image Filename Delimeter frame for this mod?
if your delimeter is "rand" then the filenames of your random images shoulr start or contain "rand" in it.
for example, in your images directory you have the following files:
image_01.gif
paramond.lpg
test.png
randcrazy.gif
randplay.png
collosal.gif
randjugo.jpg
Since the delimeter is "rand" the only files that will be cycled in the script are:
randcrazy.gif
randplay.png
randjugo.jpg
did I do this right?
[list=1]for the PATH and URL to Images, I used:
h ttp://ww w.mysitename.com/forums/images/random/
(I created a folder called "random")
The URL is correct BUT the PATH has to be the filesystem path as in "/home/name/public_html/forums/images/random/"
ggiersdorf
08-19-2005, 12:11 PM
Can I use this in multiple locations on my site? Say one in a portal and one in a forum dedicated to a specific subject?
Almost ready to hit install :)
Cyricx
08-19-2005, 01:39 PM
Thought for ya Jugo on the per style thing.
What if the delimiter was set per style?
Then as you describe it would only grab the images that started with that delimiter so if for example if you had the images
style_a_image1
style_a_image2
style_b_image1
style_b_image2
then you would set the delimiter for style a to "style_a" and similiar for style b
It may be completely off from how it would have to be done, just spitting ideas out from my insane noggin for ya as I know the style thing is giving ya a headache :)
Can I use this in multiple locations on my site? Say one in a portal and one in a forum dedicated to a specific subject?
Right now it just uses one variable, so it will display the same image on every page. I just paused my brain and though of it, it is definitely possible. But I'm gonna try and figure out the following request first.
Thought for ya Jugo on the per style thing.
What if the delimiter was set per style?
Then as you describe it would only grab the images that started with that delimiter so if for example if you had the images
style_a_image1
style_a_image2
style_b_image1
style_b_image2
then you would set the delimiter for style a to "style_a" and similiar for style b
I got the settings all set for this, except that for some reason the code is not parsing correctly....it's still using the same image for both and it's not picking up the style ID correctly...
been trying to get some help from the "Master Coders" here but two posts and no response yet....i'll wait and explore until i get it though, cause I like this idea.
ggiersdorf
08-21-2005, 07:40 PM
Jugo any anwsers on my post? Or are you working on something else?
Sai01
08-28-2005, 07:58 AM
i don't get this...where do i put the picture and how many picture can be rotated?
Jugo any anwsers on my post? Or are you working on something else?
Read the post right above yours...i answered it.
i don't get this...where do i put the picture and how many picture can be rotated?
Put the images wherever you want...Just make sure that their names includes the "delimeter" you speify in the settings and that they are within your web accessible directories. There's no limit to the number of images (although I don't recommend having hundreds and thousands of images because that may slow down the script...
ggiersdorf
08-29-2005, 02:40 PM
Jugo I have an Idea that you might be able to help with. I want to place the random image in the background of the New Thread/ Reply Box and set the Size of those boxes to a fixed size. Would you know how to accomplish this?
It would make a Unique experience. (Obvoiusly the images need to be somewhat translucent)
Would you know how to accomplish this?
You can use this as well. Just use the variable as your background image like this:
style="background: URL($randpic);"
and that should cycle through the images and place them as the background image.
ggiersdorf
08-30-2005, 12:31 PM
You can use this as well. Just use the variable as your background image like this:
style="background: URL($randpic);"
and that should cycle through the images and place them as the background image.
Jugo sorry to be a twit, but how can I use this in the CSS section: I dont want to add the HTML I cant to apply it to the WYSIWYG editor in the CSS section. What command would that use?
ohgenki
08-31-2005, 01:54 AM
can we have a link for the pic?
Boofo
08-31-2005, 02:20 AM
I need this for headers and calendar pics? How can I use it for both since they have separate pics? ;)
Jugo sorry to be a twit, but how can I use this in the CSS section: I dont want to add the HTML I cant to apply it to the WYSIWYG editor in the CSS section. What command would that use?
I'm not sure if you can parse variables in the CSS, BUT if you can, then all you have to do is go to where you would set up the background color and font style (in the all style options section of the Styles section) and inset:
background: URL($randpic);
in the "Extra CSS" Sextion.
I need this for headers and calendar pics? How can I use it for both since they have separate pics?
I am working on an update that you can have multiple delimeters. This way you can have more than one variable.
Thanks to you and the other people who suggested the idea.
Boofo
08-31-2005, 05:51 PM
I am working on an update that you can have multiple delimeters. This way you can have more than one variable.
Thanks to you and the other people who suggested the idea.
I'll be looking forward to it. ;)
cyclical
09-07-2005, 11:31 PM
just coming through... Jugo how goes the different templates thing?
I found the solution for the different style one and will be posting it in a couple of days.
Next i'll work on the Multiple variable version.
cyclical
09-08-2005, 12:31 AM
sweet..
I had to do it the semi ghetto way... looking forward to seeing yours.
:)
Mr Peabody
10-01-2005, 09:12 PM
Great hack cheers!
BradE
10-01-2005, 10:09 PM
If you could add links to the images this would be a very effective and simple banner ad system for folks that don't need something fancy.
karrerax
10-01-2005, 11:27 PM
Installed in my Forum (Vbulletin 3.5 Gold)
Great Job!
PennylessZ28
10-05-2005, 11:14 PM
Excellent work!
Itworx4me
10-06-2005, 03:50 AM
Is there a way to have the image have a link to it???
Thanks,
Itworx4me
Neutral Singh
10-06-2005, 04:37 AM
Awesome Plugin Jugo!! Thanks.
Can this Plugin be used multiple times, i mean more than one directory? Suppose on forumhome i want to use one directory ie. thumbnail from gallery and also on that same page i want to fetch images from another directory. ie. images gaming arcade images directory. That would be quite wonderful.
Thanks
piXelatedEmpire
10-12-2005, 10:39 AM
I found the solution for the different style one and will be posting it in a couple of days.
Next i'll work on the Multiple variable version.
progress update?
gyankow
10-12-2005, 02:07 PM
Does the hack auto size or thumbnail an image? Also has anyone used this in CMPS?
Cedric_FP
11-10-2005, 10:00 AM
Great hack. Works like a dream.
EDIT: Actually, it doesn't. Tunrs out if you use it in your header, and the board is closed, it won't work.
moonclamp
11-11-2005, 01:16 AM
2 questions
could a random background image be inserted by using HTML rather than css ... ie. background="$randpic"?
datruth55
11-12-2005, 05:10 AM
Does the hack auto size or thumbnail an image? Also has anyone used this in CMPS?
It doesn't display thumbnails but I would love to know how to do this if anybody knows.
Tru2Chevy
11-14-2005, 02:22 AM
n00b question....
I have just installed this, and I have three different banners saved in a file. I'm pretty sure that I have the relative path correct, and I know that I have the URL correct, however I do not know where or how to place the $randpic variable.
I tried just replacing the title image path in the AdminCP -> Style Manager -> StyleVars with the variable name, however when I do that I just get the default link to appear, and no image at all.
Can someone provide some clear instructions on how to do this?
TIA
- Justin
Allan
11-14-2005, 07:50 PM
very nice :)
Click install ;)
i'm a prob, look please:
My code actual:
<td class="alt1" width="100%">
with fonction (forumhome template):
<td class="alt1" width="100%" style="background: url($randpic);">
but don't work :(
GamerJunk.net
11-15-2005, 06:54 AM
What if I wanna do this for my imagecash gallery how would I make it read all the files in a gallery? Or for another site?
Tru2Chevy
11-15-2005, 10:30 PM
n00b question....
I have just installed this, and I have three different banners saved in a file. I'm pretty sure that I have the relative path correct, and I know that I have the URL correct, however I do not know where or how to place the $randpic variable.
I tried just replacing the title image path in the AdminCP -> Style Manager -> StyleVars with the variable name, however when I do that I just get the default link to appear, and no image at all.
Can someone provide some clear instructions on how to do this?
TIA
- Justin
:crickets: :D
Is anyone using this with vb 3.5.0? If so, could you tell me where to place the variable in order to make this work? I'm lost....
- Justin
datruth55
11-16-2005, 04:20 PM
:crickets: :D
Is anyone using this with vb 3.5.0? If so, could you tell me where to place the variable in order to make this work? I'm lost....
- Justin
You need to put the $randpic variable in tags.
<tr>
<td>$randpic</td>
</tr>
Something like that where ever you want it on your board. You will need to modify the template.
Tru2Chevy
11-16-2005, 07:43 PM
You need to put the $randpic variable in tags.
<tr>
<td>$randpic</td>
</tr>
Something like that where ever you want it on your board. You will need to modify the template.
Thanks, however that still doesn't answer my question of where to put it. Everytime I look for something about changing the logo I just get directed to the AdminCP to change the image path.
Can you tell me the name of the template that needs to be modified to add this?
- Justin
shiola
11-17-2005, 01:42 PM
Can this be modified (or is there another hack) so I can put random quotes on my forum? So I need it to work with text not images, with some kind of text manager.
(...and yes I realise I could use some kind of JS code in the forum header...I'm just asking if there's a specific VB hack).
Cheers.
Harry72
11-17-2005, 02:39 PM
That's cool - thx a lot. Works great. Use it for my coppermine gallery and i can change width and height from the pictures in the plugin-system. :nervous:
G0F0RBR0KE
11-17-2005, 03:56 PM
Can this be also included in signatures?
rharbison
11-18-2005, 12:43 AM
Is there any way to make the image clickable?
i.e. I specify a url for each image, and it allows you to click on the image and go there?
Can this be modified (or is there another hack) so I can put random quotes on my forum? So I need it to work with text not images, with some kind of text manager.
(...and yes I realise I could use some kind of JS code in the forum header...I'm just asking if there's a specific VB hack).
Cheers.
Sorry I haven't been around...I'll get toi most of these questions...BUT this one specifically, I'll create soon. I have something like this running at this site:
http://www.miworldwide.com
Look at the bottom right and refresht he page....
Allan
11-18-2005, 06:42 AM
very nice :)
Click install ;)
i'm a prob, look please:
My code actual:
<td class="alt1" width="100%">
with fonction (forumhome template):
<td class="alt1" width="100%" style="background: url($randpic);">
but don't work :(
please help :(
please help :(
The reason why that does not work is because the $randpic variable is created with the "<img" Tags already in it.
If you're daring enough you can modify it to only generate the actual image url OR I can modify the release a bit more and make it generate TWO variables...
$randpic which will generate the full "<img" tags as normal and
$randpicurl which will only generate the image's url
Does the hack auto size or thumbnail an image? Also has anyone used this in CMPS?
This hack does not create thumbnails or autosize anything. It just displays the image in it's full glory.
It should work in CMPS as it is called in the global_start hook.
dodgechargerfan
11-18-2005, 09:53 PM
Thanks, however that still doesn't answer my question of where to put it. Everytime I look for something about changing the logo I just get directed to the AdminCP to change the image path.
Can you tell me the name of the template that needs to be modified to add this?
- Justin
If you're looking to have it replace your title banner on every refresh, you would go change the header template in the Common Templates section of Style Manager.
Experiment with this on a test style. (I have a separate style set up in vB that I turn on when I want to test stuff like this and then I turn it off once I am done. If things work, then I go and change the live styles for the users.)
Look for:
<td align=center><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>
CHANGE to:
<td align=center><a href="$vboptions[forumhome].php$session[sessionurl_q]">$randimg</a></td>
I'm relatively new to vB stuff, so take this suggestion with a bit of caution. At the very worst you can just change it back and be no worse off.
If anyone else can chime in on this with confirmation or corrections, that would be great.
dodgechargerfan
11-18-2005, 09:55 PM
I am looking at this product for a type of picture banner.
The challenge that I have is that I want the banner to be made up of many different pictures.
Is it possible to replicate the part of the xml file to generate several variables?
Perhaps $randpic1 $randpic2 $randpic3 etc.... for as many as I wanted to have lined up in the banner?
dodgechargerfan
11-19-2005, 01:41 PM
I decided to take a run at making the changes myself and it worked out okay after a bit of trial and error.
I checked with jugo before posting this.
All I did was add code into the xml file to generate more variables.
From this:
$rand = mt_rand(0, $i);
$randpic = $imgurl.$files[$rand];
$randpic = "<img src=\"".$randpic."\" border=\"0\" alt=\"\" />";
To this:
$rand1 = mt_rand(0, $i);
$rand2 = mt_rand(0, $i);
$rand3 = mt_rand(0, $i);
$rand4 = mt_rand(0, $i);
$rand5 = mt_rand(0, $i);
$rand6 = mt_rand(0, $i);
$randpic1 = $imgurl.$files[$rand1];
$randpic1 = "<img src=\"".$randpic1."\" border=\"0\" alt=\"\" />";
$randpic2 = $imgurl.$files[$rand2];
$randpic2 = "<img src=\"".$randpic2."\" border=\"0\" alt=\"\" />";
$randpic3 = $imgurl.$files[$rand3];
$randpic3 = "<img src=\"".$randpic3."\" border=\"0\" alt=\"\" />";
$randpic4 = $imgurl.$files[$rand4];
$randpic4 = "<img src=\"".$randpic4."\" border=\"0\" alt=\"\" />";
$randpic5 = $imgurl.$files[$rand5];
$randpic5 = "<img src=\"".$randpic5."\" border=\"0\" alt=\"\" />";
$randpic6 = $imgurl.$files[$rand6];
$randpic6 = "<img src=\"".$randpic6."\" border=\"0\" alt=\"\" />";
Now I just use $randpic1 ..2 ..3 etc... where I want the images to show up.
In my case I wanted to use it to display a different row of pictures everytime a page loaded. You can see how it came out at www.moparnuts.com
I want to tweak things a bit to make it dsiplay a little cleaner. Maybe add a resize function or fix up the justification to get things centered and fill up the white space.
I would like to suggest another idea as well. I'm not sure if I'll be able to figure this one out.
Is there a way to have the name of the file show up as a tooltip when a user hovers their mouse over the picture. It would be great if you could parse out the prefix and file extension too.
With this new idea, I'd like to have the filenames represent the user that owns the car. That way, when someone hovers over the picture, they get a tooltip that tells who owns the car...
Thanks again, jugo, for a great tweak!
Harry72
11-19-2005, 01:49 PM
I decided to take a run at making the changes myself and it worked out okay after a bit of trial and error.
I checked with jugo before posting this.
All I did was add code into the xml file to generate more variables.
From this:
$rand = mt_rand(0, $i);
$randpic = $imgurl.$files[$rand];
$randpic = "<img src=\"".$randpic."\" border=\"0\" alt=\"\" />";
To this:
$rand1 = mt_rand(0, $i);
$rand2 = mt_rand(0, $i);
$rand3 = mt_rand(0, $i);
$rand4 = mt_rand(0, $i);
$rand5 = mt_rand(0, $i);
$rand6 = mt_rand(0, $i);
$randpic1 = $imgurl.$files[$rand1];
$randpic1 = "<img src=\"".$randpic1."\" border=\"0\" alt=\"\" />";
$randpic2 = $imgurl.$files[$rand2];
$randpic2 = "<img src=\"".$randpic2."\" border=\"0\" alt=\"\" />";
$randpic3 = $imgurl.$files[$rand3];
$randpic3 = "<img src=\"".$randpic3."\" border=\"0\" alt=\"\" />";
$randpic4 = $imgurl.$files[$rand4];
$randpic4 = "<img src=\"".$randpic4."\" border=\"0\" alt=\"\" />";
$randpic5 = $imgurl.$files[$rand5];
$randpic5 = "<img src=\"".$randpic5."\" border=\"0\" alt=\"\" />";
$randpic6 = $imgurl.$files[$rand6];
$randpic6 = "<img src=\"".$randpic6."\" border=\"0\" alt=\"\" />";
Now I just use $randpic1 ..2 ..3 etc... where I want the images to show up.
In my case I wanted to use it to display a different row of pictures everytime a page loaded. You can see how it came out at www.moparnuts.com
I want to tweak things a bit to make it dsiplay a little cleaner. Maybe add a resize function or fix up the justification to get things centered and fill up the white space.
I would like to suggest another idea as well. I'm not sure if I'll be able to figure this one out.
Is there a way to have the name of the file show up as a tooltip when a user hovers their mouse over the picture. It would be great if you could parse out the prefix and file extension too.
With this new idea, I'd like to have the filenames represent the user that owns the car. That way, when someone hovers over the picture, they get a tooltip that tells who owns the car...
Thanks again, jugo, for a great tweak!
Thx again. Nice work and very useful.
rharbison
11-20-2005, 12:56 AM
...OR I can modify the release a bit more and make it generate TWO variables...
$randpic which will generate the full "<img" tags as normal and
$randpicurl which will only generate the image's url
Not sure if you noticed my earlier post. Is there any way to add a variable that would create a clickable link with the image? That would work very well to feature random thread thumbnails.
dodgechargerfan
11-22-2005, 12:39 PM
Is there a way to have the name of the file show up as a tooltip when a user hovers their mouse over the picture. It would be great if you could parse out the prefix and file extension too.
With this new idea, I'd like to have the filenames represent the user that owns the car. That way, when someone hovers over the picture, they get a tooltip that tells who owns the car...
Some hacking and slashin and I was able to get this aspect working.
I'm not sure how valuable it is to everyone else, but it at least serves as an example of some changes that can be added.
I'll leave it to jugo to decide if it should be added to the product.
For the record, I got the parsing code from an example in the PHP online manual and adjusted things to suit my needs.
I added a function and a couple of working variables at the top of the PHP code in the xml file:
function remover($string, $sep1, $sep2)
{
$string = substr($string, 0, strpos($string,$sep2));
$string = substr(strstr($string, $sep1), strlen($sep1));
return $string;
}
$str1 = $vbulletin->options['randimg_delim'];
$str2 = ".jpg";
This function strips out text from a string based on characters that surround the text that you want.
Sending "some text (a note) some more text" with "(" and ")" as $sep1 and $sep2 would return "a note".
I added in the strlen call so that it would strip out whatever is used for the delimiter.
And then I use another variable and assign the results of the function to it.
Then the variable gets used in the building of the value for randpic# which is the variable that you can then use anywhere you want the picture to show up.
$randpic1 = $imgurl.$files[$rand1];
$alt1 = remover($randpic1, $str1, $str2);
$randpic1 = "<img src=\"".$randpic1."\" border=\"0\" alt=\"".$alt1."\" />";
The end result: when you hover your mouse over the picture, the tooltip that comes up is the image filename without the banner delimiter prefix and the file extension.
The only trick to this is to make sure that whatever you use for the banner prefix delimiter, it should be unique in the entire url of the file. Otherwise the remover function will stop on the first instance of the delimiter and you'll get whatever is left of the url as a tooltip.
So, using "banner" as your delimiter wouldn't work if you put all of your files in a directory called banner.....
"/images/banner/bannerimage1.jpg" would give you "/bannerimage1" as the alt text... not really a problem, but that's not what I was after. I wanted to see "image1" come up.
You could easily solve this by adding another character in the file name after banner and making that your delimiter.
"/images/banner/bannertimage1.jpg" and a delimiter of "bannert" would work just fine.
Thanks again to jugo for the great work.
I would not have been able to get this banner thing working without the headstart that his product provided.
dodgechargerfan
11-22-2005, 01:05 PM
Not sure if you noticed my earlier post. Is there any way to add a variable that would create a clickable link with the image? That would work very well to feature random thread thumbnails.
Making a clickable image is as easy as changing the code in the xml file from this:
"<img src=\"".$randpic."\" border=\"0\" alt=\"\" />";
to something like this:
"<a href="http://www.website.com" target="_blank"><img src=\"".$randpic."\" border=\"0\" alt=\"\" />";
The challenge is figuring out what to link to.
If it's the original image file, that might not be too hard as I think the information necessary is already part of the product.
If it's something else, then I think you're pretty much looking at hard coding it right into the code example above or generating the links in some other way.
I might take run at this and link my banner pics to the user's profile.
I'll post my results here with jugo's permission of course.
I may not get to this until next week, though.
melodiq
11-22-2005, 01:27 PM
I must be a complete noob because I cannot get this to work at all.. my big question is what template and where do you add $randpic???
dodgechargerfan
11-22-2005, 02:18 PM
Well, really, you can put it wherever you want the picture to show up.
In my case, I edited the header, and put the variables right under the logo.
All you have to do is put the variable in where you want it. You can format it if you want, too.
I have mine in a table like this:
<table border="0" width="$stylevar[outertablewidth]" cellpadding="0" cellspacing="0" align="center">
<tr>
<td align="center">$randpic1</a></td>
<td align="center">$randpic2</a></td>
<td align="center">$randpic3</a></td>
<td align="center">$randpic4</a></td>
<td align="center">$randpic5</a></td>
<td align="center">$randpic6</a></td>
<td align="$stylevar[right]">
</td>
</tr>
</table>
That puts 6 random images in a row across the top of my forums just below the logo and above the forum content.
melodiq
11-22-2005, 02:35 PM
still ain't working... below is my header code...
where do i put the code you suggested?
<!-- logo -->
<a name="top"></a>
<table border="2" bordercolor=#3E5C92 bgcolor=#738FBF width="$stylevar[outertablewidth]" cellpadding="2" cellspacing="2" align="center">
<tr>
<td align="center"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>
<td align="$stylevar[right]">
</td>
</tr>
</table>
<!-- /logo -->
<!-- content table -->
$spacer_open
$_phpinclude_output
dodgechargerfan
11-22-2005, 07:53 PM
<!-- logo -->
<a name="top"></a>
<table border="2" bordercolor=#3E5C92 bgcolor=#738FBF width="$stylevar[outertablewidth]" cellpadding="2" cellspacing="2" align="center">
<tr>
<td align="center"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>
<td align="$stylevar[right]">
</td>
</tr>
</table>
<!-- /logo -->
$randpic
<!-- content table -->
$spacer_open
melodiq
11-22-2005, 08:10 PM
still not working... i know i have my paths set correctly for the images but they are not showing up...
melodiq
11-22-2005, 08:23 PM
just figured it out... i didn't have the trailing front slash for the paths... thnx fellas...
fabriceg
11-26-2005, 12:29 PM
Hi,
Sorry for this silly question, butÂ… where did you set vars (the path, etc.) ?
$folder = $vbulletin->options['randimg_path'];
$imgurl = $vbulletin->options['randimg_url'];
$exts = $vbulletin->options['randimg_types'];
c0rupted
11-29-2005, 02:28 PM
can't seem to get this working for me, no matter where i put the $randpic it still doesn't show. I've tried all kind of different paths and it still hasn't worked.
melodiq
11-29-2005, 02:30 PM
make sure there are no trailing slashes on your paths.... that's what screwed me up...
can't seem to get this working for me, no matter where i put the $randpic it still doesn't show. I've tried all kind of different paths and it still hasn't worked.
c0rupted
11-29-2005, 02:51 PM
make sure there are no trailing slashes on your paths.... that's what screwed me up...
nope.
DefenceTalk
11-29-2005, 03:35 PM
nope.
Nice hack. You know what would be cool? Turn this into a random thumb rotator for forum images (category image) hack out here somewhere.
concepts
12-10-2005, 04:27 PM
How do I put this into a module? for my CMPS?
DA KING
12-14-2005, 02:44 AM
its not working for me! HEEEEEEEEEEEELP!
I have tried everything!
my site is "www.dawire.net"
the PATH for my site is "public_html/forums/images/randompics/"
My delimiter is "random" and I even went a inserted that in all my pics in that directory.
I even put the "$randpic" code in the header template and I get is a big red X. Can someone help me please?
dodgechargerfan
12-15-2005, 10:34 PM
Has anyone figured out if certain browsers or I don't know what might cause the variable to not work?
I have one user that cannot see the images on his home computer, but can on his work computer.
I got a copy of the source grabbed from View Source in IE and the IMG code that would normally get placed where the $randpic# variable is in the code is simply not there at all.
It's like his browser doesn't process the variable.
So instead of this:
<td align="center"><img src="http://www.moparnuts.com/forums/images/banner/qnutsbobs70gtx2.jpg" border="0" alt="bobs70gtx2" width=200 /></a></td>
his browser has this:
<td align="center"></a></td>
dodgechargerfan
12-15-2005, 10:47 PM
its not working for me! HEEEEEEEEEEEELP!
I have tried everything!
my site is "www.dawire.net"
the PATH for my site is "public_html/forums/images/randompics/"
My delimiter is "random" and I even went a inserted that in all my pics in that directory.
I even put the "$randpic" code in the header template and I get is a big red X. Can someone help me please?
I'm not sure what the fix is , but I can see what's going on.
You're generating this for the images:
<img src="attachment.php?attachmentid=35&stc=1&thumb=1" border=0 align="center">
The variable should be generating something more like a url.
<img src="http://www.moparnuts.com/forums/images/banner/qnutsbobs70gtx2.jpg" border="0" alt="bobs70gtx2" width=200 />
dodgechargerfan
12-18-2005, 12:10 PM
Has anyone figured out if certain browsers or I don't know what might cause the variable to not work?
I have one user that cannot see the images on his home computer, but can on his work computer.
I got a copy of the source grabbed from View Source in IE and the IMG code that would normally get placed where the $randpic# variable is in the code is simply not there at all.
It's like his browser doesn't process the variable.
So instead of this:
<td align="center"><img src="http://www.moparnuts.com/forums/images/banner/qnutsbobs70gtx2.jpg" border="0" alt="bobs70gtx2" width=200 /></a></td>
his browser has this:
<td align="center"></a></td>
I have now seen this problem on my own computer with a portal page that I am building. The banner shows up fine on the regular forum pages, but not in the banner. When I look at the generated source, I see everything but what would have replaced the variable - like the second code example above.
dodgechargerfan
12-18-2005, 12:55 PM
Ummmm...yes to the top one as long as you include GLOBAL.PHP (correct me if I am wrong Master Coders) :nervous: ..
I've been looking at this one and am about to test it on a drupal portal.
I think there's two ways to go about this.
1. drupal's index.php is pretty simple and has a couple of includes. Adding another would be pretty simple.
2. one of the includes that drupal has is common.inc which has a bunch of functions that get used by various modules of drupal. I am going to try and add the function from your xml file into that include file and see how it goes.
I would suspect that any other portal solution would have similar architecture that one could take advantage of.
Does anyone see any issues with either of these approaches?
I guess that including global.php would be a good thing to do if there were other functions/features that we could take advantage of in the portal.
I just started the portal stuff 3 days ago, so I have no idea if there is anything in global that would be beneficial.
MSheraz86
12-18-2005, 09:00 PM
Look for:
<td align=center><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>
CHANGE to:
<td align=center><a href="$vboptions[forumhome].php$session[sessionurl_q]">$randimg</a></td>
Correction is as follows :D
<td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]">$randpic </a></td>
It's $randpic not $randimg :)
Some TOUGH mod to figure out at start but thanks to you i've managed to get there :nervous:.
It's just what i was looking for ;) Great mod!
Dsyn11
01-13-2006, 05:43 PM
this works fine EXCEPT on index.php home page. What's going on?
matt_turpin
01-18-2006, 11:53 AM
I installed this on my FFXI message board, and it's a huge hit. I have about 107 game screenshots from my game group. Only having one show at a time, randomly, on the frontpage is a fun way to keep everyone's interest. Some members have claimed to just sit clicking refresh to see all the pics. For being a vBulletin newbie, I didn't have too much trouble getting it to work. Installing the plugin was pretty easy. I had a little trouble figuring out what the plugin wanted for the directory location (not the directory URL). The hardest part for me was making a table that looked like a vBulletin table and putting it on the page in a way that didn't break formatting or anything. But, as I mentioned, I'm still learning. It's a really cool plugin though - the first modification other than a style change I've done so far.
Big_Ern
02-03-2006, 06:53 PM
How do I put this into a module? for my CMPS?
has anyone figured out how to do this?
Dsyn11
02-13-2006, 12:35 AM
Ditto on the CMPS thing. it doesn't work.
Dsyn11
02-18-2006, 04:31 AM
Is this thread abandoned? CMPS, anyone?
Hi,
Sorry for this silly question, but? where did you set vars (the path, etc.) ?
$folder = $vbulletin->options['randimg_path'];
$imgurl = $vbulletin->options['randimg_url'];
$exts = $vbulletin->options['randimg_types'];
In the vBulletin Options.
Is this thread abandoned? CMPS, anyone?
Sorry, been very busy lately.
This should enable the variable in any template for any vB Powered page which includes the global_start hook.
I will investigate if this is not the case and fix it.
again, sorry for the absence.
Giray
03-19-2006, 11:50 AM
Does the $randpic variable work only in templates or also in phrases?
snowman872
03-21-2006, 01:48 AM
I've installed this hack and use it to display a random photo of certain forum members at the top of each page. Everyone likes this feature, but multiple people have asked if there is a way I can identify the person in the picture. At present I just a static (generic) "Forum Member" description under it.
It would be a awesome enhancement to this hack, if each image in the random pool could be associated with a particular short line of text for a description. The description could display under the image.
Thanks!
Giray
03-21-2006, 02:27 AM
Worst case scenario, why not add the text to the 'image' itself? Just add a little band at the bottom and write you caption in Photoshop... Just a thought :knockedout:
KevinL
03-28-2006, 12:45 PM
This works great! Just what I was looking for!
dodgechargerfan
03-30-2006, 12:07 AM
I've installed this hack and use it to display a random photo of certain forum members at the top of each page. Everyone likes this feature, but multiple people have asked if there is a way I can identify the person in the picture. At present I just a static (generic) "Forum Member" description under it.
It would be a awesome enhancement to this hack, if each image in the random pool could be associated with a particular short line of text for a description. The description could display under the image.
Thanks!
I wanted something similar - I wanted the tool tip to have the username in it when you hovered your mouse over the picture.
I managed to get it done.
https://vborg.vbsupport.ru/showpost.php?p=827713&postcount=69
I suppose you could tweak that to put the name underneath the picture using just some html.
The trick is that the text is part of the filename.
Another thing: that function looks for .jpg and strips it out. So, it messes up this name support for other file types. The random picture code will still work but the name will say "filename.gif" instead of "filename"
HobbiesPR
03-31-2006, 11:35 PM
its not working for me! HEEEEEEEEEEEELP!
I have tried everything!
my site is "www.dawire.net"
the PATH for my site is "public_html/forums/images/randompics/"
My delimiter is "random" and I even went a inserted that in all my pics in that directory.
I even put the "$randpic" code in the header template and I get is a big red X. Can someone help me please?
I had this problem for some hours until I discovered that the relative PATH in my case have to be c:\Inetpub\dir\dir\etc\images because I run on Windows 2003 Server. Finally got it to work.
finn snor
04-22-2006, 01:36 PM
Where do i put the $randpic in this header ?
<!-- logo -->
<a name="top"></a>
<div align="center" class="element_outer_border">
<div align="center" class="element_inner_border">
<table border="0" width="$stylevar[outertablewidth]" cellpadding="0" cellspacing="0" align="center" class="element_header_bg">
<tr>
<td align="$stylevar[left]" valign="top" height="112"><a href="$vboptions[forumhome].php?$session[sessionurl]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>
<!-- /logo -->
Anywhere you want it to show up.
ggiersdorf
05-24-2006, 09:24 PM
I really would like a time setting for the image to rotate so I can set it to change images every X seconds or hours.
ThomasR
06-23-2006, 11:47 AM
Jugo: bcause it still not possible to use a different set of randem image for each template, then, is it possible to install this product twice, with, for each, different parameters ?
Thanks!
PoetJA-1975
12-03-2006, 11:10 AM
Thanx!
Jacquii.
Krieg
01-15-2007, 11:56 AM
nope.
c0rupted, your 'PATH to images' is wrong, it should be something more like /kunden/homepages/htdocs/forums/images/random
Krieg
01-15-2007, 12:14 PM
has anyone figured out how to do this?
When you use the CMPS tables as a new template, its content should look like this :
<tr>
<td class=alt1>
$randpic
</td>
</tr>
at least mine looks like this ;)
burntire
05-18-2007, 07:00 AM
Great Mod.
snake-boy
06-16-2007, 03:18 AM
Will this work in 3.6.x generation? (Fingers crossed).
CodeRed
01-06-2008, 11:21 PM
First off, this is a great little plugin... props to jugo!
one quick question...
is anyone else having an issue with the images not being random in FireFox?
It refreshes everytime and changes the image in Internet Explorer but in Firefox the same image remains time and time again.
Just checking thanks!
Rob Hephner
04-01-2008, 09:52 PM
When you use the CMPS tables as a new template, its content should look like this :
<tr>
<td class=alt1>
$randpic
</td>
</tr>
at least mine looks like this ;)
OK, I have messed with this for an entire day and cannot get it to work on a CMPS page.
I can get a box that looks as if it is collapsed, but that's it. (It is not collapsed, just small)
The box will show with random pictures using the preview button in the module edit section, but does not work on any page.
I am on vB 3.6.8 and I am wondering if that is where my problem lies??
Any help?
theOZer
04-02-2008, 07:27 PM
A 'Heads Up' to people testing vB370RC2. This hack appears to still be working correctly/properly in vB370RC2.
Great hack.
Easy to set up.
Works.
todosbaneados
04-06-2008, 04:31 PM
It works with 3.6?
theOZer
04-06-2008, 06:43 PM
Try it. I had written my own randomizer for 36x but it doesn't work in 37x so I tried this hack in 37x and, voilĂ , this hack worked in 37x.
Remember to use the (default) _rand_ as a file prefix for your pics (jpgs, gifs, pngs).
~OZ
MoviePropCollec
09-27-2008, 07:33 AM
How do you use this?
Where are the instructions?
theOZer
10-01-2008, 05:33 PM
Copy your pics you want displayed into Images/Misc, adding prefix _rand_ to the jpeg filenames.
Here's an example of adding $randpic to the Header template:
<if condition="$ad_location['ad_header_logo']">$ad_location[ad_header_logo]
<else />
$randpic
</if>
~OZ
MoviePropCollec
01-03-2009, 05:43 PM
Huh?
domainmagick
01-22-2009, 02:38 AM
tested/working on 3.8?
thecore762
04-26-2009, 04:41 AM
Hmm, is it possible to incorporate this with vBadvanced?
Front Range 4x4
09-07-2009, 09:33 PM
Nice to see this works fine with a custom skin on version 3.8.3, great mod!
Installed.
Also a big thanks to dodgechargerfan for showing how to use multiple locations w/o pulling the same pic every time.
imported_silkroad
09-25-2009, 12:58 PM
I like this mod, BTW. Simple and works great.
sproubn
01-19-2010, 03:26 PM
Verified works great in 3.8.4
Thanks!
viper357
01-30-2010, 11:35 AM
Working great in 3.8.4 and on vbadvanced, thanks.
wd4x4
09-22-2010, 02:37 PM
Anyone get this to work in 4.0.7 yet ?
khurtsiya
06-09-2011, 11:31 AM
thank you!!!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.