Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

magic-plugin: Update?

edited July 2010 in Vanilla 2.0 - 2.8
Hi!
@bas87
Will this Plugin be updated to work again?
http://vanillaforums.org/addon/526/magic
Tagged:

Comments

  • ToddTodd Vanilla Staff
    Can you give a link at least?
  • an update for this addon would be awesome.
  • Another vote for this add on. I think this is a must have add on!
  • @bas87
    Any news here?
  • @bas87 This is the message I receive when I try to enable the Plugin:


    The addon could not be enabled because it generated a fatal error:


    FATAL ERROR IN: PHP.Gdn_ErrorHandler();

    "Magic requires the Vanilla application version >= 2.0"
    LOCATION: xxxxxx/forum/library/core/functions.general.php
    > 351: for ($i = 0; $i < $Count; ++$i) {
    > 352: $Operator = $Operators[$i];
    > 353: $MatchVersion = $Versions[$i];
    > 354: if (!version_compare($EnabledVersion, $MatchVersion, $Operator)) {
    >>> 355: throw new Exception(
    > 356: sprintf(
    > 357: T('%1$s requires the %2$s %3$s version %4$s %5$s'),
    > 358: $ItemName,
    > 359: $RequiredItemName,
    BACKTRACE:
    [xxxxxx/forum/library/core/class.pluginmanager.php 413] PHP::CheckRequirements();
    [xxxxxx/forum/applications/dashboard/controllers/class.settingscontroller.php 510] Gdn_PluginManager->TestPlugin();
    [xxxxxx/forum/library/core/class.dispatcher.php 276] SettingsController->TestAddon();
    [xxxxxx/forum/index.php 38] Gdn_Dispatcher->Dispatch();
  • rakrak
    edited August 2010
    @basb: Are you sure you are running Vanilla2? The error you got is to do with the Vanilla version number check.

    All: I got this working by removing the extra line breaks and whitespace from the img and object/embed code in plugins/magic/default.php:

    Combine lines 45-47:
    return "<a href=\"" . $Matches[0] . "\" target=\"_blank\">
    <img alt=\"Image\" width=\"450\" border=\"0\" src=\"" . $Matches[0] . "\" />
    </a>";
    into one line:
    return "<a href=\"" . $Matches[0] . "\" target=\"_blank\"><img alt=\"Image\" width=\"450\" border=\"0\" src=\"" . $Matches[0] . "\" /></a>";
    AND combine lines 60-67:
    return "<object width=\"425\" height=\"344\">
    <param name=\"movie\" value=\"http://www.youtube." . $Matches[5] . "/v/" . $Matches[7] . "&fs=1&rel=0\"></param>
    <param name=\"allowFullScreen\" value=\"true\">
    </param><param name=\"allowscriptaccess\" value=\"always\"></param>
    <embed src=\"http://www.youtube." . $Matches[5] . "/v/" . $Matches[7] . "&hl=fs=1&rel=0\"
    type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\"
    width=\"425\" height=\"344\"></embed>
    </object>";
    into one line:
    return "<object width=\"425\" height=\"344\"><param name=\"movie\" value=\"http://www.youtube." . $Matches[5] . "/v/" . $Matches[7] . "&fs=1&rel=0\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube." . $Matches[5] . "/v/" . $Matches[7] . "&hl=fs=1&rel=0\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"425\" height=\"344\"></embed> </object>";
  • thanks rak, this works fine for new posts. is there any possibility to convert older posts as well? i used vanilla 1 for several years and got a lot of image links in my board. with the fixed magic plugin the links dissapear or get shortened.
  • @rak I'm definitely using Vanilla 2.0!
    I deleted the line which checks the version, now it works.
    I applied your changes but images still don't get embedded!
    And: I also need this applied to older posts...
  • To make this work with the current changes in youtube is to change the url on line 16 to
    private $RegularYoutube = '/((http|ftp)\:\/\/)?([w]{3}\.)?(youtube\.)([a-z]{2,4})(\/watch\#\!v=)([a-zA-Z0-9_-]+)(\&feature=)?([a-zA-Z0-9_-]+)?/';

    notice the change from \? to \#\!

Sign In or Register to comment.