Wedge

Public area => The Pub => Topic started by: smap on September 9th, 2014, 03:10 PM

Title: Embed code Aeva Albums
Post by: smap on September 9th, 2014, 03:10 PM
Hi

@Nao - hope there's no problem in me doing this, or that I'm inflicting any license. Just think this is a good idea that you can use to improve Aeva on Wedge.

Just did a really small "mod" on your splendid Aeva Media 1.4w package (I'm still using SMF). I always missed the BBCode per album, since it was only available per item.

On file /Themes/default/Aeva.template.php

where it was

Code: [Select]
function template_aeva_viewAlbum()
{
global $context, $txt, $galurl, $scripturl, $amSettings, $settings, $user_info;

add ", $boardurl" to the end
   
Code: [Select]
function template_aeva_viewAlbum()
{
global $context, $txt, $galurl, $scripturl, $amSettings, $settings, $user_info, $boardurl;


where it was

Code: [Select]
</form>' : '', '
</div>';

}

function template_aeva_unseen()

insert this code bellow the "</div>';"

Code: [Select]
// BBCode Albums
if ($amSettings['show_linking_code'])
{
$i = $context['aeva_items'];

echo '
<div class="titlebg" style="margin: 0 -4px 2px -4px; padding: 7px 0 5px 8px">
', $txt['aeva_embed_bbc'], ' :
</div>
<div class="info smalltext" style="margin: 0 -4px 2px -4px; padding: 7px 0 5px 8px" >
    <textarea name="textarea" onclick="return selectText(this);" readonly="readonly">';
foreach ($i as $value)
{
echo '[smg id=' . $value['id'] . ($value['type'] == 'image' ? '' : ' type=av').']'."\n";
}
echo'
</textarea>
</div>';


// Don't show html/direct links if the helper file was deleted
if ($amSettings['show_linking_code'] == 1)
{

echo '
<div class="titlebg" style="margin: 0 -4px 2px -4px; padding: 7px 0 5px 8px">
', $txt['aeva_embed_html'], ':
</div>
<div class="info smalltext" style="margin: 0 -4px 2px -4px; padding: 7px 0 5px 8px" >
<textarea name="textarea" onclick="return selectText(this);" readonly="readonly">';
foreach ($i as $value)
{
if (strpos($value['embed_object'], 'swfobject.embedSWF') === false)
echo
$value['type'] == 'image' ?
htmlspecialchars('<img src="' . $boardurl . '/MGalleryItem.php?id=' . $value['id'] . '" alt="' . $value['title'] . '" />'."\n") :
htmlspecialchars(trim(preg_replace('/[\t\r\n]+/', ' ', $value['embed_object']))."\n");
}
echo'
</textarea>
</div>';

echo '
<div class="titlebg" style="margin: 0 -4px 2px -4px; padding: 7px 0 5px 8px">
', $txt['aeva_direct_link'] , ':
</div>
<div class="info smalltext" style="margin: 0 -4px 2px -4px; padding: 7px 0 5px 8px" >
<textarea name="textarea" onclick="return selectText(this);" readonly="readonly">';
foreach ($i as $value)
{
if ($value['type'] != 'embed')
echo $boardurl . '/MGalleryItem.php?id=' . $value['id']."\n";
}
echo '
</textarea>
</div>';

}
}

Feel free to improve my poor code, if you think this is an interesting improvement to Aeva Media

screenshot