Step by Step how to integrate SMF 1.1RC3 and Coppermine 1.4.9

Started by warhonowicz, September 13, 2006, 05:23:34 AM

Previous topic - Next topic

warhonowicz

SMF 1.1RC3 and Coppermine 1.49 integration

Someone asked me by PM whether I could help him to integrate the two as I have  done on my webpage. Maybe others can benefit from this as well. The following is how I have done it and how it works for me, I cannot guarantee that it will work for everyone.

My webpage is http://www.middlesexminiclub.co.uk

Step 1:
Have both SMF and Coppermine in the same database. In my case SMF uses a forum_ prefix and Coppermine a cpg135_ prefix.

Step 2:
Use the Coppermine Bridge Manager to bridge the two. See this PDF for a step by step description with screenshots.

Step 3:
Create a file called Coppermine.php and save it to your SOURCES directory in the SMF directory on your webserver.

<?php

if (!defined('SMF'))
die('Hacking attempt...');

function 
Coppermine()
{
global $context$mbname$txt;

//Load the main msn template
loadtemplate('Coppermine');

//Load the main msn template
$context['sub_template']  = 'main';

}
?>



Step 4:
Create a file called Coppermine.template.php in your theme directory (I am currently using the default theme but I have tried with other ones).

<?php

 
function template_main()
{
global $db_prefix$scripturl$txt$user_info,$settings$modSettings;

 echo 
' <center><iframe width="900" height="800" src="http://www.middlesexminiclub.co.uk/gallery"></iframe></center>';

}
?>



Step 5:
In your index.template.php add this to where you want the button/link to the gallery to appear.

// The Coppermine Gallery
echo ($current_action == 'Coppermine' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'Coppermine' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=Coppermine">Gallery</a>
</td>' , $current_action == 'Coppermine' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


In my case, I looked for this

// The [calendar]!
if ($context['allow_calendar'])
echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'calendar' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a>
</td>' , $current_action == 'calendar' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


and added the Coppermine bit just below it.

Remeber to change all URLs to your site's.
Tell me and I will forget
Show me and I might remember
But involve me and I will understand

SMF 2.0.11 with TP 1.2

redactor007

Just out of curiosity... Ok, well maybe out of necessity, is there an easy way to bridge Coppermine and SMF while using different databases?  I only have 100MB for each of my databases and it would be better if I could split them up.

Sorry if this question has been asked elsewhere, I just thought it would be a good addition to this thread since it is so useful already.

kegobeer

Have you reviewed the Coppermine documentation or the Coppermine forums?  You can use separate databases if you want, but the database user/password for each database must be the same.

http://coppermine-gallery.net/forum/index.php?topic=24195.msg111442;topicseen#msg111442
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

redactor007

Crap, I can't do that... the usernames and passwords are auto-generated by the system, I can't change them.  Hmm, I guess I'll have to bug my provider to give me a bigger DB

Thanks!

mbday

I have to be doing something wrong here. Becuase I followed the diractions as they area posted here but when I click on the new link fot the gallery it takes me to the index of my forums.

URL to see what is happening.
hxxp:www.sscf.net/forum [nonactive]

here is a test user so that you can see the forums.
user name: test1345
password:  test1345

Any help that you could give would be great.

kegobeer

I get this on your site when using your test account:

Your email address needs to be validated before you can login.
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

mbday

Sorry about that. Forgot to do that. It is take care of now.

kegobeer

Try this instead:


<?php
if (!defined('SMF'))
die('Hacking attempt...');

function 
Coppermine() {
// This is gonna be needed...
loadTemplate('Gallery');
}
?>

"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

mbday

Quote from: kegobeer on September 14, 2006, 09:37:01 PM
Try this instead:


<?php
if (!defined('SMF'))
die('Hacking attempt...');

function 
Coppermine() {
// This is gonna be needed...
loadTemplate('Gallery');
}
?>



That did not help. I'm still getting the samething.

Let me ask this as well. I need to edit the Inedix.Templete.php file in the Theam dir that I'm using for the forums right?
Also Coppermine.template.php goes in to the Dir of the Template that is beening used as well or doe sit go in to the default one?

And this is the last one. Could it be that I'm using Tiny Portal on my site as well that is cuasing the problem?

kegobeer

"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

kegobeer

I also gave you the wrong code.


<?php
if (!defined('SMF'))
die('Hacking attempt...');

function 
Coppermine() {
// This is gonna be needed...
loadTemplate('Coppermine');
}
?>



"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

mbday

Quote from: kegobeer on September 14, 2006, 10:03:19 PM
I also gave you the wrong code.


<?php
if (!defined('SMF'))
die('Hacking attempt...');

function 
Coppermine() {
// This is gonna be needed...
loadTemplate('Coppermine');
}
?>



This goes in to the Coppermine.php file right?

mbday

Quote from: kegobeer on September 14, 2006, 09:54:55 PM
What code did you put in your template_main function?

Template_main not sure.
I edited the files by hand.

kegobeer

Just follow the instructions here:

http://www.simplemachines.org/community/index.php?topic=111988.msg720962;topicseen#msg720962

Or you can read the original thread by snork13.  Read the entire thread, because you need to assign a custom action in index.php.  That's what this thread's writer forgot to do.

http://www.simplemachines.org/community/index.php?topic=19518.msg439235#msg439235

That's where I learned how to wrap Coppermine inside SMF.
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

mbday


G6™

Same here, i get this as soon as i activate the bridge

Fatal error: Call to undefined function: tp_loadtheme() in /home/ccsnakk/public_html/treffstedet/Sources/Load.php on line 1114

1.1rc3 and Tp V.095 Coppermine 1.4.9

Load.php lines is where $newtheme=TP_loadTheme(); is the line 1114

// TinyPortal
   $newtheme=TP_loadTheme();
   if($newtheme!=$ID_THEME && $newtheme>0)
      $ID_THEME=$newtheme;
   // end TinyPortal

warhonowicz

I did not add any custom action to index.php and it still works. What I maybe should have mentioned is that I am using a standard template and currently no TP.
Tell me and I will forget
Show me and I might remember
But involve me and I will understand

SMF 2.0.11 with TP 1.2

aluzja

Followed the instructions so far and have got Coppermine working alongside SMF, and using the iframe. Awesome job by the way, after doing a little messing around I got it all working, definitely worth the effort.

As you can see on my site, hxxp:www.uhdguild.com [nonactive], we are a WoW guild, I have created 2 new tabs, gallery, and roster.

I am wondering how to get rid of the left and right bars when a user opens either the gallery or the roster. I did some code searching, and of yet have come up empty, any ideas?

warmachine

I've done the steps in this thread, but when I click on my image gallery link at the top of my forum, I get returned to the main forum index page. Any ideas?
SMF Forum Admin/Owner:
W-body.com [nofollow]
TGPforums.com [nofollow]

Goad

Quote from: warmachine on November 17, 2006, 01:54:51 AM
I've done the steps in this thread, but when I click on my image gallery link at the top of my forum, I get returned to the main forum index page. Any ideas?

warmachine, I have the same problem. did you find a fix for this yet?

Advertisement: