[OBSOLETE] How to Integrate Coppermine with SMF

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

Previous topic - Next topic

scrawl

#120
i've seen coppermine actually intergrated into a smf forum somewhere but i don't remember the address, does anyone know how i would go about doing this?

thanks.

EDIT: after further looking it seems it might have been done with mambo i have check the forum and the mambo stuff but i don't want to change anything with my forum i just want coppermine to open up inside the forum like the smfshop or smfarcade how can i do this?

coolguy949

Quote from: kegobeer on August 21, 2005, 12:14:49 AM
Quote from: shipwreck on August 20, 2005, 11:31:10 PM
I am having a hell of a time getting my users the rights to upload pictures.  I login to the site as admin then go to coppermine and then go to groups and set registered users and other groups to "yes" for uploads but they are still not able to upload any files.

They keep getting this when clicking on the upload button
QuoteSorry there is no album where you are allowed to upload files

If you haven't set upload permissions for public albums, then of course the user will get that error if he/she hasn't created a personal album yet.  Make album(s) first, then upload images.  There's a button in each user's admin menu bar that says Create Album.

How do you even make an album public? That's where I'm having problems. I've searched everything and cant find anything in my gallery that allows album permissions to be set.

scrawl

#122
Credit for this goes to "marcnyc" as it was his code for flashchat which you can check here http://www.simplemachines.org/community/index.php?topic=27137.0 that allowed me to do this.

i had been wanting to intergrate coppermine fully into my smf forum instead of having it open in a new window and after searching for an eternity and requesting assistance without reply i decide f%$k it i'll macguyver it. so here are the steps to get coppermine to sit nicely inside your forum.


first follow all the instructions in the start of this thread and make sure smf and coppermine are running all clear. then follow these steps

(I assume that you installed SMF in the folder called /smf/ and that you are using the default theme - if you are not just change "/smf/" with the name of your smf folder on your server and change "default" with the name of your theme's folder inside the /Themes/ directory of your SMF installation):
1. open /smf/index.php
2. find this line:

'boardrecount' => array('Admin.php', 'AdminBoardRecount'),
and after that code add this code:
'coppermine' => array('Coppermine.php', 'Coppermine'),
3. create a file called Coppermine.php with your text-only editor such as NotePad (PC) or BBEdit (Mac) and add this code inside it:
<?php
if (!defined('SMF'))
die('Hacking attempt...');

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

4. save this file inside /smf/Sources
5. create a file called Coppermine.template.php with your text-only editor such as NotePad (PC) or BBEdit (Mac) and add this code inside it:
<?php

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">
<table width="80%" border="0" cellspacing="0" cellpadding="3" align="center">
<tr>
<td>'
theme_linktree(), '</td>
</tr>
</table>

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

// load coppermine
echo '<iframe width="100%" height="800" src="http://yourserver.com/public_html/coppermine/index.php"></iframe>';

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

?>

^^note the address in the above code change this to reflect your index.php file in your coppermine folder and make sure to leave out the www so as to keep compatability with firefox and IE
6. save this file inside /smf/Themes/default/
7. in that same folder open /smf/Themes/default/index.template.php and at the end of the file find this bit of code:
// The [calendar]!
if ($context['allow_calendar'])
echo '
<a href="', $scripturl, '?action=calendar">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/calendar.gif" alt="' . $txt['calendar24'] . '" style="margin: 2px 0;" border="0" />' : $txt['calendar24']), '</a>', $context['menu_separator'];


and below it copy and paste the following code
//begin gallery code
                echo '
                                <a href="', $scripturl, '?action=coppermine"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/gallery.gif" alt="' . "Gallery" . '" style="margin: 2px 0;" border="0" /></a>', $context['menu_separator'];
//end gallery code


and that's it pretty easy. hope it's cool that i posted it in here and all that jazz i just know how hard it was for me to locate or find someone to help so i figure this will help some people.


EDIT: you may want to disable the profile access if you decide to use this as it will open up the entire forum in the iframe.

ruzster

This is awesome, scrawl. It's exactly what I was looking for. Thanks. My only question is how to make the iframe automatically resize to the page size. So that it doesn't appear to be inside a frame. Any suggestions?

scrawl

#124
Quote from: ruzster on August 29, 2005, 09:34:37 AM
This is awesome, scrawl. It's exactly what I was looking for. Thanks. My only question is how to make the iframe automatically resize to the page size. So that it doesn't appear to be inside a frame. Any suggestions?

not exactly following what you mean but try this, make sure both the width and height are set at 100%

// load coppermine
echo '<iframe width="100%" height="100%" src="http://yourserver.com/public_html/coppermine/index.php"></iframe>';

scottjess

Im having probs :(

I can login from the forum to coppermine with no problems but my members cant even though i have the settings right? it just wont log them in and when they click on login from the album it brings them back to the forum.

scrawl

#126
Quote from: scottjess on August 29, 2005, 07:55:20 PM
Im having probs :(

I can login from the forum to coppermine with no problems but my members cant even though i have the settings right? it just wont log them in and when they click on login from the album it brings them back to the forum.

from my limited understanding from reading this thread and many others and the coppermine forum if you have smf and coppermine bridged correctly you should remove the login/logout links from coppermine. as for your problem it seems you might not have bridged them properly i'd just go back over the instructions at the start of this thread. but that's all i can offer one of the other fellas will probably have a solid answer it just takes a while to get a response.

scottjess


Aravot

Quote from: scottjess on August 29, 2005, 07:55:20 PM
Im having probs :(

I can login from the forum to coppermine with no problems but my members cant even though i have the settings right? it just wont log them in and when they click on login from the album it brings them back to the forum.

what version of SMF and CPG are you using

scottjess


kegobeer

#130
In Coppermine, open up your theme.php file and find this (or something similar)

<!-- BEGIN login -->
                        <a href="{LOGIN_TGT}">{LOGIN_LNK}</a>
<!-- END login -->
<!-- BEGIN logout -->
                        <a href="{LOGOUT_TGT}">{LOGOUT_LNK}</a>
<!-- END logout -->


Change to

<!-- BEGIN login -->
<!-- END login -->
<!-- BEGIN logout -->
<!-- END logout -->


Then add a link back to your forum.  I put mine here:

<!-- BEGIN album_list -->
                        <a href="../smf/index.php" title="My Forum">Forum</a> ::
                        <a href="{ALB_LIST_TGT}" title="{ALB_LIST_TITLE}">{ALB_LIST_LNK}</a> ::
<!-- END album_list -->
"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")

scottjess

it keeps telling me when I am logged in as a normal forum user that I dont have the permissions.
I dont think its logged in at all.:(

scrawl

#132
Quote from: scottjess on August 29, 2005, 09:15:32 PM
it keeps telling me when I am logged in as a normal forum user that I dont have the permissions.
I dont think its logged in at all.:(

make sure you've gone through the instructions in the first post of this thread. i had the same issue and it was because i hadn't set up the $path = '../smf'; properly

this was taken from the coppermine forum. check and make sure you've set it all up properly.


Quote from: GauGau on July 07, 2004, 12:40:49 AM
Glad you were able to solve this on your own.

For all who have similar problems and might get confused (language issue mabye), here's the solution in detail, with proper wording:
For// Set this to the location of your Settings file:
$path = '../smf';
in the SMF bridge file, you mustn't enter your board's url (like http://yourdomain.tld/smf/), but a relative path seen from your coppermine install. The two dots with a slash say "one directory up towards root level", followed by the folder name your SMF board is located at.
Some examples:
Coppermine URLSMF Board URL$path in your coppermine bridge file
http://foobar.com/coppermine/http://foobar.com/smf/$path = '../smf';
http://foobar.com/gallery/http://foobar.com/forum/$path = '../forum';
http://foobar.com/mystuff/coppermine/http://foobar.com/board/$path = '../../board';
http://foobar.com/coppermine/http://foobar.com/mysubfolder/my_board/$path = '../mysubfolder/my_board';

Hope this clarifies things for you - mind the technical terms URI/URL/relative path/absolute path. They all mean different things, although there's no such thing as a "htdocs-URL"... ;)

GauGau

scottjess

I had it working last week for a day and now I cant get it working :( ive done everything right I think and it still wont go.

I am installing the coppermine 1.4.1 BETA because it works on my testing server. :) it has the nice Bridging wizard too.

londonhogfan

#134
This topic follows so many versions and setups I just wanted to throw mine out to see if anyone else has don it...

Is the main benefit of integrating allowing members of the forum post comments or are there others?

I am using SMF 1.0.5
and Coppermine 1.3.3 I think?

I have about 100 members in my forum
just 2 in my photo archive

both coppermine members are admins and are also admins on SMF

I have almost 3000 photos (all public) in my coppermine setup.

Should this work for me?

here is my site...
http://www.razorbacklegacy.com/board
http://www.razorbacklegacy.com/hog_archive

if so do I only use the instructions in the first post?
**I don't have the login / logout buttons on my photo pages anyway**

Thanks for your time.

Londonhogfan

also Im wanting to use a new CMS is it easy to integrate all three?  Which is the most effective?

Kindred

1- yes. SMF 1.0.5 and CPG 1.3.3 should work with no problems

however, when you do the integration, there is a good chance that you will loose the connections between the new CPG users (based on the SMF user table) and the old CPG user-albums.  They'll become "unconnected"

A script could be written to re-associate them... but it would take some effort.

(because with them installed separately, the CPG users and the SMF users have completely different user numbers in the tables)

2- Yes, SMF : Mambo : CPG installations seem to work just dandy.
Сл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."

londonhogfan

Quote from: Kindred on September 02, 2005, 02:14:15 PM
however, when you do the integration, there is a good chance that you will loose the connections between the new CPG users (based on the SMF user table) and the old CPG user-albums.  They'll become "unconnected"

if the admins in cpg and SMF are the same would I have any problems?

if so would I

just add them as an admin in SMF and they would have admin in Coppermine... Right?


but all photos, comments, etc in public coppermind would still be there - as well as all posts in SMF - Correct?

if I wanted to make public folders after the integration how would I do that?

Sorry - Just want to make sure before I start changing everything.

Kindred

public albums will not be changed at all
private albums will be "unassigned" and pictures will no longer be associated with the person who uploaded them

The pictures themselves and the posts in SMF will not be altered.

Once the systems are integrated, then anyone with admin or global mod access in SMF will have admin access to CPG.

After the integration, public or private albums are done exactly like they were before the integration.
Сл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."

londonhogfan

Quote from: Kindred on September 02, 2005, 02:33:42 PM
public albums will not be changed at all
private albums will be "unassigned" and pictures will no longer be associated with the person who uploaded them

The pictures themselves and the posts in SMF will not be altered.

Once the systems are integrated, then anyone with admin or global mod access in SMF will have admin access to CPG.

After the integration, public or private albums are done exactly like they were before the integration.

Thanks, you have been very helpful

Elegant John

QuoteMake sure you install Coppermine on the same database as that of your SMF forum.

Can I get clarification on this statement please?

does this mean to list the db that CPG is to use as the SAME db that SMF uses? and not a separate db within the domain? In other words, permit CPG to build its tables wihin the SMF DB?

Brains not fucntioning today

Advertisement: