topic profile mood

View previous topic View next topic Go down

topic profile mood

Post by _Twisted_Mods_ on 1/20/2015, 1:48 am

avatar
_Twisted_Mods_
Founder
Founder

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

View user profile
ok im going to try to break this down the best i can. im not the best at tutorials





goto acp>users&groups>profile

add a new field

Type : text zone

Name : Mood

Necessarily filled ? No

Display :  Profile & Messages

Display type : text

Who can modify the profile field value ? Member himself

Save

This new field needs to stay at the top of all the profile fields!


next goto acp>modules>JavaScript management

Enable Javascript code management : Yes ... Save

create a new JavaScript

Title: Moods

Placement: In All Pages

Paste the code below and submit :
Code:
$(function(){
var ftitlen = 'Mood';
var hh = $('dl:contains('+ftitlen+')').attr('id');
var ii = $('dl:contains('+ftitlen+')').find('textarea').attr('id');
$('dl:contains(Mood)').append('<br><font size="4px" color="grey"><b>Name: <font color="red">'+hh+ '</font> , Id: <font color="red">'+ ii+'</font></b></font>');
});


then view someone profile --- not edit profile page




you should see a name and id under the mood field.. you will need them later so copy them to text file




after you have those replace the script that we already created with the one for your version below and switch the placement from all pages to in topics


phpbb2

Code:
//Post Profile Mood Selector By:_Twisted_Mods_
// Special Thanks To Ange Tuteur For Helping And Testing
// Also To SamanthaS For The Idea And List Of Moods
$(function(){
var idd = 'field_id1';
var namee = 'profile_field_2_1';
var list1 = ['None','Very Happy','Happy','Sad','Surprised','Shocked','Cool','Funny','Mad','Witty','Embarassed','Very Sad','Very Mad','Furious','Misunderstood','Good','Creative','Neutral','Like a Star','Suspicious','In Love','Sick','Amusing','Silent','Pale','Out of this World','Hyperactive','Confused','Affraid','Great!','Explosive','Drunk','Sleepy','Brightened Up','Like Santa','Like a King','Like a Queen','Like a Joker','Like a Geek','Not interested','Super Great!','Rocking','Partying','Meditating','Generous','Like I care','Feels Like Dancing','Wanna Fight?','Angelic','Like a Winner!','Very busy ...'];
var list2 = [' ',':D',':)',':(',':o',':shock:','8)',':lol:',':x',':P',':oops:',':cry:',':evil:',':twisted:',':roll:',';)',':idea:',':|',':star:',':suspect:',':heart:',':no:',':clown:',':silent:',':pale:',':alien:',':bounce:',':confused:',':affraid:',':cheers:',':bom:',':drunken:',':sleep:',':sunny:',':santa:',':king:',':queen:',':joker:',':geek:',':study:',':superman:',':rock:',':party:',':zen:',':roos:',':mouais:',':bananadance:',':boxing:',':angelic:',':mvp:',':computer:'];
var list3 = ['http://illiweb.com/fa/empty.gif','http://illiweb.com/fa/i/smiles/icon_biggrin.png','http://illiweb.com/fa/i/smiles/icon_smile.gif','http://illiweb.com/fa/i/smiles/icon_sad.gif','http://illiweb.com/fa/i/smiles/icon_surprised.gif','http://illiweb.com/fa/i/smiles/icon_eek.gif','http://illiweb.com/fa/i/smiles/icon_cool.gif','http://illiweb.com/fa/i/smiles/icon_lol.gif','http://illiweb.com/fa/i/smiles/icon_mad.gif','http://illiweb.com/fa/i/smiles/icon_razz.gif','http://illiweb.com/fa/i/smiles/icon_redface.gif','http://illiweb.com/fa/i/smiles/icon_cry.gif','http://illiweb.com/fa/i/smiles/icon_evil.gif','http://illiweb.com/fa/i/smiles/icon_twisted.gif','http://illiweb.com/fa/i/smiles/icon_rolleyes.gif','http://illiweb.com/fa/i/smiles/icon_wink.gif','http://illiweb.com/fa/i/smiles/icon_idea.png','http://illiweb.com/fa/i/smiles/icon_neutral.gif','http://illiweb.com/fa/i/smiles/star3.png','http://illiweb.com/fa/i/smiles/suspect.gif','http://illiweb.com/fa/i/smiles/herz.png','http://illiweb.com/fa/i/smiles/kopfschuettel.gif','http://illiweb.com/fa/i/smiles/icon_clown.png','http://illiweb.com/fa/i/smiles/icon_silent.png','http://illiweb.com/fa/i/smiles/icon_pale.gif','http://illiweb.com/fa/i/smiles/alien.png','http://illiweb.com/fa/i/smiles/icon_bounce.gif','http://illiweb.com/fa/i/smiles/confused.png','http://illiweb.com/fa/i/smiles/affraid.gif','http://illiweb.com/fa/i/smiles/icon_cheers.png','http://illiweb.com/fa/i/smiles/bom.png','http://illiweb.com/fa/i/smiles/drunken_smilie.png','http://illiweb.com/fa/i/smiles/sleep.gif','http://illiweb.com/fa/i/smiles/icon_sunny.png','http://illiweb.com/fa/i/smiles/icon_santa.png','http://illiweb.com/fa/i/smiles/icon_king.png','http://illiweb.com/fa/i/smiles/icon_queen.png','http://illiweb.com/fa/i/smiles/icon_jokercolor.png','http://illiweb.com/fa/i/smiles/icon_geek.png','http://illiweb.com/fa/i/smiles/icon_study.png','http://r16.imgfast.net/users/1616/35/61/96/smiles/1838004359.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/2896949932.gif','http://www.websmileys.com/sm/party/fest02.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/80174283.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/3305799796.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/4046336487.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/2097953958.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/1218057395.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/89381941.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/2265350431.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/2297342943.gif'];  var lcolors = ['E9967A','FFA07A','DC143C','FF0000','FFB6C1','FF69B4','FF1493','C71585','FF6347','FF4500','FF8C00','FFD700','FFFF00','7CFC00','00FF00','32CD32','7FFFD4','40E0D0','48D1CC','C0C0C0','A9A9A9'];
 var lcolors = ['E9967A','FFA07A','DC143C','FF0000','FFB6C1','FF69B4','FF1493','C71585','FF6347','FF4500','FF8C00','FFD700','FFFF00','7CFC00','00FF00','32CD32','7FFFD4','40E0D0','48D1CC','C0C0C0','A9A9A9'];
var thecode = '<center>Mood:<select id="blahh">';
for(var i=0;i<list1.length;i++){
  thecode = thecode + ' <option value="'+i+'" style="background-image: url('+list3[i]+');">'+list1[i]+'</option>';
};
$('.post .row1').each(function(){

 var uid = _userdata.user_id;
 if($(this).find('a[href="/u'+uid+'"]').length ==0){}else{
 $(this).append(thecode+'</select><br><span id="mstat">Status: Idle.<span></center><br>');
 };
});
$('#blahh option').click(function(){
var ggg = $(this).val();
var hhhk = $(this);
function getcolor() {
   return lcolors[Math.floor(Math.random() * lcolors.length)];
};

var newcolor = getcolor();
 
var newwmood = list2[ggg]+'[b][color=#'+newcolor+'] '+list1[ggg]+'[/color][/b]';
$('#mstat').text('Status: Loading.');
  $.getScript('http://illiweb.com/rsc/86/frm/jquery/json/jquery.json-1.3.min.js', function(){
  var id = idd, name = namee, content = new Array();
  content.push(new Array(name, newwmood));
  $.post('/ajax_profile.forum?jsoncallback=?', {
    id: id.substring(8, id.length),
    user: _userdata.user_id,
    active: '1',
    content: $.toJSON(content),
    tid: document.getElementById('logout').href.replace(/.*tid=(.*?)&.*/,'$1')
  },function(data){}, 'json') .done(function() {
$('.post .row1').each(function(){
  $(this).find('#mstat').text('Status: Done.');
  var oldhtm = $('.poster-profile:contains('+_userdata.username+')').html();
newhtm = oldhtm .replace(/(.*)Mood<\/span>: <\/span>(.*)<\/strong><br>(.*)/,'$1Mood</span>: </span> <img src="'+list3[ggg]+'"><strong><font color="#'+newcolor+'"> '+list1[ggg]+'</font></strong><br>$3');
$('.poster-profile:contains('+_userdata.username+')').html(newhtm);                          
                                
                                 });
})
  .fail(function() {
$('.post .row1').each(function(){$(this).find('#mstat').text('Status: Error');});
})
})
.fail(function() {
$('.post .row1').each(function(){$(this).find('#mstat').text('Status: Error');});
})
.always(function() {
  $('.post .row1').each(function(){$(this).find('#mstat').text('Status: Updating.');});

})
});
});



phpbb3 & invision
Code:
//Post Profile Mood Selector By:_Twisted_Mods_
// Special Thanks To Ange Tuteur For Helping And Testing
// Also To SamanthaS For The Idea And List Of Moods
$(function(){
var idd = 'field_id1';
var namee = 'profile_field_2_1';
var list1 = ['None','Very Happy','Happy','Sad','Surprised','Shocked','Cool','Funny','Mad','Witty','Embarassed','Very Sad','Very Mad','Furious','Misunderstood','Good','Creative','Neutral','Like a Star','Suspicious','In Love','Sick','Amusing','Silent','Pale','Out of this World','Hyperactive','Confused','Affraid','Great!','Explosive','Drunk','Sleepy','Brightened Up','Like Santa','Like a King','Like a Queen','Like a Joker','Like a Geek','Not interested','Super Great!','Rocking','Partying','Meditating','Generous','Like I care','Feels Like Dancing','Wanna Fight?','Angelic','Like a Winner!','Very busy ...'];
var list2 = [' ',':D',':)',':(',':o',':shock:','8)',':lol:',':x',':P',':oops:',':cry:',':evil:',':twisted:',':roll:',';)',':idea:',':|',':star:',':suspect:',':heart:',':no:',':clown:',':silent:',':pale:',':alien:',':bounce:',':confused:',':affraid:',':cheers:',':bom:',':drunken:',':sleep:',':sunny:',':santa:',':king:',':queen:',':joker:',':geek:',':study:',':superman:',':rock:',':party:',':zen:',':roos:',':mouais:',':bananadance:',':boxing:',':angelic:',':mvp:',':computer:'];
var list3 = ['http://illiweb.com/fa/empty.gif','http://illiweb.com/fa/i/smiles/icon_biggrin.png','http://illiweb.com/fa/i/smiles/icon_smile.gif','http://illiweb.com/fa/i/smiles/icon_sad.gif','http://illiweb.com/fa/i/smiles/icon_surprised.gif','http://illiweb.com/fa/i/smiles/icon_eek.gif','http://illiweb.com/fa/i/smiles/icon_cool.gif','http://illiweb.com/fa/i/smiles/icon_lol.gif','http://illiweb.com/fa/i/smiles/icon_mad.gif','http://illiweb.com/fa/i/smiles/icon_razz.gif','http://illiweb.com/fa/i/smiles/icon_redface.gif','http://illiweb.com/fa/i/smiles/icon_cry.gif','http://illiweb.com/fa/i/smiles/icon_evil.gif','http://illiweb.com/fa/i/smiles/icon_twisted.gif','http://illiweb.com/fa/i/smiles/icon_rolleyes.gif','http://illiweb.com/fa/i/smiles/icon_wink.gif','http://illiweb.com/fa/i/smiles/icon_idea.png','http://illiweb.com/fa/i/smiles/icon_neutral.gif','http://illiweb.com/fa/i/smiles/star3.png','http://illiweb.com/fa/i/smiles/suspect.gif','http://illiweb.com/fa/i/smiles/herz.png','http://illiweb.com/fa/i/smiles/kopfschuettel.gif','http://illiweb.com/fa/i/smiles/icon_clown.png','http://illiweb.com/fa/i/smiles/icon_silent.png','http://illiweb.com/fa/i/smiles/icon_pale.gif','http://illiweb.com/fa/i/smiles/alien.png','http://illiweb.com/fa/i/smiles/icon_bounce.gif','http://illiweb.com/fa/i/smiles/confused.png','http://illiweb.com/fa/i/smiles/affraid.gif','http://illiweb.com/fa/i/smiles/icon_cheers.png','http://illiweb.com/fa/i/smiles/bom.png','http://illiweb.com/fa/i/smiles/drunken_smilie.png','http://illiweb.com/fa/i/smiles/sleep.gif','http://illiweb.com/fa/i/smiles/icon_sunny.png','http://illiweb.com/fa/i/smiles/icon_santa.png','http://illiweb.com/fa/i/smiles/icon_king.png','http://illiweb.com/fa/i/smiles/icon_queen.png','http://illiweb.com/fa/i/smiles/icon_jokercolor.png','http://illiweb.com/fa/i/smiles/icon_geek.png','http://illiweb.com/fa/i/smiles/icon_study.png','http://r16.imgfast.net/users/1616/35/61/96/smiles/1838004359.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/2896949932.gif','http://www.websmileys.com/sm/party/fest02.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/80174283.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/3305799796.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/4046336487.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/2097953958.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/1218057395.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/89381941.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/2265350431.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/2297342943.gif'];  var lcolors = ['E9967A','FFA07A','DC143C','FF0000','FFB6C1','FF69B4','FF1493','C71585','FF6347','FF4500','FF8C00','FFD700','FFFF00','7CFC00','00FF00','32CD32','7FFFD4','40E0D0','48D1CC','C0C0C0','A9A9A9'];
 var lcolors = ['E9967A','FFA07A','DC143C','FF0000','FFB6C1','FF69B4','FF1493','C71585','FF6347','FF4500','FF8C00','FFD700','FFFF00','7CFC00','00FF00','32CD32','7FFFD4','40E0D0','48D1CC','C0C0C0','A9A9A9'];
var thecode = '<center>Mood:<select id="blahh">';
for(var i=0;i<list1.length;i++){
  thecode = thecode + ' <option value="'+i+'" style="background-image: url('+list3[i]+');">'+list1[i]+'</option>';
};
$('.postprofile').each(function(){

 var uid = _userdata.user_id;
 if($(this).find('a[href="/u'+uid+'"]').length ==0){}else{
 $(this).append(thecode+'</select><br><span id="mstat">Status: Idle.<span></center><br>');
 };
});
$('#blahh option').click(function(){
var ggg = $(this).val();
var hhhk = $(this);
function getcolor() {
   return lcolors[Math.floor(Math.random() * lcolors.length)];
};

var newcolor = getcolor();
 
var newwmood = list2[ggg]+'[b][color=#'+newcolor+'] '+list1[ggg]+'[/color][/b]';
$('#mstat').text('Status: Loading.');
  $.getScript('http://illiweb.com/rsc/86/frm/jquery/json/jquery.json-1.3.min.js', function(){
  var id = idd, name = namee, content = new Array();
  content.push(new Array(name, newwmood));
  $.post('/ajax_profile.forum?jsoncallback=?', {
    id: id.substring(8, id.length),
    user: _userdata.user_id,
    active: '1',
    content: $.toJSON(content),
    tid: document.getElementById('logout').href.replace(/.*tid=(.*?)&.*/,'$1')
  },function(data){}, 'json') .done(function() {
$('.postprofile').each(function(){
  $(this).find('#mstat').text('Status: Done.');
  var oldhtm = $('.postprofile:contains('+_userdata.username+') dd:contains(Mood)').html();
newhtm = oldhtm .replace(/(.*)Mood<\/span>: <\/span>(.*)<\/strong><br>(.*)/,'$1Mood</span>: </span> <img src="'+list3[ggg]+'"><strong><font color="#'+newcolor+'"> '+list1[ggg]+'</font></strong><br>$3');
$('.postprofile:contains('+_userdata.username+') dd:contains(Mood)').html(newhtm);                          
                                
                                 });
})
  .fail(function() {
$('.postprofile').each(function(){$(this).find('#mstat').text('Status: Error');});
})
})
.fail(function() {
$('.postprofile').each(function(){$(this).find('#mstat').text('Status: Error');});
})
.always(function() {
  $('.postprofile').each(function(){$(this).find('#mstat').text('Status: Updating.');});

})
});
});



punbb

Code:
//Post Profile Mood Selector By:_Twisted_Mods_
// Special Thanks To Ange Tuteur For Helping And Testing
// Also To SamanthaS For The Idea And List Of Moods
$(function(){
var idd = 'field_id1';
var namee = 'profile_field_2_1';
var list1 = ['None','Very Happy','Happy','Sad','Surprised','Shocked','Cool','Funny','Mad','Witty','Embarassed','Very Sad','Very Mad','Furious','Misunderstood','Good','Creative','Neutral','Like a Star','Suspicious','In Love','Sick','Amusing','Silent','Pale','Out of this World','Hyperactive','Confused','Affraid','Great!','Explosive','Drunk','Sleepy','Brightened Up','Like Santa','Like a King','Like a Queen','Like a Joker','Like a Geek','Not interested','Super Great!','Rocking','Partying','Meditating','Generous','Like I care','Feels Like Dancing','Wanna Fight?','Angelic','Like a Winner!','Very busy ...'];
var list2 = [' ',':D',':)',':(',':o',':shock:','8)',':lol:',':x',':P',':oops:',':cry:',':evil:',':twisted:',':roll:',';)',':idea:',':|',':star:',':suspect:',':heart:',':no:',':clown:',':silent:',':pale:',':alien:',':bounce:',':confused:',':affraid:',':cheers:',':bom:',':drunken:',':sleep:',':sunny:',':santa:',':king:',':queen:',':joker:',':geek:',':study:',':superman:',':rock:',':party:',':zen:',':roos:',':mouais:',':bananadance:',':boxing:',':angelic:',':mvp:',':computer:'];
var list3 = ['http://illiweb.com/fa/empty.gif','http://illiweb.com/fa/i/smiles/icon_biggrin.png','http://illiweb.com/fa/i/smiles/icon_smile.gif','http://illiweb.com/fa/i/smiles/icon_sad.gif','http://illiweb.com/fa/i/smiles/icon_surprised.gif','http://illiweb.com/fa/i/smiles/icon_eek.gif','http://illiweb.com/fa/i/smiles/icon_cool.gif','http://illiweb.com/fa/i/smiles/icon_lol.gif','http://illiweb.com/fa/i/smiles/icon_mad.gif','http://illiweb.com/fa/i/smiles/icon_razz.gif','http://illiweb.com/fa/i/smiles/icon_redface.gif','http://illiweb.com/fa/i/smiles/icon_cry.gif','http://illiweb.com/fa/i/smiles/icon_evil.gif','http://illiweb.com/fa/i/smiles/icon_twisted.gif','http://illiweb.com/fa/i/smiles/icon_rolleyes.gif','http://illiweb.com/fa/i/smiles/icon_wink.gif','http://illiweb.com/fa/i/smiles/icon_idea.png','http://illiweb.com/fa/i/smiles/icon_neutral.gif','http://illiweb.com/fa/i/smiles/star3.png','http://illiweb.com/fa/i/smiles/suspect.gif','http://illiweb.com/fa/i/smiles/herz.png','http://illiweb.com/fa/i/smiles/kopfschuettel.gif','http://illiweb.com/fa/i/smiles/icon_clown.png','http://illiweb.com/fa/i/smiles/icon_silent.png','http://illiweb.com/fa/i/smiles/icon_pale.gif','http://illiweb.com/fa/i/smiles/alien.png','http://illiweb.com/fa/i/smiles/icon_bounce.gif','http://illiweb.com/fa/i/smiles/confused.png','http://illiweb.com/fa/i/smiles/affraid.gif','http://illiweb.com/fa/i/smiles/icon_cheers.png','http://illiweb.com/fa/i/smiles/bom.png','http://illiweb.com/fa/i/smiles/drunken_smilie.png','http://illiweb.com/fa/i/smiles/sleep.gif','http://illiweb.com/fa/i/smiles/icon_sunny.png','http://illiweb.com/fa/i/smiles/icon_santa.png','http://illiweb.com/fa/i/smiles/icon_king.png','http://illiweb.com/fa/i/smiles/icon_queen.png','http://illiweb.com/fa/i/smiles/icon_jokercolor.png','http://illiweb.com/fa/i/smiles/icon_geek.png','http://illiweb.com/fa/i/smiles/icon_study.png','http://r16.imgfast.net/users/1616/35/61/96/smiles/1838004359.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/2896949932.gif','http://illiweb.com/fa//i/smiles/icon_batman.png','http://r16.imgfast.net/users/1616/35/61/96/smiles/80174283.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/3305799796.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/4046336487.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/2097953958.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/1218057395.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/89381941.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/2265350431.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/2297342943.gif'];
  var lcolors = ['E9967A','FFA07A','DC143C','FF0000','FFB6C1','FF69B4','FF1493','C71585','FF6347','FF4500','FF8C00','FFD700','FFFF00','7CFC00','00FF00','32CD32','7FFFD4','40E0D0','48D1CC','C0C0C0','A9A9A9'];
var thecode = '<center>Mood:<select id="blahh">';
for(var i=0;i<list1.length;i++){
  thecode = thecode + ' <option value="'+i+'" style="background-image: url('+list3[i]+');">'+list1[i]+'</option>';
};
$('.user').each(function(){

 var uid = _userdata.user_id;
 if($(this).find('a[href="/u'+uid+'"]').length ==0){}else{
 $(this).append(thecode+'</select><br><span id="mstat">Status: Idle.<span></center><br>');
 };
});
$('#blahh option').click(function(){
var ggg = $(this).val();
var hhhk = $(this);
function getcolor() {
   return lcolors[Math.floor(Math.random() * lcolors.length)];
};

var newcolor = getcolor();
 
var newwmood = list2[ggg]+'[b][color=#'+newcolor+'] '+list1[ggg]+'[/color][/b]';
$('#mstat').text('Status: Loading.');
  $.getScript('http://illiweb.com/rsc/86/frm/jquery/json/jquery.json-1.3.min.js', function(){
  var id = idd, name = namee, content = new Array();
  content.push(new Array(name, newwmood));
  $.post('/ajax_profile.forum?jsoncallback=?', {
    id: id.substring(8, id.length),
    user: _userdata.user_id,
    active: '1',
    content: $.toJSON(content),
    tid: document.getElementById('logout').href.replace(/.*tid=(.*?)&.*/,'$1')
  },function(data){}, 'json') .done(function() {
$('.user').each(function(){
  $(this).find('#mstat').text('Status: Done.');
  var oldhtm = $('.user:contains('+_userdata.username+') .user-info:contains(Mood)').html();
newhtm = oldhtm .replace(/(.*)Mood<\/span>: <\/span>(.*)<\/strong><br>(.*)/,'$1Mood</span>: </span> <img src="'+list3[ggg]+'"><strong><font color="#'+newcolor+'"> '+list1[ggg]+'</font></strong><br>$3');
$('.user:contains('+_userdata.username+') .user-info:contains(Mood)').html(newhtm);                          
                                
                                 });
})
  .fail(function() {
$('.user').each(function(){$(this).find('#mstat').text('Status: Error');});
})
})
.fail(function() {
$('.user').each(function(){$(this).find('#mstat').text('Status: Error');});
})
.always(function() {
  $('.user').each(function(){$(this).find('#mstat').text('Status: Updating.');});

})
});
});


