Page 1 of 1

Trying to make a popup information

PostPosted: January 1st, 2012, 12:37 am
by s2pidkaspr
hello,

im trying to make a popup kind of viewing profile.
like where members can click on view their ACCOUNT INFO and when they clicked on it, it will display as a popup filled with their membership information such as, avatar, username, membership status, membership expiring date, and so on...

And so what i tried to do is, make a new file named "account-info.php" and placed it over to my file directories.
then made a link somewhere on my site with this code

Code: Select all
<a href="javascript:void(window.open('http://www.MYDOMAIN.com/wp-content/themes/MYTHEME/account-info.php','accountinfo','width=600,height=350,top=200,left=365'))">Account Info</a>


The link works fine and it pops up a new window connecting to that "account-info.php"
But the thing is, whenever I put in php codes inside that file (account-info.php), the pop up gives undefined error.

And so this is my question, how to do this? So that I can have my member's informations as a popup window from their membership and so on? Basically, how can i make php work on that new file i created? Because it seems php is not available to use in that file, or maybe its because its outside the loop? Hmm.

Re: Trying to make a popup information

PostPosted: January 1st, 2012, 4:32 pm
by s2pidkaspr
bump^^

anyone ?

Re: Trying to make a popup information

PostPosted: January 3rd, 2012, 8:39 am
by Deyson
I am curious about this as well, it would be a nice link to add next to the sign up widget.

Re: Trying to make a popup information

PostPosted: January 3rd, 2012, 1:53 pm
by s2pidkaspr
still waiting for any kind of support about this idea. :)

Re: Trying to make a popup information

PostPosted: January 3rd, 2012, 5:43 pm
by Raam Dev
The problem is that you're probably not loading any of the WordPress framework in that PHP file, so anything s2Member-related will not work.

You can try adding this to the top of your PHP file before anything else:

Code: Select all
<?php
    
// Include WordPress
    define('WP_USE_THEMES', false);
    // Change path below to location of wp-blog-header.php on server
    require('/home/username/public_html/blog/wp-blog-header.php');
?>


If that still doesn't work, please paste here the exact error you're receiving.

Re: Trying to make a popup information

PostPosted: January 5th, 2012, 3:37 am
by Cristián Lávaque
This is a similar approach. viewtopic.php?f=4&t=3145&p=9683#p9683

Re: Trying to make a popup information

PostPosted: January 5th, 2012, 5:26 pm
by s2pidkaspr
@raam

that works perfect ;)
very much thanks to you happy new year

Re: Trying to make a popup information

PostPosted: January 5th, 2012, 6:39 pm
by Raam Dev
You're most welcome! Glad it worked. :) Happy new year!