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.
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);
}
}
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)
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?
This will work for any wrapped component. Which arcade room are you talking about?
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
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()
works like a charm, thanks a bunch!
No problem, glad to help :)
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 />';
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.
Awesome. Worked for me like a charm! Thank you for making this post / modification so easy to use.
p.s. Anybody combine this with the other hack where we can only display the gallery button if they *have* a gallery?
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?
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...
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
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. ; )
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.
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? ;)
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.
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.
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)
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.
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
Thanks. I have to check this out. =)
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 />
You can hard code the site address is if you want.
Is that the only solution?
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.
Hmm... But I have my site setup so that it doesn't let them access the page if that is not defined.
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.
Insert before "// auto height control"
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?
Yup, still works.
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?
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.
So All I have to do is add the code to the display.template and not touch the wrapper?
Yup, the wrapper part was extra, and not neccessary since you are using coppeminevis
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
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' ?
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
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.
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*
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 />';
:( 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 ???
Are you using SEF or normal URL's ?
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)
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
If you are using coppermine you would use very similar code, but you'd need be running the SMF-Coppermine bridge.
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
$message['member']['id']+10000
That will give you their gallery id.
I tried this but I get this:
An Error Has Occurred!
No user selected.
So I probably did it wrong
Show us the exact code.
Are you running coppermine bridged?
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.
The concept of where to add the link is the same, but the link you're going to create is different.
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 :)
Sorry. I would help but I've never used the SMF Gallery.
Me either. You're better of asking in the mods thread.
I did, several times :(
never mind, I guess I'm just not meant to have it
thanks for your help