REGISTER or LOGIN to have the annoying ads removed.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ticker-myCode
#1
Hi
good time

Really motivated of writing some myCodes i started to test some codes and i got 2 of them to work
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
#2
nice thanks for sharing
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Spoiler mycode labrocca 14 14,986 Mar 20, 2018, 03:53 PM
Last Post: Polymath
  MyCode Issues / Help / Guidance coolbud012 0 886 Oct 22, 2013, 08:55 AM
Last Post: coolbud012
  Using some MyCode in [CODE] boxes. Tekno Venus 2 1,375 Aug 26, 2012, 04:19 PM
Last Post: Tekno Venus
  How to add mycode for a click to PM hostpro 0 1,019 Mar 24, 2012, 04:32 PM
Last Post: hostpro
  Mycode privileges ? i3urn 3 1,861 Jun 27, 2011, 08:34 AM
Last Post: Oliver Evans

Forum Jump:


Users browsing this thread: 1 Guest(s)