REGISTER or LOGIN to have the annoying ads removed.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Some of my own myCodes
#1
Really motivated of writing some myCodes i started to test some codes and i got 2 of them to work Big Grin

Ticker-myCode:

its a really simple code, nothin big enough to describe it further Big Grin
(im on my way improving this, but i need some more time and help by some veteran coders Big Grin)
Feel free to edit the ticker like ur own expectations are.

regular expression:
Code:
\[ticker\](.*?)\[/ticker\]
replaced:
Code:
<marquee style="width:200px;border:1px dashed black;font-family:verdana;font-size:11pt;color:black;background-color:#F9F9F9;" direction=left>++ $1 ++</marquee>

Browser-Information:
sometimes i need some informations about the browser of the current viewer to modify some settings etc.
Here i wrote a myCode which displays the current Browser-Informations of the current thread-viewer.
Its nothin new and not a big deal, i just wanted to test this, and it has worked Big Grin
sure its not complete yet, but u can add some ur own lines, at last its just JavaScript, not difficult to learn =P

Regular:
Code:
\[browser-info\]
replaced:
Code:
<script language="JavaScript">
var temp = navigator.userAgent;
var splitted = temp.split(";");
var ie = splitted[1];
var ff = splitted[splitted.length-1].split(" ")[3];
var browser = "";
var pre = "<tr valign=top><td align=left style='border-bottom:2px dotted #E0E0E0'><b>";
var middle = "</b></td><td align=right style='border-bottom:2px dotted #E0E0E0'>";
var end = "</td></tr>";
var cookies = "<font color=red>disabled</font>";
var java = "<font color=red>disabled</font>";
if (navigator.cookieEnabled) cookies = "<font color=green>enabled</font>";
  if (navigator.javaEnabled()) java = "<font color=green>enabled</font>";
   if (/MSIE/g.test(ie)) browser = ie;
    if (/Firefox/g.test(ff)) browser = ff;
document.write("<table border=0 width=370 cellspacing=0 style='padding:4px;border:1px dashed black;background-color:#F9F9F9;font-family:verdana;font-size:11pt;'>");
document.write(pre+"Codename:"+middle+navigator.appCodeName+end);
document.write(pre+"Browser-Name:"+middle+navigator.appName+end);
document.write(pre+"Browser-Version:"+middle+browser+end);
document.write(pre+"Cookies:"+middle+cookies+end);
document.write(pre+"Java-Applets:"+middle+java+end);
document.write(pre+"Platform:"+middle+navigator.platform+end);
document.write(pre+"Color-Depth:"+middle+screen.colorDepth+"bit"+end);
document.write(pre+"Screen-Resolution:"+middle+screen.width+"x"+screen.height+end);
document.write("</table></span>");
</script>

plz try out this myCodes and report back if they work, especially the Browser-Informations.

regards,
animus
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Need help in creating own MyCodes XxAnimusxX 0 1,720 Dec 29, 2006, 03:36 PM
Last Post: XxAnimusxX

Forum Jump:


Users browsing this thread: 1 Guest(s)