hide or show signatures in posts
hide or show signatures in posts
hide or show signatures in posts

________________________

________________________
Hello everyone,
I came up with the idea for this tutorial from this suggestion Signature Options for Members
------
tThis next tutorial will help you get users and guests to choose to hide or show signatures in posts,
Note...
1:This modification applies as long as your templates are not significantly modified.
2:this trick uses the browser's local storage function
3:Signatures will appear if you clear your browser's cache/cookies or use another browser.
------------------------------------------
phpBB2 phpBB3 PunBB Invision ModernBB
- Spoiler:
- In the viewtopic_body template, find:
- Code:
{POLL_DISPLAY}
Replace it with:- Code:
{POLL_DISPLAY}
<div align="left"><br /> <div class="settings8">
<div class="settings5"></div>
</div>
</div> <br />
nstalling the JavaScript:
Title : as you like
Placement : In the topics- Code:
(function() {
// 2 = modernbb
var version = 3; // forum version
window.fara_theme_color = {
version : version,
// elements the selector is attached to
attachTo : [
'.settings5', // سبحان الله
'.settings5', // اللهم صل وسلم على محمد
'.settings5', // وفوق كل ذي علم عليم
'.settings5' // لا تنسى ذكرا الله
][version],
selected : my_getcookie('fara_theme_color') || 'ارختيار', // selected theme
// color palettes
palette : {
'Show signature' : '',
'Hide signature' : [],
},
// change the current theme
change : function(color, select) {
var head = $('head'),
style = document.getElementById('fara_theme_style');
my_setcookie('fara_theme_color', color, true); // update selected theme
// remove old styles
if (style) {
head[0].removeChild(style);
}
// Random / Normal Themes
if (!/Select a theme|Rainbow/.test(color) && fara_theme_color.palette[color]) {
fara_theme_color.selected = color == 'Hide signature' ? fara_theme_color.palette['Hide signature'][Math.floor(Math.random() * fara_theme_color.palette['Hide signature'].length)] : color;
fara_theme_color.selector.style.backgroundColor = fara_theme_color.palette[fara_theme_color.selected][1];
fara_theme_color.selector.style.borderColor = fara_theme_color.palette[fara_theme_color.selected][2];
head.append('<style type="text/css" id="fara_theme_style">' + fara_theme_color.css() + '</style>');
} else if (color == 'Rainbow') { // Rainbow theme
if (fara_theme_color.stop) {
fara_theme_color.selected = color;
fara_theme_color.selector.style.backgroundColor = fara_theme_color.palette[select][1];
fara_theme_color.selector.style.borderColor = fara_theme_color.palette[select][2];
head.append('<style type="text/css" id="fara_theme_style">' + fara_theme_color.css(select) + '</style>');
} else {
fara_theme_color.rainbow();
}
} else { // No theme
fara_theme_color.selector.style.backgroundColor = '#1e88e5';
fara_theme_color.selector.style.borderColor = '#1e88e5';
}
// delete rainbow assets if it's not selected
if (color != 'Rainbow' && fara_theme_color.stop) {
if (!fara_theme_color.transition_all) {
head[0].removeChild(document.getElementById('fa_rainbow_smoothness'));
}
window.clearInterval(fara_theme_color.interval);
delete fara_theme_color.index;
delete fara_theme_color.stop;
}
},
// get and return the theme CSS per version
css : function(select) {
var palette = fara_theme_color.palette[select || fara_theme_color.selected],
all = '::-webkit-scrollbar-track { background:#1f537b; padding: 9px;}'+
'::-webkit-scrollbar-button:horizontal:increment { background-position:-51px 0; padding: 9px; }'+
'::-webkit-scrollbar-thumb:active, ::-webkit-scrollbar-button:active { background-color:' + palette[3] + ' !important; }';
switch (fara_theme_color.version) {
case 3 : // invision
return' .signature_div, .post-signature, .sig-content{
display: none;
}'+
all;
default : // unknown
return ''+
all;
}
},
// get and return the transition CSS per version
// helps make the transition in colors smooth
applyTransitionRules : function() {
switch (fara_theme_color.version) {
default : // unknown
return '';
}
},
// setup the rainbow assets
rainbow : function() {
if (!fara_theme_color.transition_all) {
$('head').append('<style type="text/css" id="fa_rainbow_smoothness">' + fara_theme_color.applyTransitionRules() + '</style>');
}
fara_theme_color.index = 0;
fara_theme_color.stop = fara_theme_color.palette['Hide signature'].length;
fara_theme_color.change('Rainbow', fara_theme_color.palette['Hide signature'][fara_theme_color.index]);
fara_theme_color.interval = window.setInterval(function() {
if (++fara_theme_color.index >= fara_theme_color.stop) {
}
fara_theme_color.change('Rainbow', fara_theme_color.palette['Hide signature'][fara_theme_color.index]);
}, fara_theme_color.transition + fara_theme_color.delay);
}
};
var htmlStr = '', i;
// put together the theme options and random array
for (i in fara_theme_color.palette) {
if (typeof fara_theme_color.palette[i] != 'undefined') {
if (!/Random theme|Select a theme|Rainbow/.test(i)) {
fara_theme_color.palette['Hide signature'][fara_theme_color.palette['Hide signature'].length] = i;
}
htmlStr += '<option value="' + i + '" ' + ( fara_theme_color.selected == i ? 'selected="true"' : '' ) + ' style="background-color:' + (/Random theme|Select a theme|Rainbow/.test(i) ? '#FFF;color:#000;' : fara_theme_color.palette[i][2]) + '">' + i + '</option>';
}
}
// create the theme selector
fara_theme_color.selector = $('<select id="signaturehide" />').html(htmlStr).change(function() {
fara_theme_color.change(this.value);
})[0];
fara_theme_color.change(fara_theme_color.selected); // apply the selected theme
// add the theme selector to the document
$(function() {
$(fara_theme_color.attachTo).after([fara_theme_color.selector, $('<div class="clear" />')[0]]);
});
// basic styles for the theme selector
document.write('<style type="text/css">signaturehide {margin:3px; padding: 9px;}' + ( fara_theme_color.transition_all ? fara_theme_color.applyTransitionRules() : '' ) + '</style>');
}());
$(function(){
$(".settings8,
.settings8 ").css({
"display": "inline-block",
"overflow": "hidden",
});
'هذا الكود تم تعديله بواسطة كونان2000: (◔◡◔)';
});
$(function(){
$("select#signaturehide,
select#signaturehide ").css({
"background-color": "#1e88e5",
"font-size": "12px",
"color": "azure",
"padding": "7px"
});
'هذا الكود تم تعديله بواسطة كونان2000: (◔◡◔)';
});
AwesomeBB
- Spoiler:
In the viewtopic_body template, find:- Code:
{POLL_DISPLAY}
Replace it with:- Code:
{POLL_DISPLAY}
<div align="left"><br /> <div class="settings8">
<div class="settings5"></div>
</div>
</div> <br />
nstalling the JavaScript:
Title : as you like
Placement : In the topics- Code:
(function() {
// 2 = modernbb
var version = 3; // forum version
window.fara_theme_color = {
version : version,
// elements the selector is attached to
attachTo : [
'.settings5', // سبحان الله
'.settings5', // اللهم صل وسلم على محمد
'.settings5', // وفوق كل ذي علم عليم
'.settings5' // لا تنسى ذكرا الله
][version],
selected : my_getcookie('fara_theme_color') || 'ارختيار', // selected theme
// color palettes
palette : {
'Show signature' : '',
'Hide signature' : [],
},
// change the current theme
change : function(color, select) {
var head = $('head'),
style = document.getElementById('fara_theme_style');
my_setcookie('fara_theme_color', color, true); // update selected theme
// remove old styles
if (style) {
head[0].removeChild(style);
}
// Random / Normal Themes
if (!/Select a theme|Rainbow/.test(color) && fara_theme_color.palette[color]) {
fara_theme_color.selected = color == 'Hide signature' ? fara_theme_color.palette['Hide signature'][Math.floor(Math.random() * fara_theme_color.palette['Hide signature'].length)] : color;
fara_theme_color.selector.style.backgroundColor = fara_theme_color.palette[fara_theme_color.selected][1];
fara_theme_color.selector.style.borderColor = fara_theme_color.palette[fara_theme_color.selected][2];
head.append('<style type="text/css" id="fara_theme_style">' + fara_theme_color.css() + '</style>');
} else if (color == 'Rainbow') { // Rainbow theme
if (fara_theme_color.stop) {
fara_theme_color.selected = color;
fara_theme_color.selector.style.backgroundColor = fara_theme_color.palette[select][1];
fara_theme_color.selector.style.borderColor = fara_theme_color.palette[select][2];
head.append('<style type="text/css" id="fara_theme_style">' + fara_theme_color.css(select) + '</style>');
} else {
fara_theme_color.rainbow();
}
} else { // No theme
fara_theme_color.selector.style.backgroundColor = '#1e88e5';
fara_theme_color.selector.style.borderColor = '#1e88e5';
}
// delete rainbow assets if it's not selected
if (color != 'Rainbow' && fara_theme_color.stop) {
if (!fara_theme_color.transition_all) {
head[0].removeChild(document.getElementById('fa_rainbow_smoothness'));
}
window.clearInterval(fara_theme_color.interval);
delete fara_theme_color.index;
delete fara_theme_color.stop;
}
},
// get and return the theme CSS per version
css : function(select) {
var palette = fara_theme_color.palette[select || fara_theme_color.selected],
all = '::-webkit-scrollbar-track { background:#1f537b; padding: 9px;}'+
'::-webkit-scrollbar-button:horizontal:increment { background-position:-51px 0; padding: 9px; }'+
'::-webkit-scrollbar-thumb:active, ::-webkit-scrollbar-button:active { background-color:' + palette[3] + ' !important; }';
switch (fara_theme_color.version) {
case 3 : // invision
return' .signature_div, .post-signature, .sig-content{
display: none;
}'+
all;
default : // unknown
return ''+
all;
}
},
// get and return the transition CSS per version
// helps make the transition in colors smooth
applyTransitionRules : function() {
switch (fara_theme_color.version) {
default : // unknown
return '';
}
},
// setup the rainbow assets
rainbow : function() {
if (!fara_theme_color.transition_all) {
$('head').append('<style type="text/css" id="fa_rainbow_smoothness">' + fara_theme_color.applyTransitionRules() + '</style>');
}
fara_theme_color.index = 0;
fara_theme_color.stop = fara_theme_color.palette['Hide signature'].length;
fara_theme_color.change('Rainbow', fara_theme_color.palette['Hide signature'][fara_theme_color.index]);
fara_theme_color.interval = window.setInterval(function() {
if (++fara_theme_color.index >= fara_theme_color.stop) {
}
fara_theme_color.change('Rainbow', fara_theme_color.palette['Hide signature'][fara_theme_color.index]);
}, fara_theme_color.transition + fara_theme_color.delay);
}
};
var htmlStr = '', i;
// put together the theme options and random array
for (i in fara_theme_color.palette) {
if (typeof fara_theme_color.palette[i] != 'undefined') {
if (!/Random theme|Select a theme|Rainbow/.test(i)) {
fara_theme_color.palette['Hide signature'][fara_theme_color.palette['Hide signature'].length] = i;
}
htmlStr += '<option value="' + i + '" ' + ( fara_theme_color.selected == i ? 'selected="true"' : '' ) + ' style="background-color:' + (/Random theme|Select a theme|Rainbow/.test(i) ? '#FFF;color:#000;' : fara_theme_color.palette[i][2]) + '">' + i + '</option>';
}
}
// create the theme selector
fara_theme_color.selector = $('<select id="signaturehide" />').html(htmlStr).change(function() {
fara_theme_color.change(this.value);
})[0];
fara_theme_color.change(fara_theme_color.selected); // apply the selected theme
// add the theme selector to the document
$(function() {
$(fara_theme_color.attachTo).after([fara_theme_color.selector, $('<div class="clear" />')[0]]);
});
// basic styles for the theme selector
document.write('<style type="text/css">signaturehide {margin:3px; padding: 9px;}' + ( fara_theme_color.transition_all ? fara_theme_color.applyTransitionRules() : '' ) + '</style>');
}());
$(function(){
$(".settings8,
.settings8 ").css({
"display": "inline-block",
"overflow": "hidden",
});
'هذا الكود تم تعديله بواسطة كونان2000: (◔◡◔)';
});
$(function(){
$("select#signaturehide,
select#signaturehide ").css({
"background-color": "#1e88e5",
"font-size": "12px",
"color": "azure",
});
'هذا الكود تم تعديله بواسطة كونان2000: (◔◡◔)';
});
-------------------------------------------------------------------
كونان2000- Forumember
-
Posts : 36
Reputation : 21
Language : arabic
SarkZKalie and jucarese like this post

» signatures don't show in posts
» Signatures wont show up in posts
» hide category + hide popup + pictures for posts
» Hide All Signatures for A Profile
» Hide / Unhide signatures
» Signatures wont show up in posts
» hide category + hide popup + pictures for posts
» Hide All Signatures for A Profile
» Hide / Unhide signatures
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum