Album Manager not working in Coppermine Album Manager not working in Coppermine
 

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

Album Manager not working in Coppermine

Started by paquito, May 25, 2015, 02:12:01 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

paquito

Hi! All, I have integrated Coppermine with MyBB. But Album Manager not working as expected. All buttons are not working in Album Manager. looks like buttons are frozen.I tried to upload images as a registered user and as an admin, but I couldn't. Also I switched between the themes to find a solution, but It's not working. I have saw previous threads that mentioned this thing happens because of jQuery problem (I'm not a coder  :-[). Please help me to solve this.

Gallery url: rclanka.com/gallery/


Test Account login here: rclanka.com/gallery/login.php?referer=index.php
   Username: test
   Password: testsite

thanks.

paquito

and I'm using Coppermine 1.5.36 version

allvip

Where did you added this and what you need it for:


<script type="text/javascript" src="http://rclanka.com/jscripts/jquery.js?ver=1800"></script>
<script type="text/javascript" src="http://rclanka.com/jscripts/jquery.plugins.min.js?ver=1800"></script>
<script type="text/javascript" src="http://rclanka.com/jscripts/general.js?ver=1800"></script>


Your album manager is not working with any theme. Not even water_drop: http://rclanka.com/gallery/albmgr.php?theme=water_drop

paquito

Hi! allvip, Thanks for helping. I have fixed the problem. I just remove the {JAVASCRIPT} from theme templates and It works like charm. But I don't know that how this affect other features.  ;)

allvip

I don't think that's the answer.
Under {JAVASCRIPT} from theme template.html you should add:


<script type="text/javascript" src="http://rclanka.com/jscripts/jquery.js?ver=1800"></script>
<script type="text/javascript" src="http://rclanka.com/jscripts/jquery.plugins.min.js?ver=1800"></script>
<script type="text/javascript" src="http://rclanka.com/jscripts/general.js?ver=1800"></script>


That jquery scripts works if added after {JAVASCRIPT}.

Is this code in template.html?

<script type="text/javascript" src="http://rclanka.com/jscripts/jquery.js?ver=1800"></script>
<script type="text/javascript" src="http://rclanka.com/jscripts/jquery.plugins.min.js?ver=1800"></script>
<script type="text/javascript" src="http://rclanka.com/jscripts/general.js?ver=1800"></script>

paquito

no, I don't see it in them's templates.html. But I can see those scripts in "View Page Source"  via Firefox. I have used MyBB Wrapper. But I don't know about coding.

allvip

#6
Quote from: paquito on May 25, 2015, 04:53:04 PM
I have used MyBB Wrapper.

You used cpg_mybb_wrapper plugin http://www.communityplugins.com/forum/mydownloads.php?action=view_down&did=4

About {JAVASCRIPT} http://documentation.coppermine-gallery.net/en/theme_template.htm#theme_template_javascript

http://documentation.coppermine-gallery.net/en/theme_template.htm#theme_template_important

Be careful not to delete the {JAVASCRIPT}-token - this javascript is necessary for the full-size pop-ups and other functions related to JavaScript. If you remove it, you probably won't notice the difference in the first place, but you definitely mustn't remove it or your gallery will act up.

The problem you have is:
_coppermine loads on the pages jquery-1.3.2.js from the js folder of your coppermine.
_your MyBB Wrapper loads on the pages jQuery v1.11.2 from your_MyBB_folder/jscripts/jquery.js). You can see it with  in "View Page Source"  via Firefox:

<script type="text/javascript" src="http://rclanka.com/jscripts/jquery.js?ver=1800"></script>

That creats a jquery conflict (only one jquery version can load on a page) and is no need for two jquery versions to run on the same page anyway. One is enough for all the jquery plugins that load on the page.

DELETE jquery-1.3.2.js from gallery/js folder. Your jQuery v1.11.2 that is load it on every page by MyBB Wrapper will run all coppermine jquery scripts from gallery/js folder.

paquito

Thanks for your help allvip. I have removed jquery-1.3.2.js from gallery/js folder and added {JAVASCRIPT} to the template. But again I can't create albums in album manager. Same as before. Any help?  :)

allvip

#8
1)What version of MyBB you have?
2)Can you tell me the code you have in gallery/cpg_mybb_wrapper.php section:


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

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

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



3) Where you added it the code from Step 7: http://www.communityplugins.com/forum/showthread.php?tid=15
4) Can you paste the code from themes/water_drop/template.html?

allvip

#9
FOR GREG

I'm trying to test cpg_mybb_wrapper plugin, but I am not expert in php.
I have to append:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<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" />
{JAVASCRIPT}
</head>
<body>


to:


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


How to I do it? Can you give me the code?

Is this OK?


$headerinclude .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
$headerinclude .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="{LANG_DIR}">';
$headerinclude .= '<head>';
$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}';
$headerinclude .= '<head>';
$headerinclude .= '<body>';

gmc

I'm not familiar with the CPG MYBB Wrapper - nor do I have a test environment with MYBB...

Multiple ways to do the assignment - what you have is valid.
(individual assignments per line - single assignment in quotes - single assignment with heredoc syntax)
change the last $headerinclude .= '<head>'; to $headerinclude .= '</head>';  - just a typo from copying I'm sure...

Greg
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

paquito

#11
Hi! Thank you all guys for you great support.
I'm intergrated by following this instructions: http://community.mybb.com/thread-87200.html

(1) MyBB wrapper.php code in my site

<?php
//ver 1.1
//PavementSucks.com

global $BRIDGE$globalcookie$globalpost$globalget$mybb$db$plugins$lang$groupscache$error_handler$theme$templates$cache$navigation$adserver_header_banner$adserver_header_leaderboard$adserver_skyscraper_top$adserver_footer,$cpg_main_top,$cpg_main_bottom;

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

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

define('MYBB_ROOT''/actual/root/deleted/as/requested');

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


define('IN_MYBB'1);
define('IN_CPG'1);
require(
$BRIDGE['relative_path_to_config_file'] . 'config.php');

$current_dir getcwd();

// set the path to your forums directory here (without trailing slash)
$forumdir MYBB_ROOT;

//change working directory to allow board includes to work
$forumdirslash $forumdir."/";
$change_dir "./";

if(!@
chdir($forumdir) && !empty($forumdir))
{
if(@is_dir($forumdir))
{
$change_dir $forumdir;
}
else
{
die("\$forumdir is invalid!");
}
}

require_once 
MYBB_ROOT."global.php";
require_once 
MYBB_ROOT."inc/functions.php";

//change directory back to current where script is
@chdir($current_dir);

$theme['imgdir'] = $forumdirslash.substr($theme['imgdir'],0);
$theme['imglangdir'] = $forumdirslash.substr($theme['imglangdir'],0);

//init time
$dateline time();

/* URL Definitions */
if($mybb->settings['seourls'] == "yes" || ($mybb->settings['seourls'] == "auto" && $_SERVER['SEO_SUPPORT'] == 1))
{
define('CPG_URL'"index.php");
}
else
{
define('CPG_URL'"index.php");
}

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

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


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

eval("\$cpg_main_top = \"".$templates->get("cpg_main_top")."\";");
eval(
"\$cpg_main_bottom = \"".$templates->get("cpg_main_bottom")."\";");

global 
$navbits;

//since mybb parse page does not work in this case, replicate important parts and rebuild vars from others files.

// Add our main parts to the navigation
$navbits = array();
$navbits[0]['name'] = $mybb->settings['bbname_orig'];
$navbits[0]['url'] = $mybb->settings['bburl']."/index.php";

//add initial breadcrumb
add_breadcrumb('Pics/Video'CPG_URL);

// Set the link to the archive.
$archive_url $mybb->settings['bburl']."/archive/index.php";

$cpg_main_top str_replace('<navigation>'build_breadcrumb(1), $cpg_main_top);
$cpg_main_bottom str_replace('<archive_url>'$archive_url$cpg_main_bottom);

$cpg_main_top str_replace("<html""<html xmlns=\"http://www.w3.org/1999/xhtml\""$cpg_main_top); 

if(
$lang->settings['rtl'] == 1)
{
$cpg_main_top str_replace("<html""<html dir=\"rtl\""$cpg_main_top);
}
if(
$lang->settings['htmllang'])
{
$cpg_main_top str_replace("<html""<html xml:lang=\"".$lang->settings['htmllang']."\" lang=\"".$lang->settings['htmllang']."\""$cpg_main_top);
}


?>



(2) I'm using water drop theme

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<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" />

<!--
  SVN version info:
  Coppermine version: 1.5.9
  $HeadURL: https://svn.code.sf.net/p/coppermine/code/trunk/cpg1.5.x/themes/water_drop/template.html $
  $Revision: 7809 $
-->
</head>
<body>
  {CUSTOM_HEADER}
  <table width="100%" border="0" cellpadding="20" cellspacing="20">
    <tr>
      <td valign="top" style="border: 1px solid #CCD7E0; background-color: #F8F8F8;">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="100%" align="center">
              {SYS_MENU}{SUB_MENU}
            </td>
          </tr>
        </table>
        <img src="images/spacer.gif" width="1" height="15" alt="" />
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td valign="top">
              {MESSAGE_BLOCK}
              {GALLERY}
               {CREDITS}
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
  {CUSTOM_FOOTER}
</body>
</html>


(3) I'm using MyBB 1.8 in my forum. Thanks.

paquito

Hi! gmc I have sent an emergency pm for you. Please take a look. Also allvip Can you please send me a messege or email. I need your help immediately. I have made mistake in forum. my email. vipularcl@gmail.com thanks.

paquito


allvip

#14
Quote from: gmc on May 27, 2015, 01:34:40 PM
Multiple ways to do the assignment - what you have is valid.

Greg

Thanks A LOT.

allvip

Quote from: paquito on May 27, 2015, 04:23:26 PM
I have made mistake in forum.

What mistakes?

Anyway, here is the SOLUTION:

1) 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 - DELETE from the code:


<title>{$mybb->settings['bbname']}</title>


2) Open gallery/cpg_mybb_wrapper.php.

Find:

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

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


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


Replace 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
***********************************************************/


3) Open gallery/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:


</body>
</html>


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

allvip

#16
Quote from: paquito on May 27, 2015, 03:48:07 PM
I'm intergrated by following this instructions: http://community.mybb.com/thread-87200.html

You did not do Step 3. Template Edits for Coppermine 1.5.x (In template.html, remove all the content between <DOCTYPE> and {CUSTOM_HEADER} and all the content below {CUSTOM_FOOTER}) and Step 6. Wrapper for MyBB 1.4.x/1.6.x  (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.)

Those steps are mandatory for things to go right.

At step 7 Templates for MyBB 1.4.x or 1.6.x he includes forum title in the code:

<title>{$mybb->settings['bbname']}</title>

That's not a mistake, but makes coppermine use the forum title not the coppermine title (up in the browser will show RCLanka Forums, not Home - RCLanka Gallery.

Here http://www.communityplugins.com/forum/mydownloads.php?action=browse_cat&cid=10 you can find cpg mybb wrapper Version 1.4.0. It works just like ver 1.1 (the one you have). 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.

LET ME KNOW if the solution works for you.

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 posted a step by step tutorial since this plugin is a coppemine plugin.
CPG MyBB Wrapper plugin for MyBB and coppermine bridge - install instructios http://forum.coppermine-gallery.net/index.php/topic,78228.0.html 


paquito

WoW It worked.  :D Thanks allvip and gmc. No problems found at the moment.

Thank you again allvip, for your all hard work.

QuoteWhat mistakes?

gmc solved that for me.

Bye. Have a great day.