Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../SimplePi...
File: Item.php
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, $type) as $category)
[500] Fix | Delete
{
[501] Fix | Delete
$categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null, $type));
[502] Fix | Delete
}
[503] Fix | Delete
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, $type) as $category)
[504] Fix | Delete
{
[505] Fix | Delete
$categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null, $type));
[506] Fix | Delete
}
[507] Fix | Delete
[508] Fix | Delete
if (!empty($categories))
[509] Fix | Delete
{
[510] Fix | Delete
return array_unique($categories);
[511] Fix | Delete
}
[512] Fix | Delete
[513] Fix | Delete
return null;
[514] Fix | Delete
}
[515] Fix | Delete
[516] Fix | Delete
/**
[517] Fix | Delete
* Get an author for the item
[518] Fix | Delete
*
[519] Fix | Delete
* @since Beta 2
[520] Fix | Delete
* @param int $key The author that you want to return. Remember that arrays begin with 0, not 1
[521] Fix | Delete
* @return SimplePie_Author|null
[522] Fix | Delete
*/
[523] Fix | Delete
public function get_author($key = 0)
[524] Fix | Delete
{
[525] Fix | Delete
$authors = $this->get_authors();
[526] Fix | Delete
if (isset($authors[$key]))
[527] Fix | Delete
{
[528] Fix | Delete
return $authors[$key];
[529] Fix | Delete
}
[530] Fix | Delete
[531] Fix | Delete
return null;
[532] Fix | Delete
}
[533] Fix | Delete
[534] Fix | Delete
/**
[535] Fix | Delete
* Get a contributor for the item
[536] Fix | Delete
*
[537] Fix | Delete
* @since 1.1
[538] Fix | Delete
* @param int $key The contrbutor that you want to return. Remember that arrays begin with 0, not 1
[539] Fix | Delete
* @return SimplePie_Author|null
[540] Fix | Delete
*/
[541] Fix | Delete
public function get_contributor($key = 0)
[542] Fix | Delete
{
[543] Fix | Delete
$contributors = $this->get_contributors();
[544] Fix | Delete
if (isset($contributors[$key]))
[545] Fix | Delete
{
[546] Fix | Delete
return $contributors[$key];
[547] Fix | Delete
}
[548] Fix | Delete
[549] Fix | Delete
return null;
[550] Fix | Delete
}
[551] Fix | Delete
[552] Fix | Delete
/**
[553] Fix | Delete
* Get all contributors for the item
[554] Fix | Delete
*
[555] Fix | Delete
* Uses `<atom:contributor>`
[556] Fix | Delete
*
[557] Fix | Delete
* @since 1.1
[558] Fix | Delete
* @return SimplePie_Author[]|null List of {@see SimplePie_Author} objects
[559] Fix | Delete
*/
[560] Fix | Delete
public function get_contributors()
[561] Fix | Delete
{
[562] Fix | Delete
$contributors = array();
[563] Fix | Delete
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'contributor') as $contributor)
[564] Fix | Delete
{
[565] Fix | Delete
$name = null;
[566] Fix | Delete
$uri = null;
[567] Fix | Delete
$email = null;
[568] Fix | Delete
if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))
[569] Fix | Delete
{
[570] Fix | Delete
$name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
[571] Fix | Delete
}
[572] Fix | Delete
if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data']))
[573] Fix | Delete
{
[574] Fix | Delete
$uri = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]));
[575] Fix | Delete
}
[576] Fix | Delete
if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data']))
[577] Fix | Delete
{
[578] Fix | Delete
$email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
[579] Fix | Delete
}
[580] Fix | Delete
if ($name !== null || $email !== null || $uri !== null)
[581] Fix | Delete
{
[582] Fix | Delete
$contributors[] = $this->registry->create('Author', array($name, $uri, $email));
[583] Fix | Delete
}
[584] Fix | Delete
}
[585] Fix | Delete
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'contributor') as $contributor)
[586] Fix | Delete
{
[587] Fix | Delete
$name = null;
[588] Fix | Delete
$url = null;
[589] Fix | Delete
$email = null;
[590] Fix | Delete
if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data']))
[591] Fix | Delete
{
[592] Fix | Delete
$name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
[593] Fix | Delete
}
[594] Fix | Delete
if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data']))
[595] Fix | Delete
{
[596] Fix | Delete
$url = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]));
[597] Fix | Delete
}
[598] Fix | Delete
if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data']))
[599] Fix | Delete
{
[600] Fix | Delete
$email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
[601] Fix | Delete
}
[602] Fix | Delete
if ($name !== null || $email !== null || $url !== null)
[603] Fix | Delete
{
[604] Fix | Delete
$contributors[] = $this->registry->create('Author', array($name, $url, $email));
[605] Fix | Delete
}
[606] Fix | Delete
}
[607] Fix | Delete
[608] Fix | Delete
if (!empty($contributors))
[609] Fix | Delete
{
[610] Fix | Delete
return array_unique($contributors);
[611] Fix | Delete
}
[612] Fix | Delete
[613] Fix | Delete
return null;
[614] Fix | Delete
}
[615] Fix | Delete
[616] Fix | Delete
/**
[617] Fix | Delete
* Get all authors for the item
[618] Fix | Delete
*
[619] Fix | Delete
* Uses `<atom:author>`, `<author>`, `<dc:creator>` or `<itunes:author>`
[620] Fix | Delete
*
[621] Fix | Delete
* @since Beta 2
[622] Fix | Delete
* @return SimplePie_Author[]|null List of {@see SimplePie_Author} objects
[623] Fix | Delete
*/
[624] Fix | Delete
public function get_authors()
[625] Fix | Delete
{
[626] Fix | Delete
$authors = array();
[627] Fix | Delete
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author') as $author)
[628] Fix | Delete
{
[629] Fix | Delete
$name = null;
[630] Fix | Delete
$uri = null;
[631] Fix | Delete
$email = null;
[632] Fix | Delete
if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))
[633] Fix | Delete
{
[634] Fix | Delete
$name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
[635] Fix | Delete
}
[636] Fix | Delete
if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data']))
[637] Fix | Delete
{
[638] Fix | Delete
$uri = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]));
[639] Fix | Delete
}
[640] Fix | Delete
if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data']))
[641] Fix | Delete
{
[642] Fix | Delete
$email = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
[643] Fix | Delete
}
[644] Fix | Delete
if ($name !== null || $email !== null || $uri !== null)
[645] Fix | Delete
{
[646] Fix | Delete
$authors[] = $this->registry->create('Author', array($name, $uri, $email));
[647] Fix | Delete
}
[648] Fix | Delete
}
[649] Fix | Delete
if ($author = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author'))
[650] Fix | Delete
{
[651] Fix | Delete
$name = null;
[652] Fix | Delete
$url = null;
[653] Fix | Delete
$email = null;
[654] Fix | Delete
if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data']))
[655] Fix | Delete
{
[656] Fix | Delete
$name = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
[657] Fix | Delete
}
[658] Fix | Delete
if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data']))
[659] Fix | Delete
{
[660] Fix | Delete
$url = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]));
[661] Fix | Delete
}
[662] Fix | Delete
if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data']))
[663] Fix | Delete
{
[664] Fix | Delete
$email = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
[665] Fix | Delete
}
[666] Fix | Delete
if ($name !== null || $email !== null || $url !== null)
[667] Fix | Delete
{
[668] Fix | Delete
$authors[] = $this->registry->create('Author', array($name, $url, $email));
[669] Fix | Delete
}
[670] Fix | Delete
}
[671] Fix | Delete
if ($author = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'author'))
[672] Fix | Delete
{
[673] Fix | Delete
$authors[] = $this->registry->create('Author', array(null, null, $this->sanitize($author[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)));
[674] Fix | Delete
}
[675] Fix | Delete
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'creator') as $author)
[676] Fix | Delete
{
[677] Fix | Delete
$authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
[678] Fix | Delete
}
[679] Fix | Delete
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'creator') as $author)
[680] Fix | Delete
{
[681] Fix | Delete
$authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
[682] Fix | Delete
}
[683] Fix | Delete
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'author') as $author)
[684] Fix | Delete
{
[685] Fix | Delete
$authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
[686] Fix | Delete
}
[687] Fix | Delete
[688] Fix | Delete
if (!empty($authors))
[689] Fix | Delete
{
[690] Fix | Delete
return array_unique($authors);
[691] Fix | Delete
}
[692] Fix | Delete
elseif (($source = $this->get_source()) && ($authors = $source->get_authors()))
[693] Fix | Delete
{
[694] Fix | Delete
return $authors;
[695] Fix | Delete
}
[696] Fix | Delete
elseif ($authors = $this->feed->get_authors())
[697] Fix | Delete
{
[698] Fix | Delete
return $authors;
[699] Fix | Delete
}
[700] Fix | Delete
[701] Fix | Delete
return null;
[702] Fix | Delete
}
[703] Fix | Delete
[704] Fix | Delete
/**
[705] Fix | Delete
* Get the copyright info for the item
[706] Fix | Delete
*
[707] Fix | Delete
* Uses `<atom:rights>` or `<dc:rights>`
[708] Fix | Delete
*
[709] Fix | Delete
* @since 1.1
[710] Fix | Delete
* @return string
[711] Fix | Delete
*/
[712] Fix | Delete
public function get_copyright()
[713] Fix | Delete
{
[714] Fix | Delete
if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'rights'))
[715] Fix | Delete
{
[716] Fix | Delete
return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
[717] Fix | Delete
}
[718] Fix | Delete
elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'rights'))
[719] Fix | Delete
{
[720] Fix | Delete
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
[721] Fix | Delete
}
[722] Fix | Delete
elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'rights'))
[723] Fix | Delete
{
[724] Fix | Delete
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
[725] Fix | Delete
}
[726] Fix | Delete
[727] Fix | Delete
return null;
[728] Fix | Delete
}
[729] Fix | Delete
[730] Fix | Delete
/**
[731] Fix | Delete
* Get the posting date/time for the item
[732] Fix | Delete
*
[733] Fix | Delete
* Uses `<atom:published>`, `<atom:updated>`, `<atom:issued>`,
[734] Fix | Delete
* `<atom:modified>`, `<pubDate>` or `<dc:date>`
[735] Fix | Delete
*
[736] Fix | Delete
* Note: obeys PHP's timezone setting. To get a UTC date/time, use
[737] Fix | Delete
* {@see get_gmdate}
[738] Fix | Delete
*
[739] Fix | Delete
* @since Beta 2 (previously called `get_item_date` since 0.8)
[740] Fix | Delete
*
[741] Fix | Delete
* @param string $date_format Supports any PHP date format from {@see http://php.net/date} (empty for the raw data)
[742] Fix | Delete
* @return int|string|null
[743] Fix | Delete
*/
[744] Fix | Delete
public function get_date($date_format = 'j F Y, g:i a')
[745] Fix | Delete
{
[746] Fix | Delete
if (!isset($this->data['date']))
[747] Fix | Delete
{
[748] Fix | Delete
if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'published'))
[749] Fix | Delete
{
[750] Fix | Delete
$this->data['date']['raw'] = $return[0]['data'];
[751] Fix | Delete
}
[752] Fix | Delete
elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'pubDate'))
[753] Fix | Delete
{
[754] Fix | Delete
$this->data['date']['raw'] = $return[0]['data'];
[755] Fix | Delete
}
[756] Fix | Delete
elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'date'))
[757] Fix | Delete
{
[758] Fix | Delete
$this->data['date']['raw'] = $return[0]['data'];
[759] Fix | Delete
}
[760] Fix | Delete
elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'date'))
[761] Fix | Delete
{
[762] Fix | Delete
$this->data['date']['raw'] = $return[0]['data'];
[763] Fix | Delete
}
[764] Fix | Delete
elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'updated'))
[765] Fix | Delete
{
[766] Fix | Delete
$this->data['date']['raw'] = $return[0]['data'];
[767] Fix | Delete
}
[768] Fix | Delete
elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'issued'))
[769] Fix | Delete
{
[770] Fix | Delete
$this->data['date']['raw'] = $return[0]['data'];
[771] Fix | Delete
}
[772] Fix | Delete
elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'created'))
[773] Fix | Delete
{
[774] Fix | Delete
$this->data['date']['raw'] = $return[0]['data'];
[775] Fix | Delete
}
[776] Fix | Delete
elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'modified'))
[777] Fix | Delete
{
[778] Fix | Delete
$this->data['date']['raw'] = $return[0]['data'];
[779] Fix | Delete
}
[780] Fix | Delete
[781] Fix | Delete
if (!empty($this->data['date']['raw']))
[782] Fix | Delete
{
[783] Fix | Delete
$parser = $this->registry->call('Parse_Date', 'get');
[784] Fix | Delete
$this->data['date']['parsed'] = $parser->parse($this->data['date']['raw']);
[785] Fix | Delete
}
[786] Fix | Delete
else
[787] Fix | Delete
{
[788] Fix | Delete
$this->data['date'] = null;
[789] Fix | Delete
}
[790] Fix | Delete
}
[791] Fix | Delete
if ($this->data['date'])
[792] Fix | Delete
{
[793] Fix | Delete
$date_format = (string) $date_format;
[794] Fix | Delete
switch ($date_format)
[795] Fix | Delete
{
[796] Fix | Delete
case '':
[797] Fix | Delete
return $this->sanitize($this->data['date']['raw'], SIMPLEPIE_CONSTRUCT_TEXT);
[798] Fix | Delete
[799] Fix | Delete
case 'U':
[800] Fix | Delete
return $this->data['date']['parsed'];
[801] Fix | Delete
[802] Fix | Delete
default:
[803] Fix | Delete
return date($date_format, $this->data['date']['parsed']);
[804] Fix | Delete
}
[805] Fix | Delete
}
[806] Fix | Delete
[807] Fix | Delete
return null;
[808] Fix | Delete
}
[809] Fix | Delete
[810] Fix | Delete
/**
[811] Fix | Delete
* Get the update date/time for the item
[812] Fix | Delete
*
[813] Fix | Delete
* Uses `<atom:updated>`
[814] Fix | Delete
*
[815] Fix | Delete
* Note: obeys PHP's timezone setting. To get a UTC date/time, use
[816] Fix | Delete
* {@see get_gmdate}
[817] Fix | Delete
*
[818] Fix | Delete
* @param string $date_format Supports any PHP date format from {@see http://php.net/date} (empty for the raw data)
[819] Fix | Delete
* @return int|string|null
[820] Fix | Delete
*/
[821] Fix | Delete
public function get_updated_date($date_format = 'j F Y, g:i a')
[822] Fix | Delete
{
[823] Fix | Delete
if (!isset($this->data['updated']))
[824] Fix | Delete
{
[825] Fix | Delete
if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'updated'))
[826] Fix | Delete
{
[827] Fix | Delete
$this->data['updated']['raw'] = $return[0]['data'];
[828] Fix | Delete
}
[829] Fix | Delete
[830] Fix | Delete
if (!empty($this->data['updated']['raw']))
[831] Fix | Delete
{
[832] Fix | Delete
$parser = $this->registry->call('Parse_Date', 'get');
[833] Fix | Delete
$this->data['updated']['parsed'] = $parser->parse($this->data['updated']['raw']);
[834] Fix | Delete
}
[835] Fix | Delete
else
[836] Fix | Delete
{
[837] Fix | Delete
$this->data['updated'] = null;
[838] Fix | Delete
}
[839] Fix | Delete
}
[840] Fix | Delete
if ($this->data['updated'])
[841] Fix | Delete
{
[842] Fix | Delete
$date_format = (string) $date_format;
[843] Fix | Delete
switch ($date_format)
[844] Fix | Delete
{
[845] Fix | Delete
case '':
[846] Fix | Delete
return $this->sanitize($this->data['updated']['raw'], SIMPLEPIE_CONSTRUCT_TEXT);
[847] Fix | Delete
[848] Fix | Delete
case 'U':
[849] Fix | Delete
return $this->data['updated']['parsed'];
[850] Fix | Delete
[851] Fix | Delete
default:
[852] Fix | Delete
return date($date_format, $this->data['updated']['parsed']);
[853] Fix | Delete
}
[854] Fix | Delete
}
[855] Fix | Delete
[856] Fix | Delete
return null;
[857] Fix | Delete
}
[858] Fix | Delete
[859] Fix | Delete
/**
[860] Fix | Delete
* Get the localized posting date/time for the item
[861] Fix | Delete
*
[862] Fix | Delete
* Returns the date formatted in the localized language. To display in
[863] Fix | Delete
* languages other than the server's default, you need to change the locale
[864] Fix | Delete
* with {@link http://php.net/setlocale setlocale()}. The available
[865] Fix | Delete
* localizations depend on which ones are installed on your web server.
[866] Fix | Delete
*
[867] Fix | Delete
* @since 1.0
[868] Fix | Delete
*
[869] Fix | Delete
* @param string $date_format Supports any PHP date format from {@see http://php.net/strftime} (empty for the raw data)
[870] Fix | Delete
* @return int|string|null
[871] Fix | Delete
*/
[872] Fix | Delete
public function get_local_date($date_format = '%c')
[873] Fix | Delete
{
[874] Fix | Delete
if (!$date_format)
[875] Fix | Delete
{
[876] Fix | Delete
return $this->sanitize($this->get_date(''), SIMPLEPIE_CONSTRUCT_TEXT);
[877] Fix | Delete
}
[878] Fix | Delete
elseif (($date = $this->get_date('U')) !== null && $date !== false)
[879] Fix | Delete
{
[880] Fix | Delete
return strftime($date_format, $date);
[881] Fix | Delete
}
[882] Fix | Delete
[883] Fix | Delete
return null;
[884] Fix | Delete
}
[885] Fix | Delete
[886] Fix | Delete
/**
[887] Fix | Delete
* Get the posting date/time for the item (UTC time)
[888] Fix | Delete
*
[889] Fix | Delete
* @see get_date
[890] Fix | Delete
* @param string $date_format Supports any PHP date format from {@see http://php.net/date}
[891] Fix | Delete
* @return int|string|null
[892] Fix | Delete
*/
[893] Fix | Delete
public function get_gmdate($date_format = 'j F Y, g:i a')
[894] Fix | Delete
{
[895] Fix | Delete
$date = $this->get_date('U');
[896] Fix | Delete
if ($date === null)
[897] Fix | Delete
{
[898] Fix | Delete
return null;
[899] Fix | Delete
}
[900] Fix | Delete
[901] Fix | Delete
return gmdate($date_format, $date);
[902] Fix | Delete
}
[903] Fix | Delete
[904] Fix | Delete
/**
[905] Fix | Delete
* Get the update date/time for the item (UTC time)
[906] Fix | Delete
*
[907] Fix | Delete
* @see get_updated_date
[908] Fix | Delete
* @param string $date_format Supports any PHP date format from {@see http://php.net/date}
[909] Fix | Delete
* @return int|string|null
[910] Fix | Delete
*/
[911] Fix | Delete
public function get_updated_gmdate($date_format = 'j F Y, g:i a')
[912] Fix | Delete
{
[913] Fix | Delete
$date = $this->get_updated_date('U');
[914] Fix | Delete
if ($date === null)
[915] Fix | Delete
{
[916] Fix | Delete
return null;
[917] Fix | Delete
}
[918] Fix | Delete
[919] Fix | Delete
return gmdate($date_format, $date);
[920] Fix | Delete
}
[921] Fix | Delete
[922] Fix | Delete
/**
[923] Fix | Delete
* Get the permalink for the item
[924] Fix | Delete
*
[925] Fix | Delete
* Returns the first link available with a relationship of "alternate".
[926] Fix | Delete
* Identical to {@see get_link()} with key 0
[927] Fix | Delete
*
[928] Fix | Delete
* @see get_link
[929] Fix | Delete
* @since 0.8
[930] Fix | Delete
* @return string|null Permalink URL
[931] Fix | Delete
*/
[932] Fix | Delete
public function get_permalink()
[933] Fix | Delete
{
[934] Fix | Delete
$link = $this->get_link();
[935] Fix | Delete
$enclosure = $this->get_enclosure(0);
[936] Fix | Delete
if ($link !== null)
[937] Fix | Delete
{
[938] Fix | Delete
return $link;
[939] Fix | Delete
}
[940] Fix | Delete
elseif ($enclosure !== null)
[941] Fix | Delete
{
[942] Fix | Delete
return $enclosure->get_link();
[943] Fix | Delete
}
[944] Fix | Delete
[945] Fix | Delete
return null;
[946] Fix | Delete
}
[947] Fix | Delete
[948] Fix | Delete
/**
[949] Fix | Delete
* Get a single link for the item
[950] Fix | Delete
*
[951] Fix | Delete
* @since Beta 3
[952] Fix | Delete
* @param int $key The link that you want to return. Remember that arrays begin with 0, not 1
[953] Fix | Delete
* @param string $rel The relationship of the link to return
[954] Fix | Delete
* @return string|null Link URL
[955] Fix | Delete
*/
[956] Fix | Delete
public function get_link($key = 0, $rel = 'alternate')
[957] Fix | Delete
{
[958] Fix | Delete
$links = $this->get_links($rel);
[959] Fix | Delete
if ($links && $links[$key] !== null)
[960] Fix | Delete
{
[961] Fix | Delete
return $links[$key];
[962] Fix | Delete
}
[963] Fix | Delete
[964] Fix | Delete
return null;
[965] Fix | Delete
}
[966] Fix | Delete
[967] Fix | Delete
/**
[968] Fix | Delete
* Get all links for the item
[969] Fix | Delete
*
[970] Fix | Delete
* Uses `<atom:link>`, `<link>` or `<guid>`
[971] Fix | Delete
*
[972] Fix | Delete
* @since Beta 2
[973] Fix | Delete
* @param string $rel The relationship of links to return
[974] Fix | Delete
* @return array|null Links found for the item (strings)
[975] Fix | Delete
*/
[976] Fix | Delete
public function get_links($rel = 'alternate')
[977] Fix | Delete
{
[978] Fix | Delete
if (!isset($this->data['links']))
[979] Fix | Delete
{
[980] Fix | Delete
$this->data['links'] = array();
[981] Fix | Delete
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link') as $link)
[982] Fix | Delete
{
[983] Fix | Delete
if (isset($link['attribs']['']['href']))
[984] Fix | Delete
{
[985] Fix | Delete
$link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate';
[986] Fix | Delete
$this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));
[987] Fix | Delete
[988] Fix | Delete
}
[989] Fix | Delete
}
[990] Fix | Delete
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link') as $link)
[991] Fix | Delete
{
[992] Fix | Delete
if (isset($link['attribs']['']['href']))
[993] Fix | Delete
{
[994] Fix | Delete
$link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate';
[995] Fix | Delete
$this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));
[996] Fix | Delete
}
[997] Fix | Delete
}
[998] Fix | Delete
if ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'link'))
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function