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..
Raven General
Joined: Mar 22, 2003
Posts: 5233
Location: USA
Posted:
Mon Apr 21, 2003 7:33 pm
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
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