[How To] Coppermine within SMF - Page 2 [How To] Coppermine within SMF - Page 2
 

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

[How To] Coppermine within SMF

Started by snork13, January 02, 2006, 07:07:48 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Crazie

Quote from: gofwd on April 11, 2006, 04:19:53 AM

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:
<a href="', $scripturl, '?action=gallery">Gallery</a>

and replace to look like this:
<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.

dyrer

These modifications are for SMF 1.0.x?? because with SMF RC2 template is not the same needed modifications

Starrbuck

Any idea what causes this error in the SMF error logs (and how to fix it):

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.

Nibbler

It's caused by SMF, not Coppermine.

Starrbuck

Technically, it is caused by using the scripts on the first post of this thread and reported by SMF.

Nibbler

'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'.

Starrbuck

Ok, I added:

// Gallery
$txt['gallery'] = 'Gallery';


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

Thank you for your help.

steve46

can anyone update this to work with SMF 1.1 RC3  ???

steve46

nevermind, i got it working with this method.

hieddie

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

warhonowicz

Tell me and I will forget
Show me and I might remember
But involve me and I will understand

badams

Running into some troubles here...   ???
Versions:  CPG 1.4.9 / SMF 1.1 RC3
Test Site: 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:
<?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:
<?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:
'gallery' => array('Gallery.php', 'Gallery'),

Salient part out of index.template.php:
// 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

snork13

Quote from: 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
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:
<?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:
<?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:
'gallery' => array('Gallery.php', 'Gallery'),

Salient part out of index.template.php:
// 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

badams

Quote from: snork13 on September 17, 2006, 04:53:46 PM
check the bridge setup. What is the actual gallery url.

-Snork13


http://bootjack.org/coppermine    -    gallery url
http://bootjack.org/smf    -    forum url

badams

Anyone have any further ideas here?  It's been a couple days.

gorinnosho

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

gorinnosho


kirsten07734

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.

Joachim Müller

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 with the details you have given above to avoid this mod thread getting cluttered with unrelated replies.

_MAVE_

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