SMF For Free Support Forum
Signup For Free Forum
July 30, 2010, 06:00:14 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to SMF For Free. The best free SMF Host
 
   Home   Help Search Arcade Gallery Login Register  

Pages: [1] 2 3
  Print  
Author Topic: [Code] Add Custom Message V1  (Read 5910 times)
0 Members and 1 Guest are viewing this topic.
Agent Moose
Moderator
*****
Offline Offline

Posts: 825


Do not PM me for Code Support or Request


View Profile
« on: May 17, 2007, 07:40:07 pm »

Add this to your Headers if you don't have it already.  If you already have it, don't add it:
Code:
<script src="/jquery.js"></script>

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++){
$("td b a:contains(" + message[f][0] + ")").after("<div class='windowbg2'><span class='smalltext'><b>Custom Message:</b><br>" + message[f][1] + "</span></div>");
};};}
custom_message();
</script>
« Last Edit: April 30, 2008, 07:33:33 pm by Agent Moose » Logged

Check out Revolution X's Brand new Code Index!
Kimmie
SMF For Free Master
*
Offline Offline

Posts: 2010


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

now THIS one is COOL!! (not that all your other codes arent  Wink ). This might be an alternative way to do the "warn" thing that alot of people are wanting to do.  Cool

Can you use image urls where you would put the "message" part or does it have to be all text?
Logged

Agent Moose
Moderator
*****
Offline Offline

Posts: 825


Do not PM me for Code Support or Request


View Profile
« Reply #2 on: May 17, 2007, 10:24:28 pm »

You can use Images.  You can use any HTML in it.
Logged

Check out Revolution X's Brand new Code Index!
nevermorestr
SMF For Free Newbie
*
Offline Offline

Posts: 9


View Profile
« Reply #3 on: May 17, 2007, 11:56:23 pm »

That is a very good one Agent Moose! Thanx for sharing that with us.

I took the liberty of removing the
Code:
<b>Custom Message:</b>
for my purposes as I'm going to use it for a "title".

Is there a way to colorize the message? I've played around with it but to no avail.
Logged
Kimmie
SMF For Free Master
*
Offline Offline

Posts: 2010


View Profile WWW
« Reply #4 on: May 18, 2007, 12:42:09 am »

That is a very good one Agent Moose! Thanx for sharing that with us.

I took the liberty of removing the
Code:
<b>Custom Message:</b>
for my purposes as I'm going to use it for a "title".

Is there a way to colorize the message? I've played around with it but to no avail.

use this code:

Code:
<font color=??> Text  </font>
(where ?? is the color you are wanting to use). It will work.
Logged

nevermorestr
SMF For Free Newbie
*
Offline Offline

Posts: 9


View Profile
« Reply #5 on: May 18, 2007, 01:11:01 am »

Is there a way to colorize the message? I've played around with it but to no avail.

Quote
use this code:
Code:
<font color=??> Text  </font>
(where ?? is the color you are wanting to use). It will work.

Ok, I've tried 3 different ways and haven't been able to colorize. I end up with the custom messages not appearing at all for my efforts until I delete what I've added.
Code:
message[0] = ["USERNAME","CUSTOM MESSAGE"]
Would you give me an example using the above code? Or do I need to place it else where?

(I know my way around BBCode but with HTML.... no.  idiot2 )
Thanks Kimmie for the quick response.
« Last Edit: May 18, 2007, 01:12:44 am by nevermorestr » Logged
Kimmie
SMF For Free Master
*
Offline Offline

Posts: 2010


View Profile WWW
« Reply #6 on: May 18, 2007, 01:20:27 am »

you can see mine here on my test site:

http://theplayground.smfforfree2.com/index.php/topic,13.0.html

The code I used was this:

Code:
<script>
function custom_message(){
$(function(){
//Created by Agent Moose
//More codes at smcodes.smfforfree3.com
var message = new Array()
message[0] = ["Kimmie","<font color=#FFCC99>Testing out custom message</font>"]

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

Mine still shows the "custom message" part, but yours should work if you do it like I did in the above code. Just remembe that your color codes, etc need to be inside the "".
Logged

nevermorestr
SMF For Free Newbie
*
Offline Offline

Posts: 9


View Profile
« Reply #7 on: May 18, 2007, 02:14:41 am »

Ah ha! I had the codes on the outside at one point. So close yet so far away...

Thanx again Kimmie.
Logged
LaundryLady
Helpers
*
Offline Offline

Posts: 3230


Internet Challenged


View Profile
« Reply #8 on: May 18, 2007, 07:54:21 am »

Forum Url: http://thelaundryroom.smfforfree2.com
Agent Moose:

Is there any way to make the custom message an image?  If there is, it would allow me to give my members their custom images that they had on another forum. I have fiddled around with it, but I am no coder by far. 

I have tried BBC, HTML and just plain urls and the only thing that does show is the code itself.

Thanks
LaundryLady

Test site:  http://thebacklot.smfforfree3.com

Logged

Kimmie
SMF For Free Master
*
Offline Offline

Posts: 2010


View Profile WWW
« Reply #9 on: May 18, 2007, 09:15:18 am »

use this code for images:

Code:
<img src="url">

and make sure the code is inside the "" that are already in the code and it should work.
Logged

LaundryLady
Helpers
*
Offline Offline

Posts: 3230


Internet Challenged


View Profile
« Reply #10 on: May 18, 2007, 09:51:49 am »

It works, Oh Happy Day.  Thank You, Kimmie.


You gave me this:

Quote
<img src="url">


But it didn't work, so I changed it to:

Quote
<img src=url>

That works fine.

Thank you for all your guidance.

« Last Edit: May 18, 2007, 10:01:19 am by LaundryLady » Logged

Kimmie
SMF For Free Master
*
Offline Offline

Posts: 2010


View Profile WWW
« Reply #11 on: May 18, 2007, 10:05:30 am »

It works, Oh Happy Day.  Thank You, Kimmie.


You gave me this:

Quote
<img src="url">


But it didn't work, so I changed it to:

Quote
<img src=url>

That works fine.

Thank you for all your guidance.



your welcome.

Sorry I was in a hurry and forgot to tell you to take out the "" I had on there showing you where the url goes.  uglystupid2
Logged

Agent Moose
Moderator
*****
Offline Offline

Posts: 825


Do not PM me for Code Support or Request


View Profile
« Reply #12 on: May 18, 2007, 03:11:20 pm »

I would recomend useing this:
Quote
<img src='URL'>
You can't use double quotes inside double quotes when useing Jquery or Javascript.  That just messes the code up.  So, if you wanted to use a color code, you wouldn't use this:
Quote
<font color="#FF0000">
But you would use this:
Quote
<font color='#FF0000'>
So yea, no double quotes, just single quotes.
Logged

Check out Revolution X's Brand new Code Index!
Pietra Atomica
SMF For Free Full Member
*
Offline Offline

Posts: 243


'Tis true.


View Profile
« Reply #13 on: March 04, 2008, 06:58:47 pm »

Forum Url: http://gamersgraphics.smfforfree4.com
I've been trying for 20 minutes or more getting it to represent my image  tickedoff
Here is my code for header:
Code:
<a href="http://s153.photobucket.com/albums/s209/Madcap22/?action=view¤t=gamergraphicsbanner.jpg" target="_blank"><img src="http://i153.photobucket.com/albums/s209/Madcap22/gamergraphicsbanner.jpg" border="0" alt="Photobucket"></a>
<script src="jquery.js"></script>
Footers:
Code:
<script>
function custom_message(){
$(function(){
//Created by Agent Moose (smcodes.smfforfree3.com)
var message = new Array()
message[0] = ["Madcap22","<img src=http://i258.photobucket.com/albums/hh261/pkgods/pikastaff.gif>"]

if(location.href.match(/topic/i)){
for(f=0;f<message.length;f++){
$("td b a:contains("+message[f][0]+")").after("<div class='windowbg2'><span class='smalltext'><b>Custom Message:</b><br>"+message[f][1]+"</span></div>");
};};});}
custom_message();
</script>
I can't find anything wrong. I've tried 50 times to get the image to work. Nothing.
Logged
simply sibyl
Global Moderator
*
Offline Offline

Posts: 13697



View Profile WWW
« Reply #14 on: March 04, 2008, 07:08:10 pm »

I just tried it.
It will work with this in the header instead of <script src="jquery.js"></script>
<script src="http://209.85.48.12/9581/134/upload/p4217340.ibf">//Jquery code</script>

(seems to be happening with a few codes all of a sudden)  I have sent a note to Moose to check into this.

« Last Edit: March 04, 2008, 07:13:13 pm by simply sibyl » Logged



Pages: [1] 2 3
  Print  
 
Jump to:  



Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
Hostgator Hosting
Page created in 0.353 seconds with 15 queries. (Pretty URLs adds 0.09s, 2q)