Simple Machine Codes
April 19, 2024, 12:10:26 am
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  

Show post number

Pages: [1]   Go Down
  Print  
Author Topic: Show post number  (Read 1168 times)
0 Members and 1 Guest are viewing this topic.
Celebrus
Artificially Conscious
Administrator

Offline Offline

Gender: Male
Posts: 1,337


aka Omikron


View Profile WWW
« on: July 15, 2007, 06:45:35 am »

This code simply adds at the bottom of every post, that post's, well, number.
Preview: here.
Here is the code. Add to your headers.
Code:
<script language="Javascript>
function showpostnumber(numberoftopicstocover){
$(function() {
if(location.href.match(/topic/i)){
for(a=1;a<=numberoftopicstocover;a++){
msgstr="#msg_"+a;
texttoshow="<br><br><span class='quote'><div class='smalltext'>This is post number "+a+"</div></span><br>";
$(msgstr).append(texttoshow)
}};});};
showpostnumber(x);
</script>

I'll explain what all can be customized.
function showpostnumber(numberoftopicstocover){
$(function() {
if(location.href.match(/topic/i)){
for(a=1;a<=numberoftopicstocover;a++){
msgstr="#msg_"+a;
texttoshow="

<span class='quote'><div class='smalltext'>This is post number "+a+"</div></span>
";
$(msgstr).append(texttoshow)
}};});};
showpostnumber(x);

The red and yellow text can be changed.
Change this red one to read what you want the text before the topic number to be. Leave a space after your text, or there will be no gap between the text and the number. If you know HTML, you can edit the HTML surrounding it as well. Change the yellow text to the number of posts to be taken into account.
After that number of posts, the message showing the post number will not be shown.

And this is my first working code, so I'm <replace this with any word that expresses that feeling you get when you make your first working code>.
 Cool Grin Wink
Report Spam   Logged

Share on Facebook Share on Twitter

Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,672



View Profile WWW
« Reply #1 on: July 15, 2007, 01:19:32 pm »

This is a bit confusing to me...

I jsut tried the code an it didn't work.

Once I get it to work, I will tell you how it is.

Good job for your first code though Smiley
Report Spam   Logged

Celebrus
Artificially Conscious
Administrator

Offline Offline

Gender: Male
Posts: 1,337


aka Omikron


View Profile WWW
« Reply #2 on: July 19, 2007, 04:30:48 am »

There seems to be some problem. The first time I wrote it, it was working fine on my test forum, but now it isn't working at all.
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 #3 on: July 19, 2007, 05:47:18 am »

Code:
<script language="Javascript">
function showpostnumber(numberoftopicstocover){
$(function() {
if(location.href.match(/topic/i)){
for(a=1;a<=numberoftopicstocover;a++){
msgstr="#msg_"+a;
texttoshow="<br><br><span class='quote'><div class='smalltext'>This is post number "+a+"</div></span><br>";
$(msgstr).append(texttoshow)
}};});};
showpostnumber(x);
</script>

Try that and see if it works.  There was a quotation mark missing in the first line.
« Last Edit: July 19, 2007, 05:48:24 am by LaundryLady » Report Spam   Logged

Celebrus
Artificially Conscious
Administrator

Offline Offline

Gender: Male
Posts: 1,337


aka Omikron


View Profile WWW
« Reply #4 on: July 19, 2007, 06:02:54 am »

Oh! lol...
Report Spam   Logged

Frost
Members

Offline Offline

Posts: 30


View Profile
« Reply #5 on: July 21, 2007, 02:28:39 am »

http://testercarom.smfforfree3.com/index.php/topic,1.0.html

it has a little rectangle on top
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 #6 on: July 21, 2007, 05:10:18 am »

Now that one I definitely wouldn't know about, LOL.  Mr. Coder??? What's your take on that?
Report Spam   Logged

Celebrus
Artificially Conscious
Administrator

Offline Offline

Gender: Male
Posts: 1,337


aka Omikron


View Profile WWW
« Reply #7 on: July 23, 2007, 08:57:23 am »

1.   When you say Mr. Coder, are you referring to me?

2.   I don't see what you mean, Frost. I don't see anything at all.
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 #8 on: July 23, 2007, 02:00:48 pm »

There is a small rectangle directly above and to the left of the post count.  I see it on mine, using Firefox.
Report Spam   Logged

Frost
Members

Offline Offline

Posts: 30


View Profile
« Reply #9 on: July 24, 2007, 03:19:36 am »

yeah mine is on top of the post number
Report Spam   Logged
Celebrus
Artificially Conscious
Administrator

Offline Offline

Gender: Male
Posts: 1,337


aka Omikron


View Profile WWW
« Reply #10 on: July 25, 2007, 04:56:00 am »

Well, I don't know anything about it. I can't use FireFox here how much ever I'd like to couse the user account here doesn't have install priviledges. In the cybercafe, i mean.
Report Spam   Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

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