[OBSOLETE] How to Integrate Coppermine with SMF

Started by dtm.exe, July 09, 2005, 04:59:26 PM

Previous topic - Next topic

perplexed

Quote from: snork13 on March 11, 2006, 03:10:02 PM
Quote from: perplexed on March 11, 2006, 01:36:11 PM
Hello :(

I have smf 1.1 rc2 and coppermine 1.4.2

today I have just run the coppermine bridge wizard and linked CPG to Smf forum.  I selected the option to use post counts.
In CPG 'groups' I can see all my smf groups and change their options.

However, in smf forum I see nothing at all to do with the gallery!
no gallery button - how to do I create a new button for 1.1 rc2?
no galley options
no way to access or view gallery at all

does anyone know what is going on and how to fix it?

I looked in forum permissions but there is nothing in there, or features and options or current theme.  In forum permissions screen, there are some options that have radio buttons but dont show any text??? I dont know if they are related to the gallery but I switched them all on anyway and it made no difference.

Also I read above that the forum and the gallery should share the same database???  Can someone tell me how to do that too?

a step by step would be good.

Its very frustrating that the 'bridge' wizard ran smoothly but I cant see any evidence of the gallery in the forum, so no one could access it anyway.

Help!

a link to your site?

Quotein smf forum I see nothing at all to do with the gallery!

correct, it still handled via admin panel with coppermine

Quoteno way to access or view gallery at all

to add a link in forum using default 1.1rc2.

http://www.simplemachines.org/community/index.php?topic=63203



hi

ok, maybe I'm misunderstanding what it actually does :( ???

the bridge manager links the gallery to the forum 'behind the scenes' like being able to use the same member groups, but it doesnt actually display anything in the forum unless you go and add some links or some code yourself?

So I would have to add a new tab to the forum navigation and then people could access that way subject to their group permissions?

Is that right?


perplexed

#261
I have something weird in my forum permissions which may or may not have to do with bridging CPG but I noticed it straight afterwards.

Here is what is in permissions



Ever seen anything like this before?

Does anyone know what the empty lines are supposed to be or how to fix it?


edited to add: I still don't 'get it' with the whole coppermine/smf/ joomla integration thing. This could be because I dont understand all the tech lingo or maybe I'm just thick, but I have bridged coppermine to smf but I cant 'get' to coppermine from the forum or from joomla. It keeps taking me to the forum if I try directly. I have been looking at various suggestions for 'components' and reading the various threads but its still unclear.  There was one that was suggested but you had to pay for it, others involved downloading joomla versions of coppermine and so on.

I will add the goosemoose code to add link to user profile but apart from that finding/accessing the gallery seems like an IQ test.  I think I'm still missing something somewhere :(

Senkusha

#262
For complete integration use the Javascript method, as listed from the post above:

<?php
// Version: 1.1 RC2; Gallery

function template_main()
{
global $context$settings$options$txt$scripturl;

echo '
<script language="JavaScript" type="text/javascript"><!--
function checkAll(onOff)
{
for (var i = 0; i < document.searchform.elements.length; i++)
{
if (document.searchform.elements[i].name.substr(0, 3) == "brd")
document.searchform.elements[i].checked = onOff;
}
}
// --></script>
<form action="'
$scripturl'?action=search2" method="post" name="searchform" id="searchform">

 <script type="text/javascript"><!--

/***********************************************
* IFrame SSI script II- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe"]

//Should script hide iframe from browsers that don\'t support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller

// --></script>

<table width="100%" border="0" cellspacing="0" cellpadding="4" align="center" class="tborder">
<tr class="titlebg">
<td>Gallery</td>
</tr><tr>
<td class="windowbg">'
;

// load the gallery
echo '<iframe name="myframe" id="myframe" src="http://www.???.com/gallery" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:novisible; width:100%; display:none"></iframe>';

echo '
</td>
</tr>
</table>
</form>'
;
}

?>



Be sure to change the http://www.???.com to your domain name.  Also, if you the iframe doesnt' expand, double check for error messages.  Most likely, you'll see "Access Denied..."  To correct this, double check your Apache configuration.  Look for ServerName  If it's not set or set to your public IP address, change it to your www.???.com (full domain name).  You can see this in action here:

http://www.ayeka.net/smf/index.php?action=coppermine

Also, I think I read a question on how to set the custom action.  The way to do this is to edit the Who.template.php file.  Add the following line:

$txt['whoall_coppermine'] = 'Viewing the Gallery';


(assuming that your action is coppermine)

Now, the only problem that I have to resolve is since I migrated to Linux, none of my albums are working.  I get an error message:


The selected album/file does not exist !


I've verified the permissions (everything is 777) and the filenames and directories, they are in the correct capitalzation and spelling).

Has anybody run into this problem before?

edit:  I found the answer!  In your php.ini, make sure register_long_arrays=On is set (mine was off ).

Now the only thing to do is find a theme to better match SMF.

Thanks!
-- Senkusha
The Kawaii Klub
The Creative Anime Role Playing Community.
(SMF v. 2.1.4, PHP v. 8.0)

snork13

Quote from: Senkusha on March 15, 2006, 04:41:16 PM
For complete integration use the Javascript method, as listed from the post above:

<?php
// Version: 1.1 RC2; Gallery

function template_main()
{
global $context$settings$options$txt$scripturl;

echo '
<script language="JavaScript" type="text/javascript"><!--
function checkAll(onOff)
{
for (var i = 0; i < document.searchform.elements.length; i++)
{
if (document.searchform.elements[i].name.substr(0, 3) == "brd")
document.searchform.elements[i].checked = onOff;
}
}
// --></script>
<form action="'
$scripturl'?action=search2" method="post" name="searchform" id="searchform">

 <script type="text/javascript"><!--

/***********************************************
* IFrame SSI script II- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe"]

//Should script hide iframe from browsers that don\'t support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller

// --></script>

<table width="100%" border="0" cellspacing="0" cellpadding="4" align="center" class="tborder">
<tr class="titlebg">
<td>Gallery</td>
</tr><tr>
<td class="windowbg">'
;

// load the gallery
echo '<iframe name="myframe" id="myframe" src="http://www.???.com/gallery" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:novisible; width:100%; display:none"></iframe>';

echo '
</td>
</tr>
</table>
</form>'
;
}

?>



Be sure to change the http://www.???.com to your domain name.  Also, if you the iframe doesnt' expand, double check for error messages.  Most likely, you'll see "Access Denied..."  To correct this, double check your Apache configuration.  Look for ServerName  If it's not set or set to your public IP address, change it to your www.???.com (full domain name).  You can see this in action here:

http://www.ayeka.net/smf/index.php?action=coppermine

Also, I think I read a question on how to set the custom action.  The way to do this is to edit the Who.template.php file.  Add the following line:

$txt['whoall_coppermine'] = 'Viewing the Gallery';


(assuming that your action is coppermine)

Now, the only problem that I have to resolve is since I migrated to Linux, none of my albums are working.  I get an error message:


The selected album/file does not exist !


I've verified the permissions (everything is 777) and the filenames and directories, they are in the correct capitalzation and spelling).

Has anybody run into this problem before?

edit:  I found the answer!  In your php.ini, make sure register_long_arrays=On is set (mine was off ).

Now the only thing to do is find a theme to better match SMF.

Thanks!

ya, i posted MY mod over at coppermine quite some time ago... ::)

http://coppermine-gallery.net/forum/index.php?topic=25877.0
Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1

matt l

#264
I am currently trying to incorporate my copper mine into smf...

I can get it half bridged where when I click the log in button on Copper Mine it brings me to the SMF log in page but after that I can not get back to Copper Mine from SMF. And when I go back to Copper mine I am not Logged in.

I used the Bridge wizard in copper mine and that was all I got.

I am using SMF 1.1rc2 and Copper mine 1.4.2 .

I am using the default theme in the forum modified with a button tab to the gallery allready.

http://www.milwaukeeareavwclub.com/forum [nofollow]

I have searched through this file up and down through this file "/bridge/smf.inc.php" for this path "$path = '../smf';" and can not find it.

Do I have to add the path into that file?

Anyone willing to help would be greatly appreciated.

perplexed

#265
Since I integrated cpg and smf I have 'empty' albums displayed in the member gallery.  Has anyone had that problem or know how to get rid of them?  There are 4 of them; they are greyed out since there are no pics in them, and they have no 'member' name, it just says 1 album, 0 files, on each of them

It's kinda annoying, as they take up space where the actual member albums are displayed,and I cant find anywhere to delete them since they dont have a name.  If I click on the greyed out square I just get

Anonymous's Gallery, 1 album, 0 files

anyone heard of this happening and how to fix?

perplexed

I found out that in coppermine 'guests' are the anonymous users/albums but because I am bridged with smf I dont have an 'anonymous' user category.  I have smf 'guests' who dont have access to the gallery at all, so does anyone know how to get rid of these empty albums?  They are dotted inbetween the actual members albums and taking up space that real members should have ???

neonplayer

Quote from: dtm.exe on July 09, 2005, 04:59:26 PM
Coppermine is an easily setup, fast, feature-rich photo gallery script with MySQL database, user management, private galleries, automatic thumbnail creation, ecard feature and a template system for easy customization to match the rest of a site.

To start, you'll need to hxxp:sourceforge.net/project/showfiles.php?group_id=89658 [nonactive].  Once downloaded, follow these instructions to properly integrate Coppermine with your SMF forum.

In /include/init.inc.php, find:
// define('UDB_INTEGRATION', 'smf');

Replace with:
define('UDB_INTEGRATION', 'smf');

In /bridge/smf.inc.php, find:
$path = '../smf';

Replace /smf with the directory you have your SMF forum installed in.  If SMF is installed in your root directory, remove smf leaving you with $path = '../';.

Once all necessary changes have been made, upload Coppermine to its own directory (examples: /coppermine, /gallery, /album).  Once uploaded, run install.php.  Make sure you install Coppermine on the same database as that of your SMF forum.  Once installed, your new Coppermine gallery will be up and ready for use :).

Now
  I installed cpg 1.4.3 and smf 1.0.7 and tried for the integration .

But I can't do it and it's got error.

I think there is some different coding .

I find that one  define('UDB_INTEGRATION', 'smf');

But I Saw

// Set UDB_INTEGRATION if enabled in admin
if ($CONFIG['bridge_enable'] == 1 && !defined('BRIDGEMGR_PHP')) {
    $BRIDGE = cpg_get_bridge_db_values();
} else {
  $BRIDGE['short_name'] = 'coppermine';
  $BRIDGE['use_standard_groups'] = 1;
  $BRIDGE['recovery_logon_failures'] = 0;
  $BRIDGE['use_post_based_groups'] = false;
}

define('UDB_INTEGRATION', $BRIDGE['short_name']);

require_once 'bridge/' . UDB_INTEGRATION . '.inc.php';

/*


So I changed to

// Set UDB_INTEGRATION if enabled in admin
if ($CONFIG['bridge_enable'] == 1 && !defined('BRIDGEMGR_PHP')) {
    $BRIDGE = cpg_get_bridge_db_values();
} else {
  $BRIDGE['short_name'] = 'smf';
  $BRIDGE['use_standard_groups'] = 1;
  $BRIDGE['recovery_logon_failures'] = 0;
  $BRIDGE['use_post_based_groups'] = false;
}

define('UDB_INTEGRATION', $BRIDGE['short_name']);

require_once 'bridge/' . UDB_INTEGRATION . '.inc.php';

/*


And then at smf10.inc.php

if (!USE_BRIDGEMGR) {
        require_once('../smf/SSI.php');
        $boardurl = 'http://www.mysite.com/board';
} else {
        require_once($BRIDGE['relative_path_to_config_file'] . 'SSI.php');
}


I saw that one . So I need to change at    $boardurl = 'hxxp:www.mysite.com/board' [nonactive];; to my site url and also that path    require_once('../smf/SSI.php'); to my path rite ? Coz my path is not /smf it's /frm/SSI.php . 

But I don't know why . I got error . Here is the error

Fatal error: main(): Failed opening required 'bridge/smf.inc.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/poemsco/public_html/gallery/include/init.inc.php on line 234


I know I did wrong something . But i don't know how to solve . Please help me from that.  Thanks

with regards,
neonplayer

rongup

You atleast got errors.

I have 1.1RC2 and CPG 1.4.5

First of all i never foung the word smf in init.inc.php

in smf10.php i chaged to the reqd path.

But during installation it never even asked me to integrate.
Where did i go wrong

Pls Help me.
Thnaks and have a good day.

neonplayer

Hello ,

I want to know is that when i edit bridge file . Am i need to change that one .


// Database connection settings
$this->db = array(
'name' => $dbname,
'host' => $dbhost ? $dbhost : 'localhost',
'user' => $dbuser,
'password' => $dbpasswd,
'prefix' =>$table_prefix


like adding dbname to my dbname
user to my dbuser
and then password is my password .

Please help me with that. Thx

adnan

Quote from: rongup on April 28, 2006, 04:59:22 AM
You atleast got errors.

I have 1.1RC2 and CPG 1.4.5

First of all i never foung the word smf in init.inc.php

in smf10.php i chaged to the reqd path.

But during installation it never even asked me to integrate.
Where did i go wrong

Pls Help me.
Thnaks and have a good day.

My problem is the same

There isn't this code in CPG 1.4.5
// define('UDB_INTEGRATION', 'smf');

Also I think smf10.php for integrade smf 1.X and we need a new file for integrate to smf 1.1 .
When I am alone I am happy.
shop giay nam| giay nam dep| giay vnxk

Nibbler

This thread is for Coppermine 1.3 only, the process has changed for 1.4 (Perhaps someone could edit the first post in the thread to reflect this). For 1.4 use the bridge manager as dexribed in the documentation. smf10.inc.php works for SMF 1.1 as well so far.
I wanna be sedated.

adnan

When I am alone I am happy.
shop giay nam| giay nam dep| giay vnxk

crash5456

Unable to fine Code to Modify in /include/init.inc.php

Quote from: dtm.exe on July 09, 2005, 04:59:26 PM
Coppermine is an easily setup, fast, feature-rich photo gallery script with MySQL database, user management, private galleries, automatic thumbnail creation, ecard feature and a template system for easy customization to match the rest of a site.

To start, you'll need to hxxp:sourceforge.net/project/showfiles.php?group_id=89658 [nonactive].  Once downloaded, follow these instructions to properly integrate Coppermine with your SMF forum.

In /include/init.inc.php, find:
// define('UDB_INTEGRATION', 'smf');

Replace with:
define('UDB_INTEGRATION', 'smf');

In /bridge/smf.inc.php, find:
$path = '../smf';

Replace /smf with the directory you have your SMF forum installed in.  If SMF is installed in your root directory, remove smf leaving you with $path = '../';.

Once all necessary changes have been made, upload Coppermine to its own directory (examples: /coppermine, /gallery, /album).  Once uploaded, run install.php.  Make sure you install Coppermine on the same database as that of your SMF forum.  Once installed, your new Coppermine gallery will be up and ready for use :).

Aravot

Quote from: crash5456 on May 15, 2006, 10:05:57 AM
Unable to fine Code to Modify in /include/init.inc.php

Why not read two post above yours

crash5456

Apparently I need new glasses, Thanks

FJD

#276
Well i got it working and already loving it ;)

However I have one small problem as one might see when visiting my website: hxxp:www.weescreatief.nl/SCMForum/index.php [nonactive]

For some reason my header is wrong and it show the word "gallery" on the left top side. I have to find out how to get this away and since my PHP skills are rather limited I would to hear some ideas :)

-edit-
Got that going already. The most important thing for everything in life: Logic. If there is a logic behind it one can figure it out without having knowledge about it :)

I added the line in index.template.php or something (the one where you say that when user is logged on then echo this) and that I could leave out for some reason. So now it's working and I only have to alter the colours etc to have a nice website :)

c4duser

I tried to integrate smf with coppermine using the instructions in the coppermine documentation.

I'm using smf 1.1 RC2 and coppermine 1.4.2

I followed the instructions, which seemed to imply that you could use two separate databases, because it said to have both programs running independently before trying to attach the bridge.

I set up the bridge as instructed.

The result is that when I log in to coppermine, I end up in smf, but from smf there seems to be no way to use coppermine.

When I run coppermine directly, I can't log in, just can see the display as a guest.

Does anybody know how to solve this problem, or, at least, allow me to get back my coppermine functionality?

Thanks...

:(

Kindred

you have to add a button from SMF into coppermine.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Master-D

Quote from: rvforumite on July 11, 2005, 12:32:22 PM
Thanks Kindred.

Quote from: Kindred on July 11, 2005, 12:01:43 PMyou should remove the login/logout buttons from Coppermine and only use the SMF login/logout...

Which Coppermine file has the login/logout buttons code?

ok what i did here was goto (public_html/gallery/include/themes.inc.php)
looked 4 these files :-
   addbutton($sys_menu_buttons,'{LOGIN_LNK}','{LOGIN_TITLE}','{LOGIN_TGT}','login','');
    addbutton($sys_menu_buttons,'{LOGOUT_LNK}','{LOGOUT_TITLE}','{LOGOUT_TGT}','logout','');


then completely removed them, saved it then went back and added them again then saved it again.
it worked 4 me. 

Advertisement: