View Single Post
  #459  
Old 11-06-2009, 04:33 PM
wottech wottech is offline
 
Join Date: May 2006
Posts: 122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cellarius View Post
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&amp;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.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01244 seconds
  • Memory Usage 1,792KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete