View Full Version : Integrating Coppermine photo gallery using VB CSS
tgmorris
01-14-2004, 12:48 AM
I've got Coppermine installed and running with VB3 RC2. The next step is to get the styles to match. If I were to load the VB stylesheet into Coppermine is there any way to combine the 2 style sheets. That is, to redefine the Coppermine definitions based on the dynamically changing (on a per user basis) vb CSS?
The easy way would be to do something like this...
.tableh1 { .thead }
though, based on research, I doubt something like this works. Other than manually changing all the class statements in Coppermine are there any other options?
MaceNL
02-18-2004, 06:10 PM
Also would like some help on this problem
Dark_Wizard
02-18-2004, 06:35 PM
The only way I can see this working is to change all the classes in Coppermine to match vb's and adding something to the bridge and usercp....
tgmorris
02-19-2004, 02:00 AM
The only way I can see this working is to change all the classes in Coppermine to match vb's and adding something to the bridge and usercp....
Yup. I've got it to the point it loads the vb CSS info. Next is to modify the coppermine templates to use the vb classes. One of these days....
MaceNL
02-19-2004, 09:13 AM
Gonna be very excited if that hack/mod comes out ;)
Go tgmorris :D
tgmorris
02-22-2004, 05:15 PM
Well, here it is. It's not 100% complete as some of the coppermine classes are still in the HTML but it does seem to work. I don't know if I'll extend it beyond what I've done so far so feel free to make enhancements and post them.
MaceNL
02-22-2004, 07:29 PM
Thanks allot for posting the stuff mate gonna help me allot for now :D
Chefmom
02-23-2004, 10:37 PM
thanks!!
chas_h
02-24-2004, 05:38 AM
Well, here it is. It's not 100% complete as some of the coppermine classes are still in the HTML but it does seem to work. I don't know if I'll extend it beyond what I've done so far so feel free to make enhancements and post them.
Hi, thanks for your efforts. I'm trying to use this now with a working copy of Vbulletin 3 Rc-4 integrated with Coppermine and I'm getting these 2 errors
"Parse error: parse error in /var/www/html/gallery/bridge/vbulletin.inc.php on line 170
Fatal error: Call to undefined function: udb_authenticate() in /var/www/html/gallery/include/init.inc.php on line 167"
If I revert to the original vbulletin.inc.php I can at least get to the gallery. Any idea where I'm going wrong? Maybe I messed up on one of the edits?
Chas.
tgmorris
02-24-2004, 02:38 PM
Hi, thanks for your efforts. I'm trying to use this now with a working copy of Vbulletin 3 Rc-4 integrated with Coppermine and I'm getting these 2 errors
"Parse error: parse error in /var/www/html/gallery/bridge/vbulletin.inc.php on line 170
Fatal error: Call to undefined function: udb_authenticate() in /var/www/html/gallery/include/init.inc.php on line 167"
If I revert to the original vbulletin.inc.php I can at least get to the gallery. Any idea where I'm going wrong? Maybe I messed up on one of the edits?
Chas.
Hmm. May depend on which version of the bridge file you are using. You can find the modified bridge file I'm using in https://vborg.vbsupport.ru/showpost.php?p=475585&postcount=15. You may want to download it and do a comparison.
chas_h
02-24-2004, 04:08 PM
Hmm. May depend on which version of the bridge file you are using. You can find the modified bridge file I'm using in https://vborg.vbsupport.ru/showpost.php?p=475585&postcount=15. You may want to download it and do a comparison.
Hey, that seems to have fixed it, thank you very much. I can see some of my styles coming through when the 'default' theme is chosen by the admin. I can even see some of the gradient effect, possibly because I had changed paths to images a while back when integrating the Vbadvanced homepage.
I must have been using a very outdated version of the bridge file as the one I had didn't even have a place to put my VB license number. I think there are too many versions of that file around :)
Thanks again for your work on this, it's looking great so far.
Chas.
tgmorris
02-24-2004, 05:07 PM
Hey, that seems to have fixed it, thank you very much. I can see some of my styles coming through when the 'default' theme is chosen by the admin. I can even see some of the gradient effect, possibly because I had changed paths to images a while back when integrating the Vbadvanced homepage.
I must have been using a very outdated version of the bridge file as the one I had didn't even have a place to put my VB license number. I think there are too many versions of that file around :)
Thanks again for your work on this, it's looking great so far.
Chas.
Glad to help out.
Ogmuk
03-11-2004, 01:17 PM
It looks like theme.php still requires a lot of tweaking to get it to look like vbulletin's style. Is there someone who already put some time into tweaking this file and who wouldn't mind sharing an updated version?
tgmorris
03-11-2004, 03:07 PM
Have you already looked at https://vborg.vbsupport.ru/showpost.php?p=478908&postcount=6 ?
It's a first step in getting the colors to match. If you've got multiple styles that have graphics changes then, yes, there's a bunch of work left to be done. Even the stuff I've done to date is only just the start. But at least the color scheme is a lot closer on stlye changes.
If you decide to take on the challenge be sure to post your results so we can all benefit ;)
Ogmuk
03-11-2004, 03:49 PM
Yes, I have used your hack on my testvb board and it's great :) But with the CSS info of vbulletin in the page and thus with the default colors it's still quite a task to shape it into a theme for the default style with correct font sizes, alt colors for tables and everything.
tgmorris
03-11-2004, 04:27 PM
I agree wholeheartedly. That's why I stopped where I did - that and it works for what I need at the moment. But yes, it would take a dedicated individual to complete the work and redo almost all of the templates.
Plus, what it really needs is some additional coding in order to pull in all the style variables as well.
PAINTBALLM
03-12-2004, 02:34 PM
be nice get it to use vb3 navbar, and header and footer.... and also, any chance of getting more in depth so if that user has their own gallery, it shows a "Gallery" button in their postbit... when people click it, it takes tem to that persons gallery.. thats current the only thing keeping me from using coppermine instead of photopost.
magnus
03-12-2004, 06:36 PM
Heh, it would've saved me some time had I found this thread sooner.. in any event, I've sort of worked it the same way as you, tgmorris. Hours of template editing later, and I have this: http://www.sffba.net/gallery
I would release everything I did, to try and make it easier on the rest of us, but it's so involved that I would almost certainly either screw up the instructions or worse. The only advice I can give is, trial and error. Just make small adjustments, and make sure they work. A good 99% of the work is templates, but if you want to add navbar with login support, etc.. it's a bit more involved. ;)
PAINTBALLM
03-12-2004, 07:00 PM
Is anyone able to write this out in a hack for those of us who arent as experienced with vb hacking?
Reeve of shinra
03-12-2004, 07:07 PM
"any chance of getting more in depth so if that user has their own gallery, it shows a "Gallery" button in their postbit"
Whats the link to a users gallery? I think I have a way of accomplishing this but I need am I am a bit behind in how coppermine accomplishes some things.
magnus
03-12-2004, 07:19 PM
any chance of getting more in depth so if that user has their own gallery, it shows a "Gallery" button in their postbit
Easy, it would be SQL. Just check against the cpg11d_albums table for the userid, if it exists, he has an album. If not.. well, he doesn't. ;)
I can write this out later, I'm getting ready to take off from work.
Reeve of shinra
03-12-2004, 07:39 PM
So if I understand this correctly its Catagories first then Albums, right? ugh! We need each user to have thier own gallery and it would be a plus if they could put thier own work into thier own catagories though I guess at this junction that may not be too big a deal. I may try out gallery and work on intergrating that instead.
edit: let me clarify this by saying that I am looking for a nice easy way to pull up a users gallery which I don't think coppermine is capable of as it currently stands. :ermm:
As for showing a gallery button in the postbit, I was thinking of having a secondary usergroup for gallery users and using a bit of php in the template to show the link for anyone in that usergroup. The users album can be made to correspond with their member ID's so the link in the post bit should be a fairly simple thing that way.
magnus
03-12-2004, 08:38 PM
So if I understand this correctly its Catagories first then Albums, right? ugh! We need each user to have thier own gallery and it would be a plus if they could put thier own work into thier own catagories though I guess at this junction that may not be too big a deal. I may try out gallery and work on intergrating that instead.
edit: let me clarify this by saying that I am looking for a nice easy way to pull up a users gallery which I don't think coppermine is capable of as it currently stands. :ermm:
As for showing a gallery button in the postbit, I was thinking of having a secondary usergroup for gallery users and using a bit of php in the template to show the link for anyone in that usergroup. The users album can be made to correspond with their member ID's so the link in the post bit should be a fairly simple thing that way.
Of course you can pull up a users gallery easily. For instance, on my forum you can access a gallery via http://www.mysite.com/gallery/users?username
It doesn't get much easier than that. ;)
Also, the vBulletin -> Coppermine bridge already synchronizes albums with userid. All the groundwork is layed, you just need to grab it from the SQL DB.
PAINTBALLM
03-12-2004, 09:36 PM
could someone give us info on how to do the navbar and header & footer so it works 100% with vbulletins templates..
magnus
03-12-2004, 10:40 PM
could someone give us info on how to do the navbar and header & footer so it works 100% with vbulletins templates..
It's a minor pain in the butt. You need to copy the login code from the vB template and apply it in the coppermine template and tweak it yourself. It's not going to be the same for everyone. See mine @ http://www.sffba.net/gallery/
PAINTBALLM
03-12-2004, 10:59 PM
ok w/e so your saying, copy the same code that calls the header and footer, global, and navbar in index.php into the gallery php files... and i should be good to go? As long as i change the path so it can work in a different directory?
joeychgo
03-18-2004, 08:55 PM
Mangus - could you give me step by step of how to make my coppermine look like my vb -- as you did? Im still green at all this........ and skinning coppermine is a bit beyond my abilities yet --- I just figured out how to add something to the navbar LOL
WreckRman2
03-31-2004, 01:53 AM
magnus, any news on an update? Your site looks best by far.
BTW, did you get the gallery/users?username hack off the Coppermind forums? I wrote that little script. :)
www.alfisti.net
04-04-2004, 11:18 PM
Ciao,
a little bit offtopic...
I use the following link in postbit:
<a href="/gallery/thumbnails.php?album=lastupby&uid=$post[userid]"><img src="gallerypic.gif" border="0" alt="Gallerypictures of $post[username]"> $post[username]?s Gallery</a>
I want to display the link only for user who have uploaded pictures.
But I don?t know how to code a script to use a parameter with the if-clause
the table cpm_pictures has an owner_id field so it can?t be difficult for a programmer ;)
Can somebody help me please?
Thanks
Andr?
PAINTBALLM
04-04-2004, 11:37 PM
if coppermine was fully integrated an IF statement would work.
www.alfisti.net
04-05-2004, 08:01 AM
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:
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
// ####################### 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.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.