vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Integrating Coppermine photo gallery using VB CSS (https://vborg.vbsupport.ru/showthread.php?t=60183)

www.alfisti.net 04-05-2004 08:01 AM

Quote:

Originally Posted by PAINTBALLM
if coppermine was fully integrated an IF statement would work.

sorry, my english is not so good.
I ask for "how to integrate", not if it is possible.

It can?t be difficulty for a programmer to make a very small php-script to integrate this. it is the same database and all to do is to check if user id X has an entry in the table cpg_pictures table and put the result in a variable.
but I?am not a programmer and for me it is difficult :(

If somebody can give me the code I can put it in the vb-php file.

DeMiNe0 03-08-2005 04:56 PM

i have gone another approach to this. I have actauly included a page in the theme.php pageheader function of my coppermine theme. That header function now looks like this:
PHP Code:

function pageheader($section$meta '')
{
   global 
$CONFIG$THEME_DIR;
   global 
$template_header$lang_charset$lang_text_dir;


   if(empty(
$custom_header)){
         
chdir('/home/digtoxn/public_html/forums');
      include(
'/home/digtoxn/public_html/gallery/dtheader.php');
      
#include('http://www.digitaltoxicity.net/gallery/dtheader.php'); // Temp fix... Cookies + session DO NOT WORK WITH THIS ~Demi
      
$custom_header ob_get_contents();
      
ob_clean();
        
chdir('/home/digtoxn/public_html/gallery');
     }
   
   
header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
   
user_save_profile();

   
$template_vars = array(
      
'{LANG_DIR}' => $lang_text_dir,
      
'{TITLE}' => $CONFIG['gallery_name'].' - '.$section,
      
'{CHARSET}' => $CONFIG['charset'] == 'language file' $lang_charset $CONFIG['charset'],
      
'{META}' => $meta,
      
'{GAL_NAME}' => $CONFIG['gallery_name'],
      
'{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
      
'{MAIN_MENU}' => theme_main_menu(),
      
'{ADMIN_MENU}' => theme_admin_mode_menu(),
      
'{CUSTOM_HEADER}' => $custom_header,
   );

   echo 
template_eval($template_header$template_vars);


and the file i am including looks like this:
PHP Code:

<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS'1);
define('THIS_SCRIPT''dtgalleryheader'); // change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(

);

// get special data templates from the datastore
$specialtemplates = array(
    
);

// pre-cache templates used by all actions
$globaltemplates = array(
    
'gallery_shell',
);

// pre-cache templates used by specific actions
$actiontemplates = array(

);

// ######################### REQUIRE BACK-END ############################
// ## Grabs global.php ##
chdir("/home/digtoxn/public_html/forums");
require_once(
"./global.php");

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

$navbits = array();
$navbits[$parent] = 'Gallery';

$navbits construct_navbits($navbits);
eval(
'$navbar = "' fetch_template('navbar') . '";');
eval(
'print_output("' fetch_template('gallery_shell') . '");'); 

?>

Now if you look above at the first [php] tags(pageheader function)... If i include the file dtheader.php file via direct path, it throws out a VERY odd error...

Fatal error: Call to undefined function: query_first() in /home/digtoxn/public_html/forums/includes/functions.php on line 940

The reason why i find this to be an odd error is because, i KNOW query_first() is being defined.. I traced it back to an issue with the build_session function in sessions.php of vbulletin. vB defines a variable $DB_site. A call to build_session unsets this variable..... I have no rational explanation as to why it does this.... Thats where i get stumped...

As a temp fix you can comment the first include line out and uncomment the line under it in my pageheader() function php code above. That will display what you want (you may need to change the templates since i use a different header template). Just note that since php registeres as a guest to the board, it will display these templates as if a guest was viewing them.

Any help here would be great. I gave my 99cents.

Dean C 03-08-2005 07:48 PM

I can't see it in your example but you have not associated the query_first function with its object somewhere. Changes are you have query_first('QUERY HERE'); instead of $DB_site->query_first('QUERY HERE');

DeMiNe0 03-09-2005 02:54 AM

No no no no.... Read what i said above. When sessions.php calls build_session $DB_site is unset for some reasen.
I can only think of this as a bug in php as i do not see a reasen as to why it is doing this. I also presented it to 3 people in #php on freenode, and they think the same thing.

Dean C 03-09-2005 10:15 AM

Even if $DB_site was being unset I don't think that's the error you would get. var_dump($DB_site); wang that in your script in a few places and see if you get any output anywhere.


All times are GMT. The time now is 10:22 PM.

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.01174 seconds
  • Memory Usage 1,755KB
  • 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
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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