vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced CMPS > vBa CMPS v1.x (Archive - Closed for Posting) > Add-On Modules & Modifications

 
 
Thread Tools Display Modes
  #1  
Old 05-27-2004, 11:39 AM
ogetbilo's Avatar
ogetbilo ogetbilo is offline
Member
 
Join Date: Apr 2004
Posts: 68
Default Random Pictures Module

I ported the 'Feature Pic/ Babe of The day/ Intergration all in 1' hack to vB CMPS with the permission of the author.

All the credits go to Amavisca (aka: Eclipse at Speedyks.com)

This module takes a random picture from a folder in your server where you store your pictures, resizes and displays it in a smallbox in your CMPS home page.

Instructions:
1) Copy the attached refresh.php file inside the folder where your pictures are.

2) Create a template with name 'adv_portal_images' (without the quotes) with the contents:
PHP Code:
<table align="center" border="0" cellpadding="$stylevar[cellpadding]cellspacing="$stylevar[cellspacing]class="tborder" width="100%">

<
tr>
<
td class="tcat"><span class="smallfont"><b>$vboptions[blockbulletImage</b></span></td>
</
tr>
<
tr><td align="center">



<
img src="$vboptions[homeurl]/path/to/your/images/folder/refresh.php" width="150"  border="0">

</
td>
</
tr>

</
table>
<
br /> 
*Modify the path/to/your/images/folder to the folder where your images are.

**You can play with the width setting. I tried to do it with "100%" but Internet Exploder causes problems with that (works fine with mozilla though?)

3) Create a module with:
Module Title: Images
Template to include: images

set the display order and column according to taste and SAVE

That's All!
Attached Files
File Type: php refresh.php (2.4 KB, 329 views)

Last edited by ogetbilo; 05-27-2004 at 11:52 AM.
  #2  
Old 05-29-2004, 10:37 AM
Preech Preech is offline
Junior Member
 
Join Date: Mar 2004
Posts: 15
Default Re: Random Pictures Module

Can we also make this so people won't steal images, or bandwidth.
  #3  
Old 05-29-2004, 11:23 AM
adhari_com adhari_com is offline
Junior Member
 
Join Date: May 2004
Posts: 24
Default Re: Random Pictures Module

Nice and thanx alot, but a suggestion that u'd do a module to randomly pick up an attachment image and display it?

peace.
  #4  
Old 05-29-2004, 01:23 PM
ogetbilo's Avatar
ogetbilo ogetbilo is offline
Member
 
Join Date: Apr 2004
Posts: 68
Default Re: Random Pictures Module

Quote:
Originally Posted by Preech
Can we also make this so people won't steal images, or bandwidth.
You can make the module such that only subscribed users can see the picture. alternatively, you can put a plank html page to your images folder to prevent users browsing that folder.

Quote:
Originally Posted by adhari_com
Nice and thanx alot, but a suggestion that u'd do a module to randomly pick up an attachment image and display it?

peace.
I will work on this.

Last edited by ogetbilo; 05-29-2004 at 01:25 PM.
  #5  
Old 06-06-2004, 08:27 PM
quasan quasan is offline
Junior Member
 
Join Date: Jun 2004
Posts: 3
Default Re: Random Pictures Module

hi,
i like this one very much, but my problem is, that I want to click the pic and than it should appear in the original size.
  #6  
Old 06-06-2004, 10:26 PM
TYorke TYorke is offline
Member
 
Join Date: Apr 2004
Posts: 32
Default Re: Random Pictures Module

Quote:
Originally Posted by quasan
hi,
i like this one very much, but my problem is, that I want to click the pic and than it should appear in the original size.
Maybe a little HTML magic?

Code:
<a href="$vboptions[homeurl]/path/to/your/images/folder/refresh.php" target="_blank"><img src="$vboptions[homeurl]/path/to/your/images/folder/refresh.php" width="150"  border="0"></a>
I haven't tested it, but that *could* work

Last edited by TYorke; 06-06-2004 at 10:28 PM.
  #7  
Old 06-06-2004, 11:04 PM
quasan quasan is offline
Junior Member
 
Join Date: Jun 2004
Posts: 3
Default Re: Random Pictures Module

nop that doesn't work .
when you call the refreshscript it will randomly choose a picture...

so if you display the module.. it is p.e picture1.jpg...
when you click the link, the refresh script is called again and it will choose randomly any other pic...
  #8  
Old 06-07-2004, 04:01 AM
mholtum's Avatar
mholtum mholtum is offline
I ******* single moms.
 
Join Date: May 2004
Location: Tempe, Arizona
Posts: 1,938
Default Re: Random Pictures Module

I get a red X hmm

http://www.ravensrealm.net
  #9  
Old 06-09-2004, 12:00 PM
ogetbilo's Avatar
ogetbilo ogetbilo is offline
Member
 
Join Date: Apr 2004
Posts: 68
Default Re: Random Pictures Module

Quote:
Originally Posted by quasan
nop that doesn't work .
when you call the refreshscript it will randomly choose a picture...

so if you display the module.. it is p.e picture1.jpg...
when you click the link, the refresh script is called again and it will choose randomly any other pic...
hmm, I'm not sure that there is a way of calling the same picture once more without storing any data in database.
  #10  
Old 06-09-2004, 01:09 PM
quasan quasan is offline
Junior Member
 
Join Date: Jun 2004
Posts: 3
Default Re: Random Pictures Module

yep with this refresh.php there is no way to do it

perhaps this will work
the refresh.php shouldn't render the pic, but should return randomly a picname and creates the href and the img tag witht the inserted picurl.
but I think that wasn't your purpose in doing this refresh thing. so I'll try to modify it ok?
  #11  
