How to make a user page. Personal page for uCoz how to Uraaa How to create a personal user page

From time to time questions come to me asking me to tell, how to make a user page, that is, so that each registered visitor has his own own page on the site. In this article I will try to answer this question.

First of all, you need make an authorization. If you do not know how to do this, then read this:. After authorization, each user saves information about his login and password in the session. Now you can do user page So the algorithm is the following:

  1. Create a file, For example, user.php. Put in all HTML and css code, substituting some test data that will be unique for each user in the future.
  2. At the very beginning of the file read all user information(for example, from a database) using his login stored in the session.
  3. Replace test data with specific user data, information about which you received in the previous step.

Everything, now all authorized users accessing the user.php will see their own data. What kind of data (full name, avatar, date of birth, etc.) does not matter, that is, we created the most common user page.

What are personal pages and posts in WordPress, many people seem to know or have heard about it, but perhaps not many people used it because they did not find a use for them. Today I will tell you how you can use such pages to great benefit for yourself and your site.

So, let's first clarify what they are personal pages and posts in WordPress. The status "private" indicates that access to the content specific page will have only the one who created the page or post, and of course the administrator and super-administrator of the site or blog. So what is the use of personal pages and posts?

Well, let's say in a personal record you can leave some notes, texts, links, photos, and so on for yourself as a keepsake, and so on. But the benefit of this is not so much. But a personal page is a completely different matter, since you can create and use special templates for pages. That's about it, about personal pages, we'll talk.

In order to create a personal page, you need to enter the site control panel (hereinafter we will assume that you are logged in as an Administrator), select “Pages” -> “Add New” in the menu block on the left. The page creation form will open. After entering the title of the page, a link to it will appear below. The initially created page may have the following URL:

http://wpmytest.ru/?page_id=4

which is not very memorable, so it's better to make a more understandable link, for example this (if you have "Post Title" selected in the settings section "Options" -> "Permalink settings"):

http://wpmytest.ru/moya-laboratoriya/

In the content field of the page we enter any information, any text, and in general the page is ready. But now it is important to give it the status of "private". To do this, in the right block of the control panel we find the block "Visibility: Open Edit" and, by clicking on the link "Edit", select "Personal" in the list that appears and press the "OK" button. Then boldly click the "Publish" button, and we can assume that the personal page has been created.


To make sure that new page is available only to you, log out of your account and try to open your personal page in the browser at the address that you assigned to it. As a rule, you will receive a message stating that such a page does not exist, or that you do not have access to this page. That's all, but this is only half the battle, and the most interesting is yet to come.

By the way, just in case, you can add a line to the robots.txt file to prohibit crawling of your personal page (in my example, this is the /moya-laboratoriya/ directory) by search engine bots:

Disallow: /moya-laboratoriya/

Go ahead...
As I said at the beginning of this article, you can use different templates for any of the pages. Many themes, even the standard ones that come with WordPress itself, may have a couple of design templates specifically for pages. For this example, I've used the default "Twenty Eleven" theme, where you can choose from the following page templates:

Base Template
- Showcase Template
- Sidebar Template

To assign a template for a page, you need to select the page you created for editing, in the right block of the control panel, find “Page Attributes” -> “Template” and select the one you need there.

But we may not be very interested in ready-made templates, in which there is a lot of superfluous, and we will create our own.

To create your own template for the page, you just need to enter the directory where the theme files are located, which is used on the site in currently, and create a new PHP file there. By personal experience I will say that it is still better to make a copy of one of the files located there and change its code a little. For the example, I used the default theme "Twenty Eleven" and a copy of the "showcase.php" file, which I renamed "showcase-2.php", and then threw out everything I didn't need from its code. As a result, this is what happened:

Please note that the file code contains the line "Template Name: My template 1". This is very important, since only the presence of the “Template Name” label will allow us, when changing the parameters of our page, when choosing a template, we will already see a template with the name “My Template 1” in the list.

Since we have already created a new template, it remains to assign it to our personal page. Again, select the page you created for editing, in the right block of the control panel, find "Page Attributes" -> "Template" and there we select from the list the appeared, created by us "My Template 1":

My template 1


We save the changes and open our personal page for verification. Now the page will have an upper part (header), a lower part (footer) and the content of the page itself (unless, of course, you added some text or something else when editing it). And nothing more!

Well, what's so special about it? - you ask. Yes, the fact is that now it is in the code of the page template we created that you can add whatever your heart desires. For example, php codes that could not be inserted into the page content itself from the control panel. For example, scripts for collecting statistics from SEO resources, site visit statistics, and many others. And it will also not be difficult to do this without FTP access to the site, since you can call the personal page template file for editing through the site control panel: “ Appearance" -> "Editor" and on the right "My Template 1 Page Template (showcase-2.php)"

The new template is available in the WordPress editor


Now you probably noticed that it is not very convenient to view personal page always go to the control panel and look for this page there. Something must be done.

After all, at the beginning of creating a personal page, we assigned a link to it, so let's use it. Although even a link can be accidentally forgotten, especially if it was complex. But to simplify access to the page is simple.

Anywhere in your template (in one of the template files, for example, in a file that displays sidebar) You can add a link to your personal page, but for the link not to be visible to anyone search engines, nor anyone else, you need to add a condition that will allow access only to the site administrator:

However, some may want, just in case, to protect themselves even more from direct access by outsiders or other site accounts to the contents of your personal page. To do this, in the file that you created as a template for a personal page, you need to add a similar check, as you did to hide the link:

Thus, only the administrator will have access to the content of the page, even if you accidentally removed the "Private" status for this page.

And finally, let me remind you once again that you can add any code to the template file itself, including PHP scripts and any other information that will not be available to search engines and outsiders. In addition, the codes added to the personal page template file will in no way affect the performance of the site, except perhaps when you access this page yourself.

For example, you can add a small widget for the site pr-cy.ru, which will show the actual dates of the latest PR and TCI ups


"; ?>

This is how the source code of your personal page template might look like:

"; ?>

The scripts added to the personal page template will not affect the operation of your site or blog in any way. Whether JavaScript scripts, PHP or others, except of course if you used scripts to write to the database. In general, you can safely test your new scripts and conduct other experiments. But if you suddenly made a mistake in the code of the page template you created and don’t know how to solve the problem (for example, instead of your personal page you see an empty window or an error message), then you can simply delete this template file or simply select another template in the page settings ( such as the default template).

That's actually all. The last screenshot shows a part of my personal page on WordPress (the numbers on the counters are fictitious and most of the results of the scripts are hidden, since the information on my personal page is confidential), I give as an example of using a personal page with its own template for it:

Good luck and useful to you using personal pages on WordPress!

Hello everyone, I have not published new articles for a long time, as there were a lot of various work+ to everything, I took several courses on the topic of creating websites. Now, I think, I will publish various interesting notes for webmasters more often.

I'll start, perhaps, with useful WordPress plugins which really helped me in practice.

Today I will talk about the Client Portal - Private user pages and login plugin.

Why did I need it?

About a month ago, I was developing a website for a language school. Among the layout tasks and functionality was the task of creating personal pages for all students of the school and at the same time they should be convenient to fill for an inexperienced editor. Of course, at first I started looking for plugins to create a personal account for the user, but they were all too cumbersome and had huge functionality that was simply not needed and only made the site harder. While searching, I got to the Client Portal - Private user pages and login plugin page and realized that this is what I need. A lightweight plugin that allows you to create personal pages for each user.

After installing this plugin, in the admin panel in the "Users" section, when you hover over any of the users, you will see a link to your personal page. How it looks like I showed in the screenshot.

When you click on it, you will see an ordinary editor. In my case, the site editor published a lesson schedule for each student and small organizational announcements there.

How to connect correctly?

Download and install the Client Portal - Private user pages and login plugin. You will need to somehow bind it to the user, so that after he enters the site, he gets exactly to his personal page.

First you need to create a page with a name such as "Personal Account". Then copy the shortcode there - .

For redirection, I used the plugin - Theme My Login. As you can see from the screenshot below, I have specified a link to the user's redirect to the directory we need.

With these two plugins, I managed to solve the problem and at the same time, I did not put bulky personal accounts, which would only confuse the site administrator.

That's all for today, I hope this material will be useful to someone.

2015-09-15 13231 33 Denis Abdullin

V pure form how to post something on Uraaa rarely succeeds because everything is done in unified system, and users should offer something universal. Of course, in any scenario, questions and problems will arise. This design is made for a light background, so you will have to redo a lot of things "for yourself." However, I tried to make something more universal and easy to install.

Here it is a personal page for uCoz like on Uraaa. I'm not saying that I came up with something original, I'm just sharing a modern style for a personal page. It is impossible not to notice that round avatars in the center are a trend in the world of interfaces.

How to make a personal page the same
how are the other pages of the site?

This question, most likely, is not formulated exactly, not completely, but we should start with it. Personal page on uCoz by default, completely independent and small, as if it were not part of the site, but something unnecessary. It's the same with some other pages, such as private messages, but we won't talk about them now. So how do you make the "personal" really part of the template.

First, choose to open "In the current window" of the personal page in the settings of the "User" module.

Second, copy the wireframe code into Design Management - Site Pages.


Now completely replace the code in "Design Management - Users - Personal Page" with the one you took from "Site Pages". In it, replace $CONTENT$ with the original content of the personal page between and. You can immediately replace $CONTENT$ with the personal page code from Uraaa (below).

Here's what we got:


Personal page like on Uraaa

Use the following code in "Design Management - Users - Personal Page". Replace $CONTENT$ with this code as instructed above:

200?"200px":""+(this.scrollHeight+5)+"px");">



"alt="" />



$MODER_PANEL_RIGHT$$_GROUP_NAME$

To change the data$_STATUS$



$_NAME$$_USERNAME$

$_COUNTRY$, $_CITY$


$_LOAD_ENTRIES$ files
$_COM_ENTRIES$ comments
$_FORUM_ENTRIES$ responses

Login:
$_USERNAME$

Registration:
$_REG_TIME$

Entry date:
$_LOG_TIME$

Site:
$_WWW$

AOL:
$_AOL$

ICQ:
$_ICQ$

MSN:
$_MSN$

Yahoo:
$_YAHOO$

Telephone:
$_PHONE$
(Phone hidden)

Email:
$_EMAIL$
(Address hidden)

$_EMAIL$
(Address hidden)
*

Write a letter to the user
$_EMAIL$



[ Confirm e-mail ]

Signature:
$_SIGNATURE$


uID profile

Read messages ( $UNREAD_PM$)send a message

This is what we get, such a personal page for uCoz. By the way, I removed the indents from the parent element, it looks modern.