Commit 9fb40cb1 authored by lucha's avatar lucha

plugin: i-love-xm24-ribbon 0.0.4

parent c40bae5d
This diff is collapsed.
# wordpress_ilovexm24_ribbon
Plugin per wordpress che posiziona un fiocco all'angolo destro di un sito wordpress con scritto i love xm24.
La scrittà è cliccabile e punta ad una pagina che spiega la campagna di difesa di xm24.
Il fiocchetto è stato pensato e realizzato da void
\ No newline at end of file
.ilovexm24_content {
font-family: Helvetica;
font-weight: bolder;
font-size: 1.4em;
width: 200px;
text-align: center;
line-height: 50px;
letter-spacing: 1px;
color: red;
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
position: fixed;
box-shadow: 0 0 10px rgba(0,0,0,.3);
top: 25px;
right: -50px;
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
background: #FFF;
z-index:9999;
}
.ilovexm24_link,
.ilovexm24_link:hover {
color: #000;
}
.ilovexm24_link .love,
.ilovexm24_link:hover .love {
color: #FF0000;
}
<?php
/*
Plugin Name: Wordpress I love Xm24 Ribbon
Plugin URI: https://git.lattuga.net/hacklabbo/wordpress_ilovexm24_ribbon
Description:
Version: 0.0.4
Author: Hacklabbo
Author URI: http://www.ecn.org/xm24
License: GPL3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Text Domain: ilovexm24
@author HAcklabbo
@category social
@package Wordpress I love Xm24 Ribbon
@since 0.0.1
Wordpress I love Xm24 ribbon come from a void's idea. A Plugin for WordPress.
Copyright (C) 2017 Hacklabbo -
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/gpl-3.0.html.
*/
if ( ! defined( 'ABSPATH' ) ) :
exit; // Exit if accessed directly
endif;
class Xm24_Ribbon {
public function __construct() {
add_action( 'wp_enqueue_scripts', array( &$this, 'ilovexm24_load_scripts' ));
}
public function getHtmlRibbon() {
$xm24_url = 'http://www.ecn.org/xm24';
$xm24_text = 'I <span class="love">&#9829;</span> XM24';
$xm24_title = 'Solidarietà ad Xm24 a rischio di sgombero!';
$ribbon = '<div class="ilovexm24_content">'.
'<a title="'.$xm24_title.'" class="ilovexm24_link" target="_blank" href="'.$xm24_url.'">'.
$xm24_text.
'</a>'.
'</div>';
return $ribbon;
}
public function ilovexm24_load_scripts(){
wp_register_style( 'ilovexm24', plugins_url( 'css/ilovexm24.css', __FILE__), false, true );
wp_enqueue_style( 'ilovexm24' );
wp_register_script( 'ilovexm24', plugins_url('js/ilovexm24.js', __FILE__), false, false, true);
wp_enqueue_script( 'ilovexm24');
$attrs = Array(
'ribbon' => $this->getHtmlRibbon()
);
wp_localize_script( 'ilovexm24', 'attrs', $attrs );
}
}
$xm24r = new Xm24_Ribbon();
var div = document.createElement('div');
div.innerHTML = attrs.ribbon;
document.body.appendChild(div);
=== Plugin Name ===
Contributors: steppade
Tags: social
Requires at least: 4.0
Tested up to: 4.7
Stable tag: 0.0.2
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Add a ribbon where is written "I Love Xm24" at your site to support Xm24. Xm24 is a squat in Bologna since 15 years where is located an hacklab. Now the city administration wants close it and we stand for it.
== Description ==
Plugin per wordpress che posiziona un fiocco all'angolo destro di un sito wordpress con scritto i love xm24.
La scrittà è cliccabile e punta ad una pagina che spiega la campagna di difesa di xm24.
Il fiocchetto è stato pensato e realizzato da void
== Installation ==
This section describes how to install the plugin and get it working.
e.g.
1. Upload the plugin files to the `/wp-content/plugins/plugin-name` directory, or install the plugin through the WordPress plugins screen directly.
1. Activate the plugin through the 'Plugins' screen in WordPress
1. Use the Settings->Plugin Name screen to configure the plugin
1. (Make your instructions match the desired user flow for activating and installing your plugin. Include any steps that might be needed for explanatory purposes)
== Screenshots ==
1. This is a screenshot screenshot-1.jpg
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment