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, 97 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Displaying the username of a logged-in user [ ]
 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
senseipt
Nuke Cadet
Nuke Cadet


Joined: Apr 19, 2003
Posts: 1


PostPosted: Sat Apr 19, 2003 3:20 pm Reply with quoteBack to top

I'm trying to make some kind of chat/shoutbox module/block and despite I am new to PHP, everything has worked out as planned so far. My problem now is that I need to get a logged-in users username into a variable so I can display it in front of a users comment. Printing the username in a modules-file is easy, but I need to print it in a file displayed in an Iframe, so all the functions and variables from the modules-file (where the header, footer and so on is included) wont be valid. So, to simplify; How do I get the username into a variable without including header, footer and mainfile? Hope someone here is more into the nuke-system than I am.. Confused
Find all posts by senseiptView user's profileSend private message
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Mon Apr 21, 2003 7:33 pm Reply with quoteBack to top

Make a block or module that calls the IFRAME. Get the user's name and then pass it as a form literal in the url. Example:
Code:

<?php

/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

if (eregi("block-iframe.php",$PHP_SELF)) {
    Header("Location: index.php");
    die();
}
// code to get the users name goes here
// assume username = John Doe and is stored in a variable called username

$content = "<iframe frameborder=\"0\" src=\"modules/iframe/index.php?username=$username\" width=\"100%\" height=\"200\"><ilayer  src=\"modules/iframe/index.php?username=$username\" width=\"100%\" height=\"200\"></ilayer></iframe>";
?>

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
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.797 Seconds - 388 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::