Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: 1 [2] 3   Go Down

Author Topic: [How To] Coppermine within SMF  (Read 90715 times)

0 Members and 1 Guest are viewing this topic.

Crazie

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: [How To] Coppermine within SMF
« Reply #20 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.
Logged

dyrer

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 4
Re: [How To] Coppermine within SMF
« Reply #21 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
Logged

Starrbuck

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: [How To] Coppermine within SMF
« Reply #22 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.
Logged

Nibbler

  • Guest
Re: [How To] Coppermine within SMF
« Reply #23 on: July 13, 2006, 05:41:33 pm »

It's caused by SMF, not Coppermine.
Logged

Starrbuck

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: [How To] Coppermine within SMF
« Reply #24 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.
Logged

Nibbler

  • Guest
Re: [How To] Coppermine within SMF
« Reply #25 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'.
Logged

Starrbuck

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: [How To] Coppermine within SMF
« Reply #26 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.
Logged

steve46

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: [How To] Coppermine within SMF
« Reply #27 on: August 27, 2006, 01:26:49 pm »

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

steve46

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: [How To] Coppermine within SMF
« Reply #28 on: August 27, 2006, 01:57:17 pm »

nevermind, i got it working with this method.
Logged

hieddie

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: [How To] Coppermine within SMF
« Reply #29 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
Logged

warhonowicz

  • Coppermine novice
  • *
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 21
    • unsere Galerie
Re: [How To] Coppermine within SMF
« Reply #30 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
Logged
Tell me and I will forget
Show me and I might remember
But involve me and I will understand

badams

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: [How To] Coppermine within SMF
« Reply #31 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:
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
Logged

snork13

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 260
  • Internet! Is that thing still around?
    • Gallery
Re: [How To] Coppermine within SMF
« Reply #32 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
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
Logged

badams

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: [How To] Coppermine within SMF
« Reply #33 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
Logged

badams

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: [How To] Coppermine within SMF
« Reply #34 on: September 21, 2006, 12:22:36 am »

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

gorinnosho

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: [How To] Coppermine within SMF
« Reply #35 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
Logged

gorinnosho

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: [How To] Coppermine within SMF
« Reply #36 on: October 11, 2006, 02:23:48 pm »

Hi!

Forgot the link to my forum http://www.aks-germany.forum.de
Logged

kirsten07734

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: [How To] Coppermine within SMF
« Reply #37 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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: [How To] Coppermine within SMF
« Reply #38 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 with the details you have given above to avoid this mod thread getting cluttered with unrelated replies.
Logged

_MAVE_

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 3
Re: [How To] Coppermine within SMF
« Reply #39 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
Logged
Pages: 1 [2] 3   Go Up
 

Page created in 0.035 seconds with 19 queries.