PHP Web Host - Quality Web Hosting For All PHP Applications Clan Themes! We make clans look good!!
  Login or Register
 • Home • Downloads • Your Account • Forums • 
Site Navigation

Home:

 
Donate o Meter
Help Keep Our Servers Online AND Our Services Free!
Make donations with PayPal!
Donations
Anonymous May-24
Doulos May-15
Webservant May-11
AndyB May-5
Hotdog May-3
 
Please Link To Me!
 
Quality Web Hosting For All PHP Applications
Quality PHP Web Host!

Great Reviews!
Need help setting up your website, installing Apache, PHP, MySQL, or RavenNuke(tm)?
Need help customizing or designing scripts?
Please contact us via the Contact Us option for further details and pricing.

Link to Me

RavenPHPScripts

RavenPHPScripts

There are more Link To Me icons here.
 
Site Info v2.2.2 ©
Your IP: 38.107.179.231

 Welcome, Anonymous
Nickname
Password
Security Code:
Security Code
Type Security Code:

· Register
· Lost Password
Server Date/Time
24 May 2012 23:03:37 EDT (GMT -4)
 
How to redirect Your Info to the Forums user profile

18.6.2. How to redirect Your Info to the Forums user profile

Figure 18-5. Your Info link in the User Preferences panel.

Your Info link in the User Preferences panel.



With the advent of phpBB forums in PHP-Nuke (starting from somewhere around v. 6.5), you not only have to cope with two administration panels, one for PHP-Nuke in general and one for the Forums in particular, your users can maintain their profile in two places too, from the Your Info link in the User Preference panel (Figure 18-5), as well as the Forums profile link in the Forums module (Figure 18-6).

Figure 18-6. Forum Profile link in the Forums module.

Forum Profile link in the Forums module.



The Your Info link has the URL

modules.php?name=Your_Account&op=edituser

and leads to a panel similar to the one of Figure 18-7.

Figure 18-7. User profile in Your Info.

User profile in Your Info.



The Profile link in the Forums module, on the other hand, has the URL

forums.html&file=profile&mode=editprofile

(optionally with the session ID parameter, sid, which is not shown here) and leads to the panel shown in Figure 18-8.

Both panels use the same database tables in the background, so it doesn't matter which one you use. This may be confortable for some, but also confusing for other users.

If your users find it confusing to use two different entry points for their personal information, you can modify the Your_Account module to redirect them to the Forum profile (Figure 18-8), even when they click on the Your Info link (Figure 18-5).

Figure 18-8. User profile in the Forums.

User profile in the Forums.



The Your Info link is output ("echoed") in modules/Your_Account/navbar.php, in the following code block:

echo "<font class=\"content\">"
    ."<center><a href=\"modules.php?name=Your_Account&amp;op=edituser\">
      <img src=\"$menuimg\" border=\"0\" alt=\""._CHANGEYOURINFO.
     "\" title=\""._CHANGEYOURINFO."\"></a><br>"
    ."<a href=\"modules.php?name=Your_Account&amp;op=edituser\">"
    ._CHANGEYOURINFO."</a>"
    ."</center></font></td>";

To redirect the users to the Forum profile (Figure 18-8), you can change the above block to:

echo "<font class=\"content\">"
    ."<center><a href=\"forums.html&amp;file=profile&amp;mode=editprofile\">
      <img src=\"$menuimg\" border=\"0\" alt=\""._CHANGEYOURINFO.
     "\" title=\""._CHANGEYOURINFO."\"></a><br>"
    ."<a href=\"forums.html&amp;file=profile&amp;mode=editprofile\">"
    ._CHANGEYOURINFO."</a>"
    ."</center></font></td>";

As you can easily see, we have changed only the two links (one for the image and one for the text), the other lines are for your reference only.

Note

It is not necessary to compute the user's numeric ID and pass it on the URL through the u parameter - the mode=editprofile parameter on the URL will find the user automatically (but mode=viewprofile will not!).

But wait a minute! Is this really all we have to change? Is the Your Info link (Figure 18-5) the only one that leads a user to the profile screen of the Your_Info module (Figure 18-7)? How about the user name links in other modules, for example? Search for the string "op=edituser" and you will already find a ton of those links in various places (Newsletter, language files, Reviews...) And how about a new user? Will the new user registration screen be the one of Your_Account or the one of Forums?

Instead of chasing links in the code, there is a more elegant solution that will eliminate any attempt to bring a user to the Your Info profile at its very beginning! It is also a very good example of what type of control you can achieve over your PHP-Nuke, if you put your knowledge about the way a module works (see Chapter 21) into practice:

In modules/Your_Account/index.php find the lines:

case "edituser":
edituser();
break;

and replace them with:

case "edituser":
Header("Refresh: 0; url=forums.html&file=profile&mode=editprofile");
break;

This will take care of the "edit user" case. We need to do the same for the "new user" case too. Just replace

case "new_user":
new_user();
break;

with:

case "new_user":
Header("Refresh: 0; url=forums.html&file=profile&mode=register");
break;

The idea here is the following: instead of searching all code of all modules for links that point to the Your Info profile, we look at the parameters that such a link passes on the URL. A typical Your Info profile link is of the form:

modules.php?name=Your_Account&op=edituser

so the parameters it passes to the modules.php script are:

  • name: the name of the module to execute (Your_Account)

  • op: the operation to execute (edituser)

The second URL parameter, op, is checked at one single place in the code, in the switch statement of modules/Your_Account/index.php:

switch($op) {
    case "logout":
        logout();
        break;
    ...many other cases checked here, among them "edituser" and "new_user"
    
    default:
        main($user);
        break;
}

This is the one and only point of control for the actions taken by the Your_Account module. We make use of this fact and change the actions that are to be taken for the operations "edituser" and "new_user". We don't change the links, we change the actions that follow when the links are clicked.

This will make the Your Info profile practically inaccessible in your system and will present the Forums profile instead.

Warning Missing functionality in the Forums profile!
 

Bear in mind that, depending on the versions of PHP-Nuke and Forums, you may be missing some functionality in the Forums profile, that was present in the profile that was accessible through the Your Info link. This may include changing the fake email address, changing the subscription to the newsletter, or changing the extra info (Figure 12-1). However, this is planned to be corrected in the future.


Help us make a better PHP-Nuke HOWTO!

Want to contribute to this HOWTO? Have a suggestion or a solution to a problem that was not treated here? Post your comments on my PHP-Nuke Forum!

Chris Karakas, Maintainer PHP-Nuke HOWTO

 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum