WordPress.org

Support

Support » Plugins and Hacks » [Resolved] easy rotator and multisite

[Resolved] easy rotator and multisite

Viewing 10 replies - 1 through 10 (of 10 total)
  • P.s I am trying to display easy rotator on a dashboard widget sitewide using custom dashboard widget plugin for multisite.

    Plugin Author DWUser

    @dwusercom

    Hi Atlanta,

    To display rotators on other sites, you have a couple of options. First, you can copy the wp-content/uploads/EasyRotatorStorage/user-content/erc_82_XXXXXX folder from the main site to the other sites’ wp-content/uploads/ folders. Or, you could modify the easyrotator.php plugin file, modifying this function (which starts around line 1170):

    public function renderRotator($fullPath)

    You would have to update the following two lines to conditionally be different based on the passed $fullPath value:

    $path = $this->getContentDir() . $fullPath;

    And

    $urlHere = $this->getContentDirURL() . $fullPath . '/content/';

    Please let me know if you have any other questions.

    Sincerely,
    Drew O’Neill

    Thanks for the quick answer Drew. I am considering purchasing the pro version today.

    I searched easyrotator.php and did not find public function renderRotator($fullPath)

    Also, when you say that I have to update the following two lines which I don’t see in easyrotator.php,

    $path = $this->getContentDir() . $fullPath;
    $urlHere = $this->getContentDirURL() . $fullPath . ‘/content/’;

    am I replacing $fullpath with the erc_82 number?

    Thanks for your help.

    Plugin Author DWUser

    @dwusercom

    Hi,

    I apologize for the confusion—these changes are actually in the easyrotator-for-wordpress/engine/main.php file.

    Here’s an example of the updated code you might use:


    $path = $this->getContentDir() . $fullPath;
    if ($fullPath == 'erc_88_xxxxxx') // update this value!
    {
    $path = '/var/www/somedir/other/site/wp-content/uploads/EasyRotatorStorage/user-content/' . $fullPath;
    }

    ...

    $urlHere = $this->getContentDirURL() . $fullPath . '/content/';
    if ($fullPath == 'erc_88_xxxxxx') // update this value!
    {
    $urlHere = 'http://other.site.com/wp-content/uploads/EasyRotatorStorage/user-content/' . $fullPath . '/content/';
    }

    Sincerely,
    Drew O’Neill

    Plugin Author DWUser

    @dwusercom

    Hi, Drew, thanks. Clarification- I think your instructions are meant for different websites, not a multisite network, no?

    Eg..

    “To display rotators on other sites, you have a couple of options. First, you can copy the wp-content/uploads/EasyRotatorStorage/user-content/erc_82_XXXXXX folder from the main site to the other sites’ wp-content/uploads/ folders.”

    I want erc_82_XXXXXX to play in mysite.com/subsite-a, mysite.comsubsite-b, mysite.comsubsite-c. It sounds like these instructions are for mysite.com and anothersite.com

    I aslo tried this variation https://gist.github.com/anonymous/9f38300fc5822872cc34/raw/b71c12a05c5fa486fd4c1d44001bf2e553117900/gistfile1.txt and updated the erc value but it didn’t work.

    Just changed status to not resolved…

    Just changed status to not resolved…

    Plugin Author DWUser

    @dwusercom

    Hi,

    Let me run some additional experiments on a test setup and I’ll get back to you shortly.

    Sincerely,
    Drew O’Neill

    Plugin Author DWUser

    @dwusercom

    Hi Atlanta,

    I’ve double-checked the code and it works correctly on a WP multisite network. The trick is that you’ll need to know what the file path and public URL to the main site’s wp-content/uploads/EasyRotatorStorage/ folder.

    If you can confirm the following information, I’ll show the exact code that’s needed:
    – The ID of the rotator you want to display (e.g. erc_xx_xxxxxx)
    – The path to the location where this rotator’s files are stored in the main site. This will be e.g. /var/www/yoursite/wp-content/uploads/EasyRotatorStorage/wp-content/erc_xx_xxxxxx.
    – The public URL to that folder you just identified

    Sincerely,
    Drew O’Neill

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Resolved] easy rotator and multisite’ is closed to new replies.