add thumb to query
This commit is contained in:
1 parent
eaad8ec3c0
commit
4d31ca0fa6
3 files changed
+11
-6
No files matched your search
@@ -127,7 +127,6 @@ function convert_shares_to_public_schema($data, $username, $credential) {
|
||||
$share['thumbnail'] = make_url_from_contentid($share['guid'], $username, 'ithumb');
|
||||
} else {
|
||||
$share['thumbnail'] = make_url_from_contentid($share['guid'], $username, 'tthumb');
|
||||
|
||||
}
|
||||
//Filter out types not allowed by the current share config
|
||||
if ($data['sharetype'] == "all"
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ include("common.php");
|
||||
header('Content-Type: application/json');
|
||||
|
||||
$auth = get_authorization();
|
||||
|
||||
//gracefuldeath_json("early death");
|
||||
//Load share data
|
||||
$sharedata = get_share_data($auth['username'], $auth['credential'], 'gracefuldeath_json');
|
||||
//Convert to public schema
|
||||
|
||||
@@ -20,12 +20,18 @@ if (count($shareparts) > 1) {
|
||||
|
||||
//Make sure the file exists and can be loaded
|
||||
$jsondata = get_share_data($username, $config['readonlykey'], 'gracefuldeath_json');
|
||||
foreach ($jsondata['shares'] as $share => $value) {
|
||||
//print_r($value);
|
||||
if ($contentid == $value['guid'])
|
||||
foreach ($jsondata['shares'] as $shares => $share) {
|
||||
if ($contentid == $share['guid'])
|
||||
{
|
||||
//add thumb
|
||||
if (strrpos($share['contenttype'], "image") !== false) {
|
||||
$share['content'] = make_url_from_contentid($share['guid'], $username, 'i');
|
||||
$share['thumbnail'] = make_url_from_contentid($share['guid'], $username, 'ithumb');
|
||||
} else {
|
||||
$share['thumbnail'] = make_url_from_contentid($share['guid'], $username, 'tthumb');
|
||||
}
|
||||
header('Content-Type: application/json');
|
||||
print_r(json_encode($value, JSON_PRETTY_PRINT));
|
||||
print_r(json_encode($share, JSON_PRETTY_PRINT));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user