Simple Machine Codes
October 23, 2018, 08:35:22 pm
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to SMC, the best place for your SMF For Free Codes
 
  Home Help Search Arcade Gallery Affiliates Code Index Staff List Calendar Members Login Register  

Add Custom Message V1

Pages: [1] 2   Go Down
  Print  
Author Topic: Add Custom Message V1  (Read 6038 times)
Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,671



View Profile WWW
« on: May 17, 2007, 07:38:22 pm »

Place in Footers or Headers

This adds a box with a custom message under the user you choose name in a topic.
Change USERNAME to the members username, and change CUSTOM MESSAGE to the message that the user wants.
Too add more message for people, just add more of these lines:
message[message.length] = ["USERNAME","CUSTOM MESSAGE"]
Code:
<script>
function custom_message(){
//Created by Agent Moose (smcodes.smfforfree3.com)
var message = new Array();
message[message.length] = ["USERNAME","CUSTOM MESSAGE"]

if(location.href.match(/topic/i)){
for(f=0;f<message.length;f++){
$("a").each(function(){
if(this.innerHTML == message[f][0] && $(this).parent("b").parent("td").html()){
$(this).after("<div class='windowbg2'><span class='smalltext'><b>Custom Message:</b><br>" + message[f][1] + "</span></div>");
};});};};};
custom_message();
</script>
« Last Edit: March 08, 2008, 08:37:21 am by Agent Moose » Report Spam   Logged

Social Buttons

deathwilldie
100 Club Member

Offline Offline

Posts: 214


View Profile WWW
« Reply #1 on: May 17, 2007, 09:44:53 pm »

This is a pretty cool code.  How can I get one like you have on this forum?
Report Spam   Logged

Celebrus
Artificially Conscious
Administrator

Offline Offline

Gender: Male
Posts: 1,337


aka Omikron


View Profile WWW
« Reply #2 on: July 03, 2007, 02:54:25 am »


Code:
<script>
function custom_message(){
$(function(){
//Created by Agent Moose
//More codes at smcodes.smfforfree3.com
var message = new Array()
message[0] = ["USERNAME","TEXT"]

if(location.href.match(/topic/i)){
for(f=0;f<message.length;f++){
$("td b a").contains(message[f][0]).after("<div class='quote'><span class='smalltext'><b>Custom Message:</b><br>"+message[f][1]+"</span></div>");
};};});}
custom_message();
</script>

This one looks better, doesn't it?
« Last Edit: July 03, 2007, 07:26:36 am by vikhyat » Report Spam   Logged

Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,671



View Profile WWW
« Reply #3 on: July 03, 2007, 07:54:17 am »

It does look better, but I am useing my own class.  So I can make it look diffrent through CSS.
Report Spam   Logged

Celebrus
Artificially Conscious
Administrator

Offline Offline

Gender: Male
Posts: 1,337


aka Omikron


View Profile WWW
« Reply #4 on: July 11, 2007, 05:46:44 am »

doesn't work in ie6 - i know that.
Report Spam   Logged

Celebrus
Artificially Conscious
Administrator

Offline Offline

Gender: Male
Posts: 1,337


aka Omikron


View Profile WWW
« Reply #5 on: July 15, 2007, 07:07:39 am »

sorry, my fault. didn't copy the code right.
Report Spam   Logged

Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,671



View Profile WWW
« Reply #6 on: July 15, 2007, 01:11:04 pm »

lol, at least you got it working.
Report Spam   Logged

LaundryLady
Geriatric Goddess
Global Moderator

Offline Offline

Gender: Female
Posts: 290


I'm watching, I have a sense of humor: Guess Who


View Profile
« Reply #7 on: July 25, 2007, 07:48:34 am »

Quote
<span class='smalltext'>Custom Message:
"+message[f]

I took that part out.
Report Spam   Logged

Myrtle
The Girl With The Forum.
100 Club Member

Offline Offline

Gender: Female
Posts: 480


Death Note(Credits to Kai): Myrtle_Gail, Myr-chan


View Profile WWW
« Reply #8 on: February 21, 2008, 01:28:08 am »

It's not working at mines?
Report Spam   Logged

Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,671



View Profile WWW
« Reply #9 on: February 21, 2008, 05:14:35 pm »

Should work now Smiley  Just get the code from the first post again Smiley
Report Spam   Logged

Myrtle
The Girl With The Forum.
100 Club Member

Offline Offline

Gender: Female
Posts: 480


Death Note(Credits to Kai): Myrtle_Gail, Myr-chan


View Profile WWW
« Reply #10 on: February 29, 2008, 08:26:09 pm »

+-ღMyrtleღ-+


Thanks Moose. But, hmm, it's still not working though   Huh?
Report Spam   Logged

Agent Moose Jr.
Ultra Contagious
Global Moderator

Offline Offline

Gender: Male
Posts: 1,044



View Profile WWW
« Reply #11 on: February 29, 2008, 08:56:51 pm »

its because hes not added you to the code yet
Report Spam   Logged

Newest:

Myrtle
The Girl With The Forum.
100 Club Member

Offline Offline

Gender: Female
Posts: 480


Death Note(Credits to Kai): Myrtle_Gail, Myr-chan


View Profile WWW
« Reply #12 on: March 06, 2008, 06:44:00 am »

+-ღMyrtleღ-+


It's still not working.  Huh?
Report Spam   Logged

Myrtle
The Girl With The Forum.
100 Club Member

Offline Offline

Gender: Female
Posts: 480


Death Note(Credits to Kai): Myrtle_Gail, Myr-chan


View Profile WWW
« Reply #13 on: March 08, 2008, 06:11:02 am »

+-ღMyrtleღ-+

Sorry for double posting but I really want this code but it really ain't working.
Report Spam   Logged

Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,671



View Profile WWW
« Reply #14 on: March 08, 2008, 08:36:00 am »

Can you post teh code taht your using Smiley
Report Spam   Logged

Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum | Buy traffic for your forum/website

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy