PDA

View Full Version : [REQ] Random gallery image


Snowy
10-04-2005, 07:28 PM
Can someone port this little mod over, it makes the frontpage look much better, adds colour :)

Thanks in advance.

Snowy

e-steki
10-12-2005, 12:47 PM
I think half of the community is awaiting for this! This must be the 10th thread I've seen about it! I have no idea why nobody does it, how hard can it be for someone that has the knowledge? Especially since it's done before...

Our Sponsors
 

agiacosa
10-13-2005, 06:15 AM
Agreed.

trilljester
10-13-2005, 06:50 PM
Hmmm, works fine for me..

http://www.trilliummud.com - Check out the right side blocks.

Our Sponsors
 

MotoUp
10-14-2005, 10:16 AM
Could you export that as a .module file and upload it for us to try and see if it will work?

e-steki
10-14-2005, 10:20 AM
Could you export that as a .module file and upload it for us to try and see if it will work?
yeap, that would be nice :)

KingAdora
10-15-2005, 06:57 AM
Yeah I'm also interested in getting a mod like this :)

KingAdora
10-15-2005, 11:58 AM
<?php
$host = 'localhost';
$dbUser = 'xxx';
$dbPass = 'xxx';
$db = 'xxx';
mysql_connect("$host", "$dbUser", "$dbPass") or die(mysql_error());
mysql_select_db("$db") or die(mysql_error());

$result = mysql_query("SELECT id, cat, bigimage, user FROM photos WHERE approved='1' AND storecat='0' ORDER BY rand() LIMIT 1" ) or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
echo "<p><a href=\"http://xxx/showphoto.php?photo=" . $row['id'] . "\"><img border=\"0\" src=\"http://xxx/data/" . $row['cat'] . "/thumbs/" . $row['bigimage'] . "\"></a>";
}
?>



I've found this code which shows the last image uploaded to the gallery.

Does anyone know how we'd go about intergrating this into a module?

schford
10-19-2005, 08:22 AM
Any One done this as a Module yet? Am really keen.....Would contribute $10 to who ever does it!

Stuart

1996 328ti
10-20-2005, 06:48 AM
I'm using a similar script for Photopost and get loads of errors when trying to incorporate it into a module. I created a module selecting php. Obviosuly it's more than that. I sure could use help too.

Phalynx
10-21-2005, 06:19 PM
This works for me...

Create a new template called adv_portal_gallery:
<tr>
<td align="center" class="$bgclass">
<span class="smallfont">
<a href="/gallery/showimage.php?i=$gallerythumb[imageid]"><img width="160" border="0" src="/gallery/files/$gallerythumb[thumbname]"></a><br/>$gallerythumb[title]</span>
</td>
</tr>

Create a new file called randomgallery.php in your modules-folder:
<?php
$getthumb = $db->query_read("SELECT imageid, title, thumbname, username FROM adv_gallery_images WHERE valid='1' ORDER BY rand() LIMIT 1");
while ($gallerythumb = $db->fetch_array($getthumb)) {
eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_gallery') . '";');
}
?>

Customize it to your needs, like your path to the files, count of files (LIMIT 1) and also the max. width of your row (width="160").
After that, just create a new module with that php file. Please think of it: This little module doesn't take care of the permissions for the pictures. Or just use the included gallery module...

Nneel
10-23-2005, 05:01 AM
Its Nice ..Man...does that creat an gallery in vb3.5.0gold + Cmps 2 ?
Its customizeable ?

Thanks again for this nice mode...
awiting for reply.............

Phalynx
10-23-2005, 05:03 AM
This is just a simple query to pull a random picture from the database and show it on an CMPS 2.x Module

Romeos Tune
11-06-2005, 12:55 AM
Works great.... However, in my gallery software it's got seperate directories for all the different uploads..... /files/1/123.jpg

I dunno if it's user #'s or what or catagory maybe....

So basically I had to upload all the thumbs directly to the /files folder. Is there a way around this or a way to setup VBGallery to keep all the files in the same folder?

COBRAws
11-08-2005, 05:16 PM
I'm using a similar script for Photopost and get loads of errors when trying to incorporate it into a module. I created a module selecting php. Obviosuly it's more than that. I sure could use help too.
willing to help me? Im using PP too.

bugzy
11-16-2005, 05:07 PM
This works for me...

Create a new template called adv_portal_gallery:
<tr>
<td align="center" class="$bgclass">
<span class="smallfont">
<a href="/gallery/showimage.php?i=$gallerythumb[imageid]"><img width="160" border="0" src="/gallery/files/$gallerythumb[thumbname]"></a><br/>$gallerythumb[title]</span>
</td>
</tr>

Create a new file called randomgallery.php in your modules-folder:
<?php
$getthumb = $db->query_read("SELECT imageid, title, thumbname, username FROM adv_gallery_images WHERE valid='1' ORDER BY rand() LIMIT 1");
while ($gallerythumb = $db->fetch_array($getthumb)) {
eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_gallery') . '";');
}
?>

Customize it to your needs, like your path to the files, count of files (LIMIT 1) and also the max. width of your row (width="160").
After that, just create a new module with that php file. Please think of it: This little module doesn't take care of the permissions for the pictures. Or just use the included gallery module...


wow, just set this up, works pretty good =)

Thanks !

rice
12-02-2005, 05:09 PM
hey guys...this is working well for me cept on exception...
my thumbnails look pretty horrrible...tried resolution settings to no avail...
thoughts please??!!!
site is www.pressforum.com
just trying to get things in place before i let people check it out.

thanks

KW802
12-02-2005, 05:36 PM
Guys, you should check out Zachariah's version on either vB.org or Photopost.com -- the version above doesn't take into account permissions or category settings. ;)

rice
12-02-2005, 05:58 PM
ok, will do....thx
and hopefully it helps my thumbnail quality too.

cheers

rice
12-02-2005, 07:22 PM
i actually dont mind this one if the thumbnails were working for me....

rice
12-02-2005, 10:20 PM
its weird because it seems like the others that are using this do not have this problem...???

rice
12-06-2005, 10:09 PM
ok...
does anyone have an idea why the thumbnail resolution would be so bad??

sinjix_media
10-24-2006, 05:04 AM
ok...
does anyone have an idea why the thumbnail resolution would be so bad??
same here.... wondering

sinjix_media
11-07-2006, 09:34 PM
anyone?

LiquidIce
11-08-2006, 06:01 AM
photopost already has the feature

here is the module for you to use i use vbulletin 3.5.4

open up the module with a txt editor (notepad)
edit include('/home/XXXXXX/public_html/gallery/inc_features.php');

to the full path of your photopost installation.


then edit inc_features.php from


// Number of photos to display
$num_display = 4;

// Number of columns (1 for vertical)
$columns = 4;


to


// Number of photos to display
$num_display = 1;

// Number of columns (1 for vertical)
$columns = 1;


this will just display 1 image on your home page


enjoy

sinjix_media
11-08-2006, 09:13 AM
photopost already has the feature

here is the module for you to use i use vbulletin 3.5.4

open up the module with a txt editor (notepad)
edit include('/home/XXXXXX/public_html/gallery/inc_features.php');

to the full path of your photopost installation.


then edit inc_features.php from


// Number of photos to display
$num_display = 4;

// Number of columns (1 for vertical)
$columns = 4;


to


// Number of photos to display
$num_display = 1;

// Number of columns (1 for vertical)
$columns = 1;


this will just display 1 image on your home page


enjoy


i can put this module on any cmps page?
there is also the issue of how large that image will be....
will it be the size of all the other thumbnails - or can u set the size?

i get the error mesage:The file you have uploaded is not a valid module file.when i try and upload it - admincp>vba cmps>upload module

LiquidIce
11-08-2006, 10:20 AM
should work fine as i downloaded the module from my site

heres to do it manually:

Create Template called: adv_portal_thumb

<tr>
<td class="$bgclass">
$postthumbnail
</td>
</tr>

Create a file called: portalthumb.php & put it in your modules folder

<?php
include('/home/XXXXXX/public_html/gallery/inc_features.php');
echo "$photopostfeature";
?>

then edit inc_features.php from


// Number of photos to display
$num_display = 4;

// Number of columns (1 for vertical)
$columns = 4;


to


// Number of photos to display
$num_display = 1;

// Number of columns (1 for vertical)
$columns = 1;


this will just display 1 image on your home page


Hope it helps -

i have it as a top block so it looks like this:
http://img398.imageshack.us/img398/5049/samplecq6.gif


but for you if will look like this:
http://img299.imageshack.us/img299/5080/sample2ah9.gif



on the photopost site they said it wont show images from the members gallerys but i just done some editing so it does show ;)

sinjix_media
11-08-2006, 11:06 AM
so where can i control the size of this photo?

sinjix_media
11-08-2006, 11:16 AM
should work fine as i downloaded the module from my site

heres to do it manually:

Create Template called: adv_portal_thumb

<tr>
<td class="$bgclass">
$postthumbnail
</td>
</tr>

Create a file called: portalthumb.php & put it in your modules folder

<?php
include('/home/XXXXXX/public_html/gallery/inc_features.php');
echo "$photopostfeature";
?>

then edit inc_features.php from


// Number of photos to display
$num_display = 4;

// Number of columns (1 for vertical)
$columns = 4;


to


// Number of photos to display
$num_display = 1;

// Number of columns (1 for vertical)
$columns = 1;


this will just display 1 image on your home page


Hope it helps -

i have it as a top block so it looks like this:
http://img398.imageshack.us/img398/5049/samplecq6.gif


but for you if will look like this:
http://img299.imageshack.us/img299/5080/sample2ah9.gif



on the photopost site they said it wont show images from the members gallerys but i just done some editing so it does show ;)

thank u BTW... was just wondering where i could control the image size

LiquidIce
11-08-2006, 11:28 AM
so where can i control the size of this photo?

i dont think u can - or try looking in the admin area of the gallery

sinjix_media
11-08-2006, 11:35 AM
i dont think u can - or try looking in the admin area of the gallery
i looked... nothing....
wow i've seen this mod on so many forums, but cant seem to find it.

like this one:
http://www.texasphotoforum.com

LiquidIce
11-08-2006, 12:51 PM
Thats just calling a random image from a folder all the images are the same size, its nothing to do with a gallery

http://www.texasphotoforum.com/forum/rimages/ there you'll see all the images to be displayed, none of them are from the gallery

bugzy
11-08-2006, 12:53 PM
I dont think this works for 3.6, i had this working for 3.5.x