Closed (fixed)
Project:
Thickbox
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
4 Apr 2007 at 12:15 UTC
Updated:
4 Jun 2012 at 02:47 UTC
Jump to comment: Most recent
Comments
Comment #1
spooky69 commentedAs above. Interestingly, I note that this does redirect to the correct destination page when clicking a drupal generated login link, such as 'login to post a comment', but it loses the destination from a custom login that I am using:
print l("Login",'user/login' .drupal_get_destination());
The above just goes to front page using thickbox login, although the url shown when I hover over the login link generated by the above code does show the thickbox_login with the &destination= correctly appended to the url.
Any ideas?
Comment #2
spooky69 commentedFixed - replacing ' with " seemed to sort it out.
Issue closed.
Comment #3
spooky69 commentedOk, it did not fix it.
The issue seems to be that the login retains the destination url when using IE6 but does not retain the destination url when using Firefox or IE7.
Can anyone provide some advice or pointers as to why this could be happening?
Comment #4
wim leersI have the same problem. Subscribing.
Comment #5
rkn-dupe commentedsub.
Comment #6
spooky69 commentedIs there still no sign of a fix (or a comment perhaps) on this problem?
-- www.inventionmail.com --
Comment #7
frjo commentedHere are some example code for building your own login links.
Comment #8
spooky69 commentedThanks for the response. I am currently using:
print l("Login", "user/login" .drupal_get_destination());
Shouldn't this work? Users are able to log in from the code I use, it just does not always seem to get the destination part. Is there any fundamental difference in the code you have listed above and the code I am using?
Comment #9
frjo commentedSee her http://api.drupal.org/api/5/function/l how to use the l() function.
Something like this might work better.
Comment #10
spooky69 commentedThanks for the assistance and I will have a look at this. The odd thing is that it gets the destination when using IE6, but does not get the destination when using Firefox or IE7.......
Comment #11
esadot commentedAny new developments? I'd appreciate a robust solution.
Comment #12
TerrenceLP commentedtry this out...
Notice the addition of document.location.hostname +, this was it gets the current host name and the function works.
Comment #13
kulfi commentedWhich file does this edit go in?
Comment #14
Anonymous (not verified) commented@ #13, the code is the output of thickbox.module with the addition of document.location.hostname +. Just edit the module, and add that extra bit.
It works for me now. I used #7's php code in my page.tpl.php, and #12's patch of the thickbox.module
Comment #15
palmergroup commentedI solved the "create new account", which was fairly easy. I've posted the walkthrough below. But first, my two cents. I really want this thickbox to work without having to go to the actual user/login or user/register page if there were an error. That means, if a user inputs an incorrect password, the thickbox remains and highlights the password field. Same goes for register.
Register link walkthrough.
Copy the thickbox_login.js and rename the new file to thickbox_register.js. Wherever you see the word "login" change it to "register". Then go into the thickbox.module and search for all words: "login". Just copy and paste each function (or block of code) that contains the "thickbox_login" and replace the "login" with "register". These steps are simple, however, the last one required a print_r($form) because I wasn't familiar with the e-mail array. Anyways, this is what I put for the form_alter (which is the last bit in the thickbox.module):
You can see I included the part with the thickbox_login because you'll have to add your if statement inside this function.
Once that is done you'll need to go into the thickbox module options in the admin section and tick the "Enable for register links". Then i'd suggest going back into your thickbox_register.js and changing the height to 250. Should be good to go after that.
Comment #16
drupalina commentedRe #15 , cronin...
This is simply great! But it's still not 100% user-friendly.
I'm wondering if it would be possible to display the standard 3-tabbed view inside Thickbox -- i.e. "Create New Account" "Forgot Password?" and "Login" -- ALL in the same Thickbox ???
I'm also wondering which one is the robust working solution for making sure that after logging in the user remains on the same page he was seeing, rather than being redirected to the front-page??? I mean that's the whole point of thickbox - so that the user remains on the same page.
Comment #17
ekrispin commentedSubscribing...
I see that this issue is open for almost a year... I understand that there is no one seriously maintaining the module... I wonder if there is any alternative...
Comment #18
frjo commentedThis module is maintained. The feature discussed here is not one I need but if someone send in a good patch that others test to make sure it works well I will commit it.
Comment #19
aerodog commentedHey folks,
Honestly this thread confused me. There was this php script which makes sense for page.tpl, a "print l" line I'm not sure where we ought to place, a document.location.hostname + couple of lines which should, i believe, be in thickbox_login.js but someone claims is a fix for thickbox.module, and even that seems to make formerly "http://www.example.com/thickbox..." links into "http://www.example.com/www.example.com/thickbox..." links.
When I added the document.location.hostname + stuff with the backslash before 'thickbox', all I get is a thickbox that's blank with no forms printed. I actually am trying to get this to work for registration (not for login, though the same rules should apply). What can I be doing wrong?
Here's what I want to do to be more precise. I want a thickbox registration where if the registration goes wrong, I stay within the thickbox, and if registration goes right, I return to my original page.
Any help is appreciated to make clear the suggestions above. I've been tinkering around with this for a while now to no avail! All help is appreciated.
Comment #20
ekrispin commentedSolution is very simple (I assumed it would be somehow difficult as this issue is open for 16 months without even a clue given about how to solve it...)
Oh well, here is what you have to do:
In function thickbox_login() in thickbox.module after
print drupal_get_form('user_login');add the following lines:Also , change the hight of the window in thickbox_login.js to 240 to avoid scrolling.
Comment #21
HS commentedthanks ekrispin! Bless ya!
Comment #22
Parkes Design commentedthanks ekrispin! Much Appreciated... I'm surprised they haven't made this standard yet.
This also does the trick
print drupal_get_form('user_login_block');
Comment #23
frjo commentedI hace just added a Thickbox setting to 6-dev for what login form to use, user_login, user_login_block or custom. It defaults to user_login.
Comment #24
wim leersComment #25
open social commented- Once successfully logged in, keep the user on the page they were viewing, currently I'm being redirected to front.
This worked for me: