Make a forum Gallery from User Albums

SpeedRazors

New Member
vB Version: 3.7.0 Beta 5
Released 2 march 2008

This is a crude attempt at making a forum gallery from all the user albums on your vb 3.7.x forum.

I can imagine that there are many other better ways to achieve this, but I think my method is quick and easy enough to be shared with other users on this forum.

It is also my first attempt at a vbulletin hack, so forgive my naivety re all this.

STEPS:

1. Copy the album.php file and rename to (say) gallery.php
2. Open this new file in a text / php editor and navigate to line 1370 approx
3. Replace this part of the code

PHP Code:
Code:
 // fetch data and prepare data - took out  WHERE album.userid = $userinfo[userid]
 $albums = $db->query_read("
  SELECT album.*,
   picture.pictureid, picture.extension, picture.idhash,
   picture.thumbnail_dateline, picture.thumbnail_width, picture.thumbnail_height
   $hook_query_fields
  FROM " . TABLE_PREFIX . "album AS album
  LEFT JOIN " . TABLE_PREFIX . "picture AS picture ON (album.coverpictureid = picture.pictureid AND picture.thumbnail_filesize > 0)
  $hook_query_joins
   WHERE album.userid = $userinfo[userid]
   AND album.state IN ('" . implode("', '", $state) . "')
   $hook_query_where
  ORDER BY album.lastpicturedate DESC
  LIMIT $start, $perpage
 ");
with

PHP Code:
Code:
 // fetch data and prepare data - took out WHERE album.userid = $userinfo[userid]
 $albums = $db->query_read("
  SELECT album.*,
   picture.pictureid, picture.extension, picture.idhash,
   picture.thumbnail_dateline, picture.thumbnail_width, picture.thumbnail_height
   $hook_query_fields
  FROM " . TABLE_PREFIX . "album AS album
  LEFT JOIN " . TABLE_PREFIX . "picture AS picture ON (album.coverpictureid = picture.pictureid AND picture.thumbnail_filesize > 0)
  $hook_query_joins
   WHERE album.state IN ('" . implode("', '", $state) . "')
   $hook_query_where
  ORDER BY album.lastpicturedate DESC
  LIMIT $start, $perpage
 ");
It's as simple as that!

NOTE:
You need to have ?u=1 on the url, for the gallery to be available for guest viewing. I hope to sort this out later on.
 
Top