Regarding my previous tutorial for integrating Coppermine into MyBB at http://community.mybb.com/thread-76482.html, I have modified parts of it to be implemented as its own Coppermine plugin. No more modifying the sample plugin or plugin file edits.
================================================
This integration requires:
One CPG core file edit
Tweaks to CPG template of choice
Install and configure included Coppermine plugin
Upload included wrapper file
Two new MyBB templates for the top and bottom of the wrapper
==========================
Step 1. Getting started
==========================
Set your current Coppermine installation to use a default unmodified theme (one that you will not be modifying for integration). This will make it easier to install and configure the plugin without the theme messing up the layout.
Make sure MyBB and Coppermine are properly bridged and the features working as expected.
Backup <CPGROOT>\includes\init.inc.php
==========================
Step 2. Coppermine Core File Edits for 1.5.x
==========================
Edit <cpgroot>\includes\init.inc.php
Here you can either disable strict mode, but that opens up all superglobals that CPG is trying to lock out for security, or make a copy of the $_COOKIE variable before that happens and let CPG work as it originally does. I chose the latter method
after:
add:
This will store the $_COOKIE variables for later use in the MyBB code. Without this edit or setting $strict = FALSE, MyBB will not have access to the server cookies needed to support MyBB user data when wrapping in CPG 1.5
If you use the $strict=FALSE; option instead, you should still add the $globalcookie line, or if not, comment out three lines similar to $_COOKIE=$globalcookie (cookie, post and get) line in the wrapper file below
==========================
Step 3. Template Edits for Coppermine 1.5.x
==========================
In my case, I edited the template.html file of the Classic theme. In template.html, remove all the content between <DOCTYPE> and {CUSTOM_HEADER} and all the content below {CUSTOM_FOOTER}
While you are there, correct any layout issues like missing closing tags, etc.
If there is any javascript or stylesheet info in the template.html header, retain that info for later use.
Depending on how complex the theme is, you may just want to backup the Classic theme and modify that one as it is a simple theme and template which will make initial edits easier. You can always apply these edits to another theme once you have the integration working.
==========================
Step 4. CSS Edits for Coppermine 1.5.x
==========================
To match the overall look, you need to edit the Classic theme's style.css file as well. For my site, I had to modify .tableh1, .tableh1compact and .navmenu to include the background and color settings from MyBB's .thead. You may need to adjust the path to background images depending on your folder setup.
There may be other minor edits you need to make the style.css file to get a better looking match.
==========================
Step 5. Installing Coppermine Plugin for 1.5.x
==========================
Upload the contents of the included \Coppermine\plugins folder to you <cpgroot>\plugins\ folder. This should be a folder called mybb_wrapper with 3 files in it.
From your Coppermine plugin manager (usually linked in the Config > General Settings > Plugins > Manage Plugins) click the Install icon next to the MyBB Wrapper plugin. This will install the plugin into Coppermine and take you to the plugin configuration page.
Enter the appropriate data using the default paths as an example. Click the OK button.
==========================
Step 6. Wrapper for MyBB 1.4.x/1.6.x
==========================
I have include my copy of the wrapper in the zip file as I need it. There are several edits you would need to make...
You may need to modify the globals line. Most entries are required, but as you can see, there are some variables you wont need, like the $adserver_* ones as those are for my banner ads that are generated via a separate plugin. If you have a plugin that applies other variables to the templates, you will need to add those to this globals list.
Update the path in the MYBB_ROOT definition. This is the only edit required for basic functionality.
Remember the template.html <head> items you saved when modifying that file? Now is the time to add those into the $headerinclude variable at the bottom of the wrapper. Otherwise you will loose the features of the CPG theme you are trying to implement. Do NOT overwrite the $headerinclude, but append to it.
If you set the init.inc.php file to use $strict=FALSE, comment out the $_COOKIE=$globalcookie line unless you added the globalcookie line to init.inc.php above.
There is some navigation language when adding the breadcrumb, you can edit that if you like.
Upload this file to your <CPGROOT> folder
==========================
Step 7. Templates for MyBB 1.4.x or 1.6.x
==========================
Create two new templates called cpg_main_top and cpg_main_bottom. I am using the default templates, so adjust to fit your template needs. I just grabbed the parts I needed from the index template.
Top:
Bottom:
==========================
Step 8. Clean Up existing custom header/footer for Coppermine 1.5.x
==========================
If you have already specified a custom header and/or footer in the CPG config, empty those values as the wrapper will now handle it all.
All Done!
==========================
You can check out how it all is working on my site, listed in my sig line.
UPDATE on 10/8/2011
There is an issue if your host still have Magic Quotes enabled (you really should ask them to disable it and if your site breaks, update it to not use magic_quotes and code it correctly)
So there are minor edits required to make it work (Step 2 has been updated). The above tutorial has been updated as has the attached zip package.
To upgrade, just redo Step 2 above and upload the new cpg_mybb_wrapper.php file.
================================================
This integration requires:
One CPG core file edit
Tweaks to CPG template of choice
Install and configure included Coppermine plugin
Upload included wrapper file
Two new MyBB templates for the top and bottom of the wrapper
==========================
Step 1. Getting started
==========================
Set your current Coppermine installation to use a default unmodified theme (one that you will not be modifying for integration). This will make it easier to install and configure the plugin without the theme messing up the layout.
Make sure MyBB and Coppermine are properly bridged and the features working as expected.
Backup <CPGROOT>\includes\init.inc.php
==========================
Step 2. Coppermine Core File Edits for 1.5.x
==========================
Edit <cpgroot>\includes\init.inc.php
Here you can either disable strict mode, but that opens up all superglobals that CPG is trying to lock out for security, or make a copy of the $_COOKIE variable before that happens and let CPG work as it originally does. I chose the latter method
after:
// Set $strict to false to make the superglobals available
$strict = TRUE;
add:
$globalcookie = $_COOKIE;
$globalpost = $_POST;
$globalget = $_GET;
This will store the $_COOKIE variables for later use in the MyBB code. Without this edit or setting $strict = FALSE, MyBB will not have access to the server cookies needed to support MyBB user data when wrapping in CPG 1.5
If you use the $strict=FALSE; option instead, you should still add the $globalcookie line, or if not, comment out three lines similar to $_COOKIE=$globalcookie (cookie, post and get) line in the wrapper file below
==========================
Step 3. Template Edits for Coppermine 1.5.x
==========================
In my case, I edited the template.html file of the Classic theme. In template.html, remove all the content between <DOCTYPE> and {CUSTOM_HEADER} and all the content below {CUSTOM_FOOTER}
While you are there, correct any layout issues like missing closing tags, etc.
If there is any javascript or stylesheet info in the template.html header, retain that info for later use.
Depending on how complex the theme is, you may just want to backup the Classic theme and modify that one as it is a simple theme and template which will make initial edits easier. You can always apply these edits to another theme once you have the integration working.
==========================
Step 4. CSS Edits for Coppermine 1.5.x
==========================
To match the overall look, you need to edit the Classic theme's style.css file as well. For my site, I had to modify .tableh1, .tableh1compact and .navmenu to include the background and color settings from MyBB's .thead. You may need to adjust the path to background images depending on your folder setup.
There may be other minor edits you need to make the style.css file to get a better looking match.
==========================
Step 5. Installing Coppermine Plugin for 1.5.x
==========================
Upload the contents of the included \Coppermine\plugins folder to you <cpgroot>\plugins\ folder. This should be a folder called mybb_wrapper with 3 files in it.
From your Coppermine plugin manager (usually linked in the Config > General Settings > Plugins > Manage Plugins) click the Install icon next to the MyBB Wrapper plugin. This will install the plugin into Coppermine and take you to the plugin configuration page.
Enter the appropriate data using the default paths as an example. Click the OK button.
==========================
Step 6. Wrapper for MyBB 1.4.x/1.6.x
==========================
I have include my copy of the wrapper in the zip file as I need it. There are several edits you would need to make...
You may need to modify the globals line. Most entries are required, but as you can see, there are some variables you wont need, like the $adserver_* ones as those are for my banner ads that are generated via a separate plugin. If you have a plugin that applies other variables to the templates, you will need to add those to this globals list.
Update the path in the MYBB_ROOT definition. This is the only edit required for basic functionality.
Remember the template.html <head> items you saved when modifying that file? Now is the time to add those into the $headerinclude variable at the bottom of the wrapper. Otherwise you will loose the features of the CPG theme you are trying to implement. Do NOT overwrite the $headerinclude, but append to it.
If you set the init.inc.php file to use $strict=FALSE, comment out the $_COOKIE=$globalcookie line unless you added the globalcookie line to init.inc.php above.
There is some navigation language when adding the breadcrumb, you can edit that if you like.
Upload this file to your <CPGROOT> folder
==========================
Step 7. Templates for MyBB 1.4.x or 1.6.x
==========================
Create two new templates called cpg_main_top and cpg_main_bottom. I am using the default templates, so adjust to fit your template needs. I just grabbed the parts I needed from the index template.
Top:
<html>
<head>
<title>{$mybb->settings['bbname']}</title>
{$headerinclude}
<script type="text/javascript">
<!--
lang.no_new_posts = "{$lang->no_new_posts}";
lang.click_mark_read = "{$lang->click_mark_read}";
// -->
</script>
</head>
<body>
{$header}
Bottom:
<br style="clear: both" />
{$footer}
</body>
</html>
==========================
Step 8. Clean Up existing custom header/footer for Coppermine 1.5.x
==========================
If you have already specified a custom header and/or footer in the CPG config, empty those values as the wrapper will now handle it all.
All Done!
==========================
You can check out how it all is working on my site, listed in my sig line.
UPDATE on 10/8/2011
There is an issue if your host still have Magic Quotes enabled (you really should ask them to disable it and if your site breaks, update it to not use magic_quotes and code it correctly)
So there are minor edits required to make it work (Step 2 has been updated). The above tutorial has been updated as has the attached zip package.
To upgrade, just redo Step 2 above and upload the new cpg_mybb_wrapper.php file.
Lost interest, sold my sites, will browse here once in a while. It's been fun.