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

Events and Birthdays $calendarNext-buildMonth(); // days $this-registry-getObject('template')-dataToTags( $calendarNext-getDaysInOrder(),'cal_2_day_' ); // dates $this-registry-getObject('template')-dataToTags( $calendarNext-getDates(),'cal_2_dates_' ); // styles $this-registry-getObject('template')-dataToTags( $calendarNext-getDateStyles(),'cal_2_dates_style_' ); // data $this-registry-getObject('template')-dataToTags( $calendarNext-getDateData(),'cal_2_dates_data_' ); With events 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 simply pass an array of dates that have events, and an array of event data. Both. | Events and Birthdays calendarNext- buildMonth days this- registry- getObject template - dataToTags calendarNext- getDaysInOrder cal_2_day_ dates this- registry- getObject template - dataToTags calendarNext- getDates cal_2_dates_ styles this- registry- getObject template - dataToTags calendarNext- getDateStyles cal_2_dates_style_ data this- registry- getObject template - dataToTags calendarNext- getDateData cal_2_dates_data_ With events 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 simply pass an array of dates that have events and an array of event data. Both arrays use the day of the month as the key. Birthdays Birthdays should be a fairly straightforward feature for us to implement. We need to Add an additional profile field for the user s birthday Look up the date of birth of our user s contacts Calculate their age Send the data to the calendar Generate the calendar view Display a list of upcoming birthdays to our users 272 Download from Chapter 9 Getting relationship IDs For us to quickly look up the birthdays of a user s connections we need to quickly gain access to the IDs of users another user is connected to. We have some similar functionality in our relationships model models however the following method will give us a query returning IDs. We can then use this as a sub query in our birthdays lookup query Get IDs of users a user has a relationship with @param int user the user in question @param bool cache - cache the results or return the query return String int public function getIDsByUser user cache false sql SELECT FROM users u profile p relationships r relationship_types t WHERE

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.