You appear to be a bot. Output may be restricted
Description
Get the banner file URLWe have a couple of places where we can find the information about the banner image to display: homepage and oik_server If oik_server contains /oik-plugins/ then we should be able to replace it with /banner/ otherwise we have to work from the homepage, stripping anything after /oik-plugins/ and replacing it with /banner/$name This is because the oik-plugins server returns the full URL of the oik-plugins page Deliver an oik-plugins style image from the oik-plugins server // $file = $plugininfo->oik_server ."/banner/" . $name;
Usage
bw_get_banner_file_URL( $name, $plugininfo );
Parameters
- $name
- ( mixed ) required –
- $plugininfo
- ( mixed ) required –
Returns
voidSource
File name: oik-bob-bing-wide/shortcodes/oik-plug.phpLines:
1 to 21 of 21
function bw_get_banner_file_URL( $name, $plugininfo ) { bw_trace2( ); if ( isset( $plugininfo->oik_server ) ) { $pos = strpos( $plugininfo->oik_server, "/oik-plugins/" ); } else { $pos = false; } if ( $pos === false ) { $pos = strpos( $plugininfo->homepage, "/oik-plugins/" ); if ( $pos === false ) { $file = null; } else { $file = substr( $plugininfo->homepage, 0, $pos ); $file .= "/banner/$name"; } } else { $file = str_replace( "/oik-plugins/", "/banner/", $plugininfo->oik_server ); } bw_trace2( $file, "file" ); return( $file ); }View on GitHub