forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Bridging/Integration => Topic started by: snork13 on January 02, 2006, 07:07:48 pm

Title: [How To] Coppermine within SMF
Post by: snork13 on January 02, 2006, 07:07:48 pm
I shared this over at smf with kegobeer, and thought others might find it interesting here. This hack will allow you to have your forum wrapped around coppermine, assuming you have already bridged the 2 ;)

example:

http://www.snork13.net/forum/index.php?action=gallery (http://www.snork13.net/forum/index.php?action=gallery)


You will need to create the 2 new files: Gallery.php & Gallery.template.php
edit 2 other files: index.php & index.template.php

**3/15/06*** edited Gallery.php to provide a linktree, and uploaded a copy, just remove the .txt ;)

sources/Gallery.php
Code: [Select]
<?php
if (!defined('SMF'))
die(
'Hacking attempt...');

Function 
Gallery()
{

global  $txt$scripturl,  $db_prefix$context;
LoadTemplate('Gallery');
$context['page_title'] = "Gallery";
$context['linktree'][] = array(
'url' => $scripturl '?action=gallery',
'name' => $txt['gallery']
);

}

?>


themes/???/Gallery.template.php
Code: [Select]
<?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 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>'
;
}

?>

/index.php


 find:

Code: [Select]
'findmember' => array('Subs-Auth.php', 'JSMembers'),
after add;
Code: [Select]
'gallery' => array('Gallery.php', 'Gallery'),

themes/???/index.template

find:
Code: [Select]
if ($context['user']['is_logged'])
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'];

after add:
Code: [Select]
echo'
<a href="', $scripturl, '?action=gallery">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/gallery.gif" alt="Gallery"' . $txt[''] . '" style="margin: 2px 0;" border="0" />' : $txt['Gallery']), '</a>', $context['menu_separator'];


change www.???.com to reflect your actual location, the template has a javascript that allows the iframe to open full, it's the best i could do. It similar to the FlashChat intergration and where i got the idea :)

i would also suggestion tweaking the gallery menu to meet your needs, and you could also prevent direct access to the gallery via a .htaccess file

-snork
Title: Re: [How To] Coppermine within SMF
Post by: kegobeer on January 02, 2006, 07:10:35 pm
One thing that doesn't work well at all with this tweak is the config page.  Expanding the options does not expand the "frame" that Coppermine sits in.  Everything else works great.
Title: Re: [How To] Coppermine within SMF
Post by: snork13 on January 02, 2006, 07:17:59 pm
One thing that doesn't work well at all with this tweak is the config page.  Expanding the options does not expand the "frame" that Coppermine sits in.  Everything else works great.

yes, i noticed, you have to expand the last option first :-\

-snork
Title: Re: [How To] Coppermine within SMF
Post by: conradk on January 11, 2006, 04:32:26 am
Hi,

Just wanted to throw in my results...

I'm using coppermine 1.4.3 and SMF 1.1 RC2. All I get is a broken image icon after "Hello, [user]," When I click on the broken icon it gives me a php error that occurred on line 3 of Sources/Gallery.php, some unexpected text encountered... (Sorry, didn't write down the error as I was rushing to get the forum back up.)

I've tried creating a static link in SMF to the gallery, but I lose my login credentials when I do that. Linking out of a topic works fine, though.

Thanks,
Conrad
Title: Re: [How To] Coppermine within SMF
Post by: Crazie on March 02, 2006, 03:01:30 pm
1st off, thanks for this mod. 

Now for the big ?'s.

1.  The iFrame isn't expanding at all.  What you see in this screenshot I took is all I can see.  And I can't adjust it.

2.  I'm using a modified version of the default theme, and can't (for the life of me) figure out how to make the "Gallery.gif" look like the others.  I searched forever through all the .gif files, and they all look like the gallery one.  I'm wondering how in the heck I'm supposed to slip the "Gallery" in between the Calendar and Members buttons.

Maybe I'm just tired and did something wrong, but I have triple and quadruple checked my work.  Any suggestions?
Title: Re: [How To] Coppermine within SMF
Post by: Crazie on March 03, 2006, 12:37:51 am
On second thought, I think I'll just disable bridging alltogether.  For some reason, the only thing that didn't work when I bridged, was the logout.  My forums would NOT let me log out.  Due to this, I'm scrapping the whole "Bridge" thing for now.
Title: Re: [How To] Coppermine within SMF
Post by: Crazie on March 03, 2006, 02:01:32 am
UPDATE:  I resume my request for assitance with this.  I now have Coppermine fully bridged and working!  Whew! ;D
Title: Re: [How To] Coppermine within SMF
Post by: Joachim Müller on March 03, 2006, 08:58:55 am
posting a link to your page might be a good start if you need help ::)
Title: Re: [How To] Coppermine within SMF
Post by: Crazie on March 03, 2006, 09:11:36 am
Sure thing, I just took the mod out becuase it was looking a bit bad the way it came out.

Here's a link to the site: http://atv-edge.com/forum (http://atv-edge.com/forum)

user/pw: test / test

I put the mod back in, and you'll see that "Gallery" shows up above all the other links, instead of in-line with them.  And the iframe doesn't expand at all, seems to be a fixed height.
Title: Re: [How To] Coppermine within SMF
Post by: justinkase on March 14, 2006, 08:18:39 pm
I just installed both SMF and Coppermine 1.4.4 and have the same problem with the gallery button and the Coppermine frame.

Any suggestions?
Title: Re: [How To] Coppermine within SMF
Post by: snork13 on March 15, 2006, 11:49:03 pm


I just installed both SMF and Coppermine 1.4.4 and have the same problem with the gallery button and the Coppermine frame.

Any suggestions?

accroding to Senkusha over at smf, In your php.ini, make sure register_long_arrays=On is set

http://www.simplemachines.org/community/index.php?topic=41542.msg512991#msg512991 (http://www.simplemachines.org/community/index.php?topic=41542.msg512991#msg512991)
Title: Re: [How To] Coppermine within SMF
Post by: aravot on March 16, 2006, 12:51:32 am
How to add a tabs (button) to SMF 1.1 (http://www.simplemachines.org/community/index.php?topic=63203.0)
Title: Re: [How To] Coppermine within SMF
Post by: daimmo on March 20, 2006, 04:32:43 am
added coppermine latest version to smf 1.1 rc2
bridged following the tutorial on the coppermine documentation
seems to work
but i cannot manage groups and users
the "users" function moves me to the userlist on smf, and that's ok..
the "groups" page does not make what i set
i just want "registered users" to be able to do quite everything on the website (upload to personal and public galleries), plus having "global moderators" (or "administrators") create new public galleries
i'm talking of www.abruzzesi.com and www.abruzzesi.com/gallery
Title: Re: [How To] Coppermine within SMF
Post by: Crazie on March 29, 2006, 06:10:10 pm

accroding to Senkusha over at smf, In your php.ini, make sure register_long_arrays=On is set

http://www.simplemachines.org/community/index.php?topic=41542.msg512991#msg512991 (http://www.simplemachines.org/community/index.php?topic=41542.msg512991#msg512991)

I've been in the middle of moving or I would have replied much sooner, but where is the php.ini file????  I'm feeling stupid for asking, but I've looked almost everywhere and can't seem to find it.  Maybe the move stole some brain cells or something. ???
Title: Re: [How To] Coppermine within SMF
Post by: Crazie on March 29, 2006, 06:49:40 pm
How to add a tabs (button) to SMF 1.1 (http://www.simplemachines.org/community/index.php?topic=63203.0)

Thanks for that link!  Now if I can only find the php.ini file...lol.
Title: Re: [How To] Coppermine within SMF
Post by: Joachim Müller on March 29, 2006, 09:59:50 pm
accroding to Senkusha over at smf, In your php.ini, make sure register_long_arrays=On is set
Only applies if you're on PHP5. However, don't worry about it, you wouldn't be able to run coppermine if this setting was wrong, no need to look for php.ini. You usually can't change it anyway when webhosted.
Title: Re: [How To] Coppermine within SMF
Post by: Starrbuck on March 30, 2006, 11:31:38 pm
i would also suggestion tweaking the gallery menu to meet your needs, and you could also prevent direct access to the gallery via a .htaccess file

Hey, snork, this all worked great for me!  I did do some tweaks to the available options in CPG, such as removing the login/logout links and the ability to bring up your profile.

Do you have any examples of how to prevent direct access to the gallery?  I want to only be able to get there from the SMF menu, but I have no idea how to accomplish this...
Title: Re: [How To] Coppermine within SMF
Post by: Crazie on March 31, 2006, 02:00:03 am
Only applies if you're on PHP5. However, don't worry about it, you wouldn't be able to run coppermine if this setting was wrong, no need to look for php.ini. You usually can't change it anyway when webhosted.

That being the case, do you guys have any other suggestions for me?  I don't want to abandon the iframe option, especially when I'm so close to having it working perfectly.
Title: Re: [How To] Coppermine within SMF
Post by: gofwd on April 11, 2006, 04:19:53 am
Sure thing, I just took the mod out becuase it was looking a bit bad the way it came out.

Here's a link to the site: http://atv-edge.com/forum (http://atv-edge.com/forum)

user/pw: test / test

I put the mod back in, and you'll see that "Gallery" shows up above all the other links, instead of in-line with them.  And the iframe doesn't expand at all, seems to be a fixed height.


I had the same problem.  Java errors 'on' revealed permission denied on IFrame resize due to domain mismatch.  Turns out the $scriptrul in SMF had no 'www' after the 'http:' but cpg had to have it  in Gallery.template.php.  So rather than risk breaking SMF I replaced the $scripturl with the hard url including the 'www' so there was no domain mismatch in the index.template.php file (only one place where the gallery button was added.)
 
Hope this topic is not too cold for a little more input, it has been very helpful to me.
Title: Re: [How To] Coppermine within SMF
Post by: CoasterJoe.com on April 26, 2006, 03:23:39 am
Is there a way to do this while using the Tiny Portal mod for SMF? I'm running this and and I cant seem to find where to change the code in
themes/???/index.template I'm think the mod changes this. Any thoughts?
Title: Re: [How To] Coppermine within SMF
Post by: Crazie on April 26, 2006, 03:58:01 pm

I had the same problem.  Java errors 'on' revealed permission denied on IFrame resize due to domain mismatch.  Turns out the $scriptrul in SMF had no 'www' after the 'http:' but cpg had to have it  in Gallery.template.php.  So rather than risk breaking SMF I replaced the $scripturl with the hard url including the 'www' so there was no domain mismatch in the index.template.php file (only one place where the gallery button was added.)
 
Hope this topic is not too cold for a little more input, it has been very helpful to me.

Sorry for the late reply...but just to clarify.

In Index.template.php find:
Code: [Select]
<a href="', $scripturl, '?action=gallery">Gallery</a>
and replace to look like this:
Code: [Select]
<a href="', http://www.my_gallery_url</a>
I just wasn't sure which part of the code needs to come out and be replaced.  Thanks for the advice up to this point.

I was having some serious FTP issues with my site so I decided to halt all mods until it was resolved.  Now it seems things are back in working order.
Title: Re: [How To] Coppermine within SMF
Post by: dyrer on June 06, 2006, 06:43:14 pm
These modifications are for SMF 1.0.x?? because with SMF RC2 template is not the same needed modifications
Title: Re: [How To] Coppermine within SMF
Post by: Starrbuck on July 13, 2006, 05:22:10 pm
Any idea what causes this error in the SMF error logs (and how to fix it):

Code: [Select]
http://www.fioch.org/index.php?action=gallery 
8: Undefined index: gallery
File: /home/fiochorg/public_html/Sources/Gallery.php
Line: 13

I get this any time the Gallery is entered.
Title: Re: [How To] Coppermine within SMF
Post by: Nibbler on July 13, 2006, 05:41:33 pm
It's caused by SMF, not Coppermine.
Title: Re: [How To] Coppermine within SMF
Post by: Starrbuck on July 13, 2006, 06:07:20 pm
Technically, it is caused by using the scripts on the first post of this thread and reported by SMF.
Title: Re: [How To] Coppermine within SMF
Post by: Nibbler on July 13, 2006, 06:09:45 pm
Code: [Select]
'name' => $txt['gallery']
That's the line. I think $txt is used by SMF for translation purposes. Perhaps you need to add a translation for the word 'gallery'.
Title: Re: [How To] Coppermine within SMF
Post by: Starrbuck on July 13, 2006, 06:40:48 pm
Ok, I added:

Code: [Select]
// Gallery
$txt['gallery'] = 'Gallery';

...to my theme's Modifications.english.php file and SMF no longer reports the error.

Thank you for your help.
Title: Re: [How To] Coppermine within SMF
Post by: steve46 on August 27, 2006, 01:26:49 pm
can anyone update this to work with SMF 1.1 RC3  ???
Title: Re: [How To] Coppermine within SMF
Post by: steve46 on August 27, 2006, 01:57:17 pm
nevermind, i got it working with this method.
Title: Re: [How To] Coppermine within SMF
Post by: hieddie on August 31, 2006, 10:18:43 pm
I am trying to Coppermine within SMF and the only issue that I am having is that I have a "tab" style template. I have created all the files that I needed to, however I am haivng a problem inserting the "tab" so that the "Gallery" can be viwed. Any help would be appreciated! Thanks in advance. Here is what I have so far.....

index.template.php
Code: [Select]
// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'pm' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a>
</td>' , $current_action == 'pm' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
// Try to add the Gallery button [Gallery]
if ($context['user']['is_logged'] && $context['gallery'])
echo ($current_action == 'gallery' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'gallery' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=gallery">' , $txt['gallery'] , ' ', $context['user']['gallery'] > 0 ? '[<strong>'. $context['user']['language'] . '</strong>]' : '' , '</a>
</td>' , $current_action == 'gallery' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// 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>' : '';

I tried to add a "Gallery" tab between the PM and the Calander
Title: Re: [How To] Coppermine within SMF
Post by: warhonowicz on September 13, 2006, 05:17:32 pm
can anyone update this to work with SMF 1.1 RC3  ???

I got it to work (SMF 1.1RC3 with Coppermine 1.4.9) ... the thread is here

http://www.simplemachines.org/community/index.php?topic=113488.msg727373#msg727373 (http://www.simplemachines.org/community/index.php?topic=113488.msg727373#msg727373)
Title: Re: [How To] Coppermine within SMF
Post by: badams on September 17, 2006, 06:05:23 am
Running into some troubles here...   ???
Versions:  CPG 1.4.9 / SMF 1.1 RC3
Test Site: http://radiator.bootjack.org (http://radiator.bootjack.org)
Username/Password:  123test987 / 987123  (non-admin user)
Bridging: Enabled
Guest Access: Disabled

Your bridge settings
Forum URL:    http://bootjack.org/smf   (radiator.bootjack.org is just a pointer to this directory)
Relative path to your BBS's config file:    ../smf/
Use post-based groups?:    0

Both SMF and CPG are in the same database

Gallery.php:
Code: [Select]
<?php
if (!defined('SMF'))
die(
'Hacking attempt...');

Function 
Gallery()
{

global  
$txt$scripturl,  $db_prefix$context;
LoadTemplate('Gallery');
$context['page_title'] = "Gallery";
$context['linktree'][] = array(
'url' => $scripturl '?action=gallery',
'name' => $txt['gallery']
);
}
?>

Gallery.template.php:
Code: [Select]
<?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">
<iframe id="myframe" src="http://bootjack.org/coppermine" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:novisible; width:100%; display:none"></iframe>
</td>
</tr>
</table>
</form>
'
;
}
?>

Salient part out of index.php:
Code: [Select]
'gallery' => array('Gallery.php', 'Gallery'),
Salient part out of index.template.php:
Code: [Select]
// the [Gallery] button
if ($context['user']['is_logged'])
echo ($current_action == 'gallery' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'gallery' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=gallery">Gallery</a>
</td>' , $current_action == 'gallery' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

I don't think there is any more information that I could possibly give you  ;D

Problems I'm having:
If I leave guest access turned on it only displays a sliver of the gallery window.
If I turn guess access off when I go to gallery it gives me a login prompt which then just creates another instance of the forums inside the iframe

I would like to leave guest access off so that not just anyone can browse to my photos.  I can't use .htaccess to password protect that directory because when I do that and then click on the gallery button in my forums it does absolutely nothing.  I imagine that if I had javascript errors turned on that it would tell me that it was denied access.

My main issue is that when I try to view the gallery from within SMF it pops up a full width but only a couple hundred pixel high frame

Any assistance would be greatly appreciated

Thanks
-bob
Title: Re: [How To] Coppermine within SMF
Post by: snork13 on September 17, 2006, 04:53:46 pm
Running into some troubles here...   ???
Versions:  CPG 1.4.9 / SMF 1.1 RC3
Test Site: http://radiator.bootjack.org (http://radiator.bootjack.org)
Username/Password:  123test987 / 987123  (non-admin user)
Bridging: Enabled
Guest Access: Disabled

Your bridge settings
Forum URL:    http://bootjack.org/smf   (radiator.bootjack.org is just a pointer to this directory)
Relative path to your BBS's config file:    ../smf/
Use post-based groups?:    0

Both SMF and CPG are in the same database

Gallery.php:
Code: [Select]
<?php
if (!defined('SMF'))
die(
'Hacking attempt...');

Function 
Gallery()
{

global  
$txt$scripturl,  $db_prefix$context;
LoadTemplate('Gallery');
$context['page_title'] = "Gallery";
$context['linktree'][] = array(
'url' => $scripturl '?action=gallery',
'name' => $txt['gallery']
);
}
?>

Gallery.template.php:
Code: [Select]
<?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">
<iframe id="myframe" src="http://bootjack.org/coppermine" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:novisible; width:100%; display:none"></iframe>
</td>
</tr>
</table>
</form>
'
;
}
?>

Salient part out of index.php:
Code: [Select]
'gallery' => array('Gallery.php', 'Gallery'),
Salient part out of index.template.php:
Code: [Select]
// the [Gallery] button
if ($context['user']['is_logged'])
echo ($current_action == 'gallery' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'gallery' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=gallery">Gallery</a>
</td>' , $current_action == 'gallery' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

I don't think there is any more information that I could possibly give you  ;D

Problems I'm having:
If I leave guest access turned on it only displays a sliver of the gallery window.
If I turn guess access off when I go to gallery it gives me a login prompt which then just creates another instance of the forums inside the iframe

I would like to leave guest access off so that not just anyone can browse to my photos.  I can't use .htaccess to password protect that directory because when I do that and then click on the gallery button in my forums it does absolutely nothing.  I imagine that if I had javascript errors turned on that it would tell me that it was denied access.

My main issue is that when I try to view the gallery from within SMF it pops up a full width but only a couple hundred pixel high frame

Any assistance would be greatly appreciated

Thanks
-bob

check the bridge setup. What is the actual gallery url.

-Snork13
Title: Re: [How To] Coppermine within SMF
Post by: badams on September 17, 2006, 10:24:43 pm
check the bridge setup. What is the actual gallery url.

-Snork13


http://bootjack.org/coppermine    -    gallery url
http://bootjack.org/smf    -    forum url
Title: Re: [How To] Coppermine within SMF
Post by: badams on September 21, 2006, 12:22:36 am
Anyone have any further ideas here?  It's been a couple days.
Title: Re: [How To] Coppermine within SMF
Post by: gorinnosho on October 11, 2006, 01:43:01 pm
Hi!

Please take a look at my forum!

The bridge is working - I guess (because, I can see all registered Users in the Gallery)!

Well, when I klick the Gallery I just have nothing - only an empty window!
No Gallery, nothing!

I just made it as you told in your instructions!

Do you have an idea?

Greets
Frank
Title: Re: [How To] Coppermine within SMF
Post by: gorinnosho on October 11, 2006, 02:23:48 pm
Hi!

Forgot the link to my forum http://www.aks-germany.forum.de (http://www.aks-germany.forum.de)
Title: Re: [How To] Coppermine within SMF
Post by: kirsten07734 on January 06, 2007, 10:43:41 am
I have the following issue when trying to bridge coppermine and SMF:
I used the instructions on this thread to run CPG inside my SMF forum.  I have the button installed, and the action does open the gallery in an iframe inside SMF.  However, it always opens to the SMF login page, even when I'm already logged in.  Obviously my error, but I can't figure out where I went wrong.  I am not an experienced PHP coder.  Any suggestions would be greatly appreciated.

Coppermine install: http://playground.workndog.org/gallery/
Forum install: http://playground.workndog.org/smforum/
Coppermine version: cpg1.4.10
Forum version: SMF 1.1.1
Test user account: Member / password

BridgeManager settings:
Forum URL:      http://www.playground.workndog.org/smforum
Relative path to your BBS's config file:    ../smforum/
Use post-based groups?:    1

I'm very excited about all the great features offered in this package and look forward to sharing it with folks on my real forum as soon as I can get it running on my test forum.  Thanks to all the developers for all the many hours of hard work they must have put into this.
Title: Re: [How To] Coppermine within SMF
Post by: Joachim Müller on January 06, 2007, 11:48:50 am
This is not related to this mod (which discusses visual integration of coppermine into SMF), but to bridging in general. Please start a thread on the regular bridging support board (http://forum.coppermine-gallery.net/index.php?board=50.0) with the details you have given above to avoid this mod thread getting cluttered with unrelated replies.
Title: Re: [How To] Coppermine within SMF
Post by: _MAVE_ on May 30, 2007, 03:08:46 pm
Hello,
i build a mod for smf. Now you can install and uninstall the Coppermine integration.

http://custom.simplemachines.org/mods/index.php?mod=837
Title: Re: [How To] Coppermine within SMF
Post by: Joachim Müller on May 31, 2007, 09:00:54 am
The instructions on the page you refered to are incorrect: there is no file named template.php. The mod can't be downloaded, as it is unapproved. If you want us to evaluate it, attach it to your posting on this board. You should have started a thread of your own instead of trying to hijack this thread, which deals with a different mod.
Title: Re: [How To] Coppermine within SMF
Post by: _MAVE_ on May 31, 2007, 01:38:27 pm
Oh und das jetzt auf englisch ???  ::)

Yes its right the mod its today unapproved.
No, i am dont want to hijack this thread, i use the informations from this thread to create this mod. He is only the automatic version from this thread with some adds. So i think its accurate to post it here.
It isnt, sorry for this and delete all.  :-\


Title: Re: [How To] Coppermine within SMF
Post by: shomazta on June 01, 2007, 11:56:13 pm
I get this =(

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fi13.tinypic.com%2F4qss100.gif&hash=f33b6ea9e1943f281abc9484c2c6ff980e91cf18)
Title: Re: [How To] Coppermine within SMF
Post by: _MAVE_ on June 02, 2007, 11:00:55 am
Sorry i forgot the attachement. :-[
Title: Re: [How To] Coppermine within SMF
Post by: TheTazZ on July 23, 2007, 01:47:08 am
It seems you also forgot the install file for the package or am i missing something important in the process?
Title: issue with bridge
Post by: Loki66 on October 01, 2007, 09:53:46 pm
I have some issue with the SMF bridge ... Only admin can upload files, not members through I allow members to upload in config/

Moreover, when I try to access the bridge administration, it tells me I am not login.

Thanks,

Loïc
Title: Re: [How To] Coppermine within SMF
Post by: Nibbler on October 02, 2007, 02:14:44 am
Please start your own thread, providing the information requested in the manual/sticky thread,
Title: Re: [How To] Coppermine within SMF
Post by: Bungy on October 07, 2007, 09:59:07 pm
I've been using SMF for a while, and I'm still clueless, so I thank you for the comprehensive guide.

My one question:

I get this error

Code: [Select]
An Error Has Occurred!
Unable to load the 'main' template.

Now, I think that's fairly obvious as to what it means, but I can honestly think of no way to fix it. It occurs when I click on the Gallery image link.

Again, any help you could provide would be great.

Thanks for the guide, and the CopperMine Gallery ;).
Title: Re: [How To] Coppermine within SMF
Post by: murdo on January 03, 2008, 11:37:36 am
I've been using SMF for a while, and I'm still clueless, so I thank you for the comprehensive guide.

My one question:

I get this error

Code: [Select]
An Error Has Occurred!
Unable to load the 'main' template.

Now, I think that's fairly obvious as to what it means, but I can honestly think of no way to fix it. It occurs when I click on the Gallery image link.

Again, any help you could provide would be great.

Thanks for the guide, and the CopperMine Gallery ;).

This is the exact same problem I am having!!!

http://www.gamersfiles.net/forum/index.php?action=gallery

Can ANYONE help? :(
Title: Re: [How To] Coppermine within SMF
Post by: Gazab on February 05, 2008, 09:02:31 pm
Hi,

Sorry if this is a stupid question.... I have Coppermine bridged with SMF, I have a problem in that Coppermine is exhausting bandwidth with my host. Therefore would it be posible to move Coppermine to another host and domain but still bridge it with SMF with my present host?

Cheers
Gazab :)
Title: Re: [How To] Coppermine within SMF
Post by: SaWey on February 05, 2008, 11:30:40 pm
Please do not highjack other people's threads, we have a strict 'one issue per thread' policy.
To answer your question, it won't be possible without making sure the db can be used from another host and extra coding in the core code.
Please create a new thread if you want to discuss this further!