Let the user set a "home" folder to jump to after logging in
Posted by korsakov
Let the user set a "home" folder to jump to after logging in March 17, 2010 11:30AM |
Registered: 15 years ago Posts: 753 |
I am just looking for an idea how to best let a user choose a ("Home-")folder and have the ID of this folder saved during the user's registration. I would like to direct the user to his home-folder after login for example. Thank you for your help!
Edited 1 time(s). Last edit at 03/17/2010 11:35AM by Maurice Makaay.
Edited 1 time(s). Last edit at 03/17/2010 11:35AM by Maurice Makaay.
Re: Let the user set a "home" folder to jump to after logging in March 17, 2010 11:34AM |
Admin Registered: 19 years ago Posts: 8,532 |
Not really on topic for the enhanced custom profiles module, so I split this off.
What's the idea with doing this during the user's registration? It sounds more like a feature that a user wants to access after registration and after using the forums ("Make this my startup page after logging in"). Choosing a folder during signup seems like putting a feature in the wrong spot to me.
If I would implement something like this, I wouldn't make it an "after login" folder. I would rather provide the user with a kind of in-Phorum bookmark list, where he/she can quickly jump to the pages that are bookmarked. I think that this would be a more useful feature, but maybe you have a different use case in mind here.
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Edited 1 time(s). Last edit at 03/17/2010 11:35AM by Maurice Makaay.
What's the idea with doing this during the user's registration? It sounds more like a feature that a user wants to access after registration and after using the forums ("Make this my startup page after logging in"). Choosing a folder during signup seems like putting a feature in the wrong spot to me.
If I would implement something like this, I wouldn't make it an "after login" folder. I would rather provide the user with a kind of in-Phorum bookmark list, where he/she can quickly jump to the pages that are bookmarked. I think that this would be a more useful feature, but maybe you have a different use case in mind here.
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Edited 1 time(s). Last edit at 03/17/2010 11:35AM by Maurice Makaay.
Re: Let the user set a "home" folder to jump to after logging in March 21, 2010 02:40PM |
Registered: 15 years ago Posts: 753 |
I apparently forgot to send my reply. The reason why I want to give the user the option to choose his home-folder during registration is the fact that I want to spare him the frustration in case the site is not for him. As Thomas recommended I inserted code from the "Favorite Forum" module into register.tpl. The drop-down is correctly listing all folders. I am currently working on a small baby-laptop and I just have difficulties to set the custom variable "folder_sel" with the according folder_id. Could you look at the last line where I use a hidden <input>-field? It would be very helpful. Thank you!!
Edited 1 time(s). Last edit at 03/21/2010 02:41PM by korsakov.
Language: PHP
global $PHORUM; $forums = phorum_mod_favorite_forums_get_forums(); $content = "<select name=';FavoriteForums"."[]'; size=';5';>"; foreach ($forums as $forum_id => $forum_data) { $content .= "<option value=\"{$forum_id}\""; foreach ($dropdown_chosen as $chosen) { if ($chosen == "$forum_id") { $content .= " selected=';selected';";$folder_sel=$chosen; break; } } } $content .= ">".$forum_data["name"]."</option>"; } } $content .= "</select><input type=\"hidden\" name=\"folder_sel\" value=\"{$folder_sel}\" />"; print $content;
Edited 1 time(s). Last edit at 03/21/2010 02:41PM by korsakov.
Re: Let the user set a "home" folder to jump to after logging in March 21, 2010 02:54PM |
Moderator Registered: 17 years ago Posts: 1,301 |
I am seeing a number of things wrong here. If you want to save the forum_id to a custom profile field named "folder_sel" then you need to change your code a bit. Drop the whole hidden input field and simple change the select tag's name to folder_sel. So, line 3 becomes:
Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
line 11 becomes:Language: PHP
$content = "<select name=';folder_sel'; size=';5';>";
and line 19 becomes:Language: PHP
$content .= " selected=';selected';";
Language: PHP
$content .= "</select>";
Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Re: Let the user set a "home" folder to jump to after logging in March 21, 2010 03:26PM |
Registered: 15 years ago Posts: 753 |
Sorry, only registered users may post in this forum.