SimplePortal

Customization => Custom Coding => Topic started by: andreblue on June 17, 2012, 07:42:29 PM

Title: Get a user name from simple portal page.
Post by: andreblue on June 17, 2012, 07:42:29 PM
So i want to be able to get a person's username from within a simple portal php page. What wwould i do to do so?
Title: Re: Get a user name from simple portal page.
Post by: phantomm on June 18, 2012, 08:41:26 AM
First add at the beginning:
Code: [Select]
global $context;
and in place where should be username:
Code: [Select]
', $context['user']['name'], '
Title: Re: Get a user name from simple portal page.
Post by: andreblue on June 18, 2012, 11:27:46 AM
First add at the beginning:
Code: [Select]
global $context;
and in place where should be username:
Code: [Select]
', $context['user']['name'], '
Thank you.
Now to figure out what causes this:
Code: [Select]
Database Error
Table 'andreblu_melon.smf_sessions' doesn't exist
File: /xxx/xxx/public_html/melon/forum/Sources/Load.php
Line: 2467
Could it be due to me connecting to a database from within the page itself?
SimplePortal 2.3.8 © 2008-2024, SimplePortal