replace the id and name with the once you have in your text file from earlier ..

Code:
var idd = 'newidhere';
var namee = 'newnamehere';

Code:
list1 = the list of titles or moods
list2 = the codes for the smileys
list3 = the image url for each smiley
lcolors = a list of random colors

list1,list2,list3 must have the same amout of items for this to work right and they go in order

so the first item in every list belongs to each other and so on




if you decide you want to assign a color to each on insted of having a random color




replace
Code:

var newcolor = getcolor();

with

Code:
var newcolor = lcolors[ggg];

then you have to have the same ammount of colors as you do moods




and lastly




here some css its not needed but makes it look good



[css]
Code:
#blahh{


border: 0 !important; /*Removes border*/


-webkit-appearance: none; /*Removes default chrome and safari style*/


-moz-appearance: none; /* Removes Default Firefox style*/





background: #6DA1C4 url(http://icons.iconarchive.com/icons/rafiqul-hassan/blogger/16/Arrow-Download-icon.png) no-repeat 100px center; /*background color and arrow image*/


width: 120px; /*Width of select dropdown to give space for arrow image*/


text-indent: 0.01px; /* Removes default arrow from firefox*/


text-overflow: ""; /*Removes default arrow from firefox*/ /*My custom style for fonts*/


color: #000; /*font color*/


border-radius: 5px; /*roundness of the border*/


padding: 1px; /*space around the text*/


height:20px; /*menu height*/


box-shadow: inset 0 0 5px rgba(000,000,000, 0.5); /*inner shadow*/


}





#blahh option {


border-radius: 10px 0; /*roundness of the border*/


padding-right: 1em; /*space on right side*/


padding-left: 50px; /*space on left side of text to allow the background image to show*/


padding-bottom: 10px; /*space on bottom to allow full image to show*/


background-repeat: no-repeat; /* stops background image from repeating*/


background-position: 0px center; /* 0px to left center to top and bottom*/


text-align: right; /*make the text go all the way to the right*/


margin-bottom: 10px; /*space on bottom to prevent some errors with this styling*/


}




list of smileys and there codes so you can add them to your forum




just paste this somewhere that accepts html

Code:
<img src="http://illiweb.com/fa/i/smiles/icon_biggrin.png" alt="Gelukkig" longdesc="1">:D    <img src="http://illiweb.com/fa/i/smiles/icon_smile.gif" alt="Blij" longdesc="2">:)    <img src="http://illiweb.com/fa/i/smiles/icon_sad.gif" alt="Ongelukkig" longdesc="3">:(    <img src="http://illiweb.com/fa/i/smiles/icon_surprised.gif" alt="Verrast" longdesc="4">:o    <img src="http://illiweb.com/fa/i/smiles/icon_eek.gif" alt="Geschokt" longdesc="5">:shock:    <img src="http://illiweb.com/fa/i/smiles/icon_cool.gif" alt="Cool" longdesc="6">8)    <img src="http://illiweb.com/fa/i/smiles/icon_lol.gif" alt="Grappig" longdesc="7">:lol:    <img src="http://illiweb.com/fa/i/smiles/icon_mad.gif" alt="Boos" longdesc="8">:x    <img src="http://illiweb.com/fa/i/smiles/icon_razz.gif" alt="Lollig" longdesc="9">:P    <img src="http://illiweb.com/fa/i/smiles/icon_redface.gif" alt="Schaamt zich" longdesc="10">:oops:    <img src="http://illiweb.com/fa/i/smiles/icon_cry.gif" alt="Verdrietig" longdesc="11">:cry:    <img src="http://illiweb.com/fa/i/smiles/icon_evil.gif" alt="Kwaad" longdesc="12">:evil:    <img src="http://illiweb.com/fa/i/smiles/icon_twisted.gif" alt="Woest" longdesc="13">:twisted:    <img src="http://illiweb.com/fa/i/smiles/icon_rolleyes.gif" alt="Onbegrepen" longdesc="14">:roll:    <img src="http://illiweb.com/fa/i/smiles/icon_wink.gif" alt="Goed" longdesc="15">;)    <img src="http://illiweb.com/fa/i/smiles/icon_idea.png" alt="Creatief" longdesc="18">:idea:    <img src="http://illiweb.com/fa/i/smiles/icon_neutral.gif" alt="Neutraal" longdesc="20">:|    <img src="http://illiweb.com/fa/i/smiles/star3.png" alt="Een ster" longdesc="22">:star:    <img src="http://illiweb.com/fa/i/smiles/suspect.gif" alt="Verdacht" longdesc="23">:suspect:    <img src="http://illiweb.com/fa/i/smiles/herz.png" alt="Verliefd" longdesc="24">:heart:    <img src="http://illiweb.com/fa/i/smiles/kopfschuettel.gif" alt="Ziek" longdesc="25">:no:    <img src="http://illiweb.com/fa/i/smiles/icon_clown.png" alt="Amusant" longdesc="28">:clown:    <img src="http://illiweb.com/fa/i/smiles/icon_silent.png" alt="Stil" longdesc="31">:silent:    <img src="http://illiweb.com/fa/i/smiles/icon_pale.gif" alt="Witjes" longdesc="32">:pale:    <img src="http://illiweb.com/fa/i/smiles/alien.png" alt="Buitenaards" longdesc="33">:alien:    <img src="http://illiweb.com/fa/i/smiles/icon_bounce.gif" alt="Stuiterbal" longdesc="38">:bounce:    <img src="http://illiweb.com/fa/i/smiles/confused.png" alt="Verward" longdesc="39">:confused:    <img src="http://illiweb.com/fa/i/smiles/affraid.gif" alt="Bang" longdesc="40">:affraid:    <img src="http://illiweb.com/fa/i/smiles/icon_cheers.png" alt="Geweldig!" longdesc="42">:cheers:    <img src="http://illiweb.com/fa/i/smiles/bom.png" alt="Explosief" longdesc="43">:bom:    <img src="http://illiweb.com/fa/i/smiles/drunken_smilie.png" alt="Dronken" longdesc="44">:drunken:    <img src="http://illiweb.com/fa/i/smiles/sleep.gif" alt="Slaperig" longdesc="45">:sleep:    <img src="http://illiweb.com/fa/i/smiles/icon_sunny.png" alt="Het zonnetje" longdesc="46">:sunny:    <img src="http://illiweb.com/fa/i/smiles/icon_santa.png" alt="De Kerstman" longdesc="49">:santa:    <img src="http://illiweb.com/fa/i/smiles/icon_king.png" alt="Als de Koning" longdesc="52">:king:    <img src="http://illiweb.com/fa/i/smiles/icon_queen.png" alt="Als de Koningin" longdesc="53">:queen:    <img src="http://illiweb.com/fa/i/smiles/icon_jokercolor.png" alt="Als een joker" longdesc="54">:joker:    <img src="http://illiweb.com/fa/i/smiles/icon_geek.png" alt="Als een nerd" longdesc="55">:geek:    <img src="http://illiweb.com/fa/i/smiles/icon_study.png" alt="Ongeinteresseerd" longdesc="57">:study:    <img src="http://r16.imgfast.net/users/1616/35/61/96/smiles/1838004359.gif" alt="Supergeweldig!" longdesc="62">:superman:    <img src="http://r16.imgfast.net/users/1616/35/61/96/smiles/2896949932.gif" alt="Rockend" longdesc="63">:rock:    <img src="http://www.websmileys.com/sm/party/fest02.gif" height="27" width="15">:party:    <img src="http://r16.imgfast.net/users/1616/35/61/96/smiles/80174283.gif" alt="Mediterend" longdesc="69">:zen:    <img src="http://r16.imgfast.net/users/1616/35/61/96/smiles/3305799796.gif" alt="Genereus" longdesc="73">:roos:    <img src="http://r16.imgfast.net/users/1616/35/61/96/smiles/4046336487.gif" alt="Kan me niets schelen" longdesc="67">:mouais:    <img src="http://r16.imgfast.net/users/1616/35/61/96/smiles/2097953958.gif" alt="BananaDance" longdesc="66">:bananadance:    <img src="http://r16.imgfast.net/users/1616/35/61/96/smiles/1218057395.gif" alt="Kom maar op!" longdesc="71">:boxing:    <img src="http://r16.imgfast.net/users/1616/35/61/96/smiles/89381941.gif" alt="Als een engeltje" longdesc="68">:angelic:    <img src="http://r16.imgfast.net/users/1616/35/61/96/smiles/2265350431.gif" alt="Als een winnaar" longdesc="72">:mvp:    <img src="http://r16.imgfast.net/users/1616/35/61/96/smiles/2297342943.gif" alt="Erg druk" longdesc="70">:computer:  &nbsp;


Last edited by _Twisted_Mods_ on 1/27/2015, 9:03 pm; edited 2 times in total

Back to top Go down

Re: topic profile mood

Post by _Twisted_Mods_ on 1/21/2015, 8:56 am

avatar
_Twisted_Mods_
Founder
Founder

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

View user profile
phpbb3

Dutch version by Samantha


[script=Post Profile Mood Selector=In the topics]
Code:

// Post Profile Mood Selector By:_Twisted_Mods_
// Special Thanks To Ange Tuteur For Helping And Testing
// Also To SamanthaS For The Idea And List Of Moods
jQuery(document).ready(function(){
var idd = 'field_id4';
var namee = 'profile_field_2_4';
var list1 = ['Geen','Gelukkig','Blij','Ongelukkig','Verrast','Geschokt','Cool','Grappig','Boos','Lollig','Schaamt zich','Verdrietig','Kwaad','Woest','Onbegrepen','Goed','Creatief','Neutraal','Een ster','Verdacht','Verliefd','Ziek','Amusant','Stil','Witjes','Buitenaards','Stuiterbal','Verward','Bang','Geweldig!','Explosief','Dronken','Slaperig','Het zonnetje','De Kerstman','Als de Koning','Als de Koningin','Als een joker','Als een nerd','Ongeinteresseerd','Supergeweldig!','Rockend','In feeststemming','Mediterend','Genereus','Kan me niets schelen','Zin in een dansje','Kom maar op!','Als een engeltje','Als een winnaar!','Erg druk ...'];
var list2 = [' ',':D',':)',':(',':o',':shock:','8)',':lol:',':x',':P',':oops:',':cry:',':evil:',':twisted:',':roll:',';)',':idea:',':|',':star:',':suspect:',':heart:',':no:',':clown:',':silent:',':pale:',':alien:',':bounce:',':confused:',':affraid:',':cheers:',':bom:',':drunken:',':sleep:',':sunny:',':santa:',':king:',':queen:',':joker:',':geek:',':study:',':superman:',':rock:',':party:',':zen:',':roos:',':mouais:',':bananadance:',':boxing:',':angelic:',':mvp:',':computer:'];
var list3 = ['http://illiweb.com/fa/empty.gif','http://illiweb.com/fa/i/smiles/icon_biggrin.png','http://illiweb.com/fa/i/smiles/icon_smile.gif','http://illiweb.com/fa/i/smiles/icon_sad.gif','http://illiweb.com/fa/i/smiles/icon_surprised.gif','http://illiweb.com/fa/i/smiles/icon_eek.gif','http://illiweb.com/fa/i/smiles/icon_cool.gif','http://illiweb.com/fa/i/smiles/icon_lol.gif','http://illiweb.com/fa/i/smiles/icon_mad.gif','http://illiweb.com/fa/i/smiles/icon_razz.gif','http://illiweb.com/fa/i/smiles/icon_redface.gif','http://illiweb.com/fa/i/smiles/icon_cry.gif','http://illiweb.com/fa/i/smiles/icon_evil.gif','http://illiweb.com/fa/i/smiles/icon_twisted.gif','http://illiweb.com/fa/i/smiles/icon_rolleyes.gif','http://illiweb.com/fa/i/smiles/icon_wink.gif','http://illiweb.com/fa/i/smiles/icon_idea.png','http://illiweb.com/fa/i/smiles/icon_neutral.gif','http://illiweb.com/fa/i/smiles/star3.png','http://illiweb.com/fa/i/smiles/suspect.gif','http://illiweb.com/fa/i/smiles/herz.png','http://illiweb.com/fa/i/smiles/kopfschuettel.gif','http://illiweb.com/fa/i/smiles/icon_clown.png','http://illiweb.com/fa/i/smiles/icon_silent.png','http://illiweb.com/fa/i/smiles/icon_pale.gif','http://illiweb.com/fa/i/smiles/alien.png','http://illiweb.com/fa/i/smiles/icon_bounce.gif','http://illiweb.com/fa/i/smiles/confused.png','http://illiweb.com/fa/i/smiles/affraid.gif','http://illiweb.com/fa/i/smiles/icon_cheers.png','http://illiweb.com/fa/i/smiles/bom.png','http://illiweb.com/fa/i/smiles/drunken_smilie.png','http://illiweb.com/fa/i/smiles/sleep.gif','http://illiweb.com/fa/i/smiles/icon_sunny.png','http://illiweb.com/fa/i/smiles/icon_santa.png','http://illiweb.com/fa/i/smiles/icon_king.png','http://illiweb.com/fa/i/smiles/icon_queen.png','http://illiweb.com/fa/i/smiles/icon_jokercolor.png','http://illiweb.com/fa/i/smiles/icon_geek.png','http://illiweb.com/fa/i/smiles/icon_study.png','http://r16.imgfast.net/users/1616/35/61/96/smiles/1838004359.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/2896949932.gif','http://www.websmileys.com/sm/party/fest02.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/80174283.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/3305799796.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/4046336487.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/2097953958.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/1218057395.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/89381941.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/2265350431.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/2297342943.gif'];  var lcolors = ['E9967A','FFA07A','DC143C','FF0000','FFB6C1','FF69B4','FF1493','C71585','FF6347','FF4500','FF8C00','FFD700','FFFF00','7CFC00','00FF00','32CD32','7FFFD4','40E0D0','48D1CC','C0C0C0','A9A9A9'];
var thecode = '</br></br><center>Wijzig stemming:<select id="blahh">';
for(var i=0;i<list1.length;i++){
 thecode = thecode + ' <option value="'+i+'" style="background-image: url('+list3[i]+');">'+list1[i]+'</option>';
};
$('.postprofile').each(function(){

var uid = _userdata.user_id;
if($(this).find('a[href="/u'+uid+'"]').length ==0){}else{
$(this).append(thecode+'</select><br><span id="mstat">Status: Inactief.<span></center><br>');
};
});
$('.postprofile #blahh option').click(function(){
var ggg = $(this).val();
var hhhk = $(this);
function getcolor() {
  return lcolors[Math.floor(Math.random() * lcolors.length)];
};

var newcolor = getcolor();

var newwmood = list2[ggg]+'[b][color=#'+newcolor+'] '+list1[ggg]+'[/color][/b]';
$('#mstat').text('Status: Laden.');
 $.getScript('http://illiweb.com/rsc/86/frm/jquery/json/jquery.json-1.3.min.js', function(){
 var id = idd, name = namee, content = new Array();
 content.push(new Array(name, newwmood));
 $.post('/ajax_profile.forum?jsoncallback=?', {
  id: id.substring(8, id.length),
  user: _userdata.user_id,
  active: '1',
  content: $.toJSON(content),
  tid: document.getElementById('logout').href.replace(/.*tid=(.*?)&.*/,'$1')
 },function(data){}, 'json') .done(function() {
$('.postprofile').each(function(){
 $(this).find('#mstat').text('Status: Klaar.');
 var oldhtm = $('.postprofile:contains('+_userdata.username+') dd:contains(Stemming)').html();
newhtm = oldhtm .replace(/(.*)Stemming<\/span>: <\/span>(.*)<\/strong><br>(.*)/,'$1Stemming</span>: </span> <img src="'+list3[ggg]+'"><strong><font color="#'+newcolor+'"> '+list1[ggg]+'</font></strong><br>$3');
$('.postprofile:contains('+_userdata.username+') dd:contains(Stemming)').html(newhtm);                         
                             
                                });
})
 .fail(function() {
$('.postprofile').each(function(){$(this).find('#mstat').text('<center>Status: Fout');});
})
})
.fail(function() {
$('.postprofile').each(function(){$(this).find('#mstat').text('<center>Status: Fout');});
})
.always(function() {
 $('.postprofile').each(function(){$(this).find('#mstat').text('<center>Status: Bijwerken...');});

})
});
});


CSS:

[css]
Code:

   /**** MOODS ******************************************************/
    #blahh{
      border: 0 !important; /*Removes border*/
      -webkit-appearance: none; /*Removes default chrome and safari style*/
      -moz-appearance: none; /* Removes Default Firefox style*/
      z-index: 999;
      background: #FEC76C url(http://icons.iconarchive.com/icons/rafiqul-hassan/blogger/16/Arrow-Download-icon.png) no-repeat 150px center; /*background color and arrow image*/
      width: 170px; /*Width of select dropdown to give space for arrow image*/
      text-indent: 0.01px; /* Removes default arrow from firefox*/
      text-overflow: ""; /*Removes default arrow from firefox*/ /*My custom style for fonts*/
      color: #000; /*font color*/
      border-radius: 5px; /*roundness of the border*/
      padding: 1px; /*space around the text*/
      height:20px; /*menu height*/
      box-shadow: inset 0 0 5px rgba(000,000,000, 0.5); /*inner shadow*/
    }
    #blahh option:checked, #blahh option:hover {
      box-shadow: 0px 0px 5px 100px rgba(255, 81, 0,0.7) inset;
    }
    #blahh option {
      border-radius: 10px 0; /*roundness of the border*/
      padding-right: 1em; /*space on right side*/
      padding-left: 50px; /*space on left side of text to allow the background image to show*/
      padding-bottom: 10px; /*space on bottom to allow full image to show*/
      background-repeat: no-repeat; /* stops background image from repeating*/
      background-position: 0px center; /* 0px to left center to top and bottom*/
      text-align: right; /*make the text go all the way to the right*/
      margin-bottom: 10px; /*space on bottom to prevent some errors with this styling*/
    }
    /**** END MOODS **************************************************/

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