Pokebip - Espace Membre

Script permettant de donner une autre apparence au forum.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Pokebip - Espace Membre
// @namespace   Linking13   
// @description Script permettant de donner une autre apparence au forum.
// @include     http://www.pokebip.com/pokemon/index.php?phppage=membres/*
// @version     1
// ==/UserScript==

// R�cup�ration de l'url du cookie
var customban = getCookie("customban");
if (customban != null && customban != "") {
	var banniere = document.getElementsByClassName('titre')[0];
    banniere.innerHTML = "<img src=\"" + customban + "\" />";
}

addBanParam();

//alert("ok end");

function addBanParam() {
    
    // ajout de la pop up    
    document.body.innerHTML += "<div id=\"banparam\" style=\"opacity: 0.25; transition: all .20s linear;\"><img src=\"http://i.imgur.com/Cdhh9hx.png\" style=\"vertical-align: middle;\" title=\"Modifier la bannière\" />&nbsp&nbsp<span style=\"font-family: sans-serif; font-weight:bold;\">Modifier la bannière</span></div>";
        
    var banparam = document.getElementById("banparam");
    banparam.onmouseover = function() { banparam.style.opacity = "1"};
    banparam.onmouseout = function() { banparam.style.opacity = "0.25"};
    
    //cell.onclick = function () { mafunction(param); }
    
    banparam.style.cursor = "pointer";
    
    banparam.style.position = "fixed";
    banparam.style.top = "10px";
    banparam.style.left = "10px";
    
    banparam.onclick = function () {
        var url=prompt("Entrez l'url de la nouvelle bannière. La dimension conseillée est de 990*160 pixels. Laissez vide pour utiliser la bannière par défaut.","http://i.imgur.com/dScmIK1.png");
        if(url == null) {
            
        }
        else if(url == "") {
            alert("La bannière par défaut va être utilisée.");
			setCookie("customban", "http://www.pokebip.com/pokemon/skins/sinnoh/images/em.jpg", 365);
            window.location.reload();
        }
        else {
			setCookie("customban", url, 365);
			window.location.reload()   
        }
    
    };
    
    
}

function setCookie(cname, cvalue, exdays)
{
	var d = new Date();
	d.setTime(d.getTime()+(exdays*24*60*60*1000));
	var expires = "expires="+d.toGMTString();
	document.cookie = cname+"="+cvalue+"; "+expires;
}

function getCookie(cname)
{
	var name = cname + "=";
	var ca = document.cookie.split(';');
	for(var i = 0; i < ca.length; ++i) 
	{
		var c = ca[i].trim();
		if (c.indexOf(name)==0)
			return c.substring(name.length,c.length);
	}
	return "";
}