ssl https mobile version
-
@modemlooper i am switching my site to all https ssl now …. when i load the iphone version using your plugin ….i get no css ….just what looks like a totally bare bones page with the login boxes …. can you please advise on how to fix so it loads right with https? if i go back to just http the mobile version loads fine again thanks
-
It’s because the URL https is different so you will have to fix the urls. In the buddypress-mobile.php file there is a function to load styles. It’s calling WP_plugins_dir. That will use http not https. Try and hard code the URL with the full path.
@modemlooper thanks so much for the reply ….. i see this get_stylesheet function but don’t know enough to code in that full path …can you help me with some actual code ? I am using buddypress mobile 1.5 because of customized theme need to stick with it for now and it works
function get_stylesheet($stylesheet) {
if($this->iphone){
return ‘default’;
}else{
return $stylesheet;
}
}No, the function is near bottom. Look for enque style and WP_Plugin_dir. You need to Chang that to the full path to the CSS file https://URL.com/wp-content/plugins/buddypress-mobile/templates/default/mobile.css
@modemlooper this is at the bottom of version 1.5 so change both those lines to the .js files to full https path? not seeing one for the stylesheet (i know you do it differently the version after this)
function bp_mobile_scripts() {
wp_enqueue_script( “buddypress-mobile”, path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) ).”/themes/default/theme.js”), array( ‘jquery’ ) );
if (get_option(‘add2homescreen’)==1) {
wp_enqueue_script( “add2home-mobile”, path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) ).”/themes/default/add2home.js”) );
}
}
add_action(‘wp_print_scripts’, ‘bp_mobile_scripts’);?>
That one is the JavaScript function. Find the other one
@modemlooper … thanks for the reply but i do not see the stylesheet one …. here is your file ..can you please tell me where it is exactly?
`<?php
/*
Plugin Name: BuddyPress Mobile
Plugin URI: http://go-themes.com
Description: A plugin and theme for BuddyPress for optimized viewing on Apple’s iPhone and iPod touch. Also works with some Android and blackberry devices..
Author: modemlooper
Version: 1.5
Author URI: http://twitter.com/modemlooper
*//*
* Make sure BuddyPress is loaded before we do anything.
*/
if ( !function_exists( ‘bp_core_install’ ) ) {
require_once( ABSPATH . ‘/wp-admin/includes/plugin.php’ );
if ( is_plugin_active( ‘buddypress/bp-loader.php’ ) ) {
require_once ( WP_PLUGIN_DIR . ‘/buddypress/bp-loader.php’ );
} else {
add_action( ‘admin_notices’, ‘buddypress_mobile_install_buddypress_notice’ );
return;
}
}define ( ‘BUDDYPRESS_MOBILE_VERSION’, ’1.5′ );
/*
* admin links
*/
require ( dirname( __FILE__ ) . ‘/admin.php’ );function buddypress_mobile_install_buddypress_notice() {
echo ‘‘;
_e(‘BuddyPress Mobile requires the BuddyPress plugin to work. Please install BuddyPress first, or deactivate BuddyPress Mobile.’);
echo ‘‘;
}require_once( ‘include/compat.php’ );
class bpMobilePlugin{
var $iphone;function bpMobilePlugin(){
$this->iphone = false;
add_action(‘plugins_loaded’,array(&$this,’detectiPhone’));
add_filter(‘stylesheet’,array(&$this,’get_stylesheet’));
add_filter(‘template’,array(&$this,’get_template’));
add_filter( ‘theme_root’, array(&$this, ‘theme_root’) );
add_filter( ‘theme_root_uri’, array(&$this, ‘theme_root_uri’) );
add_filter( ‘template’, array(&$this, ‘get_template’) );
}function detectiPhone($query){
$container = $_SERVER;
$useragents = array (
“iPhone”,
“iPod”,
“Android”,
“blackberry9500″,
“blackberry9530″,
“blackberry9520″,
“blackberry9550″,
“blackberry9800″,
“webOS”
);
$this->iphone = false;
foreach ( $useragents as $useragent ) {
if (eregi($useragent,$container)){
$this->iphone = true;
}
}}
function get_stylesheet($stylesheet) {
if($this->iphone){
return ‘default’;
}else{
return $stylesheet;
}
}function get_template($template) {
if($this->iphone){
return ‘default’;
}else{
return $template;
}
}function get_template_directory( $value ) {
$theme_root = compat_get_plugin_dir( ‘buddypress-mobile’ );
if ($this->iphone) {
return $theme_root . ‘/themes’;
} else {
return $value;
}
}function theme_root( $path ) {
$theme_root = compat_get_plugin_dir( ‘buddypress-mobile’ );
if ($this->iphone) {
return $theme_root . ‘/themes’;
} else {
return $path;
}
}function theme_root_uri( $url ) {
if ($this->iphone) {
$dir = compat_get_plugin_url( ‘buddypress-mobile’ ) . “/themes”;
return $dir;
} else {
return $url;
}
}}
$bp_mobile = new bpMobilePlugin();function bp_mobile_scripts() {
wp_enqueue_script( “buddypress-mobile”, path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) ).”/themes/default/theme.js”), array( ‘jquery’ ) );
if (get_option(‘add2homescreen’)==1) {
wp_enqueue_script( “add2home-mobile”, path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) ).”/themes/default/add2home.js”) );
}
}
add_action(‘wp_print_scripts’, ‘bp_mobile_scripts’);?>`
`function bp_mobile_styles() {
if ( $_COOKIE != ‘normal’){
wp_enqueue_style( ‘main’, path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) ).’/themes/default/mobile.css’));if (get_option(‘style’) == ‘black’){
wp_enqueue_style( “black”, path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) ).”/themes/default/black.css”) );
}
}
}
add_action(‘wp_print_styles’, ‘bp_mobile_styles’);`@modemlooper i really appreciate your reply and help but the code you posted does not exist in the version of your plugin i’m using 1.5 …. if you look at the code i posted above can you please tell me where in that code do i force the https url? thanks!
@modemlooper i think i found a version of 1.5.1 i can use … and the really cool thing i just found out the activity bump to top plugin has now been upgraded to work with buddypress 1.5 ..so i should be able to upgrade to your latest version soon
You must be logged in to reply to this topic.