easy rotator and multisite
-
easyrotator_display_rotator(‘erc_82_xxxxxx’);
only displays on the main site.
How do I get easy rotator to display on all sub sites without having to create the same slideshow over and over?
http://ww.wp.xz.cn/extend/plugins/easyrotator-for-wordpress/
-
P.s I am trying to display easy rotator on a dashboard widget sitewide using custom dashboard widget plugin for multisite.
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_XXXXXXfolder from the main site to the other sites’wp-content/uploads/folders. Or, you could modify theeasyrotator.phpplugin 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
$fullPathvalue:$path = $this->getContentDir() . $fullPath;And
$urlHere = $this->getContentDirURL() . $fullPath . '/content/';Please let me know if you have any other questions.
Sincerely,
Drew O’NeillThanks 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.
Hi,
I apologize for the confusion—these changes are actually in the
easyrotator-for-wordpress/engine/main.phpfile.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(Here’s the code in a more readable format: https://gist.github.com/anonymous/9f38300fc5822872cc34/raw/b71c12a05c5fa486fd4c1d44001bf2e553117900/gistfile1.txt )
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…
Hi,
Let me run some additional experiments on a test setup and I’ll get back to you shortly.
Sincerely,
Drew O’NeillHi 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 identifiedSincerely,
Drew O’Neill
The topic ‘easy rotator and multisite’ is closed to new replies.