Old 06-12-2004, 03:35 PM
TheSauceMaster TheSauceMaster is offline
Junior Member
 
Join Date: May 2004
Posts: 19
Default Re: Random Pictures Module

Thanks , very nice and easy to add ...aprreciate the effort.
  #12  
Old 06-21-2004, 03:50 PM
EntityPacket EntityPacket is offline
Junior Member
 
Join Date: Jun 2004
Posts: 5
Default Re: Random Pictures Module

This one didn't work for me. I get the follow errors from random.php.

PHP Code:
Warningarray_rand(): Second argument has to be between 1 and the number of elements in the array in /home/clancor/public_html/vBulletin/test/refresh.php on line 25

Warning
Cannot modify header information headers already sent by (output started at /home/clancor/public_html/vBulletin/test/refresh.php:25in /home/clancor/public_html/vBulletin/test/refresh.php on line 32 
  #13  
Old 07-04-2004, 06:28 AM
Fiber Fiber is offline
Senior Member
 
Join Date: Jul 2004
Posts: 132
Default Re: Random Pictures Module

Not working here either, must be I.E.

Thanks anyways nice mod.

Fiber
  #14  
Old 07-27-2004, 03:45 PM
chrisvonc chrisvonc is offline
Member
 
Join Date: May 2004
Posts: 65
Default Re: Random Pictures Module

Will this pull from sub-directories inside the main picture directory you select or do they all just need to be dumped into the main folder?
  #15  
Old 08-26-2004, 01:11 AM
socals socals is offline
Junior Member
 
Join Date: Aug 2004
Location: California
Posts: 21
Talking Getting a red x?

I found out the hard way, by testing the refresh.php script by itself that it was reporting warning errors. I figured these errors were corrupting the header or something and found out my php.ini file had this setting:

error_reporting - E_ALL;

I changed it to:

error_reporting - E_FATAL;


And now the script works fine and I can see my images!

Don't know if anyone else has this problem, but check it out just in case. It made me alot happier!

I found the answer on:

http://forums.devarticles.com/archive/t-9337

Also, if you don't set $tnsize then it's really just sending the entire image and using the width statement to shrink it. (Fine if all your pics are thumbnails, or small anyway)

If you do set $tnsize, I found out that it wasn't getting the $ext correctly, it was when it read from folder, but not when it chose the random file name. You should get it then. Mine happen to read the .php last, so $ext was ".php" even though it found pics in the folder. So it fell through some logic.

I also changed the ImageCreate to ImageCreateTrueColor (I use only jpeg images) which produces a much better thumbnail, and ImageJPEG to spit out the image. I'm new to PHP/GD so this just happens to be the way I fixed it.

I then took the style page from the "paypal" project and copied it to make the window collapsable. All and all, it works!

Last edited by socals; 08-26-2004 at 03:16 AM.
  #16  
Old 04-05-2005, 09:03 PM
Nautiqeman Nautiqeman is offline
Member
 
Join Date: Oct 2004
Posts: 77
Default Re: Random Pictures Module

Is there a way to make it so the picture module refreshes, say every 5 seconds so that people can watch a picture show?
  #17  
Old 04-07-2005, 11:44 AM
jugo jugo is offline
Junior Member
 
Join Date: Jun 2004
Posts: 22
Default Re: Random Pictures Module

Quote:
Originally Posted by Preech
Can we also make this so people won't steal images, or bandwidth.

Check out the babe on the left...click on her ...

http://www.s3squad.com You may have to scroll down a little...look under the heading "Babes"

Should I release this as a module??

Last edited by jugo; 04-07-2005 at 11:46 AM.
  #18  
Old 04-13-2005, 12:30 PM
Nautiqeman Nautiqeman is offline
Member
 
Join Date: Oct 2004
Posts: 77
Default Re: Random Pictures Module

Quote:
Originally Posted by Nautiqeman
Is there a way to make it so the picture module refreshes, say every 5 seconds so that people can watch a picture show?
Any ideas on this? Ideally I'd want the actually module to refresh every so many seconds... is this possible with PHP?
  #19  
Old 04-16-2005, 03:54 PM
Dirty Harry Dirty Harry is offline
Junior Member
 
Join Date: Sep 2004
Posts: 10
Default Re: Random Pictures Module

Quote:
Originally Posted by jugo
Check out the babe on the left...click on her ...

http://www.s3squad.com You may have to scroll down a little...look under the heading "Babes"

Should I release this as a module??
YES you should release this as a module!
By the way, nice job on the website.
  #20  
Old 04-16-2005, 07:35 PM
Dirty Harry Dirty Harry is offline
Junior Member
 
Join Date: Sep 2004
Posts: 10
Default Re: Random Pictures Module

Got it working, Looks great. Thanks!
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Weather Module cLord Add-On Modules & Modifications 157 09-08-2006 07:50 PM
Basic Module cLord Add-On Modules & Modifications 55 04-24-2006 08:45 AM
PayPal Module cLord Add-On Modules & Modifications 36 09-21-2005 01:08 AM
Google Module cLord Add-On Modules & Modifications 22 05-03-2005 04:49 PM
not display a module (or part of a module) in IE ogetbilo Troubleshooting / "How do I..." Questions 3 05-25-2004 10:02 PM


All times are GMT -4. The time now is 04:40 AM.

Forums Powered by vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Please note that vBadvanced is in no way affiliated with Jelsoft Enterprises Ltd, nor will Jelsoft be able to provide any support for our products.