Файловый менеджер - Редактировать - /home/wuectly/www/03cbe/event.php.tar
Назад
home/wuectly/www/libraries/joomla/event/event.php 0000604 00000003341 15245570401 0016224 0 ustar 00 <?php /** * @package Joomla.Platform * @subpackage Event * * @copyright (C) 2005 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JEvent Class * * @since 1.5 * @deprecated 4.0 The CMS' Event classes will be replaced with the `joomla/event` package */ abstract class JEvent extends JObject { /** * Event object to observe. * * @var object * @since 2.5 */ protected $_subject = null; /** * Constructor * * @param object &$subject The object to observe. * * @since 2.5 */ public function __construct(&$subject) { // Register the observer ($this) so we can be notified $subject->attach($this); // Set the subject to observe $this->_subject = &$subject; } /** * Method to trigger events. * The method first generates the even from the argument array. Then it unsets the argument * since the argument has no bearing on the event handler. * If the method exists it is called and returns its return value. If it does not exist it * returns null. * * @param array &$args Arguments * * @return mixed Routine return value * * @since 1.5 */ public function update(&$args) { // First let's get the event from the argument array. Next we will unset the // event argument as it has no bearing on the method to handle the event. $event = $args['event']; unset($args['event']); /* * If the method to handle an event exists, call it and return its return * value. If it does not exist, return null. */ if (method_exists($this, $event)) { return call_user_func_array(array($this, $event), array_values($args)); } } } home/wuectly/www/libraries/f0f/utils/observable/event.php 0000604 00000003631 15245605472 0017572 0 ustar 00 <?php /** * @package FrameworkOnFramework * @subpackage utils * @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('F0F_INCLUDED') or die; /** * Defines an observable event. * * This class is based on JEvent as found in Joomla! 3.2.0 */ abstract class F0FUtilsObservableEvent extends F0FUtilsObject { /** * Event object to observe. * * @var object */ protected $_subject = null; /** * Constructor * * @param object &$subject The object to observe. */ public function __construct(&$subject) { // Register the observer ($this) so we can be notified $subject->attach($this); // Set the subject to observe $this->_subject = &$subject; } /** * Method to trigger events. * The method first generates the even from the argument array. Then it unsets the argument * since the argument has no bearing on the event handler. * If the method exists it is called and returns its return value. If it does not exist it * returns null. * * @param array &$args Arguments * * @return mixed Routine return value */ public function update(&$args) { // First let's get the event from the argument array. Next we will unset the // event argument as it has no bearing on the method to handle the event. $event = $args['event']; unset($args['event']); /* * If the method to handle an event exists, call it and return its return * value. If it does not exist, return null. */ if (method_exists($this, $event)) { return call_user_func_array(array($this, $event), $args); } else { return null; } } } home/wuectly/www/administrator/components/com_icagenda/models/event.php 0000604 00000034177 15245632666 0022616 0 ustar 00 <?php /** *------------------------------------------------------------------------------ * iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x *------------------------------------------------------------------------------ * @package com_icagenda * @copyright Copyright (c)2012-2015 Cyril Rezé, Jooml!C - All rights reserved * * @license GNU General Public License version 3 or later; see LICENSE.txt * @author Cyril Rezé (Lyr!C) * @link http://www.joomlic.com * * @version 3.5.12 2015-09-25 * @since 1.0 *------------------------------------------------------------------------------ */ // No direct access to this file defined('_JEXEC') or die(); jimport('joomla.application.component.modeladmin'); /** * iCagenda model. */ class iCagendaModelEvent extends JModelAdmin { /** * @var string The prefix to use with controller messages. * @since 1.0 */ protected $text_prefix = 'COM_ICAGENDA'; /** * Method to test whether a record can be deleted. * * @param object $record A record object. * * @return boolean True if allowed to delete the record. Defaults to the permission set in the component. * * @since 3.5.6 */ protected function canDelete($record) { if ( ! empty($record->id)) { if ($record->state != -2) { return false; } $user = JFactory::getUser(); if ($user->authorise('core.delete')) { icagendaCustomfields::deleteData($record->id, 2); icagendaCustomfields::cleanData(2); return true; } } return false; } /** * Prepare and sanitise the table prior to saving. * * @param JTable $table A JTable object. * * @return void * * @since 1.0 */ protected function prepareTable( $table ) { $date = JFactory::getDate(); $user = JFactory::getUser(); $table->name = htmlspecialchars_decode($table->name, ENT_QUOTES); if (empty($table->id)) { // Set the values $table->created = $date->toSql(); // Set ordering to the last item if not set if (empty($table->ordering)) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('MAX(ordering)') ->from($db->quoteName('#__icagenda_events')); $db->setQuery($query); $max = $db->loadResult(); $table->ordering = $max + 1; } } else { // Set the values $table->modified = $date->toSql(); $table->modified_by = $user->get('id'); } } /** * Returns a Table object, always creating it. * * @param string $type The table type to instantiate * @param string $prefix A prefix for the table class name. Optional. * @param array $config Configuration array for model. Optional. * * @return JTable A database object * * @since 1.0 */ public function getTable($type = 'Event', $prefix = 'iCagendaTable', $config = array()) { return JTable::getInstance($type, $prefix, $config); } /** * Method to get a single record. * * @param integer $pk The id of the primary key. * * @return mixed Object on success, false on failure. * * @since 1.0 */ public function getItem($pk = null) { if ($item = parent::getItem($pk)) { // Do any procesing on fields here if needed } return $item; } /** * Method to get the record form. * * @param array $data Data for the form. * @param boolean $loadData True if the form is to load its own data (default case), false if not. * * @return mixed A JForm object on success, false on failure * * @since 1.0 */ public function getForm($data = array(), $loadData = true) { // Get the form. $form = $this->loadForm('com_icagenda.event', 'event', array('control' => 'jform', 'load_data' => $loadData)); if (empty($form)) { return false; } return $form; } /** * Method to get the data that should be injected in the form. * * @return mixed The data for the form. * * @since 1.0 */ protected function loadFormData() { // Check the session for previously entered form data. $app = JFactory::getApplication(); $data_array = $app->getUserState('com_icagenda.edit.event.data', array()); if (empty($data_array)) { $data = $this->getItem(); } else { $data = new JObject; $data->setProperties($data_array); } // If not array, creates array with week days data if ( ! is_array($data->weekdays)) { $data->weekdays = explode(',', $data->weekdays); } // Retrieves data, to display selected week days $arrayWeekDays = $data->weekdays; foreach ($arrayWeekDays as $allTest) { if ($allTest == '') { $data->weekdays = '0,1,2,3,4,5,6'; } } // Set displaytime default value if ( ! isset($data->displaytime)) { $data->displaytime = JComponentHelper::getParams('com_icagenda')->get('displaytime', '1'); } // Set Features $data->features = $this->getFeatures($data->id); // Convert features into an array so that the form control can be set if ( ! isset($data->features)) { $data->features = array(); } if ( ! is_array($data->features)) { $data->features = explode(',', $data->features); } return $data; } /** * Method to save the form data. * * @param array $data The form data. * * @return boolean True on success. * * @since 3.4.0 */ public function save($data) { $input = JFactory::getApplication()->input; $date = JFactory::getDate(); $user = JFactory::getUser(); // Fix version before 3.4.0 to set a created date (will use last modified date if exists, or current date) if (empty($data['created'])) { $data['created'] = ( ! empty($data['modified'])) ? $data['modified'] : $date->toSql(); } // Alter the title for save as copy if ($input->get('task') == 'save2copy') { $origTable = clone $this->getTable(); $origTable->load($input->getInt('id')); if ($data['title'] == $origTable->title) { list($title, $alias) = $this->generateNewTitle($data['catid'], $data['alias'], $data['title']); $data['title'] = $title; $data['alias'] = $alias; } else { if ($data['alias'] == $origTable->alias) { $data['alias'] = ''; } } $data['state'] = 0; } // Automatic handling of alias for empty fields if (in_array($input->get('task'), array('apply', 'save', 'save2new')) && (int) $input->get('id') == 0) { if ($data['alias'] == null) { if (JFactory::getConfig()->get('unicodeslugs') == 1) { $data['alias'] = JFilterOutput::stringURLUnicodeSlug($data['title']); } else { $data['alias'] = JFilterOutput::stringURLSafe($data['title']); } $table = JTable::getInstance('Event', 'iCagendaTable'); if ($table->load(array('alias' => $data['alias'], 'catid' => $data['catid']))) { $msg = JText::_('COM_ICAGENDA_ALERT_EVENT_SAVE_WARNING'); } list($title, $alias) = $this->generateNewTitle($data['catid'], $data['alias'], $data['title']); $data['alias'] = $alias; if (isset($msg)) { JFactory::getApplication()->enqueueMessage($msg, 'warning'); } } } // Generates Alias if empty if ($data['alias'] == null || empty($data['alias'])) { $data['alias'] = JFilterOutput::stringURLSafe($data['title']); if ($data['alias'] == null || empty($data['alias'])) { if (JFactory::getConfig()->get('unicodeslugs') == 1) { $data['alias'] = JFilterOutput::stringURLUnicodeSlug($data['title']); } else { $data['alias'] = JFilterOutput::stringURLSafe($data['created']); } } } // Set File Uploaded if ( ! isset($data['file'])) { $file = JRequest::getVar('jform', null, 'files', 'array'); $fileUrl = $this->upload($file); $data['file'] = $fileUrl; } // Set Creator infos $userId = $user->get('id'); $userName = $user->get('name'); if (empty($data['created_by'])) { $data['created_by'] = (int) $userId; } $data['username'] = $userName; // Set Params if (isset($data['params']) && is_array($data['params'])) { // Convert the params field to a string. $parameter = new JRegistry; $parameter->loadArray($data['params']); $data['params'] = (string)$parameter; } // Get Event ID from the result back to the Table after saving. $table = $this->getTable(); if ($table->save($data) === true) { $data['id'] = $table->id; } else { $data['id'] = null; } if (parent::save($data)) { // Save Features to database $this->maintainFeatures($data); // Save Custom Fields to database if (isset($data['custom_fields']) && is_array($data['custom_fields'])) { icagendaCustomfields::saveToData($data['custom_fields'], $data['id'], 2); } return true; } return false; } /** * Upload * * @since 3.5.3 */ function upload($file) { jimport('joomla.filesystem.file'); jimport('joomla.filesystem.folder'); $filename = JFile::makeSafe($file['name']['file']); // Get media path $params_media = JComponentHelper::getParams('com_media'); $image_path = $params_media->get('image_path', 'images'); // Paths to thumbs folder $thumbsPath = $image_path . '/icagenda/thumbs'; if ($filename != '') { $src = $file['tmp_name']['file']; $dest = JPATH_SITE . '/' . $image_path . '/icagenda/files/' . $filename; if ( ! is_dir($dest)) { mkdir($intDir, 0755); } if (JFile::upload($src, $dest, false)) { echo 'upload'; return $image_path . '/icagenda/files/' . $filename; } return $image_path . '/icagenda/files/' . $filename; } } /** * Maintain features to data * * @since 3.4.0 */ protected function maintainFeatures($data) { // Get the list of feature ids to be linked to the event $features = isset($data['features']) && is_array($data['features']) ? implode(',', $data['features']) : ''; $db = JFactory::getDbo(); // Write any new feature records to the icagenda_feature_xref table if ( ! empty($features)) { // Get a list of the valid features already present for this event $query = $db->getQuery(true); $query->select('feature_id') ->from($db->qn('#__icagenda_feature_xref')); $query->where('event_id = ' . (int) $data['id']); $query->where('feature_id IN (' . $features . ')'); $db->setQuery($query); $existing_features = $db->loadColumn(0); // Identify the insert list if (empty($existing_features)) { $new_features = $data['features']; } else { $new_features = array(); foreach ($data['features'] as $feature) { if ( ! in_array($feature, $existing_features)) { $new_features[] = $feature; } } } // Write the needed xref records if ( ! empty($new_features)) { $xref = new JObject; $xref->set('event_id', $data['id']); foreach ($new_features as $feature) { $xref->set('feature_id', $feature); $db->insertObject('#__icagenda_feature_xref', $xref); $db->setQuery($query); if ( ! $db->execute()) { return false; } } } } // Delete any unwanted feature records from the icagenda_feature_xref table $query = $db->getQuery(true); $query->delete($db->qn('#__icagenda_feature_xref')); $query->where('event_id = ' . (int) $data['id']); if ( ! empty($features)) { // Delete only unwanted features $query->where('feature_id NOT IN (' . $features . ')'); } $db->setQuery($query); $db->execute($query); if ( ! $db->execute()) { return false; } return true; } /** * Extracts the list of Feature IDs linked to the event and returns an array * * @param integer $event_id * * @return array/integer Set of Feature IDs * * @since 3.5.3 */ protected function getFeatures($event_id) { // Write any new feature records to the icagenda_feature_xref table if (empty($event_id)) { return ''; } else { $db = JFactory::getDbo(); // Get a comma separated list of the ids of features present for this event // Note: Direct extraction of a comma separated list is avoided because each db type uses proprietary syntax $query = $db->getQuery(true); $query->select('fx.feature_id') ->from($db->qn('#__icagenda_events', 'e')) ->innerJoin('#__icagenda_feature_xref AS fx ON e.id=fx.event_id') ->innerJoin('#__icagenda_feature AS f ON fx.feature_id=f.id AND f.state=1'); $query->where('e.id = ' . (int) $event_id); $db->setQuery($query); $features = $db->loadColumn(0); // Return a comma separated list return implode(',', $features); } } /** * Approve Function. * * @since 3.2.0 */ function approve($cid, $publish) { if (count($cid)) { JArrayHelper::toInteger($cid); $cids = implode( ',', $cid ); $query = 'UPDATE #__icagenda_events' . ' SET approval = '.(int) $publish . ' WHERE id IN ( '.$cids.' )'; $this->_db->setQuery( $query ); if ( ! $this->_db->query()) { $this->setError($this->_db->getErrorMsg()); return false; } } return true; } /** * Method to test whether a record can be deleted. * * @param object $record A record object. * * @return boolean True if allowed to delete the record. Defaults to the permission set in the component. * * @since 3.6.0 */ // protected function canDelete($record) // { // if ( ! empty($record->id)) // { // if ($record->state != -2) // { // return false; // } // $user = JFactory::getUser(); // return $user->authorise('core.delete', 'com_icagenda.event.' . (int) $record->id); // } // return false; // } /** * Method to test whether a record can have its state edited. * * @param object $record A record object. * * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component. * * @since 3.6.0 */ // protected function canEditState($record) // { // $user = JFactory::getUser(); // Check for existing event. // if (!empty($record->id)) // { // return $user->authorise('core.edit.state', 'com_icagenda.event.' . (int) $record->id); // } // New event, so check against the category. // elseif (!empty($record->catid)) // { // return $user->authorise('core.edit.state', 'com_icagenda.event.' . (int) $record->catid); // } // Default to component settings if neither event nor category known. // else // { // return parent::canEditState('com_icagenda'); // } // } } home/wuectly/www/libraries/joomla/facebook/event.php 0000604 00000040427 15245657417 0016677 0 ustar 00 <?php /** * @package Joomla.Platform * @subpackage Facebook * * @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Facebook API User class for the Joomla Platform. * * @link http://developers.facebook.com/docs/reference/api/event/ * @since 3.2.0 * @deprecated 4.0 Use the `joomla/facebook` package via Composer instead */ class JFacebookEvent extends JFacebookObject { /** * Method to get information about an event visible to the current user. Requires authentication. * * @param string $event The event id. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 3.2.0 */ public function getEvent($event) { return $this->get($event); } /** * Method to get the event's wall. Requires authentication. * * @param string $event The event id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 3.2.0 */ public function getFeed($event, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($event, 'feed', '', $limit, $offset, $until, $since); } /** * Method to post a link on event's feed which the current_user is or maybe attending. Requires authentication and publish_stream permission. * * @param string $event The event id. * @param string $link Link URL. * @param string $message Link message. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 3.2.0 */ public function createLink($event, $link, $message = null) { // Set POST request parameters. $data = array(); $data['link'] = $link; $data['message'] = $message; return $this->createConnection($event, 'feed', $data); } /** * Method to delete a link. Requires authentication and publish_stream permission. * * @param mixed $link The Link ID. * * @return boolean Returns true if successful, and false otherwise. * * @since 3.2.0 */ public function deleteLink($link) { return $this->deleteConnection($link); } /** * Method to post on event's wall. Message or link parameter is required. Requires authentication and publish_stream permission. * * @param string $event The event id. * @param string $message Post message. * @param string $link Post URL. * @param string $picture Post thumbnail image (can only be used if link is specified) * @param string $name Post name (can only be used if link is specified). * @param string $caption Post caption (can only be used if link is specified). * @param string $description Post description (can only be used if link is specified). * @param array $actions Post actions array of objects containing name and link. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 3.2.0 */ public function createPost($event, $message = null, $link = null, $picture = null, $name = null, $caption = null, $description = null, $actions = null) { // Set POST request parameters. $data = array(); $data['message'] = $message; $data['link'] = $link; $data['name'] = $name; $data['caption'] = $caption; $data['description'] = $description; $data['actions'] = $actions; $data['picture'] = $picture; return $this->createConnection($event, 'feed', $data); } /** * Method to delete a post. Note: you can only delete the post if it was created by the current user. * Requires authentication and publish_stream permission. * * @param string $post The Post ID. * * @return boolean Returns true if successful, and false otherwise. * * @since 3.2.0 */ public function deletePost($post) { return $this->deleteConnection($post); } /** * Method to post a status message on behalf of the user on the event's wall. Requires authentication and publish_stream permission. * * @param string $event The event id. * @param string $message Status message content. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 3.2.0 */ public function createStatus($event, $message) { // Set POST request parameters. $data = array(); $data['message'] = $message; return $this->createConnection($event, 'feed', $data); } /** * Method to delete a status. Note: you can only delete the post if it was created by the current user. * Requires authentication and publish_stream permission. * * @param string $status The Status ID. * * @return boolean Returns true if successful, and false otherwise. * * @since 3.2.0 */ public function deleteStatus($status) { return $this->deleteConnection($status); } /** * Method to get the list of invitees for the event. Requires authentication and user_events or friends_events permission. * * @param string $event The event id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 3.2.0 */ public function getInvited($event, $limit = 0, $offset = 0) { return $this->getConnection($event, 'invited', '', $limit, $offset); } /** * Method to check if a user is invited to the event. Requires authentication and user_events or friends_events permission. * * @param string $event The event id. * @param mixed $user Either an integer containing the user ID or a string containing the username. * * @return array The decoded JSON response or an empty array if the user is not invited. * * @since 3.2.0 */ public function isInvited($event, $user) { return $this->getConnection($event, 'invited/' . $user); } /** * Method to invite users to the event. Requires authentication and create_event permission. * * @param string $event The event id. * @param string $users Comma separated list of user ids. * * @return boolean Returns true if successful, and false otherwise. * * @since 3.2.0 */ public function createInvite($event, $users) { // Set POST request parameters. $data = array(); $data['users'] = $users; return $this->createConnection($event, 'invited', $data); } /** * Method to delete an invitation. Note: you can only delete the invite if the current user is the event admin. * Requires authentication and rsvp_event permission. * * @param string $event The event id. * @param string $user The user id. * * @return boolean Returns true if successful, and false otherwise. * * @since 3.2.0 */ public function deleteInvite($event, $user) { return $this->deleteConnection($event, 'invited/' . $user); } /** * Method to get the list of attending users. Requires authentication and user_events or friends_events permission. * * @param string $event The event id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 3.2.0 */ public function getAttending($event, $limit = 0, $offset = 0) { return $this->getConnection($event, 'attending', '', $limit, $offset); } /** * Method to check if a user is attending an event. Requires authentication and user_events or friends_events permission. * * @param string $event The event id. * @param mixed $user Either an integer containing the user ID or a string containing the username. * * @return array The decoded JSON response or an empty array if the user is not invited. * * @since 3.2.0 */ public function isAttending($event, $user) { return $this->getConnection($event, 'attending/' . $user); } /** * Method to set the current user as attending. Requires authentication and rsvp_event permission. * * @param string $event The event id. * * @return boolean Returns true if successful, and false otherwise. * * @since 3.2.0 */ public function createAttending($event) { return $this->createConnection($event, 'attending'); } /** * Method to get the list of maybe attending users. Requires authentication and user_events or friends_events permission. * * @param string $event The event id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 3.2.0 */ public function getMaybe($event, $limit = 0, $offset = 0) { return $this->getConnection($event, 'maybe', '', $limit, $offset); } /** * Method to check if a user is maybe attending an event. Requires authentication and user_events or friends_events permission. * * @param string $event The event id. * @param mixed $user Either an integer containing the user ID or a string containing the username. * * @return array The decoded JSON response or an empty array if the user is not invited. * * @since 3.2.0 */ public function isMaybe($event, $user) { return $this->getConnection($event, 'maybe/' . $user); } /** * Method to set the current user as maybe attending. Requires authentication and rscp_event permission. * * @param string $event The event id. * * @return boolean Returns true if successful, and false otherwise. * * @since 3.2.0 */ public function createMaybe($event) { return $this->createConnection($event, 'maybe'); } /** * Method to get the list of users which declined the event. Requires authentication and user_events or friends_events permission. * * @param string $event The event id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 3.2.0 */ public function getDeclined($event, $limit = 0, $offset = 0) { return $this->getConnection($event, 'declined', '', $limit, $offset); } /** * Method to check if a user responded 'no' to the event. Requires authentication and user_events or friends_events permission. * * @param string $event The event id. * @param mixed $user Either an integer containing the user ID or a string containing the username. * * @return array The decoded JSON response or an empty array if the user is not invited. * * @since 3.2.0 */ public function isDeclined($event, $user) { return $this->getConnection($event, 'declined/' . $user); } /** * Method to set the current user as declined. Requires authentication and rscp_event permission. * * @param string $event The event id. * * @return boolean Returns true if successful, and false otherwise. * * @since 3.2.0 */ public function createDeclined($event) { return $this->createConnection($event, 'declined'); } /** * Method to get the list of users which have not replied to the event. Requires authentication and user_events or friends_events permission. * * @param string $event The event id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 3.2.0 */ public function getNoreply($event, $limit = 0, $offset = 0) { return $this->getConnection($event, 'noreply', '', $limit, $offset); } /** * Method to check if a user has not replied to the event. Requires authentication and user_events or friends_events permission. * * @param string $event The event id. * @param mixed $user Either an integer containing the user ID or a string containing the username. * * @return array The decoded JSON response or an empty array if the user is not invited. * * @since 3.2.0 */ public function isNoreply($event, $user) { return $this->getConnection($event, 'noreply/' . $user); } /** * Method to get the event's profile picture. Requires authentication and user_events or friends_events permission. * * @param string $event The event id. * @param boolean $redirect If false this will return the URL of the picture without a 302 redirect. * @param string $type To request a different photo use square | small | normal | large. * * @return string The URL to the event's profile picture. * * @since 3.2.0 */ public function getPicture($event, $redirect = true, $type = null) { $extra_fields = ''; if ($redirect == false) { $extra_fields = '?redirect=false'; } if ($type) { $extra_fields .= (strpos($extra_fields, '?') === false) ? '?type=' . $type : '&type=' . $type; } return $this->getConnection($event, 'picture', $extra_fields); } /** * Method to get photos published on event's wall. Requires authentication. * * @param string $event The event id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 3.2.0 */ public function getPhotos($event, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($event, 'photos', '', $limit, $offset, $until, $since); } /** * Method to post a photo on event's wall. Requires authentication and publish_stream permission. * * @param string $event The event id. * @param string $source Path to photo. * @param string $message Photo description. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 3.2.0 */ public function createPhoto($event, $source, $message = null) { // Set POST request parameters. $data = array(); $data[basename($source)] = '@' . realpath($source); if ($message) { $data['message'] = $message; } return $this->createConnection($event, 'photos', $data, array('Content-Type' => 'multipart/form-data')); } /** * Method to get videos published on event's wall. Requires authentication. * * @param string $event The event id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 3.2.0 */ public function getVideos($event, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($event, 'videos', '', $limit, $offset, $until, $since); } /** * Method to post a video on event's wall. Requires authentication and publish_stream permission. * * @param string $event The event id. * @param string $source Path to photo. * @param string $title Video title. * @param string $description Video description. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 3.2.0 */ public function createVideo($event, $source, $title = null, $description = null) { // Set POST request parameters. $data = array(); $data[basename($source)] = '@' . realpath($source); if ($title) { $data['title'] = $title; } if ($description) { $data['description'] = $description; } return $this->createConnection($event, 'videos', $data, array('Content-Type' => 'multipart/form-data')); } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка