Post by waverunner24 on Apr 30, 2007 9:17:26 GMT -5
Hi there, I'm new to the board. I was wondering if it was possible to modify the PM notifier code with a particular image? I tried , but the image I chose to use was too large. Can this be adjusted?
This is the PM code I used
<script type="text/javascript">
/*------------------------- --------*\
| P M Notifier
| (C) Simie 2006 - Present
| Do not repost without permission
\*--------------------------------- */
var imageUrl = 'http://img174.imageshack.us/img174/88/exclamationsb1.png';
// Edit Above
var td = document.getElementsByTagName("td");
var newPMs = (td[2].innerHTML.match(/(\d+)\s(are|is)\s/i))? RegExp.$1 : false;
if(newPMs > 0){
var t;
var holder = document.createElement('div');
holder.id='holder';
holder.style.width='100px';
holder.style.height='100px';
holder.style.position='absolute';
holder.style.right='0px';
holder.style.top='0px';
//holder.style.backgroundColor='EFEFEF';
holder.className = 'windowbg';
holder.style.border = '1px solid black';
var spanLeft = document.createElement('span');
spanLeft.style.cssFloat = 'left';
var spanRight = document.createElement('span');
spanRight.style.cssFloat = 'right';
spanRight.id = 'spanRight';
spanRight.style.textAlign = 'center';
var A = document.createElement('a');
A.id = 'theA';
A.href = "javascript:collapse()";
A.title = 'Close';
var excla = document.createElement('img');
excla.src = imageUrl;
excla.border = '0';
excla.style.border = '1px solid black';
excla.width = '99';
excla.height = '99';
A.appendChild(excla);
spanLeft.appendChild(A);
var theSpan = document.createElement('span');
theSpan.id = 'theSpan';
theSpan.style.marginRight = '20px';
theSpan.style.marginBottom = '20px';
spanRight.appendChild(theSpan);
holder.appendChild(spanLeft);
holder.appendChild(spanRight);
document.getElementsByTagName('body')[0].appendChild(holder);
setTimeout('flash()', 1000);
}
function expand(timeout){
if(timeout){
setTimeout('collapse(1)', 5000);
}
var holder = document.getElementById('holder');
var width = holder.style.width;
var height = holder.style.height;
var top = holder.style.top;
var right = holder.style.right;
if(parseInt(width) < 300){
holder.style.width = parseInt(width)+4+'px';
//holder.style.height = parseInt(height)+1+'px';
holder.style.top = parseInt(top)+4+'px';
holder.style.right = parseInt(right)+6+'px';
setTimeout('expand()', 1);
} else {
document.getElementById('theA').href='javascript:collapse(1);';
hide();
}
}
function hide(){
if(document.getElementById('theSpan').hasChildNodes()){
document.getElementById('theSpan').style.display="";
} else {
var all = document.createDocumentFragment();
if(newPMs > 1){
var text = document.createTextNode("You have "+newPMs+" new messages!!!");
} else {
var text = document.createTextNode("You have "+newPMs+" new message!");
}
all.appendChild(text);
var br = document.createElement('br');
all.appendChild(br);
all.appendChild(document.createTextNode('[ '));
var aInbox = document.createElement('a');
aInbox.href = '/index.cgi?action=pm';
aInbox.appendChild(document.createTextNode('Inbox'));
all.appendChild(aInbox);
all.appendChild(document.createTextNode(' | '));
var aCompose = document.createElement('a');
aCompose.href= '/index.cgi?action=pmsend';
aCompose.appendChild(document.createTextNode('New Message'));
all.appendChild(aCompose);
all.appendChild(document.createTextNode(' ]'));
document.getElementById('theSpan').appendChild(all);
}
}
function collapse(remove){
var holder = document.getElementById('holder');
var width = holder.style.width;
var height = holder.style.height;
var top = holder.style.top;
var right = holder.style.right;
if(parseInt(width) > 100){
holder.style.width = parseInt(width)-2+'px';
/*if(t == 1){
holder.style.height = parseInt(height)-1+'px';
t = 0;
} else {
t=1;
}*/
holder.style.top = parseInt(top)-2+'px';
holder.style.right = parseInt(right)-3+'px';
setTimeout('collapse(0)', 1);
} else {
document.getElementById('theA').href='javascript:expand();';
}
if(remove){
document.getElementById('theSpan').style.display="none";
if(!document.cookie.match(/PMshown\=1/)){
document.cookie = 'PMshown=1';
}
}
}
function flash(){
document.getElementById('holder').style.display="none";
setTimeout('flash2()', 500);
}
function flash2(){
document.getElementById('holder').style.display="";
if(!document.cookie.match(/PMshown\=1/)){
setTimeout('expand(1)', 500);
}
}
</script>
And, THIS is the image I would like to use instead of the exclamation ( It's STILL cool, but i would like this one instead )
I'm sorry for the long post, but if you could help me, I would be so greatful Thanks
This is the PM code I used
<script type="text/javascript">
/*------------------------- --------*\
| P M Notifier
| (C) Simie 2006 - Present
| Do not repost without permission
\*--------------------------------- */
var imageUrl = 'http://img174.imageshack.us/img174/88/exclamationsb1.png';
// Edit Above
var td = document.getElementsByTagName("td");
var newPMs = (td[2].innerHTML.match(/(\d+)\s(are|is)\s/i))? RegExp.$1 : false;
if(newPMs > 0){
var t;
var holder = document.createElement('div');
holder.id='holder';
holder.style.width='100px';
holder.style.height='100px';
holder.style.position='absolute';
holder.style.right='0px';
holder.style.top='0px';
//holder.style.backgroundColor='EFEFEF';
holder.className = 'windowbg';
holder.style.border = '1px solid black';
var spanLeft = document.createElement('span');
spanLeft.style.cssFloat = 'left';
var spanRight = document.createElement('span');
spanRight.style.cssFloat = 'right';
spanRight.id = 'spanRight';
spanRight.style.textAlign = 'center';
var A = document.createElement('a');
A.id = 'theA';
A.href = "javascript:collapse()";
A.title = 'Close';
var excla = document.createElement('img');
excla.src = imageUrl;
excla.border = '0';
excla.style.border = '1px solid black';
excla.width = '99';
excla.height = '99';
A.appendChild(excla);
spanLeft.appendChild(A);
var theSpan = document.createElement('span');
theSpan.id = 'theSpan';
theSpan.style.marginRight = '20px';
theSpan.style.marginBottom = '20px';
spanRight.appendChild(theSpan);
holder.appendChild(spanLeft);
holder.appendChild(spanRight);
document.getElementsByTagName('body')[0].appendChild(holder);
setTimeout('flash()', 1000);
}
function expand(timeout){
if(timeout){
setTimeout('collapse(1)', 5000);
}
var holder = document.getElementById('holder');
var width = holder.style.width;
var height = holder.style.height;
var top = holder.style.top;
var right = holder.style.right;
if(parseInt(width) < 300){
holder.style.width = parseInt(width)+4+'px';
//holder.style.height = parseInt(height)+1+'px';
holder.style.top = parseInt(top)+4+'px';
holder.style.right = parseInt(right)+6+'px';
setTimeout('expand()', 1);
} else {
document.getElementById('theA').href='javascript:collapse(1);';
hide();
}
}
function hide(){
if(document.getElementById('theSpan').hasChildNodes()){
document.getElementById('theSpan').style.display="";
} else {
var all = document.createDocumentFragment();
if(newPMs > 1){
var text = document.createTextNode("You have "+newPMs+" new messages!!!");
} else {
var text = document.createTextNode("You have "+newPMs+" new message!");
}
all.appendChild(text);
var br = document.createElement('br');
all.appendChild(br);
all.appendChild(document.createTextNode('[ '));
var aInbox = document.createElement('a');
aInbox.href = '/index.cgi?action=pm';
aInbox.appendChild(document.createTextNode('Inbox'));
all.appendChild(aInbox);
all.appendChild(document.createTextNode(' | '));
var aCompose = document.createElement('a');
aCompose.href= '/index.cgi?action=pmsend';
aCompose.appendChild(document.createTextNode('New Message'));
all.appendChild(aCompose);
all.appendChild(document.createTextNode(' ]'));
document.getElementById('theSpan').appendChild(all);
}
}
function collapse(remove){
var holder = document.getElementById('holder');
var width = holder.style.width;
var height = holder.style.height;
var top = holder.style.top;
var right = holder.style.right;
if(parseInt(width) > 100){
holder.style.width = parseInt(width)-2+'px';
/*if(t == 1){
holder.style.height = parseInt(height)-1+'px';
t = 0;
} else {
t=1;
}*/
holder.style.top = parseInt(top)-2+'px';
holder.style.right = parseInt(right)-3+'px';
setTimeout('collapse(0)', 1);
} else {
document.getElementById('theA').href='javascript:expand();';
}
if(remove){
document.getElementById('theSpan').style.display="none";
if(!document.cookie.match(/PMshown\=1/)){
document.cookie = 'PMshown=1';
}
}
}
function flash(){
document.getElementById('holder').style.display="none";
setTimeout('flash2()', 500);
}
function flash2(){
document.getElementById('holder').style.display="";
if(!document.cookie.match(/PMshown\=1/)){
setTimeout('expand(1)', 500);
}
}
</script>
And, THIS is the image I would like to use instead of the exclamation ( It's STILL cool, but i would like this one instead )
I'm sorry for the long post, but if you could help me, I would be so greatful Thanks