add points via profile

View previous topic View next topic Go down

add points via profile Empty add points via profile

Post by _Twisted_Mods_ 1/23/2015, 12:52 pm

_Twisted_Mods_
_Twisted_Mods_
Founder
Founder

Posts : 101
Reputation : 3
Birthday : 1986-08-05
Join date : 2014-10-03
Age : 37
Location : USA

this will allow admins to add points via the profile page .. its for phpbb3 if requested i will make it for other versions

add points via profile GIawUzPOTkWAkw0wwE2U+profilepoints



phpbb3


[script=Your choice=in all pages]
Code:
$(function(){
if(location.href.match(/\/u\d+/)){
if(_userdata.user_level==1){
var userid = $('#tabs a:last').attr('href');
jQuery('#tmpt_stnotice').text('Loading..');
userid = userid.match(/\/u(\d+)/);
 var uuid= userid[1];
jQuery('#cp-main').after('<div id="cp-main" class="tm_points"><h1><font color="white">Add Points To User</font></h1><div id="tm_phold"><table cellspacing="1"><thead><tr class="header"><th style="width:33.3%">Username</th><th style="width:33.3%;">Points</th><th style="width:33.3%">New value</th></tr></thead><tbody class="center"><tr><td><span id="namee">User Name</span></td><td><span id="points">+00</span></td><td><input name="tmnew_value" type="text"></td></tr></tbody></table><br> <center><input value="Save" class="tms-button" type="button"><span id="tmpt_stnotice">Idle...</span></center></div></div> ');
jQuery.get('http://liquidcode.forumotion.com/admin/index.forum?part=users_groups&sub=users&mode=edit&extended_admin=1&u='+uuid+'&tid='+document.getElementById('logout').href.replace(/.*tid=(.*?)&.*/,'$1') ,function(data){
var group = jQuery('tr:contains(Points) .row2', data).eq(0).text();
jQuery('#tm_phold tbody tr input').val('+'+group);
 jQuery('#tm_phold #points').text('+'+group);
 jQuery('#tm_phold #namee').text(jQuery('.page-title span').text());
}).done(function(){
 jQuery('#tmpt_stnotice').text('Loaded....');
 });

$('.tms-button').click(function(){
 var ttt = jQuery('#tm_phold tbody tr input').val();
 ttt=ttt.replace('+','');

 var uun = jQuery('.page-title span').text();
 jQuery('#tmpt_stnotice').text('Adding Points');
jQuery.post('/admin/index.forum?part=modules&sub=point&mode=don&extended_admin=1&tid='+document.getElementById('logout').href.replace(/.*tid=(.*?)&.*/,'$1')+'&points_new_value%5B'+uuid+'%5D='+ ttt, {
 action: 'add_points_for_user',
 search_user: uun,
 submit: 1
 
                          }).done(function(){
 jQuery('#tmpt_stnotice').text('Verifying Points Was Added');
 
 jQuery.get('http://liquidcode.forumotion.com/admin/index.forum?part=users_groups&sub=users&mode=edit&extended_admin=1&u='+uuid+'&tid='+document.getElementById('logout').href.replace(/.*tid=(.*?)&.*/,'$1') ,function(data){
var group = jQuery('tr:contains(Points) .row2', data).eq(0).text();
 group=group.replace('+','');
 var curpointz = jQuery('#tm_phold tbody tr input').val();
 curpointz = curpointz.replace('+','');
if (group==curpointz){
 jQuery('#tm_phold #points').text('+'+group);
 jQuery('#tmpt_stnotice').text('Done.. Points Added');
}else{
 jQuery('#tmpt_stnotice').text('Verifying Failed Points Was Not Added');
}
 });});});};};});

[css]
Code:
#tm_phold table{margin-left:auto;margin-right:auto;text-align:center;width:100%;font-size:12px;font-weight:bold;}
#tm_phold .header th{border-bottom:1px solid white;padding:5px;}
#tm_phold tbody tr td{padding-top:5px !important;}
#tm_phold {border: 0px 0px 5px white;border-radius:5px;}
.tm_points h1{border-bottom:1px solid white !important;display:block!important;width:50%;text-align:center;
 margin-left:auto!important;margin-right:auto!important;}
.tms-button{
    background-image: url("http://2img.net/i/fa/admin/icon_ok.gif");
    color: #6C0;
    border: 1px solid #8FD534;
    margin: 2px 0px 2px 20px;
padding: 0px 5px 0px 16px;
cursor: pointer;
background-repeat: no-repeat;
direction: ltr;
 background-color: #777;
 font-size: 120%;
font-weight: normal;
}
#tmpt_stnotice{margin-left:10%;width:150px;display:inline-block}
.tm_points{margin-top:10px}

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum