vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Random Images Anywhere (https://vborg.vbsupport.ru/showthread.php?t=94433)

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

Quote:

Originally Posted by jugo
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

Quote:

Originally Posted by gyankow
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:
Code:

<td class="alt1" width="100%">
with fonction (forumhome template):
Code:

<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

Quote:

Originally Posted by Tru2Chevy
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

Quote:

Originally Posted by Tru2Chevy
: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

Quote:

Originally Posted by datruth55
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?

jugo 11-18-2005 03:28 AM

Quote:

Originally Posted by shiola
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

Quote:

Originally Posted by Allan
very nice :)

Click install ;)

i'm a prob, look please:

My code actual:
Code:

<td class="alt1" width="100%">
with fonction (forumhome template):
Code:

<td class="alt1" width="100%"  style="background: url($randpic);">
but don't work :(

please help :(

jugo 11-18-2005 12:11 PM

Quote:

Originally Posted by Allan
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

jugo 11-18-2005 12:12 PM

Quote:

Originally Posted by gyankow
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

Quote:

Originally Posted by Tru2Chevy
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:
Code:

<td align=center><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>
CHANGE to:
Code:

<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:
Code:

$rand = mt_rand(0, $i);

$randpic = $imgurl.$files[$rand];
$randpic = "<img src=\"".$randpic."\" border=\"0\" alt=\"\" />";

To this:
Code:

$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

Quote:

Originally Posted by dodgechargerfan
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:
Code:

$rand = mt_rand(0, $i);

$randpic = $imgurl.$files[$rand];
$randpic = "<img src=\"".$randpic."\" border=\"0\" alt=\"\" />";

To this:
Code:

$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

Quote:

Originally Posted by jugo
...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

Quote:

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:
Code:

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.
Code:

$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

Quote:

Originally Posted by rharbison
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:

Code:

"<img src=\"".$randpic."\" border=\"0\" alt=\"\" />";
to something like this:

Code:

"<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:

Code:

<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]">
                &nbsp;
        </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]">
&nbsp;
</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]">
&nbsp;
</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...

Quote:

Originally Posted by c0rupted
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

Quote:

Originally Posted by melodiq
make sure there are no trailing slashes on your paths.... that's what screwed me up...

nope.


All times are GMT. The time now is 04:17 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01412 seconds
  • Memory Usage 1,862KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (15)bbcode_code_printable
  • (16)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete