Simple Machines Community Forum

Archived Boards and Threads... => Archived Boards => Joomla Bridge Support => Topic started by: Goosemoose on February 19, 2005, 01:49:41 AM

Title: Coppermine Button and other wrapping fixes!
Post by: Goosemoose on February 19, 2005, 01:49:41 AM
Okay, I spent the last hour trying to figure out how to put a button linking to my users coppermine galleries below their avatars, but still opening in a mambo page. I also found out how to make wrapped pages like coppermine to go back to the top of the page after clicking on a link. The solution not only works but also allows us to pass ANY variables to a wrapper. Note I just merged a whole bunch of different solutions together and hacked them up so they would work for us.

First, insert the following code before the words "// auto height control" in wrapper.php in your wrapper components folder.

// pass all except Mambo specific parameters to the wrapper
    $allparams = '?';
             
    if (isset( $_GET['option'] ))
      $workarray = $_GET;
    if (isset( $_POST['option'] ))
      $workarray = $_POST;
             
    reset($workarray);

    while (list($key, $val) = each($workarray)) {
    if (($key != 'option') && ($key != 'Itemid'))
        $allparams = $allparams . $key . '=' . $val . '&';
    }
    $row->url = $row->url . $allparams;


Now open your display.template.php in your theme and add the following code after where you want the gallery link to occur, I placed mine below the personal text which you can find by searching for:
// Show their personal text?


// Add for personal gallery
      echo '
', '<a href="' . $mosConfig_live_site . '/index.php?option=com_wrapper&Itemid=66&cat=', $message['member']['id']+10000, '"/><img border="0" src="' . $settings['images_url'] . '/gallery.gif" width="75" height="35" alt="" /></a><br />';



How this is going to work (this is for the info of those who want to use this elsewhere):
Now anytime you call a wrapper from smf or anywhere else anything that you add to the end of the link with &putparamatershere will get added on to the actual wrapped page. For example if you want to link to a user gallery the address is usually http://www.yoursite.com/coppermine/index.php?cat=15031 but your coppermine wrapper is actually something like http://www.yoursite.com/index.php?option=com_wrapper&Itemid=66, and it wraps http://www.yoursite.com/coppermine/index.php. Now that we have edited wrapper.php if you call the wrapped item by saying http://www.yoursite.com/index.php?option=com_wrapper&Itemid=66&cat=10001 the &cat=10001 will become ?cat=10001 and get appended to the http://www.yoursite.com/coppermine/index.php and become a link to that users gallery, http://www.yoursite.com/coppermine/index.php?cat=10001.


Let me know if you get this to work, or if you need help! This can really help with integrating other mambo/smf items.
Title: Re: Coppermine Button and other wrapping fixes!
Post by: Goosemoose on February 19, 2005, 02:39:24 AM
Oh I forgot to post the code to make coppermines wrapped page return to the top when you click on a link. In wrapper.html.php

Insert the following twice into your iFrameHeight:
parent.scrollTo(0,0);

so your function looks like this:

function iFrameHeight() {
var h = 0;
if ( !document.all ) {
h = document.getElementById('blockrandom').contentDocument.height;
document.getElementById('blockrandom').style.height = h + 60 + 'px';
parent.scrollTo(0,0);
} else if( document.all ) {
h = document.frames('blockrandom').document.body.scrollHeight;
document.all.blockrandom.style.height = h + 20 + 'px';
parent.scrollTo(0,0);
}
}
Title: Re: Coppermine Button and other wrapping fixes!
Post by: Goosemoose on February 19, 2005, 03:02:10 AM
Oh, you need to upload this image to your themes image folder. I grabbed this from somone else's thread on the forum but I forget who.
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.goosemoose.com%2Frfc%2FThemes%2Ftheme1%2Fimages3%2Fgallery.gif&hash=d337cdb62b0bf9e4c1d933d00a28b6e648f5cfaf)
Title: Re: Coppermine Button and other wrapping fixes!
Post by: trenchteam on February 19, 2005, 03:08:19 AM
Will this work for other packages as well as a work around the wrapper, or is this for Coppermine only?  Do you think this will work for the arcade rooM?
Title: Re: Coppermine Button and other wrapping fixes!
Post by: Goosemoose on February 19, 2005, 03:40:06 AM
This will work for any wrapped component. Which arcade room are you talking about?
Title: Re: Coppermine Button and other wrapping fixes!
Post by: trenchteam on February 19, 2005, 04:07:30 AM
The Arcade by Niko for SMF.  I can get the arcade in the wrapper, but none of the games work using the bridge. It has to be outside of the portal using /forums not /portal
Title: Re: Coppermine Button and other wrapping fixes!
Post by: Goosemoose on February 19, 2005, 04:24:26 AM
This will help with going the other way around, i.e. putting things that weren't meant in mambo and creating links to them in smf. To get the arcade wrapper to work you need to do the same thing you did for getting chat to work. Make sure you make any changes that were for index.php to the smf.php file and change obexit() to return()
Title: Re: Coppermine Button and other wrapping fixes!
Post by: bmwheaven on March 08, 2005, 07:13:02 PM
works like a charm, thanks a bunch!
Title: Re: Coppermine Button and other wrapping fixes!
Post by: Goosemoose on March 08, 2005, 07:15:11 PM
No problem, glad to help :)
Title: Re: Coppermine Button and other wrapping fixes!
Post by: Kindred on March 09, 2005, 09:34:25 AM
in order to make this even simpler (and not require hardcoding the site), I believe you could use the following in place of the hardcoded call to the coppermine wrapped site:


// Add for personal gallery
      echo '
', '<a href="' . $mosConfig_live_site . '/index.php?option=com_wrapper&Itemid=66&cat=', $message['member']['id']+10000, '"/><img border="0" src="' . $settings['images_url'] . '/gallery.gif" width="75" height="35" alt="" /></a><br />';



Title: Re: Coppermine Button and other wrapping fixes!
Post by: chadness on March 09, 2005, 10:06:20 AM
Goosemoose, this is awesome!  Worked like a charm. 

Kindred beat me (as usual) to the suggestion for how to code the site address.  But, I coded it like this:

            // Add for personal gallery
            echo '
                            ', '<a href="' . $mosConfig_live_site . 'index.php?option=com_wrapper&Itemid=38&cat=', $message['member']['id']+10000, '"/><img border="0" src="' . $settings['images_url'] . '/gallery.gif" width="75" height="35" alt="" /></a><br />';

Note that I removed the / from in front of index.php.  If I leave that in, my development site links to the root, instead of the /dev subdirectory it is in.
Title: Re: Coppermine Button and other wrapping fixes!
Post by: NoRad on May 06, 2005, 01:37:44 AM
Awesome. Worked for me like a charm! Thank you for making this post / modification so easy to use.
Title: Re: Coppermine Button and other wrapping fixes!
Post by: NoRad on May 06, 2005, 01:40:22 AM
p.s. Anybody combine this with the other hack where we can only display the gallery button if they *have* a gallery?
Title: Re: Coppermine Button and other wrapping fixes!
Post by: Goosemoose on May 06, 2005, 02:21:20 AM
Hmm, if you have bridge coppermine and smf, everyone should have a gallery, even if nothing is in it. Do you mean it would only appear if there were no albums?
Title: Re: Coppermine Button and other wrapping fixes!
Post by: NoRad on May 06, 2005, 06:13:05 PM
Everybody can have a gallery, but it's not automatically created by default. So if they don't it just says "No album configured for this user" or something like that. If they do, you see their albums/pictures. So what I'd like to do is display 1 button if they have a gallery and another button if they don't...
Title: Re: Coppermine Button and other wrapping fixes!
Post by: Goosemoose on May 06, 2005, 11:06:04 PM
Hmm. If my users have not created an album yet they still end up in a default gallery like this:
Home > User galleries > chaos_in_motion and it says "No image to display" for the gallery. It sounds like your users are not being shared properly. Can you give me a link to a user who does not have a gallery? You can see one of mine here: http://www.goosemoose.com/index.php?option=com_wrapper&Itemid=66&cat=16083
Title: Re: Coppermine Button and other wrapping fixes!
Post by: NoRad on May 07, 2005, 05:12:17 AM
That's the exact same thing I get, but why send a user to that page? It would be more user-friendly to just let them know that this chump doesn't have a gallery yet... so don't bother clicking. ; )
Title: Re: Coppermine Button and other wrapping fixes!
Post by: Goosemoose on May 08, 2005, 02:13:02 AM
True. I leave it there because it encourages my users to use the photo albums. They don't want others clicking on it and seeing no pics.
Title: Re: Coppermine Button and other wrapping fixes!
Post by: NoRad on May 08, 2005, 11:31:21 PM
I'd love to display up to 4 thumbnails in addition to the avatar on their profile page that are pulled from the user's coppermine gallery. Anybody want to take a stab at this?  ;)
Title: Re: Coppermine Button and other wrapping fixes!
Post by: Goosemoose on May 09, 2005, 01:03:45 AM
Orstio is working on a mambo-smf bridged profile page that allows users to create their own profile with html and everything. You could give instructions on how to call the html function in coppermine to display 4 pictures.
Title: Re: Coppermine Button and other wrapping fixes!
Post by: NoRad on May 09, 2005, 03:16:04 AM
This type of page sounds really cool. I was actually searching for something similar to this right now.

I'm sure some of you have heard of MySpace.com ... I'd like to give some members the ability to create their own "band" pages like myspace does, completely with mp3s and all that jazz. I already developed a custom flash player for the frontend that pulls the tracklist from an xml file. It would take a little tweaking, but I think I can make it happen. I was thinking about trying to use a hack on coppermine to handle the files though.
Title: Re: Coppermine Button and other wrapping fixes!
Post by: Aravot on May 09, 2005, 11:14:09 AM
Something similar like MySpace, Homepage(s) for members, if you are using Mambo 4.5 you could use lmtg.myhomepages (http://www.tectonique.net/index.php?option=com_lmtg_myhomepage&lmtg_subject=mark&lmtg_item=2) does not work with 4.5.2, if your are using Mambo 4.5.X (1 or 2) User HomePages (http://mamboforge.net/projects/uhp)
Title: Re: Coppermine Button and other wrapping fixes!
Post by: Kindred on May 09, 2005, 11:34:11 AM
I dunno about you, but I have the lmtg home pages working with mambo 4.5.2...   I also have the User Home Pages (uhp) working with 4.5.2...

Overall, I think I like UHP better, anyhow.
Title: Re: Coppermine Button and other wrapping fixes!
Post by: Aravot on May 09, 2005, 01:20:31 PM
Quote from: Kindred on May 09, 2005, 11:34:11 AM
I dunno about you, but I have the lmtg home pages working with mambo 4.5.2...   I also have the User Home Pages (uhp) working with 4.5.2...

Overall, I think I like UHP better, anyhow.

Than I must be doing something wrong cause I can't get lmtg to work with 4.5.2.1
Title: Re: Coppermine Button and other wrapping fixes!
Post by: NoRad on May 09, 2005, 11:19:45 PM
Thanks. I have to check this out. =)
Title: Re: Coppermine Button and other wrapping fixes!
Post by: NoRad on May 17, 2005, 10:24:53 PM
Hey, I'm getting a lot of errors in my SMF error log from this hack.

Apply Filter: Only show the errors with the same message
8: Undefined variable: mosConfig_live_site
File: I:\louipimps\forum\Themes\louipimps_v4\Profile.template.php
Line: 399

and line 399:

<a href="' . $mosConfig_live_site . 'index.php?option=com_wrapper&Itemid=43&cat=', $context['member']['id']+10000, '"/><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/gallery.gif" alt="Personal Gallery" border="0"></a><br /><br />
Title: Re: Coppermine Button and other wrapping fixes!
Post by: Goosemoose on May 22, 2005, 03:30:25 AM
You can hard code the site address is if you want.
Title: Re: Coppermine Button and other wrapping fixes!
Post by: NoRad on May 22, 2005, 03:45:29 AM
Is that the only solution?
Title: Re: Coppermine Button and other wrapping fixes!
Post by: Goosemoose on May 22, 2005, 03:24:25 PM
That I know of , it seems that mosConfig_live_site causes problems when people try to access you site directly (not through mambo), this problem has been noted in the general mambo threads and is not really due to the script itself.
Title: Re: Coppermine Button and other wrapping fixes!
Post by: NoRad on May 22, 2005, 10:42:06 PM
Hmm... But I have my site setup so that it doesn't let them access the page if that is not defined.
Title: Re: Coppermine Button and other wrapping fixes!
Post by: brother7 on October 26, 2005, 11:14:38 AM
Quote from: Goosemoose on February 19, 2005, 01:49:41 AM
First, insert the following code into line 46 of wrapper.php in your wrapper components folder.

// pass all except Mambo specific parameters to the wrapper
    $allparams = '?';
             
    if (isset( $_GET['option'] ))
      $workarray = $_GET;
    if (isset( $_POST['option'] ))
      $workarray = $_POST;
             
    reset($workarray);

    while (list($key, $val) = each($workarray)) {
    if (($key != 'option') && ($key != 'Itemid'))
        $allparams = $allparams . $key . '=' . $val . '&';
    }
    $row->url = $row->url . $allparams;
Can someone tell me between which lines should I place this code?  I'm using the latest Joomla 1.0.3 and the wrapper.php file is dated 2005-09-15.  I just want to make sure I'm pasting the code in the right place.  Thanks in advance.
Title: Re: Coppermine Button and other wrapping fixes!
Post by: Aravot on October 26, 2005, 03:12:18 PM
Insert before "// auto height control"
Title: Re: Coppermine Button and other wrapping fixes!
Post by: perplexed on April 17, 2006, 08:57:53 PM
can we still use this since it hasnt been posted in for a while I just wanted to check?

I am using the new bridge 1.1.3?
Title: Re: Coppermine Button and other wrapping fixes!
Post by: Goosemoose on April 17, 2006, 10:03:20 PM
Yup, still works.
Title: Re: Coppermine Button and other wrapping fixes!
Post by: perplexed on April 18, 2006, 08:29:24 AM
thanks, should I do this before or after doing the coppermine fetch fix (to stop the admins album showing up)

also fiddling with the wrapper.php does that affect anything else?
Title: Re: Coppermine Button and other wrapping fixes!
Post by: Goosemoose on April 18, 2006, 09:25:49 PM
Fiddling with wrapper.php is not neccesary for the other things to work. It will affect anything using the wrapper by not forcing the page to return to the top of the screen after each click.
Title: Re: Coppermine Button and other wrapping fixes!
Post by: perplexed on April 19, 2006, 01:41:54 PM
So All I have to do is add the code to the display.template and not touch the wrapper?
Title: Re: Coppermine Button and other wrapping fixes!
Post by: Goosemoose on April 19, 2006, 08:23:32 PM
Yup, the wrapper part was extra, and not neccessary since you are using coppeminevis
Title: Re: Coppermine Button and other wrapping fixes!
Post by: perplexed on April 26, 2006, 12:06:09 PM
Hi

Problem 1:
I got around to trying this today, just by inserting the code in the display template ( my previous posts were checking that I didnt have to touch the wrapper) I changed the wrapper to copperminevis and it seems to work for everyone except me :(

I am the admin and I have that problem where the admin's album shows up in the gallery on no one elses does lol but for this, it takes me to an empty page, so I guess my album is elsewhere?


Problem 2:
I am getting pages and pages of this error in my forum error log:

8: Undefined variable: mosConfig_live_site
File: /home/mysite/public_html/forum/Themes/default/Display.template.php (main sub template - eval?)
Line: 418
Title: Re: Coppermine Button and other wrapping fixes!
Post by: Goosemoose on April 26, 2006, 08:49:44 PM
The mosConfig_live_site fix is discussed on the first page of this thread, you will basically need to hard code your url in.

Can you give me the link to one of the 'empty pages' ?
Title: Re: Coppermine Button and other wrapping fixes!
Post by: perplexed on April 27, 2006, 07:21:16 AM
Quote from: Goosemoose on April 26, 2006, 08:49:44 PM
The mosConfig_live_site fix is discussed on the first page of this thread, you will basically need to hard code your url in.
I thought that what I was doing with the code added to display template.  How do I do this? ???

Quote from: Goosemoose on April 26, 2006, 08:49:44 PM
Can you give me the link to one of the 'empty pages' ?
the gallery isnt open to public, just registered members, I could send you a screenshot?

the url for a regular album is
http://www.mysite.com/index.php?option=com_copperminevis&Itemid=50&place=gallery&cat=10162

the greyed out anonymous albums have
http://www.mysite.com/index.php?option=com_copperminevis&Itemid=50&place=gallery&cat=10000
Title: Re: Coppermine Button and other wrapping fixes!
Post by: Goosemoose on April 27, 2006, 09:57:35 PM
It looks like the code wasn't copied in correctly as it's hard coding 10000 on there rather than adding 10000 to the original cat id.
Title: Re: Coppermine Button and other wrapping fixes!
Post by: perplexed on April 29, 2006, 09:59:02 AM
hmmm see, your code from the first page says

'<a href="' . $mosConfig_live_site . '/index.php?option=com_wrapper&Itemid=66&cat=',

but I dont have the coppermine set up in the wrapper, I have that copperminevis thing lol so I changed your code from com_wrapper to com_copperminevis and it does seem to work for the regular members apart from me and getting all the forum errors, so what should I have done instead?

I dont really know what I'm doing, its all guesswork lol

and those 'anonymous' albums dont belong to anyone so I dont know what to do to get rid of them, its very annoying.  It seems on CPG anonymous is for guests but because I have smf groups, I dont have 'anonymous' in my groups, I have smf guest group and they have no rights.  Am I going to be stuck with these grey albums forever *cries*

Title: Re: Coppermine Button and other wrapping fixes!
Post by: Goosemoose on April 29, 2006, 04:09:30 PM
For copperminevis change it to this and note that I hard coded my url (so make sure to change goosemoose.com to your url) to avoid the error log messages:


// Add for personal gallery
echo '
', '<a href="http://www.goosemoose.com/component/option,com_copperminevis/Itemid,210/place,gallery/cat,', $message['member']['id']+10000, '/"/><img border="0" src="' . $settings['images_url'] . '/gallery.gif" width="75" height="35" alt="" /></a><br />';
Title: Re: Coppermine Button and other wrapping fixes!
Post by: perplexed on April 30, 2006, 07:38:04 AM
:( I copied it exactly, changing my site address and itemid and I got this:

QuoteNot Found
The requested URL /component/option,com_copperminevis/Itemid,50/place,gallery/cat,10183/ was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

when I clicked on the member gallery link ???
Title: Re: Coppermine Button and other wrapping fixes!
Post by: Goosemoose on May 02, 2006, 01:42:06 PM
Are you using SEF or normal URL's ?
Title: Re: Coppermine Button and other wrapping fixes!
Post by: perplexed on June 16, 2006, 09:36:13 AM
normal urls

eg the url for my gallery is
http://mysite.com/index.php?option=com_copperminevis&Itemid=50

(sorry for the delay in replying, Ive been away)
Title: Re: Coppermine Button and other wrapping fixes!
Post by: perplexed on April 05, 2007, 11:24:30 AM
can someone tell me how to change this to go to a gallery not using joomla?

I would like a to smf gallery under posts using something like this for members

Title: Re: Coppermine Button and other wrapping fixes!
Post by: Goosemoose on April 05, 2007, 12:45:27 PM
If you are using coppermine you would use very similar code, but you'd need be running the SMF-Coppermine bridge.
Title: Re: Coppermine Button and other wrapping fixes!
Post by: perplexed on April 05, 2007, 12:52:56 PM
this is the link I want to use but I just dont know how to code it

http://www.mysite.com/testforum/index.php?action=gallery;sa=myimages;u=1

u=1 is the admin so I would need it to go to the correct member gallery

Sorry if this is off topic
Title: Re: Coppermine Button and other wrapping fixes!
Post by: NoRad on April 06, 2007, 01:29:43 PM
 $message['member']['id']+10000

That will give you their gallery id.
Title: Re: Coppermine Button and other wrapping fixes!
Post by: perplexed on April 07, 2007, 01:38:56 PM
I tried this but I get this:

An Error Has Occurred!
No user selected.

So I probably did it wrong  
Title: Re: Coppermine Button and other wrapping fixes!
Post by: Goosemoose on April 07, 2007, 02:52:12 PM
Show us the exact code.
Title: Re: Coppermine Button and other wrapping fixes!
Post by: NoRad on April 07, 2007, 03:12:16 PM
Are you running coppermine bridged?
Title: Re: Coppermine Button and other wrapping fixes!
Post by: perplexed on April 07, 2007, 07:44:24 PM
Quote from: perplexed on April 05, 2007, 11:24:30 AM
can someone tell me how to change this to go to a gallery not using joomla?

I would like a to smf gallery under posts using something like this for members


Its not for coppermine, I wanted to link to smf gallery.  I asked in another thread and was directed here.
Title: Re: Coppermine Button and other wrapping fixes!
Post by: NoRad on April 08, 2007, 11:22:43 PM
The concept of where to add the link is the same, but the link you're going to create is different.
Title: Re: Coppermine Button and other wrapping fixes!
Post by: perplexed on April 09, 2007, 07:34:50 AM
I understand that the link will be different but I dont know how to create it, which is why I am here in this thread :)
Title: Re: Coppermine Button and other wrapping fixes!
Post by: NoRad on April 10, 2007, 02:13:34 AM
Sorry. I would help but I've never used the SMF Gallery.
Title: Re: Coppermine Button and other wrapping fixes!
Post by: Goosemoose on April 16, 2007, 01:25:59 PM
Me either. You're better of asking in the mods thread.
Title: Re: Coppermine Button and other wrapping fixes!
Post by: perplexed on April 16, 2007, 03:43:06 PM
I did, several times :(

never mind, I guess I'm just not meant to have it

thanks for your help