vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   New Posting Features - Photo Popup - Insert pictures easily from vB Albums, Photopost, vBGallery, Photoplog (https://vborg.vbsupport.ru/showthread.php?t=202385)

cellarius 10-25-2009 11:34 AM

Quote:

Originally Posted by wottech (Post 1902840)
Ken, there is a Garage 2.x config file that *I think* works over on the CND website. I thought someone had passed it on to cellarius, but perhaps not.

Sorry for the late answer, I was away on business.
Yes, the file was passed on to me, and should work, but since I have not succeeded in installing the new version (the light version available for free), I am unable to test it.

trotskid 11-05-2009 03:00 AM

Hi. We have private categories in Photoplog Pro for certain usergroups, but anyone can see all the categories in the photo popup, so I disabled temporaly. Any solution for this?

Thanks

cellarius 11-05-2009 08:54 PM

I don't understand. Everyone can only see the photos he himself uploaded. You tell me your users can upload photos they then have no permission to see? Seems not to make much sense to me if I have understood you correctly...

trotskid 11-05-2009 09:12 PM

I mean that all users can see all the categories when there are categories restricted for certain usergroups.

DieselTruck 11-06-2009 05:03 AM

Can anyone confirm that this works with the CND Garage system?

I can't get it to bring up any pictures???? It shows the title of the Vehicle, but no pictures.

Here is the actual file path:

http://www.thetruckstop.us/forum/ima...2571871491.jpg

Here is url the code is supplying:

http://www.thetruckstop.us/forum/ima...2571871491.jpg

cellarius 11-06-2009 06:28 AM

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).

trotskid 11-06-2009 03:49 PM

Ok, let me explain it again.

There is an option in your product that says "Show Albums list?" (Albums -> Categories on Photopost Pro, it's the same thing). If set to yes you can browse in a menu (drop down) all the categories (or albums..) in photo popup window, with or without your uploaded photos, you can see the categories, but in my forum there are categories with permissions, and these categories can see them any user (without permssion).

Sorry, my english is basic, so I explain it as better as I can.

wottech 11-06-2009 04:33 PM

Quote:

Originally Posted by cellarius (Post 1910901)
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.

DieselTruck 11-06-2009 04:34 PM

Thanks so much wottech!!

Works perfect!

cellarius 11-06-2009 07:03 PM

Quote:

Originally Posted by trotskid (Post 1911004)
Ok, let me explain it again.

There is an option in your product that says "Show Albums list?" (Albums -> Categories on Photopost Pro, it's the same thing). If set to yes you can browse in a menu (drop down) all the categories (or albums..) in photo popup window, with or without your uploaded photos, you can see the categories, but in my forum there are categories with permissions, and these categories can see them any user (without permssion).

Sorry, my english is basic, so I explain it as better as I can.

OK, I see the issue, but at the moment there's no way to take permissions into account. I would have to look at the database structure and change the query accordingly, which probably could be done, but atm I don't have the time, sorry :erm:


All times are GMT. The time now is 11:22 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01824 seconds
  • Memory Usage 1,765KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete