Advertise Here

Author Topic: Need some code help  (Read 2053 times)

0 Members and 1 Guest are viewing this topic.

Offline Sherry

  • SMF For Free Full Member
  • *
  • Posts: 119
    • View Profile

  • Total Badges: 11
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 100 Posts
Need some code help
« on: February 14, 2009, 01:52:28 pm »
Forum Url: http://pittcountymomsclub.smfforfree2.com
I got this code from Agent Moose. I can not get it to work though so I hope someone can help me.

Here is the code

Code: [Select]
<script>
function P_A(){
//Created by Agent Moose at smcodes.smfforfree3.com
var Awards = new Array();
Awards[Awards.length] = ["100","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=100posts.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/100posts.png" border="0" alt="Photobucket"></a>"];
Awards[Awards.length] = ["200","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=200posts.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/200posts.png" border="0" alt="Photobucket"></a>"]
Awards[Awards.length] = ["300","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=300posts.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/300posts.png" border="0" alt="Photobucket"></a>"]
Awards[Awards.length] = ["400","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=400posts.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/400posts.png" border="0" alt="Photobucket"></a>"]
Awards[Awards.length] = ["500","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=500posts.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/500posts.png" border="0" alt="Photobucket"></a>"]
Awards[Awards.length] = ["750","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=750posts.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/750posts.png" border="0" alt="Photobucket"></a>"]
Awards[Awards.length] = ["1000","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=1000posts-1.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/1000posts-1.png" border="0" alt="Photobucket"></a>"]
Awards[Awards.length] = ["1500","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=1500posts.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/1500posts.png" border="0" alt="Photobucket"></a>"]
Awards[Awards.length] = ["2000","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=2000posts-1.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/2000posts-1.png" border="0" alt="Photobucket"></a>"]
Awards[Awards.length] = ["2500","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=2500posts.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/2500posts.png" border="0" alt="Photobucket"></a>"]
Awards[Awards.length] = ["3000","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=3000posts-1.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/3000posts-1.png" border="0" alt="Photobucket"></a>"]

c = document.getElementsByTagName("div");
for (a=0;a<c.length;a++)
for (v=0;v<Awards.length;v++)
if(location.href.match(/topic,/i)){
if((c[a].className=="smalltext") && (c[a].innerHTML.match(/Posts: (\d+)/))){
if(RegExp.$1 == Awards[v][0]){
c[a].innerHTML+="<br /><b>Awards</b>: " + Awards[v][1];
};};};};
P_A();
</script>

Offline Seldom Fail

  • Helpers
  • *
  • Posts: 2082
  • Helping for 3 years! :)
    • View Profile
    • My Site!

  • Total Badges: 26
    Badges: (View All)
    Sixth year Anniversary Fifth year Anniversary Apple User Search Poll Voter
Re: Need some code help
« Reply #1 on: February 14, 2009, 02:03:02 pm »
Forum Url: http://pittcountymomsclub.smfforfree2.com
I got this code from Agent Moose. I can not get it to work though so I hope someone can help me.

Here is the code

Code: [Select]
<script>
function P_A(){
//Created by Agent Moose at smcodes.smfforfree3.com
var Awards = new Array();
Awards[Awards.length] = ["100","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=100posts.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/100posts.png" border="0" alt="Photobucket"></a>"];
Awards[Awards.length] = ["200","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=200posts.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/200posts.png" border="0" alt="Photobucket"></a>"]
Awards[Awards.length] = ["300","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=300posts.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/300posts.png" border="0" alt="Photobucket"></a>"]
Awards[Awards.length] = ["400","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=400posts.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/400posts.png" border="0" alt="Photobucket"></a>"]
Awards[Awards.length] = ["500","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=500posts.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/500posts.png" border="0" alt="Photobucket"></a>"]
Awards[Awards.length] = ["750","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=750posts.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/750posts.png" border="0" alt="Photobucket"></a>"]
Awards[Awards.length] = ["1000","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=1000posts-1.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/1000posts-1.png" border="0" alt="Photobucket"></a>"]
Awards[Awards.length] = ["1500","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=1500posts.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/1500posts.png" border="0" alt="Photobucket"></a>"]
Awards[Awards.length] = ["2000","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=2000posts-1.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/2000posts-1.png" border="0" alt="Photobucket"></a>"]
Awards[Awards.length] = ["2500","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=2500posts.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/2500posts.png" border="0" alt="Photobucket"></a>"]
Awards[Awards.length] = ["3000","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=3000posts-1.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/3000posts-1.png" border="0" alt="Photobucket"></a>"]

c = document.getElementsByTagName("div");
for (a=0;a<c.length;a++)
for (v=0;v<Awards.length;v++)
if(location.href.match(/topic,/i)){
if((c[a].className=="smalltext") && (c[a].innerHTML.match(/Posts: (\d+)/))){
if(RegExp.$1 == Awards[v][0]){
c[a].innerHTML+="<br /><b>Awards</b>: " + Awards[v][1];
};};};};
P_A();
</script>

What's the code for and where did you place it?
<--- Donate to SMF For Free! :D

Offline Sherry

  • SMF For Free Full Member
  • *
  • Posts: 119
    • View Profile

  • Total Badges: 11
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 100 Posts
Re: Need some code help
« Reply #2 on: February 14, 2009, 02:12:25 pm »
It is for awards when you hit a certain post count. I placed it in my footers where Agent Moose said to put it.

Offline Andrew

  • Helpers
  • *
  • Posts: 2060
  • Andrew at your service
    • View Profile
    • Alabama Weather Prediction

  • Total Badges: 32
    Badges: (View All)
    10 Poll Votes Level 6 Eighth year Anniversary Seventh year Anniversary Sixth year Anniversary
Re: Need some code help
« Reply #3 on: February 14, 2009, 02:18:18 pm »
Ill take this to my test server and see what I can do with it. In the meantime, can you give us the topic that was created here on support for this code?

Offline Sherry

  • SMF For Free Full Member
  • *
  • Posts: 119
    • View Profile

  • Total Badges: 11
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 100 Posts
Re: Need some code help
« Reply #4 on: February 14, 2009, 02:39:20 pm »
I didn't get it from SMFsupport, I got it from SMcodes

Offline Andrew

  • Helpers
  • *
  • Posts: 2060
  • Andrew at your service
    • View Profile
    • Alabama Weather Prediction

  • Total Badges: 32
    Badges: (View All)
    10 Poll Votes Level 6 Eighth year Anniversary Seventh year Anniversary Sixth year Anniversary
Re: Need some code help
« Reply #5 on: February 14, 2009, 03:01:04 pm »
OK, can you PM it to me or post it here? Need to see what this code is exactly supposed to do

Offline Sherry

  • SMF For Free Full Member
  • *
  • Posts: 119
    • View Profile

  • Total Badges: 11
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 100 Posts
Re: Need some code help
« Reply #6 on: February 14, 2009, 03:14:46 pm »

Offline zizach

  • SMF For Free Member
  • *
  • Posts: 22
    • View Profile

  • Total Badges: 10
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 10 Posts
Re: Need some code help
« Reply #7 on: February 14, 2009, 03:22:20 pm »
Code: [Select]
<script>
function P_A(){
//Created by Agent Moose at smcodes.smfforfree3.com
var Awards = new Array();
Awards[Awards.length] = ["100","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=100posts.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/100posts.png" border="0" alt="Photobucket"></a>"];
Awards[Awards.length] = ["200","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=200posts.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/200posts.png" border="0" alt="Photobucket"></a>"];
Awards[Awards.length] = ["300","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=300posts.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/300posts.png" border="0" alt="Photobucket"></a>"];
Awards[Awards.length] = ["400","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=400posts.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/400posts.png" border="0" alt="Photobucket"></a>"];
Awards[Awards.length] = ["500","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=500posts.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/500posts.png" border="0" alt="Photobucket"></a>"];
Awards[Awards.length] = ["750","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=750posts.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/750posts.png" border="0" alt="Photobucket"></a>"];
Awards[Awards.length] = ["1000","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=1000posts-1.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/1000posts-1.png" border="0" alt="Photobucket"></a>"];
Awards[Awards.length] = ["1500","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=1500posts.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/1500posts.png" border="0" alt="Photobucket"></a>"];
Awards[Awards.length] = ["2000","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=2000posts-1.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/2000posts-1.png" border="0" alt="Photobucket"></a>"];
Awards[Awards.length] = ["2500","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=2500posts.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/2500posts.png" border="0" alt="Photobucket"></a>"];
Awards[Awards.length] = ["3000","<a href="http://s412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/?action=view¤t=3000posts-1.png" target="_blank"><img src="http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/3000posts-1.png" border="0" alt="Photobucket"></a>"];

c = document.getElementsByTagName("div");
for (a=0;a<c.length;a++)
for (v=0;v<Awards.length;v++)
if(location.href.match(/topic,/i)){
if((c[a].className=="smalltext") && (c[a].innerHTML.match(/Posts: (\d+)/))){
if(RegExp.$1 == Awards[v][0]){
c[a].innerHTML+="<br /><b>Awards</b>: " + Awards[v][1];
};};};};
P_A();
</script>

I'm not 100% on this but try that.

Offline Sherry

  • SMF For Free Full Member
  • *
  • Posts: 119
    • View Profile

  • Total Badges: 11
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 100 Posts
Re: Need some code help
« Reply #8 on: February 14, 2009, 03:26:15 pm »
That didn't work either.

Offline zizach

  • SMF For Free Member
  • *
  • Posts: 22
    • View Profile

  • Total Badges: 10
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 10 Posts
Re: Need some code help
« Reply #9 on: February 14, 2009, 03:51:12 pm »
Code: [Select]
<script>
function P_A(){
//Created by Agent Moose at smcodes.smfforfree3.com
var Awards = new Array();
Awards[Awards.length] = ["100","<img src=http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/100posts.png />"];
Awards[Awards.length] = ["200","<img src=http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/200posts.png />"]
Awards[Awards.length] = ["300","<img src=http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/300posts.png />"]
Awards[Awards.length] = ["400","<img src=http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/400posts.png />"]
Awards[Awards.length] = ["500","<img src=http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/500posts.png />"]
Awards[Awards.length] = ["750","<img src=http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/750posts.png />"]
Awards[Awards.length] = ["1000","<img src=http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/1000posts-1.png />"]
Awards[Awards.length] = ["1500","<img src=http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/1500posts.png />"]
Awards[Awards.length] = ["2000","<img src=http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/2000posts-1.png />"]
Awards[Awards.length] = ["2500","<img src=http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/2500posts.png />"]
Awards[Awards.length] = ["3000","<img src=http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/3000posts-1.png />"]

c = document.getElementsByTagName("div");
for (a=0;a<c.length;a++)
for (v=0;v<Awards.length;v++)
if(location.href.match(/topic,/i)){
if((c[a].className=="smalltext") && (c[a].innerHTML.match(/Posts: (\d+)/))){
if(RegExp.$1 == Awards[v][0]){
c[a].innerHTML+="<br /><b>Awards</b>: " + Awards[v][1];
};};};};
P_A();
</script>

Alright try this one.

Offline Sherry

  • SMF For Free Full Member
  • *
  • Posts: 119
    • View Profile

  • Total Badges: 11
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 100 Posts
Re: Need some code help
« Reply #10 on: February 14, 2009, 04:20:21 pm »
That one did not work either. I have no idea what is wrong.

Offline zizach

  • SMF For Free Member
  • *
  • Posts: 22
    • View Profile

  • Total Badges: 10
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 10 Posts
Re: Need some code help
« Reply #11 on: February 14, 2009, 04:24:03 pm »
No, it actually does work.

It is made to give you an image for when you have exactly say "100" posts, if you have "101" posts it will not show up.

That is the way Agent Moose created it.

Offline Sherry

  • SMF For Free Full Member
  • *
  • Posts: 119
    • View Profile

  • Total Badges: 11
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 100 Posts
Re: Need some code help
« Reply #12 on: February 14, 2009, 04:30:46 pm »
Oh okay. So the it is not really worth it then.  :'(

Does anyone know of a code that will stay til they reach the next "level"?

Offline zizach

  • SMF For Free Member
  • *
  • Posts: 22
    • View Profile

  • Total Badges: 10
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 10 Posts
Re: Need some code help
« Reply #13 on: February 14, 2009, 05:02:40 pm »
If you have some time on your hands you can do this.

Awards[Awards.length] = ["100","<img src=http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/100posts.png />"];
Awards[Awards.length] = ["101","<img src=http://i412.photobucket.com/albums/pp209/PittCountyMomsClub/Ranks/100posts.png />"];
etc. for each

(Change post thing to 100, 101, 102)

I'm not much with JavaScript so I couldn't tell you a simpler way, sorry.

Offline Sherry

  • SMF For Free Full Member
  • *
  • Posts: 119
    • View Profile

  • Total Badges: 11
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 100 Posts
Re: Need some code help
« Reply #14 on: February 14, 2009, 05:39:24 pm »
Yeah that is what I was thinking but that would take way too much time.

Thanks

 

Related Topics

  Subject / Started by Replies Last post
21 Replies
13379 Views
Last post August 16, 2009, 09:16:42 pm
by [FailSafe]
8 Replies
4467 Views
Last post October 08, 2007, 10:37:44 am
by R u n e s c a p e
8 Replies
4668 Views
Last post November 15, 2007, 11:58:56 am
by simply sibyl
8 Replies
7638 Views
Last post July 09, 2008, 07:17:47 pm
by LaundryLady
1 Replies
2325 Views
Last post November 12, 2008, 07:59:32 am
by simply sibyl