Quote:
Originally Posted by cellarius
There's a different config file somewhere with the new version of the mod; I don't offer it here since I couldn't test it (couldn't get the new garage version installed).
|
Code:
<?php
if (!IN_SCRIPT == "photo_popup") {die();}
/*
##################################################################################
## ##
## PHOTO POPUP 3.1 ##
## configuration for *** CND Garage *** ##
## ##
## This Mod is (c) 2009 by cellarius ##
## Contributions to this config file by wottech ##
##################################################################################
*/
// If you do allow albums selection in popup, but want to disable it for this
// product, set this to TRUE;
//
$album_override = FALSE;
//
/*################################################################################
####### Do not change anything beyond, except you know what you are doing! ######
################################################################################*/
/*
###### Basics ######
*/
$medium_possible = 0;
if ($medium_override == TRUE)
{
$medium_possible = 1;
}
$albums_possible = 1;
if ($album_override == TRUE)
{
$album_override = 1;
}
$db_prefix = TABLE_PREFIX . "garage_";
/*
###### Select statement for useralbums or categories ######
*/
function albums_select ()
{
global $db_prefix;
global $userid;
$albums_select .= "
SELECT vehicle_id, CONCAT(made_year, \" \",make, \" \",model) AS vehicle
FROM " . $db_prefix . "user_vehicle
LEFT JOIN " . $db_prefix . "makes
ON " . $db_prefix . "user_vehicle.make_id = " . $db_prefix . "makes.id
LEFT JOIN " . $db_prefix . "models
ON " . $db_prefix . "user_vehicle.model_id = " . $db_prefix . "models.id
WHERE " . $db_prefix . "user_vehicle.user_id = $userid
ORDER BY vehicle_id
";
return $albums_select;
}
/*
###### Select statement for pagination ######
*/
function count_select ()
{
global $db_prefix;
global $userid;
global $where_add;
$count_select = "
SELECT COUNT('attach_id') AS fotos
FROM " . $db_prefix . "images
INNER JOIN " . $db_prefix . "user_vehicle
ON " . $db_prefix . "images.vehicle_id = " . $db_prefix . "user_vehicle.vehicle_id
WHERE user_id = $userid" . $where_add . " AND attach_is_image = 1
";
return $count_select;
}
/*
###### Main select stateement for images ######
*/
function images_select()
{
global $db_prefix;
global $userid;
global $where_add;
$images_select = "
SELECT " . $db_prefix . "images.vehicle_id, attach_location, attach_thumb_location
FROM " . $db_prefix . "images
INNER JOIN " . $db_prefix . "user_vehicle
ON " . $db_prefix . "images.vehicle_id = " . $db_prefix . "user_vehicle.vehicle_id
WHERE user_id = $userid" . $where_add . " AND attach_is_image = 1
ORDER BY attach_date DESC
";
return $images_select;
}
/*
###### Construct image bits ######
*/
function imagebits ()
{
global $array;
global $data_dir;
global $vb_url;
global $userid;
global $filedir;
$filedir = $vb_url . "/images/garage/attach";
$path = implode('/', preg_split('//', $userid, -1, PREG_SPLIT_NO_EMPTY));
$filedir = $filedir . '/' . $path;
$img['orig'] = $filedir . "/" . $array['attach_location'];
$img['thumb'] = $filedir . "/" . $array['attach_thumb_location'];
$img['med'] = "";
$img['gallery'] = $vb_url . "/garage_vehicle.php?do=view_vehicle&id=" . $array['vehicle_id'];
return $img;
}
/*
###### Albums filter ######
*/
function where_add ()
{
global $which_album;
global $db_prefix;
$where_add = " AND " . $db_prefix . "user_vehicle.vehicle_id = $which_album";
return $where_add;
}
?>
Copy and paste the above code into the CND garage config file and you should be set.