本文整理汇总了PHP中album::getMedia方法的典型用法代码示例。如果您正苦于以下问题:PHP album::getMedia方法的具体用法?PHP album::getMedia怎么用?PHP album::getMedia使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类album
的用法示例。
在下文中一共展示了album::getMedia方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: comGetImage
function comGetImage()
{
if (isset($this->data['page']) && isset($this->data['count'])) {
$listMedia = $this->album->getMedia($this->data['id'], null, $this->data['page'], $this->data['count']);
} else {
$listMedia = $this->album->getMedia($this->data['id']);
$this->data['page'] = 1;
$this->data['count'] = count($listMedia);
}
$xml = '<?xml version="1.0" encoding="UTF-8" ?>
<RESPONSE>
<INFO>
<COMMAND>' . $this->command . '</COMMAND>
<ID>' . $this->data['id'] . '</ID>
<PAGE>' . $this->data['page'] . '</PAGE>
<COUNT>' . $this->data['count'] . '</COUNT>
</INFO>
<DATA>';
foreach ($listMedia as $value) {
$mime = explode('/', $value['mime']);
$xml .= '
<IMAGE>
<ID>' . $value['id'] . '</ID>
<ALBUM>' . $value['aid'] . '</ALBUM>
<TITLE>' . $value['title'] . '</TITLE>
<DESCRIPTION>' . $value['desc'] . '</DESCRIPTION>
<WIDTH>' . $value['width'] . '</WIDTH>
<HEIGHT>' . $value['height'] . '</HEIGHT>
<DURATION>' . $value['duration'] . '</DURATION>
<SIZE>' . $value['size'] . '</SIZE>
<DATE>' . $value['firstdate'] . '</DATE>
<MIME>
<GROUP>' . $mime[0] . '</GROUP>
<TYPE>' . $mime[1] . '</TYPE>
</MIME>
<USER>
<ID>' . $value['uid'] . '</ID>
<NAME>' . $value['username'] . '</NAME>
<FIRSTNAME></FIRSTNAME>
<LASTNAME></LASTNAME>
</USER>
</IMAGE>
';
}
$xml .= '
</DATA>
</RESPONSE>';
$xml = preg_replace('/(\\s*)(.*)\\n/', "\\2\n", $xml);
$xml = preg_replace('/>(\\s*)\\n(\\s*)</', "><", $xml);
$this->html = $xml;
}