CPG MyBB Wrapper plugin for MyBB and coppermine bridge - install instructions CPG MyBB Wrapper plugin for MyBB and coppermine bridge - install instructions
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

CPG MyBB Wrapper plugin for MyBB and coppermine bridge - install instructions

Started by allvip, May 28, 2015, 02:30:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

allvip

Install instruction can be found here: http://community.mybb.com/thread-87200.html but they are very short. For begginers can be hard to understant so I'm writing a step by step tutorial since this plugin is a coppermine plugin.

1) Install coppermine
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.
2) Install MyBB forum script http://www.mybb.com/
3) Go to MyBB Admin CP - Configuration - Site Details - Cookie Path - type just /
3) Go to Bridge Manager in coppermine (your_domain/gallery_folder/bridgemgr.php). Bridge coppermine with MyBB.
Make sure MyBB and Coppermine are properly bridged and the features working as expected.
4) If you choosed Use bridge app custom groups? - YES when you bdridged then go to coppermine gropups - Administrators and allow him to Rating, Comments, Public albums upload, Personal gallery, Access level (see attachment groups.jpg)
5) Backup (make a copy) of your_gallery_folder/includes/init.inc.php
Open your_gallery_folder/includes/init.inc.php and after:

// Set $strict to false to make the superglobals available
$strict = TRUE;


add:

$globalcookie = $_COOKIE;
$globalpost = $_POST;
$globalget = $_GET;


6) Remove all the content between <DOCTYPE> and {CUSTOM_HEADER} and all the content below {CUSTOM_FOOTER}

Make a copy of the water drop themes or whatever themes you use for coppermine.
Example for theme water drop (your_gallery_folder/themes/water_drop):

Open themes/water_drop/template.html and delete:


<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="{LANG_DIR}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={CHARSET}" />
<meta http-equiv="Pragma" content="no-cache" />
<title>{TITLE}</title>
{META}
<link rel="stylesheet" href="css/coppermine.css" type="text/css" />
<link rel="stylesheet" href="themes/water_drop/style.css" type="text/css" />
<link rel="shortcut icon" href="favicon.ico" />


and:


</head>
<body>


and:


{CREDITS}
</body>
</html>


Add:

{CREDITS}

Under:

{GALLERY}

7) Download cpg_mybb_wrapper plugin ver 1.1 http://community.mybb.com/thread-87200.html or cpg_mybb_wrapper plugin Version 1.4.0 http://www.communityplugins.com/forum/mydownloads.php?action=browse_cat&cid=10

Version 1.4.0. works just like ver 1.1. It also contains a mybb wrapper plugin for MyBB to add in forum_folder/inc/plugins but is not compatible with MyBB 1.8. I do not know what mybb wrapper plugin for MyBB can do in plus.

Unzip and upload to your_gallery_folder/plugins only the folder mybb_wrapper (this should be a folder called mybb_wrapper with 3 files in it.). Is in coppermine/plugins folder of the zip file. Upload cpg_mybb_wrapper.php in your gallery folder. Is in coppermine folder of the zip file.


8 ) From your Coppermine plugin manager (usually linked in the Config > Plugin Manager or just type in the browser http://your_domain_name/your_gallery_folder/pluginmgr.php) click the Install icon next to the MyBB Wrapper plugin. This will install the plugin into Coppermine. After you install it click Configure plugin.

Enter the appropriate data using the default paths as an example:

MyBB Root Path (with trailing slash): http://your_domain_name/forum_folder/
Wrapper File (path relative to MyBB install): http://your_domain_name/your_gallery_folder/cpg_mybb_wrapper.php

Click the GO button.

9) If you want your coppermine theme to look like your forum theme then edit themes/water_drop/style.css or whatverver theme your are using.
Learn how to edit css styles: http://www.w3schools.com/css/default.asp

10) Open your_gallery_folder/cpg_mybb_wrapper.php and replace:

/***********************************************************
Start User Edit (1 of 2)
***********************************************************/

define('MYBB_ROOT', '/home/pavemen/public_html/board/');

/***********************************************************
End User Edit
***********************************************************/


with:


/***********************************************************
Start User Edit (1 of 2)
***********************************************************/

define('MYBB_ROOT', '../forum/');

/***********************************************************
End User Edit
***********************************************************/


I have coppermine install in gallery folder and MyBB in forum folder. If you have it diffrent then ajust

define('MYBB_ROOT', '../forum/') with your path.

11) Replace:


/***********************************************************
Start User Edit (2 of 2)
***********************************************************/

$headerinclude .= '<link rel="stylesheet" href="themes/classic/style.css" type="text/css" />';

/***********************************************************
End User Edit
***********************************************************/


with:


/***********************************************************
Start User Edit (2 of 2)
***********************************************************/

$headerinclude .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="{LANG_DIR}">';
$headerinclude .= '<meta http-equiv="Content-Type" content="text/html; charset={CHARSET}" />';
$headerinclude .= '<meta http-equiv="Pragma" content="no-cache" />';
$headerinclude .= '<title>{TITLE}</title>';
$headerinclude .= '{META}';
$headerinclude .= '<link rel="stylesheet" href="css/coppermine.css" type="text/css" />';
$headerinclude .= '<link rel="stylesheet" href="themes/water_drop/style.css" type="text/css" />';
$headerinclude .= '<link rel="shortcut icon" href="favicon.ico" />';
$headerinclude .= '{JAVASCRIPT}';

/***********************************************************
End User Edit
***********************************************************/


Replace water_drop in the code above with the name of the coppermine theme you use.

12) Create two new templates called cpg_main_top and cpg_main_bottom.
Go to your MyBB Forum Admin CP - click Templates & Style - click Templates - click Default Templates (or Global Templates if you want all forum themes to have this templates) - click Expand Templates - click Add Template - Template Name - cpg_main_top - paste this code (see attachment cpg_main_top.jpg):


<html>
<head>
{$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}


or


<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}


but <title>{$mybb->settings['bbname']}</title> from the code above will use the forum title not the coppermine title (up in the browser will show Your Forum Name, not Home - Your Gallery Name.

Click Save and Return to Listing

Click Add Template - Template Name - cpg_main_bottom - paste this code(see attachment cpg_main_bottom.jpg):


<br style="clear: both" />
{$footer}
</body>
</html>


Click Save and Return to Listing

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

14) Go to gallery/js folder and delete jquery-1.3.2.js

All Done!
IMPORTANT. If you want to edit your cpg_main_top and cpg_main_bottom templates code you can always go to: forum Admin CP - Templates & Style - Templates - Search/Replace - scroll down to Search Template Titles - Search For - type in the box cpg_main_top - click Find Templates - click Options - click Full Edit

IMPORTANT. If you want to unbridge go to Config - change to curve theme - go to plugin manager - uninstall it then go to bridge manager.