SimplePortal

Customization => Custom Coding => Topic started by: AngelinaBelle on March 09, 2010, 04:34:08 PM

Title: AEVA -- show thumbnails instead of "full AEVA embedding"?
Post by: AngelinaBelle on March 09, 2010, 04:34:08 PM
I'm still working on a custom Articles Block mod.
As you can see at http://www.rockhallsailingclub.org/smf1test/index.php?page=pageRacing (http://www.rockhallsailingclub.org/smf1test/index.php?page=pageRacing)
results can sometimes be ugly.
 
I'm going to take this one step at a time.
First, AEVA. Is there an AEVA hook to display thumbnails in place of you-tube videos?
 
Thanks for the advice
 
Title: Re: AEVA -- show thumbnails instead of "full AEVA embedding"?
Post by: MultiformeIngegno on March 10, 2010, 03:21:00 AM
I'm interested too
Title: Re: AEVA -- show thumbnails instead of "full AEVA embedding"?
Post by: Nathaniel on March 10, 2010, 04:02:02 AM
I don't have much experience with that particular mod. If you are looking for AEVA hooks, then you might want to ask over at their support/coding forums.
Title: Re: AEVA -- show thumbnails instead of "full AEVA embedding"?
Post by: AngelinaBelle on March 10, 2010, 08:29:38 AM
Yep. Asked over there, too. I figured asking over here would not hurt, since folks over here have come up with some innovative ways to use the SMF-media gallery.
Title: Re: AEVA -- show thumbnails instead of "full AEVA embedding"?
Post by: dannbass on March 12, 2010, 05:54:01 PM
What is it that you are trying to do exactly? the page says... * Administrator is testing this
I just want to know if I can help you, displaying thumbnails it's easy, it's already in the API.
Title: Re: AEVA -- show thumbnails instead of "full AEVA embedding"?
Post by: AngelinaBelle on March 12, 2010, 08:10:43 PM
I'm really fiddling around on that page -- can you tell?
I'm trying several things at once.
 
One of those articles contains a YouTube video, which shows up as a link, just like it does in an articles display. I'd like it if it automagically showed the YouTube thumbnail, instead.
 
I asked Nao about it, but he did not seem interested...
 
I really want AeMe's bit of parse_bbc to have a flag to tell it "don't embed the video. But don't put just a link either. Put the thumbnail instead." But it doesn't.
Title: Re: AEVA -- show thumbnails instead of "full AEVA embedding"?
Post by: dannbass on March 12, 2010, 08:39:44 PM
I understand you know, I was thinking Aeva Media... and with a loop and m.embed you can get to display only the thumbnails, but you're talking only the embedding, sorry, the only thing I can think of is having the video in the gallery first.
Title: Re: AEVA -- show thumbnails instead of "full AEVA embedding"?
Post by: Chen Zhen on March 12, 2010, 09:14:22 PM
Youtube provides thumbnails via a link as long as you provide a video id number.

ie.
Code: [Select]
$num =  'xwfde5cFw2s';
echo '<img src="http://img.youtube.com/vi/'.$num.'/default.jpg" width="70" height="70" alt="" title="Youtube thumbnail" />';

If you need to get the video id number from a variable containing the whole embed code or a youtube url:
Code: [Select]
/*  $source can be url or html embed code  */
$source = 'http://www.youtube.com/watch?v=86bCjoQk2bw&feature=topvideos';
$match = array();
preg_match("/http:\\/\\/www\.youtube\.com\\/v\\/([^\"][a-zA-Z0-9-_]+)[&\"]/siU",$source,$match);
$num = $match[1];
echo '<img src="http://img.youtube.com/vi/'.$num.'/default.jpg" width="70" height="70" alt="" title="Youtube thumbnail" />';


UD
Title: Re: AEVA -- show thumbnails instead of "full AEVA embedding"?
Post by: AngelinaBelle on March 12, 2010, 09:27:22 PM
@Underdog -- I'm only going to go into the guts of AEVA's bit of parse_bbc if there is no other way around.
 
@dannbass -- Ok. I can put the video in the gallery first (Once I reinstall the gallery). Then is there some way to tell AEVA how I want its bits of parse_bbc to render the [sg tag?
Without rewriting AEVA's bits of parse_bbc, I mean?
 
I really don't like mucking around in core code like parse_bbc -- the part that actually does the parsing. Or modding other peoples' mods of parse_bbc. Too fragile.
 
 
Title: Re: AEVA -- show thumbnails instead of "full AEVA embedding"?
Post by: Chen Zhen on March 12, 2010, 09:38:27 PM
@Underdog -- I'm only going to go into the guts of AEVA's bit of parse_bbc if there is no other way around.
 
@dannbass -- Ok. I can put the video in the gallery first (Once I reinstall the gallery). Then is there some way to tell AEVA how I want its bits of parse_bbc to render the [sg tag?
Without rewriting AEVA's bits of parse_bbc, I mean?
 
I really don't like mucking around in core code like parse_bbc -- the part that actually does the parsing. Or modding other peoples' mods of parse_bbc. Too fragile.

I'm not 100% sure on the specifics of what you are trying to accomplish here.

If the block you are writing shows the youtube link, have it query the variable and if it is a youtube link then extract the video number with the code I gave you shown above. Then have it display the thumbnail img src.

If it's the articles block that you are afraid to edit, just extract and rename the whole function as I told you in the past.
Or omit the function (brackets and all) and just let it execute the code.

UD
Title: Re: AEVA -- show thumbnails instead of "full AEVA embedding"?
Post by: dannbass on March 12, 2010, 09:45:23 PM
Absolutely yes...
Title: Re: AEVA -- show thumbnails instead of "full AEVA embedding"?
Post by: AngelinaBelle on March 12, 2010, 10:41:12 PM
@Underdog -- I am working on something like that. And I COULD pre-parse all AEVA things. But AEVA is better at that than I am. So I'm trying to figure out a way to avoid it. Maybe I won't be able to!
 
I like option 3 the best! But, even better, I want a switch in $context or $modSettings that I can use to flip the switch on all of the processing, rather than doing it one tag at a time.
Then, after I parse all my article bodies, I can flip the switch back to where it was.
 
I don't think Nao sees the need for this right now!
 
 
SimplePortal 2.3.8 © 2008-2024, SimplePortal