本文整理汇总了PHP中phpFlickr::grabComments方法的典型用法代码示例。如果您正苦于以下问题:PHP phpFlickr::grabComments方法的具体用法?PHP phpFlickr::grabComments怎么用?PHP phpFlickr::grabComments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phpFlickr
的用法示例。
在下文中一共展示了phpFlickr::grabComments方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: urlencode
}
$flickr_infos = file_get_contents($service_url . '?action=subscription_status&url=' . urlencode($site_url));
if (substr($flickr_infos, 0, 1) == '@') {
$flickr_state = (bool) substr($flickr_infos, 1, 1);
$flickr_last_update = substr($flickr_infos, 3);
} else {
$flickr_state = false;
}
/* Unique Photo */
$description = "";
if ($please_update) {
$description .= "<h3><font color='red'>New Update available : " . $addon_name . " " . $last_version . ". Please update!</font> [ <a href='http://www.pixelpost.org/extend/addons/flickr-comments-grabber/'><font color='blue'>Download Link</font></a> ]</h3>";
}
$description .= "<h3>Retrieve comments</h3>";
$description .= "<form action='" . $site_url . "admin/index.php?view=addons' method='post' accept-charset='UTF-8'>\n\tRetrieve the comments of all your photos. If you only want to retrieve the comments of a specified photo, enter the Flickr ID of the photo in the input text<br>\n\tDuration of the operation : 2 images per second.<br>\n\t<br>\n\tFlickr ID (<i>optional</i>) : <input type='text' size='10' value='' name='f_id'>\n\t<input type='submit' value='grab !' name='flickr_comments_update'>\n\t</form>";
/* Auto-Update */
$description .= "<h3>Auto-Update</h3>";
$description .= "<form action='" . $site_url . "admin/index.php?view=addons' method='post' accept-charset='UTF-8'>\n\tIf you want to retrieve automatically the comments of all your photos (once a day at 00:00:00 UTC).<br />\n\tEnable this option will first retrieve the comments of all your photos | Execution Time : 2 images per second.\n\t<br /><br />\n\t<input type='radio' name='state' id='state1' value='1' " . ($flickr_state ? 'checked="checked" ' : '') . "/>\n\t<label for='state1'>Enabled</label>\t\n\t<input type='radio' name='state' id='state2' value='0' " . (!$flickr_state ? 'checked="checked" ' : '') . "/>\n\t<label for='state2'>Disabled</label>\n\t<input type='submit' value='save !' name='flickr_settings_update' >" . ($flickr_state ? ' <strong>Last update: ' . $flickr_last_update . '</strong>' : '') . "\n\t</form>";
/* Reset */
$description .= "<h3>Reset</h3>";
$description .= "<form action='" . $site_url . "admin/index.php?view=addons' method='post' accept-charset='UTF-8'>\n\tIf you want to remove all the comments that have been retrieved from Flickr (your other comments will not be removed).\n\t<br /><br />\n\t<input type='submit' value='reset !' name='flickr_comments_remove'>\n\t</form>";
/* About */
$addon_description = "Retrieve your image comments from Flickr. In order for it to work, please insert the Flickr ID into the photo's tags (ex : 4518790540).<p>" . $description . "<p>Created by Aymeric Brisse (<a href='http://www.agregats.net/' target='_blank'>agregats.net</a>) - (<a href='http://www.pixelpost.org/extend/addons/flickr-comments-grabber/' target='_blank'>Plugin Page</a>) (<a href='http://www.pixelpost.org/forum/showthread.php?t=11883' target='_blank'>Forum</a>) </p>";
} elseif (isset($_GET['action']) && $_GET['action'] == 'flickr_comments_update') {
/* Retrieve comments - via AutoUpdate */
require_once "phpFlickr/phpFlickr.php";
$f = new phpFlickr($api_key);
$flickr_content .= $f->grabComments("all");
/* Log */
die($flickr_content);
}