« Home « Chủ đề thiết kế web với php

Chủ đề : thiết kế web với php


Có 120+ tài liệu thuộc chủ đề "thiết kế web với php"

Tạo mạng xã hội với PHP - part 15

tailieu.vn

Our relationships table needs to relate two users together, as well as record the type of relationship. Since some relationships require mutual consent, we need to indicate if the non-requesting user accepted the request to connect. Increment A unique ID for the relationship between the two users. Type ID The type of relationship (a reference to the. relationship_types table). Usera...

Tạo mạng xã hội với PHP - part 16

tailieu.vn

AND r.usera={$usera} ";. $cache = $this->registry->getObject('db')->cacheQuery( $sql. The controller needs to check if the user is logged in, include our relationships model, get the pending requests, and display them to the user in the view.. 'models/relationships.php');. $relationships = new Relationships( $this->registry. $this->registry->getObject('template')->buildFromTemplates(. 'header.tpl.php', 'friends/pending.tpl.php', 'footer.tpl.php');. $this->registry->getObject('template')->getPage() ->addTag('pending', array( 'SQL', $pending. $this->registry->errorPage( 'Please login', 'Please login to manage pending connections');. We...

Tạo mạng xã hội với PHP - part 17

tailieu.vn

$sc = new Profilestatusescontroller( $this->registry, true, $user. If the user tried to access a sub-controller that doesn't exist, we would display an error.. @return void. $this->registry->errorPage( 'Sorry, an error has occured', 'The link you followed was invalid, please try again');. Although the user's profile is going to be broken down into different areas, which are accessed through different links showing...

Tạo mạng xã hội với PHP - part 18

tailieu.vn

This enacts the profile controller, which in turn passes control to the profile information controller. Views/default/templates/members/list.tpl.php. Views/default/templates/members/search.tpl.php The link is shown below:. <p><strong><a href="profile/view/{ID}">{name}</a></strong></p>. <p>Keeper of <strong>{dino_name}</strong>. a <strong>{dino_gender}. {dino_breed}</strong></p>. The profile information controller ( controllers/profile/. profileinformationcontroller.php ) needs to communicate with the model, to get the data for the profile, and have the data assigned to template variables.. We...

Tạo mạng xã hội với PHP - part 19

tailieu.vn

if( in_array( $ext, $this->uploadExtentions. $this- >uploadTypes. $this->name = $name_prefix . $name_prefix.$name;. $this->loadFromFile( $path. return $this->name;. When we have finished processing an image, the save method finds the appropriate image function for the format of the image, and then saves the file.. after resize * @param String $location location of image * @param String $type type of the image * @param...

Tạo mạng xã hội với PHP - part 20

tailieu.vn

$this->registry->getSetting('view. $this->page->addTemplateBit( $tag, $bit, $replacements. As mentioned above, we need to take this parameter in the method in the page object. this method also needs to be changed to assign both the template bit and the replacements array with the template tag, and not just assign the template bit with the template tag, as it previously did. This can be...

Tạo mạng xã hội với PHP - part 21

tailieu.vn

the activity of all users directly connected to the logged-in user. to determine the context of the status. status to list in the stream, all of which will require different wording to present to. the user. The user's own status update. A contact posting a status update on the profile of the logged-in user. We will require a stream model...

Tạo mạng xã hội với PHP - part 22

tailieu.vn

'-fromself.tpl.php', $datatags. $this->registry->getObject('template')->addTemplateBit(. '-user.tpl.php', $datatags. '.tpl.php', $datatags. $this->registry->getObject('template')->buildFromTemplates(. 'header.tpl.php', 'stream/none.tpl.php', 'footer.tpl.php');. We can now look at adding comments, likes, and dislikes to the stream.. Comments, likes, and dislikes. The functionality behind adding comments, likes, and dislikes is very similar to the work we did in Chapter 5 in developing the statuses on a user's profile.. The concept to adding these...

Tạo mạng xã hội với PHP - part 23

tailieu.vn

If the user isn't connected to the user, or isn't logged in, then we simply remove the template tag from the view so they don't see any update or post box on the page:. $this->registry->getObject('template')->getPage. >addTag( 'status_update. Now, we need to process status updates and profile posts, and create the templates that make up the final aspect of our view.....

Tạo mạng xã hội với PHP - part 24

tailieu.vn

ID of the message. ID of the sender. Name of the sender. ID of the recipient. Name of the recipient. Subject of the message. When the message was sent (TIMESTAMP). User readable, friendly format of the time the message was sent. Has the message been read. The message content itself. The constructor takes the registry and ID of the message...

Tạo mạng xã hội với PHP - part 25

tailieu.vn

Once a user has read a message, we should update the database to indicate that the message has been read, so that the user can see at a glance which of their messages are new and unread, and which ones have already been read. However, for privacy reasons, we shouldn't show this information to the sender of the message.. @param...

Tạo mạng xã hội với PHP - part 26

tailieu.vn

Changes to the view. Since all of the media types we are going to support require at least one additional database field in a table that extends the statuses table, we are going to need to display any additional fields on the post status form. To support a varying number of additional fields depending on the type, we could use...

Tạo mạng xã hội với PHP - part 27

tailieu.vn

The following getter method is used to return the name of the image we are working with:. Get the image name * @return String. public function getName(). return $this->name;. after resize * @param String $location location of image * @param String $type type of the image * @param int $quality image quality /100 * @return void. public function save( $location,...

Tạo mạng xã hội với PHP - part 28

tailieu.vn

One of the two main remaining features (the other being groups) is events. How to re-use this calendar feature in other areas of the site. How to notify users of the birthday of their contacts. Because a calendar is something we will most likely want to reuse throughout our network, and because of the complexities that come with it, it...

Tạo mạng xã hội với PHP - part 29

tailieu.vn

$this->dates = $cal_dates;. $this->dateStyles = $cal_dates_style;. $this->dateData = $cal_dates_data;. $this->registry->getObject('template')->dataToTags( $calendar- >getDates(),'cal_0_dates_'. $this->registry->getObject('template')->dataToTags( $calendar- >getDateStyles(),'cal_0_dates_style_'. $this->registry->getObject('template')->dataToTags( $calendar- >getDateData(),'cal_0_dates_data_'. <p><a href="calendar/?&amp;month={nm}&amp;year={ny}">Next</a>. <a href="calendar/?&amp;month={pm}&amp;year={py}">Previous</a></p>. <table id="ccc">. <th class="weekend">{cal_0_day_0}</th>. <th class gt;{cal_0_day_1}</th>. <th class gt;{cal_0_day_2}</th>. <th class gt;{cal_0_day_3}</th>. <th class gt;{cal_0_day_4}</th>. <th class gt;{cal_0_day_5}</th>. <th class="weekend">{cal_0_day_6}</th>. <td class="weekend {cal_0_dates_style_0}">. {cal_0_dates_0} {cal_0_dates_data_0}</td>. <td class="{cal_0_dates_style_1}">{cal_0_dates_1}. {cal_0_dates_data_1}</td>. <td class="{cal_0_dates_style_2}">{cal_0_dates_2}. {cal_0_dates_data_2}</td>. <td class="{cal_0_dates_style_3}">{cal_0_dates_3}. {cal_0_dates_data_3}</td>. <td class="{cal_0_dates_style_4}">{cal_0_dates_4}. {cal_0_dates_data_4}</td>....

Tạo mạng xã hội với PHP - part 30

tailieu.vn

$this->registry->getObject('template')->dataToTags(. To display event information alongside dates in the calendar, we simply need to pass an array of data to our calendar library, indicating which days have events, and we can also pass the data itself for inclusion in the calendar:. pass data to the calendar for inclusion. $calendar->setData( $data. tell the calendar which days should be highlighted. $calendar->setDaysWithEvents($days);. We...

Tạo mạng xã hội với PHP - part 31

tailieu.vn

This would be where we may wish to add an e-mail notification to the user to inform them that they have been invited to the event:. Save the event * @return bool. public function save(). $this->registry->getObject('authenticate')-. $this->creator. $this->registry- >getObject('authenticate')->getUser()->isAdmin. $this->ID. we are either the user created the event, or we are the administrator, or the event is being created. $this->$field;....

Tạo mạng xã hội với PHP - part 33

tailieu.vn

Name of the group. Creator / owner of the group: So we know who has permission to manage it. Description of the group: So users know what the group is about, in a little more detail than its name. Permission structure of the group: So that the group can be shown if appropriate, and so that it is clear if...

Tạo mạng xã hội với PHP - part 34

tailieu.vn

public function getFirstPost(). return $this->post;. Set the group this topic should be part of * @param int $group. public function setGroup( $group. $this->group = $group;. Set the creator of the topic * @param int $creator. public function setCreator( $creator. $this->creator = $creator;. Set the name of the topic * @param String $name * @return void. public function setName( $name. $this->name...

Tạo mạng xã hội với PHP - part 32

tailieu.vn

<div id="main">. <div id="rightside">. <div id="content">. method="post">. <label for gt;Name</label><br />. name="name". /><br />. <label for gt;Type of event</label><br />. <select name="type">. <option value="public">Public event</option>. <option value="private">Private event</option>. </select><br />. <label for gt;Date</label><br />. name="date". <label for gt;Start time</label><br />. name="start_. <label for gt;End time</label><br />. name="end_. <label for gt;Description</label><br />. <textarea name="description". </ textarea><br />. <h2>Invite friends?</h2>. name="". value="Create...