Advertisement:

Author Topic: Coppermine Button and other wrapping fixes!  (Read 44368 times)

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Coppermine Button and other wrapping fixes!
« 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.
Code: [Select]
// 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?

Code: [Select]
// 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.
« Last Edit: January 06, 2006, 03:07:55 AM by Goosemoose »

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: Coppermine Button and other wrapping fixes!
« Reply #1 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:
Code: [Select]
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);
}
}

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: Coppermine Button and other wrapping fixes!
« Reply #2 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.

Offline trenchteam

  • Sr. Member
  • ****
  • Posts: 901
  • Gender: Male
    • NO WALLS STANDING
Re: Coppermine Button and other wrapping fixes!
« Reply #3 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?

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: Coppermine Button and other wrapping fixes!
« Reply #4 on: February 19, 2005, 03:40:06 AM »
This will work for any wrapped component. Which arcade room are you talking about?

Offline trenchteam

  • Sr. Member
  • ****
  • Posts: 901
  • Gender: Male
    • NO WALLS STANDING
Re: Coppermine Button and other wrapping fixes!
« Reply #5 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

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: Coppermine Button and other wrapping fixes!
« Reply #6 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()

Offline bmwheaven

  • Semi-Newbie
  • *
  • Posts: 56
  • Gender: Male
  • Sh*t happens.... All the time
    • BMW Heaven - The Knowledge Base
Re: Coppermine Button and other wrapping fixes!
« Reply #7 on: March 08, 2005, 07:13:02 PM »
works like a charm, thanks a bunch!
Sh*t happens
All the time

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: Coppermine Button and other wrapping fixes!
« Reply #8 on: March 08, 2005, 07:15:11 PM »
No problem, glad to help :)

Offline Kindred

  • The Mean One
  • Local Moderator
  • SMF Master
  • *
  • Posts: 42,288
  • Gender: Male
    • wagner999 on Facebook
    • Kindred-999 on GitHub
    • www.linkedin.com/in/wdwagner/ on LinkedIn
    • @Kindred_999 on Twitter
Re: Coppermine Button and other wrapping fixes!
« Reply #9 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:

Code: [Select]
// 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 />';


Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support forums.  Thank you.

Offline chadness

  • Sophist Member
  • *****
  • Posts: 1,025
  • Gender: Male
    • technoadvice.com
Re: Coppermine Button and other wrapping fixes!
« Reply #10 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:
Code: [Select]
            // 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.

Offline Radianation

  • Sophist Member
  • *****
  • Posts: 1,269
  • Gender: Male
  • Why not believe in me?
Re: Coppermine Button and other wrapping fixes!
« Reply #11 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.

Offline Radianation

  • Sophist Member
  • *****
  • Posts: 1,269
  • Gender: Male
  • Why not believe in me?
Re: Coppermine Button and other wrapping fixes!
« Reply #12 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?

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: Coppermine Button and other wrapping fixes!
« Reply #13 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?

Offline Radianation

  • Sophist Member
  • *****
  • Posts: 1,269
  • Gender: Male
  • Why not believe in me?
Re: Coppermine Button and other wrapping fixes!
« Reply #14 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...

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: Coppermine Button and other wrapping fixes!
« Reply #15 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

Offline Radianation

  • Sophist Member
  • *****
  • Posts: 1,269
  • Gender: Male
  • Why not believe in me?
Re: Coppermine Button and other wrapping fixes!
« Reply #16 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. ; )

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: Coppermine Button and other wrapping fixes!
« Reply #17 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.

Offline Radianation

  • Sophist Member
  • *****
  • Posts: 1,269
  • Gender: Male
  • Why not believe in me?
Re: Coppermine Button and other wrapping fixes!
« Reply #18 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?  ;)

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: Coppermine Button and other wrapping fixes!
« Reply #19 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.