Advertise Here

Author Topic: [Code] Reason to Edit Karma  (Read 11792 times)

0 Members and 1 Guest are viewing this topic.

Offline Agent Moose

  • Moderator
  • *****
  • Posts: 836
  • Do not PM me for Code Support or Request
    • View Profile

  • Total Badges: 32
    Badges: (View All)
    Search Level 6 Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary
[Code] Reason to Edit Karma
« on: June 12, 2009, 07:30:11 am »
Add this to your headers if you don't have it already:
Code: [Select]
<script src="/jquery.js"></script>
Footers:
Code: [Select]
<script type="text/javascript">
var i = ""; var r = ""; var b = "";
//Created by Agent Moose (revolutionx.smfforfree3.com)
$("td[width='16%'] b a").each(function(){
if(this.href.match(/u=(.*)/i)){
i = RegExp.$1;
r = $(this).parent().next().find("a[href*='sa=applaud']").attr("href");
b = $(this).parent().next().find("a[href*='sa=smite']").attr("href");
$(this).parent().next().find("a[href*='sa=applaud']").each(function(){
this.href = "javascript:void(0);";
this.onclick = function(){ Red(); };
});
$(this).parent().next().find("a[href*='sa=smite']").each(function(){
this.href = "javascript:void(0);";
this.onclick = function(){ Blue(); };
});};});
function Red(){ var x = prompt("Reason:",""); if(x){ $.post(smf_scripturl + "?action=comment&sa=add2",{comment: "[b][color=green]Karma Added!  Reason:[/color][/b]\n" + x, userid: i}); alert("Reason Posted!"); window.location = r; }else if(!x){ alert("You must enter a reason!"); };};
function Blue(){ var v = prompt("Reason:",""); if(v){ $.post(smf_scripturl + "?action=comment&sa=add2",{comment: "[b][color=red]Karma Subtracted!  Reason:[/color][/b]\n" + v, userid: i}); alert("Reason Posted!"); window.location = b; }else if(!v){ alert("You must enter a reason!"); };};
</script>


Original Request: http://revolutionx.smfforfree3.com/index.php/topic,553.0.html

When you click on the links that add/subtract karma from a person, a pop-up will show up where you can add a reason for Adding/Subtracting karma from that user.

Enjoy :)
« Last Edit: June 12, 2009, 07:36:06 am by Agent Moose »
Check out Revolution X's Brand new Code Index!

Offline B E N E L

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

  • Total Badges: 11
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 50 Posts
Re: [Code] Reason to Edit Karma
« Reply #1 on: June 17, 2009, 05:39:06 pm »
Thanks very much helpfull ;) now people kno why they got rated and from who thanks alot. :)


EDIT: It's not working for me either :o
« Last Edit: June 20, 2009, 05:36:36 pm by B E N E L »
BEST RSPS CLICK SIG DL THE CLIENT Here Runelocus CLICK HERE JOIN!!

Offline мσנσвσנσ82

  • SMF For Free Sr. Member
  • *
  • Posts: 310
    • View Profile
    • Darkilscape

  • Total Badges: 14
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Code] Reason to Edit Karma
« Reply #2 on: June 19, 2009, 06:48:34 pm »
Where does it show up?



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: [Code] Reason to Edit Karma
« Reply #3 on: June 19, 2009, 06:52:04 pm »
Where does it show up?

Its supposed to show up when you add or subtract karma for anyone. This one didnt work for me though.

Offline B E N E L

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

  • Total Badges: 11
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 50 Posts
Re: [Code] Reason to Edit Karma
« Reply #4 on: June 24, 2009, 02:28:36 pm »
It needs to be fixed, cause i want to use it :(
BEST RSPS CLICK SIG DL THE CLIENT Here Runelocus CLICK HERE JOIN!!

Offline simply sibyl

  • Helpers
  • *
  • Posts: 14347
  • On hiatus
    • View Profile
    • The Tent Dwellers

  • Total Badges: 31
    Badges: (View All)
    Level 6 Poll Voter Webmaster Arcade Highscore Windows User
Re: [Code] Reason to Edit Karma
« Reply #5 on: June 24, 2009, 02:32:19 pm »
It needs to be fixed, cause i want to use it :(


1.  Post the code you used so we can look at it.
2.  Did you put this in your header?    <script src="/jquery.js"></script>

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: [Code] Reason to Edit Karma
« Reply #6 on: June 24, 2009, 03:38:06 pm »
This code isnt currently working, and I already told Agent about it and he hasnt responded, so, wel'll just have to see if he can fix it soon.

Offline Agent Moose

  • Moderator
  • *****
  • Posts: 836
  • Do not PM me for Code Support or Request
    • View Profile

  • Total Badges: 32
    Badges: (View All)
    Search Level 6 Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary
Re: [Code] Reason to Edit Karma
« Reply #7 on: June 25, 2009, 11:32:52 am »
I didn't get anything about this not working...

But anyway, I don't get why it wouldn't work.  I havn't chagned anything with it.
Check out Revolution X's Brand new Code Index!

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: [Code] Reason to Edit Karma
« Reply #8 on: June 25, 2009, 12:05:47 pm »
I posted it in the thread on RX found HERE
I also sent you a PM once on RX, saying this wasnt working.

Offline simply sibyl

  • Helpers
  • *
  • Posts: 14347
  • On hiatus
    • View Profile
    • The Tent Dwellers

  • Total Badges: 31
    Badges: (View All)
    Level 6 Poll Voter Webmaster Arcade Highscore Windows User
Re: [Code] Reason to Edit Karma
« Reply #9 on: June 25, 2009, 12:21:49 pm »
I just tried this code on my test forum and it worked perfectly.
NOTE:  I tested this ONLY with Internet Explorer.    

It adds a Comment to the persons Profile Comments and sends them a PM telling them a new Comment has been made to their Profile Comments page.   They will only get this PM if they have this option checked in their Profile under Look and Layout Preferences>Notify when comments are posted on your profile page    It will still post it to the Profile Comments however.

See attached screenshot for what it puts on the Profile Comments.

It works even if you change the names for the Karma Label and applaud and smite in the Karma settings.   I checked that as well.

Your security settings in IE and possible settings in Firefox (Ive not tested with FF) could interfere with your being able to see/use this when you applaud/smite a member.     When doing so with IE,  (because of my IE security settings)   I get a notice at the top of the screen that says:  The website is using a scripted window to ask you for information.   If you trust this website click here to allow scripted windows.       That is not because of an issue with the code - it is totally related to my IE security settings.   You may/may not get this notice depending on your own settings in IE.   Also note that you must have javascript enabled in your browser.    
« Last Edit: June 25, 2009, 12:41:21 pm by simply sibyl »

Offline B E N E L

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

  • Total Badges: 11
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 50 Posts
Re: [Code] Reason to Edit Karma
« Reply #10 on: June 25, 2009, 12:42:56 pm »
My main internet is EX i never use FF
Code: [Select]
<script type="text/javascript">
var i = ""; var r = ""; var b = "";
//Created by Agent Moose (revolutionx.smfforfree3.com)
$("td[width='16%'] b a").each(function(){
if(this.href.match(/u=(.*)/i)){
i = RegExp.$1;
r = $(this).parent().next().find("a[href*='sa=applaud']").attr("href");
b = $(this).parent().next().find("a[href*='sa=smite']").attr("href");
$(this).parent().next().find("a[href*='sa=applaud']").each(function(){
this.href = "javascript:void(0);";
this.onclick = function(){ Red(); };
});
$(this).parent().next().find("a[href*='sa=smite']").each(function(){
this.href = "javascript:void(0);";
this.onclick = function(){ Blue(); };
});};});
function Red(){ var x = prompt("Reason:",""); if(x){ $.post(smf_scripturl + "?action=comment&sa=add2",{comment: "[b][color=green]Karma Added!  Reason:[/color][/b]\n" + x, userid: i}); alert("Reason Posted!"); window.location = r; }else if(!x){ alert("You must enter a reason!"); };};
function Blue(){ var v = prompt("Reason:",""); if(v){ $.post(smf_scripturl + "?action=comment&sa=add2",{comment: "[b][color=red]Karma Subtracted!  Reason:[/color][/b]\n" + v, userid: i}); alert("Reason Posted!"); window.location = b; }else if(!v){ alert("You must enter a reason!"); };};
</script>

i used that and yes i do have this
Code: [Select]
<script src="/jquery.js"></script> added, But anyways not that important :o
BEST RSPS CLICK SIG DL THE CLIENT Here Runelocus CLICK HERE JOIN!!

Offline simply sibyl

  • Helpers
  • *
  • Posts: 14347
  • On hiatus
    • View Profile
    • The Tent Dwellers

  • Total Badges: 31
    Badges: (View All)
    Level 6 Poll Voter Webmaster Arcade Highscore Windows User
Re: [Code] Reason to Edit Karma
« Reply #11 on: June 25, 2009, 12:47:20 pm »
hi B E N E L

I editd my post a little bit ago -  you may have seen it before the edits.
How and if this works for you and your members (using IE mind you- I have not tested with FF) will depend on your security settings in IE,  AND/OR if you have javascript enabled or not.    Would also be good to be sure you are using the current Java version.   (this site is excellent for checking to be sure you are up to date for that and more:   http://secunia.com/vulnerability_scanning/online/ )   Click the red "Start Scanner" button when you get there.


NOTE:   I tested this using IE 7.0     I do not know if there may be an issue with it with IE 8.0 but the above should still apply
« Last Edit: June 25, 2009, 12:54:44 pm by simply sibyl »

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: [Code] Reason to Edit Karma
« Reply #12 on: June 25, 2009, 01:58:47 pm »
Ah *snaps* guess this is just one of those codes that dont wanna work in all browsers :(

Offline B E N E L

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

  • Total Badges: 11
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 50 Posts
Re: [Code] Reason to Edit Karma
« Reply #13 on: June 25, 2009, 02:04:28 pm »
Yep :( ima try the scanning tho ;)
BEST RSPS CLICK SIG DL THE CLIENT Here Runelocus CLICK HERE JOIN!!

Offline Agent Moose

  • Moderator
  • *****
  • Posts: 836
  • Do not PM me for Code Support or Request
    • View Profile

  • Total Badges: 32
    Badges: (View All)
    Search Level 6 Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary
Re: [Code] Reason to Edit Karma
« Reply #14 on: June 27, 2009, 09:12:43 am »
Ah *snaps* guess this is just one of those codes that dont wanna work in all browsers :(

Andrew, you use Firefox right?  Well, I create all my codes in FF, meaning I got it to work.  I don't know really why it doesn't want to work for some people.
Check out Revolution X's Brand new Code Index!

 

Related Topics

  Subject / Started by Replies Last post
20 Replies
5731 Views
Last post January 09, 2009, 09:44:08 pm
by Andrew
11 Replies
4488 Views
Last post February 01, 2009, 12:36:15 pm
by Andrew
0 Replies
1262 Views
Last post February 14, 2009, 07:13:22 am
by Andrew
9 Replies
2576 Views
Last post May 10, 2009, 04:22:14 pm
by Andrew
1 Replies
1297 Views
Last post April 24, 2009, 06:42:29 pm
by Andrew