You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 61 guest(s) and 3 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Choose page other than Your_Account as entry page. [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
Prophet
Captain
Captain


Joined: Mar 14, 2004
Posts: 422

Location: Florida, USA, Earth, Space

PostPosted: Sat Oct 02, 2004 9:34 pm Reply with quoteBack to top

Open index.php from the modules/Your_Account directory and find the following code within the login function (around line 828 in Nuke 7.4 - this may vary, but look for the login function)

Code:
if ($redirect == "" ) {
            Header("Location: modules.php?name=Your_Account&op=userinfo&bypass=1&username=$username");
        } else if ($mode == "") {
            Header("Location: modules.php?name=Forums&file=$forward");
        } else if ($t !="")  {
            Header("Location: modules.php?name=Forums&file=$forward&mode=$mode&t=$t");
        } else {
            Header("Location: modules.php?name=Forums&file=$forward&mode=$mode&f=$f");


Alter this line ...
Code:
if ($redirect == "" ) {
            Header("Location:modules.php?name=Your_Account&op=userinfo&bypass=1&username=$username");


Edit the URL to take members to an alternate page upon login.
Remove modules.php?name=Your_Account&op=userinfo&bypass=1&username=$username and replace it with the URL of your choosing.

**Update** In unmodified copies of version 7.8, you can find the above code on or around line 855.

_________________
- Prophet
Image
Get the Last Visit module (and others modules I designed) from my website! FREE! http://jasonlau.biz

Media Embedding

Last edited by Prophet on Tue Dec 06, 2005 9:20 am; edited 1 time in total
Find all posts by ProphetView user's profileSend private messageVisit poster's websiteAIM Address
djserby
Nuke Cadet
Nuke Cadet


Joined: Aug 27, 2004
Posts: 3


PostPosted: Fri Apr 01, 2005 1:07 pm Reply with quoteBack to top

Awesome, Thanks for the post!!! Very Happy
Find all posts by djserbyView user's profileSend private message
Beta3
Private
Private


Joined: Jul 30, 2005
Posts: 35


PostPosted: Sat Sep 10, 2005 3:51 pm Reply with quoteBack to top

And if you use Nuke 7.7, just find this :

Code:
modules.php?name=Your_Account&op=userinfo&bypass=1&username=$username


and replace with the link you want Cool

_________________
Note: i´m not a Natural English Reader/Writer, so, sorry for any gramatical error...Wink
Image
I'm the Rainbow Brite you hated . . .
Find all posts by Beta3View user's profileSend private message
Xyberian
Colonel
Colonel


Joined: Mar 14, 2004
Posts: 1921

Location: Behind you

PostPosted: Sat Sep 10, 2005 5:42 pm Reply with quoteBack to top

Actually, that codes are not properly working for some reasons. The above codes assumed "naked" module names such as
Forums
Your_Account
etc...

What if you put security patches?
They must be changed using $module_name variable by extracting dirname() function.

So, first of all, use direname() function prior to changing them.

However, you changed modules names such as Forums --> Bulletin Board ?

This modification does not work anymore. Therefore, the best and tight codes, which runs at any cases, must have a query to extract module names from DB tables (module name tables and mid field (module_id or name)).

Good Luck. this is a very good discussion and staring point to dig into what's going on.

_________________
NukeKorea Dev. Network.
NukeKorea Laboratories
Find all posts by XyberianView user's profileSend private messageVisit poster's website
Prophet
Captain
Captain


Joined: Mar 14, 2004
Posts: 422

Location: Florida, USA, Earth, Space

PostPosted: Tue Dec 06, 2005 10:02 am Reply with quoteBack to top

Better yet, you can use php sessions to determine when to redirect the user. Here is how ...

Create the following if it does not already exist ...
For versions 7.5 and lower, create includes/myheader.php
For versions 7.6 and above, create includes/custom_files/custom_header.php

How the code works -

// We begin a php session unconditionally when the client enters the site.
Code:
session_start();


// prevent sessionid from showing in url
Code:
ini_set("url_rewriter.tags","");
ini_set("session.use_trans_sid", false);

// Next we set the global variables for user and admin
Code:
global $user, $admin;


// Next we check to see if the client is logged in as user or admin
Code:
if(!is_user($user) && !is_admin($admin)){


// If the the client is not logged in as user and is not admin we register a temporary variable to the session
Code:
session_register(no_redirect);
$no_redirect = "true";
}


// if the client is logged in as a user and is not admin and the temporary variable exists in the session, we unset the temporary variable and redirect the client to whatever page we choose
Code:
if(is_user($user) && !is_admin($admin)){
if($_SESSION[no_redirect]=="true"){
unset($_SESSION[no_redirect]);
Header("Location: URL GOES HERE");
}
}


So, the complete code looks like this ...
Code:

// Redirect users - JasonLau.biz
global $user, $admin;
session_start();
ini_set("url_rewriter.tags","");
ini_set("session.use_trans_sid", false);
if(!is_user($user) && !is_admin($admin)){
session_register(no_redirect);
$no_redirect = "true";
}
if(is_user($user) && !is_admin($admin)){
if($_SESSION[no_redirect]=="true"){
unset($_SESSION[no_redirect]);
Header("Location: URL GOES HERE");
}
}


All you have to do is replace URL GOES HERE with the url address you are redirecting the client to.


If you are creating a new file for this code, simply copy and save the following...
Code:
<?php
// Redirect users - 2005 JasonLau.biz
global $user, $admin;
session_start();
ini_set("url_rewriter.tags","");
ini_set("session.use_trans_sid", false);
if(!is_user($user) && !is_admin($admin)){
session_register(no_redirect);
$no_redirect = "true";
}
if(is_user($user) && !is_admin($admin)){
if($_SESSION[no_redirect]=="true"){
unset($_SESSION[no_redirect]);
Header("Location: modules.php?name=Downloads");
}
}
?>


With this method, it should not matter what patches have been installed and so forth.
Note that this code will not redirect the admin upon login.

Hope this helps someone! Very Happy

_________________
- Prophet
Image
Get the Last Visit module (and others modules I designed) from my website! FREE! http://jasonlau.biz

Media Embedding
Find all posts by ProphetView user's profileSend private messageVisit poster's websiteAIM Address
Xyberian
Colonel
Colonel


Joined: Mar 14, 2004
Posts: 1921

Location: Behind you

PostPosted: Tue Dec 06, 2005 10:59 am Reply with quoteBack to top

Using sessionization is another good idea, prophet.
The above codes are much much better.

How about a small admin config tweak? For instance, admin will have an option in there preferces of admin CP which allow them to select module name to redirect or go to when users login/ create account/ or rediction ?

_________________
NukeKorea Dev. Network.
NukeKorea Laboratories
Find all posts by XyberianView user's profileSend private messageVisit poster's website
Beta3
Private
Private


Joined: Jul 30, 2005
Posts: 35


PostPosted: Sat Dec 24, 2005 9:36 am Reply with quoteBack to top

Prophet wrote:
Better yet, you can use php sessions to determine when to redirect the user. Here is how ...

Create the following if it does not already exist ...
For versions 7.5 and lower, create includes/myheader.php
For versions 7.6 and above, create includes/custom_files/custom_header.php


I´m not understanding something. . .

Now i´m using Nuke 7.9(patched) , i create the file :

Quote:
For versions 7.6 and above, create includes/custom_files/custom_header.php


and what else i must do, i must make the changes offirst post too? or only create this file?

I only create the file, but nothing change, i´m forggeting something or i must include this file in some other?


thanx. . .

_________________
Note: i´m not a Natural English Reader/Writer, so, sorry for any gramatical error...Wink
Image
I'm the Rainbow Brite you hated . . .
Find all posts by Beta3View user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.392 Seconds - 349 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::