» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Online Users: 50
0 members and 50 guests
No Members online
Most users ever online was 611, 03-21-2008 at 11:10 PM.
» .::.
Web Hosting - web hosting, dedicated servers and web design services
Online Degree - search for 1000+ online degrees, online colleges & online universities.
Tattoo - we are a group of tattoo enthusiasts
Gexa Energy - your absolute best choice in electric service
Texas electricity - save on electric rates
Football Betting - best nfl betting promotions at sportsbook.com.
Oral Chelation - initial cleansing of your veins & arteries
Portatiles - Ofertas en Ordenadores y Portatiles. Increibles Ofertas DELL.

Register Now! Contact Us

About this Page
This is a discussion on Simple module need help to do it right within the Nuke 6.5 to 6.9 - Modules forums, part of the PHP-Nuke 6.5 to 6.9 category; Hi everyone, I am trying to build a simple module and collect the user info and pass on to other ...


Go Back   Nukemods Forum » PHP-Nuke 6.5 to 6.9 » Nuke 6.5 to 6.9 - Modules

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-17-2003, 02:10 AM
Junior Member
 
Join Date: Jun 2003
Posts: 5
Simple module need help to do it right
Hi everyone,

I am trying to build a simple module and collect the user info and pass on to other web program within my site and don't need user to login to the web program again. Here is what I did
Code:
<?php 

if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
	die ("You can't access this file directly...");
}
$module_name = basename(dirname(__FILE__));
$pagetitle = "$module_name";
$index = 1;
require_once("mainfile.php"); 
 if(is_user($user)){  
     $userinfo = getusrinfo($user);  
    
include("header.php");
OpenTable();
echo "<div align=\"center\"><font class=\"title\">Welcome $userinfo[username] to Member Upload</font></div>

";
echo "<a href=\"ftp://$userinfo[username]:$userinfo[user_password]@ftp.osward.net/\" target=\"_blank\">Access your personal folder directly here</a>


";
CloseTable();
include("footer.php");
}

?>
This works fine with basically what I want, but I want to know if I could skip this page and send the user directly to their user folder without have to click the link again in a seperate window.

That means when user click this link in the menu, the user will be sent to his folder without having to click the link again. I don't know how to do it, would someone please help me to achieve that.

Thanks in advance for the time

Regards,
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-19-2003, 01:51 PM
Moderator
 
Join Date: Nov 2002
Location: Belgium
Posts: 957
You can use this block wich will do the same as your module
Code:
<?php
if (eregi("block-Member_Upload.php", $_SERVER['PHP_SELF'])) {
    Header("Location: index.php");
    die();
}
global $user;
 if(is_user($user)){
     $userinfo = getusrinfo($user);  

$content .= "Welcome $userinfo[username] to Member Upload

";
$content .= "<a href=\"ftp://$userinfo[username]:$userinfo[user_password]@ftp.osward.net/\" target=\"_blank\">Access your personal folder directly here</a>";
}else{
     $content .= "Please login";
}

?>
__________________
Yannick R. aka Mighty_Y
http://support.code-area51.com
http://www.code-area51.com

Search before asking makes my life easier!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-19-2003, 11:15 PM
Junior Member
 
Join Date: Jun 2003
Posts: 5
Thanks for the tips,

Would you please explain the different between doing it with a block and a module. This is a Registered Member service and not intend for public.

I managed to do it as follows:
Code:
<?php 

if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
	die ("You can't access this file directly...");
}
$module_name = basename(dirname(__FILE__));
$pagetitle = "$module_name";
$index = 1;
require_once("mainfile.php"); 
 if(is_user($user)){  
     $userinfo = getusrinfo($user);  
$url = "Location: ftp://" .$userinfo[username]. ":" .$userinfo[user_password2]. "@ftp.osward.net/";
header ($url);
exit;
}
?>
I can now send user to their folder directly with the above when they click the link at the menu. However there is a draw back with this way which is I can't open this as a new window. User will have to use the back button to return to my site and leaves an open connection to the ftp server.

I also would like to have a popup window for user to click a notify form for their upload when they click the link in the menu.

How am I going to do these, please advise

Thanks in advance for the time

Regards,
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-20-2003, 05:30 AM
Moderator
 
Join Date: Nov 2002
Location: Belgium
Posts: 957
If you use my block you'll see that when a user isn't logged in there will show up Please login so only registered users can use it
__________________
Yannick R. aka Mighty_Y
http://support.code-area51.com
http://www.code-area51.com

Search before asking makes my life easier!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 07-20-2003, 06:36 AM
Junior Member
 
Join Date: Jun 2003
Posts: 5
I am totally aware of this in the block you suggested.

Actually, I want this module or block can proform the following:

1. When clicked, check for the user data stored in the database
2. Use that data and send user to the ftp server folder in a seperate window
3. Popup a notify form window to let user notify the upload

I think with either the block your suggested or the one I am using solved only (1) and (2) I want to do.

If I can open the user ftp folder in a seperate window, I might just leave the notifty form in the module page that I don't need a popup window for the form

How am I going to do the (3) a popup notify form. Do I have to physically make the block displayed? Can I access it directly from the menu?

Please advise

Thanks in advance for the time

Regards,
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A simple question? realowner Open topics 2 01-12-2006 10:28 PM
Simple: but confusing for me Colin_da_Killer Purged Topics 1 06-06-2003 08:30 AM
Simple module creation? dv8reality Nuke 6.5 to 6.9 - Modules 4 05-28-2003 03:18 PM
Simple logo lsva Logo requests 0 05-16-2003 01:12 AM
KISGB (keep it simple guest book) v5.0 Module Martin Purged Topics 0 01-20-2003 10:14 AM


All times are GMT -5. The time now is 09:41 PM.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.

LinkBacks Enabled by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31