Пример #1
0
function wpmp_barcode_activate()
{
    foreach (array('wpmp_barcode_title' => __('Our mobile site', 'wpmp'), 'wpmp_barcode_link' => function_exists('wpmp_switcher_domains') ? "http://" . wpmp_switcher_domains('mobile', true) : '', 'wpmp_barcode_size' => '190', 'wpmp_barcode_help' => 'true', 'wpmp_barcode_reader_list' => 'true') as $name => $value) {
        if (get_option($name) == '') {
            update_option($name, $value);
        }
    }
}
Пример #2
0
function wpmp_switcher_link($type, $label)
{
    $cookie = WPMP_SWITCHER_COOKIE_VAR . "={$type};path=/;expires=Tue, 01-01-2030 00:00:00 GMT";
    $target_url = esc_url("http://" . wpmp_switcher_domains($type, true) . wpmp_switcher_current_path_plus_cgi('', $type));
    if ($target_url) {
        return "<a onclick='document.cookie=\"{$cookie}\";' href='{$target_url}'>{$label}</a>";
    }
}
Пример #3
0
      <tr class='wpmp_mobile_domain'>
        <th><?php 
_e('Mobile domains', 'wpmp');
?>
</th>
        <td>
          <?php 
print wpmp_switcher_option('wpmp_switcher_mobile_domains');
?>
          <br />
          <?php 
_e('Use comma-separated domain fragments. eg:', 'wpmp');
?>
 <b>mysite.mobi, m.mysite.com</b>
          <?php 
if (strpos(get_option('wpmp_switcher_mode'), 'domain') !== false && wpmp_switcher_domains('desktop', true) == wpmp_switcher_domains('mobile', true)) {
    _e("<br /><strong style='color:#770000'>Warning</strong>: your primary desktop and mobile domains are the same. The switcher will default to 'browser detection' mode unless one is changed.", 'wpmp');
}
?>
          <br/>
          <?php 
_e('Mobile users who mistakenly access a desktop domain will be given the option to return to the first domain in this list.', 'wpmp');
?>
          <br/>
          <?php 
_e('<b>NB</b>: The plugin does not <i>create</i> these domains. You must be sure their DNS entries already resolve and are served by this web server.', 'wpmp');
?>
        </td>
      </tr>
      <tr class='wpmp_links'>
        <th><?php