Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 11:52 am EST

Geeklog Forums

How get username??


Ancona5

Anonymous
I have put in header.thtml of my layout folder a javascript to open a popup ..

I want to view the username of the utent! what is the value of the argument to pass to the script??

I see in the header.thtml that there are some value, as welcome_msg .. site_slogan .. ecc ecc but nothing about username
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
The username isn't available as a theme variable, but since you can use PHP in header.thtml, you could use the $_USER['username'] variable (within a short piece of PHP code). Keep in mind, though, that it will be empty for anonymous users.

bye, Dirk
 Quote

Ancona5

Anonymous
Quote by Dirk:within a short piece of PHP code

ehm .... which short piece of PHP ? Can someone help me

I have to interrogate the sql database in header.thtml? that's page is in html, how and where can I write php code?



thanks of all Dirk Wink
 Quote

Ancona5

Anonymous
ehm .... dirk .... help praying it will work
 Quote

Ancona5

Anonymous
up up up
 Quote

Status: offline

eg0master

Forum User
Regular Poster
Registered: 07/21/05
Posts: 73
Location:Stockholm
What dirk means is that you *may* use PHP in template files. Its not a "html" file it is a "thtml" file (Template HTML) and PHP is executed in geeklog template files.

Text Formatted Code
Welcome user <?php echo $_USER['username']; ?>
 


Geeklog Plugins: http://plugincms.com
 Quote

Ancona5

Anonymous
very thanks!!!!!
 Quote

All times are EST. The time is now 11:52 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content