[proposal] Multi-Site mfunc compatibility
-
Hello everybody,
[edit]
still need to fix a fresh-caching issue – working on it.[edit2] disregard that, just a stupid me who apparently can’t use vim x) Anyway: This hack comes without any warrants, so you are on your own if you run into trouble ??
[/edit]since our team wanted this plugin for one of our multi-site installations, I was given permission to add the missing mfunc compatibility. It’s not 100% clean, but it works and should be easily incorporated by reviewmyfile (who actually pointed out the to-dos here: https://www.ads-software.com/support/topic/plugin-ad-injection-multi-site-problems?replies=7).
Enjoy ??
====
In ad-injection.php find&replace:
1)
define('ADINJ_AD_PATH', WP_PLUGIN_DIR.'/ad-injection-data');
if (function_exists('is_multisite') && is_multisite()) { define('ADINJ_AD_PATH', WP_PLUGIN_DIR.'/ad-injection-data/'.$GLOBALS['current_blog']->blog_id); } else { define('ADINJ_AD_PATH', WP_PLUGIN_DIR.'/ad-injection-data'); }
2)
<!--Ad Injection mfunc mode ad include code--><!--mfunc include_once('$plugin_dir/adshow.php') --><?php include_once('$plugin_dir/adshow.php'); ?><!--/mfunc-->
<!--Ad Injection mfunc mode ad include code--><!--mfunc ".'$GLOBALS["current_blog_id"]'." = '".$GLOBALS['current_blog']->blog_id."'; include_once('$plugin_dir/adshow.php') --><?php ".'$GLOBALS["current_blog_id"]'." = '".$GLOBALS['current_blog']->blog_id."'; include_once('$plugin_dir/adshow.php'); ?><!--/mfunc-->
===
In adshow.php find&replace:
$ad_path = dirname($plugin_dir).'/ad-injection-data/'.$adfile;
if (function_exists('is_multisite') && is_multisite()) { $blog_id = if(isset($GLOBALS['current_blog_id']))?$GLOBALS['current_blog_id']:$GLOBALS['current_blog']->blog_id; $ad_path = dirname($plugin_dir).'/ad-injection-data/'.$blog_id.'/'.$adfile; } else { $ad_path = dirname($plugin_dir).'/ad-injection-data/'.$adfile; }
- The topic ‘[proposal] Multi-Site mfunc compatibility’ is closed to new replies.