News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

[Deprecated, use Aeva] YouTube BBCode v2.6

Started by Nao 尚, September 27, 2007, 05:51:05 PM

Previous topic - Next topic

Magicjax

Forgive my ignorance. This is my first attempt to install a mod here.

The first line of instructions says:

Quote
FIND
Code: [Select]
         'flash' => array('code' => 'flash',
ADD BEFORE
Code: [Select]
         'youtube' => array('code' => 'youtube', 'before' => '
', 'description' => $txt['youtube']),

Now I understand the concept here (Find a line in the code then add a line before it). But it it doesn't tell me what file to "Find" the line in.

I guess I need a "for dummies" explanation. :)

Can anyone walk me through it? Thanks for your time.

Deaks

that would in your Post.template.php file located in your themes folder
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

58tbird

I tried installing the convert_ytplaylist_bbcode.php file, but I got this error:
QuoteThe package manager currently allows only these file types: zip, tgz, tar.gz.

Is this file needed for anything?  The mod seems to work fine otherwise.

Deaks

no that file is not needed to work with this mod
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

58tbird


dotcomguy

Quote from: TDNY on April 30, 2009, 08:51:43 PM
I have youtube checked off on the bbc code list and the mod works fine.

When I tried this then it just showed the youtube url instead of the actual video in the post. I'd like to be the only one on my forum to be able to use this mod but I haven't found a way to do it. Anyone know how? I thought if I uncheck it in the bbc list (post and topics/bbc) then the button won't show up for others (which it doesn't) but it also doesn't work for admins either if it's unchecked. Thanks!

Nao 尚

dotcom, if you're an admin, just disable any similar mod (aeva, ytbbc) and use the [html] tag to embed video code.
Or use Aeva (I don't know about the ytbbc internals) and modify the Subs.php stuff to call aeva_parse_bbc2() only if ($user_info['is_admin']) (just one line to add, piece of cake), or $user_info['id'] == your_user_id. If you do that, only you will be able to view embeds, rather than a link. Or you can do it before the call to aeva_onposting(), meaning everyone will be able to view embeds, but only for *your* posted links.
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

dotcomguy

#287
I'm not very good with coding; could you tell me where in the subs.php I should put that? The first html option wouldn't work since others would be able to add videos too. I'm not the admin but the global moderator so I think the code $user_info['id'] == your_user_id would work and the last part you said "before the call to aeva_onposting(), meaning everyone will be able to view embeds, but only for *your* posted links." is exactly what I need.

Ideally I would like to be able to have the bbc permission based so I could add video, photos, etc. and no one else could. I see there's a mod that does that but it hasn't been updated in a long time.

Thanks for your help!

I'm running 1.1.9 by the way.

Nao 尚

Quote from: dotcomguy on July 06, 2009, 12:46:18 AM
I'm not very good with coding; could you tell me where in the subs.php I should put that? The first html option wouldn't work since others would be able to add videos too. I'm not the admin but the global moderator so I think the code $user_info['id'] == your_user_id would work
Yes, it would work... As long as you replace your_user_id with your id, of course ;)

    if ($user_info['id'] == 1)

is equivalent to if ($user_info['is_admin']) (if you only have one admin, of course.)

If I remember correctly, the code for the entire moderator family would be if ($user_info['is_mod'])

Quoteand the last part you said "before the call to aeva_onposting(), meaning everyone will be able to view embeds, but only for *your* posted links." is exactly what I need.
Then that's it. :)

QuoteIdeally I would like to be able to have the bbc permission based so I could add video, photos, etc. and no one else could. I see there's a mod that does that but it hasn't been updated in a long time.
I don't think that mod would help much.
So, as I said -- search for the call to aeva_onposting() in Subs.php (after you installed Aeva, of course), and add that line before it.

QuoteI'm running 1.1.9 by the way.
It should be behaving the same way as in SMF2.
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

dotcomguy

Do you mean the sources/Subs-Aeva.php file to add that code? I tried searching in sources/Subs.php and couldn't find aeva_onposting() but did find it in Subs-Aeva.php.

function aeva_onposting($input)
{
   global $modSettings, $context, $sites, $sourcedir;

   // Exit if all three are disabled:
   // - Lookups (retrieve final URL, check whether embeds are allowed, etc.)
   // - Fix embed HTML (when n00bs try to post the full embed code rather than just the URL)
   if (empty($modSettings['aeva_fix_html']) && empty($modSettings['aeva_lookups']))
      return $input;

   $array = array(
      // bbc => retain
      'code' => true,
      'html' => true,
      'php' => true,
      'noembed' => true,
   );

So I would add the code...

$user_info['id'] == username

Somewhere in this part of the code in the Subs-Aeva.php then? I'm sorry for all the questions, like I said I'm not good with coding. Thanks.

Nao 尚

Sorry, meant Post.php. You have to do that twice:

Search for
global $sourcedir;
@include_once($sourcedir . '/Subs-Aeva.php');
if (function_exists('aeva_onposting'))
$_POST['message'] = aeva_onposting($_POST['message']);
}


Replace with
global $sourcedir, $user_info;
@include_once($sourcedir . '/Subs-Aeva.php');
if (function_exists('aeva_onposting') && $user_info['is_mod'])
$_POST['message'] = aeva_onposting($_POST['message']);
}


I would recommend leaving the $user_info out from the "global" line on the first occurrence though, as it's already globaled and I'm not sure it's not going to "forget" its settings once it's declared again. I don't think so, though, but if you're having trouble, remove the ", $user_info".
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

gregh

I just installed this into a clean 2.0 RC1-2, it says it installed fine, but the button doesn't appear and the gif files wasn't copied over. I am using the default theme.

Rostam

I tried to upload and install it on RC1.2 and it didnt work. the test failed. I hope you provide a new version for SMF 2.0 RC1.2, TIA

gregh

any tips on getting this running onto SMF 2.0 RC1.2?? The youtube.gif is there in the correct folder, but I'm not what else I need to manually do to get this running?

Cheers,

Greg

Nao 尚

Runic transferred the mod's ownership to me.
I warned him that I would end up turning it into an "Aeva Lite for YouTube" but that didn't seem to bother him, so that's probably what I'll do in the near future ;)
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

Teerapat

#295
This is translation to thai and thai-utf8

$txt['youtube'] = 'ใส่ยูทูบ';
$txt['youtube_invalid'] = '#YouTube Link ไม่ถูกต้อง!#';

Nao 尚

Shh!! Don't bump the topic! Or people will notice I'm not updating this to Aeva Lite like I promised ;)
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

Teerapat

Quote from: Nao/Gilles on October 22, 2009, 08:31:06 AM
Shh!! Don't bump the topic! Or people will notice I'm not updating this to Aeva Lite like I promised ;)

:) Thank you. :)

Guardian ekiM

I have my YouTube code installed in my forums on my website.
The YouTube code is working with [youtube][/youtube]; however, the button isn't showing up. I placed the youtube.gif file in my theme/images/bbc for the theme I have running, but I'm still not seeing the YouTube button.

Please advise.

Nao 尚

Right click on the place where the button is supposed to show up, and copy the URL... Then upload the file so that it appears at this place ;)
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

Advertisement: