MyBB Community Forums

Full Version: Using MyBB settings on non-MyBB php pages
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'm not sure if this is the best place, but I guessed plugin peeps would have more idea on this than theme peeps. Undecided

Anyway.

I want to use MyBB settings on non-MyBB pages. Coppermine Photo Gallery pages to be precise.

I'm trying to create a theme for Coppermine that integrates with MyBB. So I'm calling the MyBB CSS and using all the MyBB classes instead of Coppermine classes.

I want to use {$mybb->settings['bburl']}, {$theme['borderwidth']} and {$theme['tablespace']} in the Coppermine theme. Is that possible? If so how?

Coppermine and MyBB use the same database with different table prefixes.

Any help appreciated. Smile
unfortunately you cant use the built-in Coppermine optional header/footer files that contain PHP code as they are output as HTML.

you would have to modify the Coppermine theme/template PHP files to be able to include dynamic content required to make a fully functional mybb header/footer.

this is why my site looks similar, but is not a fully functional mybb header. i took the forum source code and pasted the header/footer parts into static HTML files that I specify in the Coppermine config.

unfortunately, Coppermine uses an archaic template/theme system (at least in the coppermine 1.4 series)
(2010-06-08, 06:53 PM)pavemen Wrote: [ -> ]you would have to modify the Coppermine theme/template PHP files to be able to include dynamic content required to make a fully functional mybb header/footer.

Do you know how I would go about using those settings in theme.php?

It's probably only those 3 settings I need to use.
need to include global and init files, iirc. then you can use those variables. i do not recall which coppermine file you need to modify though.

i thought about doing this myself but was too lazy to do. it was easier to copy the source code of a page i liked to 'get it close'
(2010-06-08, 08:10 PM)pavemen Wrote: [ -> ]need to include global and init files, iirc. then you can use those variables. i do not recall which coppermine file you need to modify though.

i thought about doing this myself but was too lazy to do. it was easier to copy the source code of a page i liked to 'get it close'

Well that's what I'm doing atm on http://petsmania.net - but I want to make something people can just upload and be done with it, no editing of files etc. So anyone can have Coppermine intergrated with MyBB. Smile
I suppose one could create a coppermine plugin that will let the admin set the paths to their mybb files, then hook in the proper place that the mybb/coppermine templates can use it.
Hmmm, I think this is possibly a bit beyond me at the moment. Sad
this is why i kept my setup simple....

i may look at it later, as an integration plugin (outside the built in bridge system) would be nice to simplify the overall integration and look of the site
Could you not just include:

Mybbpath/inc/init.php
Into a global file used by all coppermine pages


Then call: $mybb->blah
(2010-06-23, 09:19 PM)Tommyk Wrote: [ -> ]Could you not just include:

Mybbpath/inc/init.php
Into a global file used by all coppermine pages


Then call: $mybb->blah

i would recommend including global.php instead of init.php as global has all the theme, user, etc settings.

also, doing so defeats the option of "upload and go" with no file edits. though i agree its an easy solution.
Pages: 1 2