Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

possible? make an individual page for each user?

Asked Modified Viewed 7,586 times
P
Pade2204
P
  • Junior Member, joined since
  • Contributed 21 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
asked
Junior Member

Hey there !

I am looking for a way to make an individual page for each my users.

For instance I need to make 1 page which is personal for each login member.

Like "your order history:" and then this page is linked to only this user, and so on...

Is this possible on php-fusion ?

I know the user, admin, super-admin rights, but its not like that - a page wich is person for each member :-) hehe

Please help..

THANKS
0 replies

21 posts

P
PolarFox
P
  • Veteran Member, joined since
  • Contributed 1,633 posts on the community forums.
  • Started 29 threads in the forums
answered
Veteran Member

Yes it is possible if you edit pages manually :)

Like this

if(you_user_with_id_X) {
content;
}

or

if(you_user_with_id_X) {
show_content_for_id_X
}

need code?
0 replies
P
Pade2204
P
  • Junior Member, joined since
  • Contributed 21 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

yeah.

Its only 1 page that needs to visible for X user.

I would be VERY glad if u had some code and a noob "insert your page here" thing :-)

thanks mate
0 replies
P
PolarFox
P
  • Veteran Member, joined since
  • Contributed 1,633 posts on the community forums.
  • Started 29 threads in the forums
answered
Veteran Member

Ok.

<?php
require_once "maincore.php";
require_once THEMES."templates/header.php";

add_to_title($locale['global_200'].'WRITE_NAME');

opentable('WRITE_NAME');
if(iUSER && $userdata['user_id'] == 'ID_WHAT_YOU_NEED') {
echo 'content'; //or something else
}
else {
echo 'Error, you are not right user!';
}
closetable();

require_once THEMES."templates/footer.php";
?>
- it's a full new page.

not tested yet, if it's buggy - post to this thread :)
Edited by PolarFox on 23-08-2009 08:31,
0 replies
P
Pade2204
P
  • Junior Member, joined since
  • Contributed 21 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

I cant get it to work:

I tried this:

<?php

require_once "maincore.php";

require_once THEMES."templates/header.php";

   

add_to_title($locale['global_200'].'WRITE_NAME');



opentable('WRITE_NAME');

if(iUSER && $userdata['user_id'] == '2') {

This is your personal page

}

else {

echo 'Error, you are not right user!';

}

closetable();



require_once THEMES."templates/footer.php";

?>


THen I logged in with id nr 2, and the page was blank.

BUT...

Come to think of it.

Can this be made as a starting page, when the user logs in ? So when he or she logs in its their personal starting page they see and that page can only be seen by their id ?
Edited by Pade2204 on 25-08-2009 21:58,
0 replies
P
PolarFox
P
  • Veteran Member, joined since
  • Contributed 1,633 posts on the community forums.
  • Started 29 threads in the forums
answered
Veteran Member

I'm not stupid, i'm testing your code with small fix and it's worked! 8)

<?php

require_once "maincore.php";

require_once THEMES."templates/header.php";

   

add_to_title($locale['global_200'].'WRITE_NAME');



opentable('WRITE_NAME');

if(iUSER && $userdata['user_id'] == '2') {

echo 'This is your personal page'; [color=#ff0000]//small fix[/color]

}

else {

echo 'Error, you are not right user!';

}

closetable();



require_once THEMES."templates/footer.php";

?>


yes this can be user start page of course, but need more modification.
0 replies
P
Pade2204
P
  • Junior Member, joined since
  • Contributed 21 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

THANKS MATE... nice.

But 1 last question.

The thing is that I want a link in the navigation-panel that for instance says "Your services" - and that page would be unique for that user and as your code, only can be read by that user.

Wow im bad in explaining myself :-)

Can u help me... Just when u have the time... thanks again.
0 replies
A
afoster
A
  • Senior Member, joined since
  • Contributed 725 posts on the community forums.
  • Started 128 threads in the forums
answered
Senior Member

Is it possible to have a user be re-directed to his page when he logs in using the code above? If so, is the code above used as the re-directed file that the user would be sent to? I'm trying to figure out how this would work.
0 replies
P
PolarFox
P
  • Veteran Member, joined since
  • Contributed 1,633 posts on the community forums.
  • Started 29 threads in the forums
answered
Veteran Member

Whence script shall take these services to display?
0 replies
P
Pade2204
P
  • Junior Member, joined since
  • Contributed 21 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

In my dream it would be:

When a user logs in - then a "My data" link in the navigation-panel is visible.

When you click that link, a page is opened that only is visible for that user logged in.

:-)

thats what u ment ?
0 replies
P
PolarFox
P
  • Veteran Member, joined since
  • Contributed 1,633 posts on the community forums.
  • Started 29 threads in the forums
answered
Veteran Member

No, i sayed about content of this page (where he's kept?), or you write/change this content for any user manually in that page?
&
How many that users with special content?

&
In navigation panel - set the link visible for members.
0 replies
P
Pade2204
P
  • Junior Member, joined since
  • Contributed 21 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

I will make and correct the page manually for each user.

It would be nice to have a "my data" link / page for all users (less than 100 users)

A link should be visible for all users, linked to their individual pages.
0 replies
P
PolarFox
P
  • Veteran Member, joined since
  • Contributed 1,633 posts on the community forums.
  • Started 29 threads in the forums
answered
Veteran Member

Okay let's see what we may doing:

Create one master file (see center post) and in this file include another files with data.

Then:
mainfile.php
<?php
require_once "maincore.php";
require_once THEMES."templates/header.php";
add_to_title($locale['global_200'].'WRITE_NAME');

opentable('WRITE_NAME');
if(iUSER && file_exists(BASEDIR.'users/data_for_id_'.$userdata['user_id'].'.php')) {
include BASEDIR.'users/data_for_id_'.$userdata['user_id'].'.php'; //incluide personal file of THAT user - example: user have id 2 then his file must be named data_for_id_2.php (in a folder users)
}
else {
echo 'Error, you don\'t have a personal page! PolarFox cry with you ;(';
}

closetable();
require_once THEMES."templates/footer.php";
?>


Personal page (data_for_id_XXX.php) code:
<?php
if (!defined("IN_FUSION")) { die('no data'); } //direct access without rights not allowed of course
?>

<center>Your <b>ANY</b> html code there</center>


PS Folder named 'users' also possible lock with .htaccess
inserting this :
order allow deny
deny from all


That's all, and of course not tested :)
Edited by PolarFox on 27-08-2009 10:42,
0 replies
P
Pade2204
P
  • Junior Member, joined since
  • Contributed 21 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

This didnt work for me. This is what I did:

- Made a "users/" folder

- Made a link/page in navigation-panel named "My data" with this code:

<?php

require_once "maincore.php";

require_once THEMES."templates/header.php";

add_to_title($locale['global_200'].'WRITE_NAME');

opentable('WRITE_NAME');

if(iUSER && file_exists(BASEDIR.'users/data_for_id_'.$userdata['user_id'].'.php')) {

$userdata['user_id']

include BASEDIR.'users/data_for_id_'.$userdata['user_id'].'.php';
}

else {

echo 'Your personal page is not made yet';

}

closetable();

require_once THEMES."templates/footer.php";

?>


- Made a file called "data_for_id_2.php" with this data:

<?php

if (!defined("IN_FUSION")) { die('no data'); } //direct access without rights not allowed of course

?>
<p>This is your data:</p>
<p>Canal+<br />
TV2 Sport HD</p>


Then saved the file into the "users/" folder.

When I log in with user "Maersk" or id nr 2, the site is blank - not even the "echo 'Your personal page is not made yet';" is shown...

:|
Edited by Pade2204 on 26-08-2009 22:23,
0 replies
A
afoster
A
  • Senior Member, joined since
  • Contributed 725 posts on the community forums.
  • Started 128 threads in the forums
answered
Senior Member

Neither code is working for me either, just to be clear the file data_for_id_2.php would be uploaded to the users folder, but the mainpage.php file would be in the root directory of the cms, correct?
0 replies
P
PolarFox
P
  • Veteran Member, joined since
  • Contributed 1,633 posts on the community forums.
  • Started 29 threads in the forums
answered
Veteran Member

wow sorry, remove the $userdata['user_id']
from
if(iUSER && file_exists(BASEDIR.'users/data_for_id_'.$userdata['user_id'].'.php')) {
$userdata['user_id'] <== kill this!
i'am not removed debug code :)

&
mainpage would be in the root directory you are right afoster :)
Edited by PolarFox on 27-08-2009 10:48,
0 replies
A
afoster
A
  • Senior Member, joined since
  • Contributed 725 posts on the community forums.
  • Started 128 threads in the forums
answered
Senior Member

I made the change noted above, however it is not finding the data_for_id_2.php page. It is just displaying the error msg in the mainpage.php. Also, Is it supposed to display the page upon signin or not?
0 replies
P
Pade2204
P
  • Junior Member, joined since
  • Contributed 21 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

Thank you mate..
It works for me now.

Deleted that line, and it goes to the page in users folder.

And displaying the "no page found" if there is not made a data_for_id_XX.php yet...

NICE JOB man !
0 replies
P
PolarFox
P
  • Veteran Member, joined since
  • Contributed 1,633 posts on the community forums.
  • Started 29 threads in the forums
answered
Veteran Member

afoster if you are not logged then page say:
Your personal page is not made yet (also if you are member without page)

Files structure:
/mainpage.php
/users/data_for_id_1.php
/users/data_for_id_5.php
- if you have structure like this (numbers may be different), maybe your id and user-page number not equal?
0 replies
A
afoster
A
  • Senior Member, joined since
  • Contributed 725 posts on the community forums.
  • Started 128 threads in the forums
answered
Senior Member

I must be a bigger newbie than I thought as I can't get it to work. My file structure is as follows:

public_html/fusion/mainpage.php
public_html/fusion/users/data_for_id_2.php
Here is the code for mainpage.php
<?php
require_once "maincore.php";
require_once THEMES."/templates/header.php";
add_to_title($locale['global_200'].'WRITE_NAME');
opentable('WRITE_NAME');
if(iUSER && file_exists(BASEDIR.'/users/data_for_id_'.$userdata['user_id'].'.php')) {

include BASEDIR.'/users/data_for_id_'.$userdata['user_id'].'data_for_id_2.php'; //incluide personal file of THAT user - example: user have id 2 then his file must be named data_for_id_2.php (in a folder users)

}

else {

echo 'Error, you don\'t have a personal page! Have patience, it is coming. ;(';

}

closetable();
require_once THEMES."/templates/footer.php";
?>


What am I doing wrong?
Edited by afoster on 28-08-2009 07:55,
0 replies

Category Forum

General Discussion

Labels

None yet

Statistics

  • Views 0 views
  • Posts 21 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

A
A
  • Senior Member, joined since
  • Contributed 725 posts on the community forums.
  • Started 128 threads in the forums
P
P
  • Junior Member, joined since
  • Contributed 21 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
P
P
  • Veteran Member, joined since
  • Contributed 1,633 posts on the community forums.
  • Started 29 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet