OSClass to wordpress plugin

Discussion in 'WordPress' started by SharingEngines, Oct 24, 2011.

  1. #1
    Hi,

    I have this code

    <?php
    
    /*
    Plugin Name: Portugal Rollover Maps
    Plugin URI: http://www.osclass.org/
    Description: This Plugin displays a rollover map Portugal.
    Version: 1.0
    Author: 
    Author URI: http://www.osclass.org/
    Short Name: Portugalrollover
    */
    function portugal_rollover_js() {
    		
    	?>
    <!--rollover maps --!>
    <script type="text/javascript" src="<?php echo osc_base_url() . 'oc-content/plugins/rollover_maps/js/mapa.js'; ?>"></script>
    <link href="<?php echo osc_base_url() . 'oc-content/plugins/rollover_maps/css/mapa.css'; ?>" rel="stylesheet" type="text/css" />
    	<?php	
    }
    
    function display_portugal_map() {
    	
    	?>
    <div id="h_main">
        <div id="h_portugal"> 
    	<div class="Port">Selecionar no mapa</div> 
            <div class="Map">
                <div id="region_map"> 
                    <img src="<?php echo osc_current_web_theme_url('images/transparent.gif') ; ?>" height="252" width="196" title="Clique numa regi&#227;o para ver os an&#250;ncios!" alt="Clique numa regi&#227;o para ver os an&#250;ncios!" usemap="#PortugalMap" /> 
                </div> 
            </div> 
        </div> 
    </div> 
    
    <map id="portugal_map" name="PortugalMap"> 
    	<area shape="poly" alt="Viana do Castelo" title="Viana do Castelo" onmouseover="change_image(1);" onmouseout="hide_image(1);" href="<?php echo osc_base_url(); ?>index.php?page=search&sPattern=&sCity=Viana do Castelo" coords="120,0,121,4,125,4,120,11,122,15,111,19,108,25,105,23,99,26,99,23,97,20,98,14,108,5,114,3,116,4,119,3" /> 
    	<area shape="poly" alt="Madeira" title="Madeira" onmouseover="change_image(20);" onmouseout="hide_image(20);" href="<?php echo osc_base_url(); ?>index.php?page=search&sPattern=&sCity=Madeira" coords="68,208,70,216,61,238,41,242,23,232,25,225,39,227,49,224,54,211" /> 	
    </map>
    
    	<?php
    }
    
    // This is needed in order to be able to activate the plugin
    osc_register_plugin(osc_plugin_path(__FILE__), '');
    // This is a hack to show a Uninstall link at plugins table (you could also use some other hook to show a custom option panel)
    osc_add_hook(osc_plugin_path(__FILE__) . '_uninstall', '');
    //Header
    osc_add_hook('header', 'portugal_rollover_js');
    ?>
    Code (markup):
    It is possible change it to works in wordpress?

    Thank you for your help,
    RAN
     
    SharingEngines, Oct 24, 2011 IP