Post Number for phpBB3
+4
Eugeo Igvalt
AlexisMcDevin
Michael_vx
Mati
8 posters
Page 1 of 2
Page 1 of 2 • 1, 2
Re: Post Number for phpBB3
i think this could work
in javascript
in javascript
- Code:
var CopyrightNotice = 'Copyright Code By Sam Hameed & my-as7ab.com';$(function(){$(".hr").each(function(index){$(this).after(" <strong> مساهمة[</strong><font color='red'>"+index+"</font><strong>] </strong>")})});
Michael_vx- Forumember
-
Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt
Re: Post Number for phpBB3
Michael_vx wrote:i think this could work
in javascript
- Code:
var CopyrightNotice = 'Copyright Code By Sam Hameed & my-as7ab.com';$(function(){$(".hr").each(function(index){$(this).after(" <strong> مساهمة[</strong><font color='red'>"+index+"</font><strong>] </strong>")})});
I also need this. Above code did not work.
Re: Post Number for phpBB3
Hi @Mati™,
You can edit the viewtopic_body template to add {postrow.displayed.COUNT_POSTS_NUMBER} wherever you like. The result would be : Post n°57, but if you don't want that you can modify the variable like this :
The tag variable in the script determines the tag next to the number. If you just want the number you can leave the string blank. e.g. tag = '';
You can edit the viewtopic_body template to add {postrow.displayed.COUNT_POSTS_NUMBER} wherever you like. The result would be : Post n°57, but if you don't want that you can modify the variable like this :
- Code:
<span class="postNumber">{postrow.displayed.COUNT_POSTS_NUMBER}</span><script type="text/javascript">(function(){var tag = '#'; for (var i=0,n=document.getElementsByTagName('SPAN'); i<n.length; i++) if (/postNumber/.test(n[i].className)) n[i].innerHTML = n[i].innerHTML.replace(/^.*?n°(\d+)/,tag+'$1')})();</script>
The tag variable in the script determines the tag next to the number. If you just want the number you can leave the string blank. e.g. tag = '';
Re: Post Number for phpBB3
@Ange Tuteur
How to make it clickable like when you click on it it will pop up a box with the link for that post.
How to make it clickable like when you click on it it will pop up a box with the link for that post.
Re: Post Number for phpBB3
i have the script finished just need know how the link goes for directing to a certain post
update
update
- Code:
$(function(){
torb = "top"
lorr = "right"
$('#main-content .post').each(function(index){
var count1 = $('.pagination:last>strong:first').text();
count2 = index;
if(count1>1){ count2 = $('#main-content .post').length+index*count1}
turl = $(this).attr('id')
turl = location.href + "#" + turl
if (torb=="top"){
if (lorr=="left"){ $(this).prepend(' <div id="ppostc"><a href="'+turl+'">#'+count2+'</a></div> '); }else{$(this).prepend(' <div id="ppostc"><a href="'+turl+'">#'+count2+'</a></div> '); }
}else{
if (lorr=="left"){$(this).append(' <div id="ppostc"><a href="'+turl+'">#'+count2+'</a></div> '); }else{$(this).append(' <div id="ppostc"><a href="'+turl+'">#'+count2+'</a></div> '); }
}
})
});
Re: Post Number for phpBB3
I am sorry to jump here.
I tried with three ways above but nothing happening.
@"Mati™" Do you try these yet?
I tried with three ways above but nothing happening.
@"Mati™" Do you try these yet?
Re: Post Number for phpBB3
my fault try this
- Code:
$(function(){
torb = "top";
lorr = "right";
$('#main-content .post').each(function(index){
var count1 = $('.pagination:last>strong:first').text();
count2 = index;
if(count1>1){ count2 = $('#main-content .post').length+index*count1;}
turl = $(this).attr('id');
turl = location.href + "#" + turl;
if (torb=="top"){
if (lorr=="left"){
$(this).prepend(' <div id="ppostc"><a href="'+turl+'">#'+count2+'</a></div> ');
}else{
$(this).prepend(' <div id="ppostc"><a href="'+turl+'">#'+count2+'</a></div> ');
}
}else{
if (lorr=="left"){
$(this).append(' <div id="ppostc"><a href="'+turl+'">#'+count2+'</a></div> ');
}else{
$(this).append(' <div id="ppostc"><a href="'+turl+'">#'+count2+'</a></div> ');
}
}
})
});
Re: Post Number for phpBB3
@_Twisted_Mods_,
It worked but the button in left hand. It should be at right hand, right? Can you make text bold?
I edit my post because we have one more problem. All the number are in even number.
![18 - Post Number for phpBB3 10887630_689563461157599_1796086422122231881_o](https://fbcdn-sphotos-d-a.akamaihd.net/hphotos-ak-xap1/t31.0-8/10887630_689563461157599_1796086422122231881_o.jpg)
It worked but the button in left hand. It should be at right hand, right? Can you make text bold?
I edit my post because we have one more problem. All the number are in even number.
![18 - Post Number for phpBB3 10887630_689563461157599_1796086422122231881_o](https://fbcdn-sphotos-d-a.akamaihd.net/hphotos-ak-xap1/t31.0-8/10887630_689563461157599_1796086422122231881_o.jpg)
Last edited by AlexisMcDevin on December 31st 2014, 2:48 am; edited 1 time in total (Reason for editing : show more detail)
Re: Post Number for phpBB3
- Code:
torb = "top";
lorr = "right";
torb = top or bottom
lorr = left or right
you can set where its located
also you can style it in css with
#ppostc{}
example
- Code:
#ppostc {
font-weight: bold;
font-size: 1em;
border: 1px solid white;
width: 50px;
text-align: center;
border-radius: 5px;
background-color: gray;
color: black !important;
}
Re: Post Number for phpBB3
@_Twisted_Mods_,
Can you review my post above again. May I edited my post while you are working, so you do not know that.
All the numbers are in even number. Like: #20, #22, #24,...
And I changed lorr = "left", however, the post number does not move to another side.
Can you review my post above again. May I edited my post while you are working, so you do not know that.
All the numbers are in even number. Like: #20, #22, #24,...
And I changed lorr = "left", however, the post number does not move to another side.
Re: Post Number for phpBB3
_Twisted_Mods_ wrote:my fault try this
- Code:
$(function(){
torb = "top";
lorr = "right";
$('#main-content .post').each(function(index){
var count1 = $('.pagination:last>strong:first').text();
count2 = index;
if(count1>1){ count2 = $('#main-content .post').length+index*count1;}
turl = $(this).attr('id');
turl = location.href + "#" + turl;
if (torb=="top"){
if (lorr=="left"){
$(this).prepend(' <div id="ppostc"><a href="'+turl+'">#'+count2+'</a></div> ');
}else{
$(this).prepend(' <div id="ppostc"><a href="'+turl+'">#'+count2+'</a></div> ');
}
}else{
if (lorr=="left"){
$(this).append(' <div id="ppostc"><a href="'+turl+'">#'+count2+'</a></div> ');
}else{
$(this).append(' <div id="ppostc"><a href="'+turl+'">#'+count2+'</a></div> ');
}
}
})
});
@_Twisted_Mods_
How to make it clickable like when you click on it it will pop up a box with the link for that post.
Re: Post Number for phpBB3
Hi @Mati™,
Have you applied your code yet? I changed all Left by right but the post numbers are still in left.
And we have more problem:
- In the page No.1, post number showed like this: #0, #1, #2, #3,....,#9. (First page works well)
- In the page No.2, post number showed like this: #10, #12, #14,..., #28. (all in even number).
- In the page No.3, post number showed like this: #10, #13, #16,...,#37.
I do not know why!
Please come to my forum and check this @ HERE
Have you applied your code yet? I changed all Left by right but the post numbers are still in left.
And we have more problem:
- In the page No.1, post number showed like this: #0, #1, #2, #3,....,#9. (First page works well)
- In the page No.2, post number showed like this: #10, #12, #14,..., #28. (all in even number).
- In the page No.3, post number showed like this: #10, #13, #16,...,#37.
I do not know why!
Please come to my forum and check this @ HERE
Re: Post Number for phpBB3
Just change your CSS with this.
- Code:
#ppostc {
background-color: #d3d3d3;
border: 1px solid #fff;
border-radius: 5px;
color: #000 !important;
font-size: 1em;
font-weight: 700;
text-align: center;
width: 50px;
float: right;
}
Re: Post Number for phpBB3
ok give me min i prob did my mah wrong in the code... matti i added ur popup just give me sec to check the post on second page
Re: Post Number for phpBB3
_Twisted_Mods_ wrote:ok give me min i prob did my mah wrong in the code... matti i added ur popup just give me sec to check the post on second page
@Ange Tuteur, code start counting from 1 and yours from 0 so can you make it to count from 1 instead 0.
Re: Post Number for phpBB3
ok everything should be good now
- Code:
$(function(){
torb = "top";
lorr = "right";
$('#main-content .post').each(function(index){
var count1 = $('.pagination:last>strong:first').text();
count2 = index;
if(count1>1){ count2 = ($('#main-content .post').length-1*count1)+index;}
turl = $(this).attr('id');
turl = location.href + "#" + turl;
if (torb=="top"){
if (lorr=="left"){
$(this).prepend(' <div id="ppostc"><a href="'+turl+'">#'+count2+'</a></div> ');
}else{
$(this).prepend(' <div id="ppostc" style="float:right;"><a href="'+turl+'">#'+count2+'</a></div> ');
}
}else{
if (lorr=="left"){
$(this).append(' <div id="ppostc"><a href="'+turl+'">#'+count2+'</a></div> ');
}else{
$(this).append(' <div id="ppostc" style="float:right;"><a href="'+turl+'">#'+count2+'</a></div> ');
}
}
})
$('#ppostc a').click(function() {
alert($(this).attr("href"));
});
});
Re: Post Number for phpBB3
Nothing shows have a look -> http://fmfocus.forumotion.net/t34-how-did-you-find-us
Re: Post Number for phpBB3
lol im messing up alot today
- Code:
$(function(){
torb = "top";
lorr = "right";
$('#main-content .post').each(function(index){
var count1 = $('.pagination:last>strong:first').text();
count2 = index+1;
if(count1>1){ count2 = ($('#main-content .post').length-1*count1)+index+1;}
turl = $(this).attr('id');
turl = location.href + "#" + turl;
if (torb=="top"){
if (lorr=="left"){
$(this).prepend(' <div id="ppostc"><a href="'+turl+'">#'+count2+'</a></div> ');
}else{
$(this).prepend(' <div id="ppostc" style="float:right;"><a href="'+turl+'">#'+count2+'</a></div> ');
};
}else{
if (lorr=="left"){
$(this).append(' <div id="ppostc"><a href="'+turl+'">#'+count2+'</a></div> ');
}else{
$(this).append(' <div id="ppostc" style="float:right;"><a href="'+turl+'">#'+count2+'</a></div> ');
};
};
});
$('#ppostc a').click(function() {
alert($(this).attr("href"));
});
});
Re: Post Number for phpBB3
Yes is not counting correct I have 15 post per page after 15 is not counting 16 17 18 and so on...
Re: Post Number for phpBB3
Mati™ wrote:Yes is not counting correct I have 15 post per page after 15 is not counting 16 17 18 and so on...
Hi Mati,
Sorry again to make some noise into your topic!
I have a question from here. Can you come there?
Thank you!
Re: Post Number for phpBB3
after test working with phpbb3 and punbb good_Twisted_Mods_ wrote:lol im messing up alot today
- Code:
$(function(){
torb = "top";
lorr = "right";
$('#main-content .post').each(function(index){
var count1 = $('.pagination:last>strong:first').text();
count2 = index+1;
if(count1>1){ count2 = ($('#main-content .post').length-1*count1)+index+1;}
turl = $(this).attr('id');
turl = location.href + "#" + turl;
if (torb=="top"){
if (lorr=="left"){
$(this).prepend(' <div id="ppostc"><a href="'+turl+'">#'+count2+'</a></div> ');
}else{
$(this).prepend(' <div id="ppostc" style="float:right;"><a href="'+turl+'">#'+count2+'</a></div> ');
};
}else{
if (lorr=="left"){
$(this).append(' <div id="ppostc"><a href="'+turl+'">#'+count2+'</a></div> ');
}else{
$(this).append(' <div id="ppostc" style="float:right;"><a href="'+turl+'">#'+count2+'</a></div> ');
};
};
});
$('#ppostc a').click(function() {
alert($(this).attr("href"));
});
});
![Smile](https://2img.net/i/fa/i/smiles/icon_smile.gif)
Michael_vx- Forumember
-
Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt
Re: Post Number for phpBB3
@AlexisMcDevin, please take such conversation to Private Messages. ![Wink](https://2img.net/i/fa/i/smiles/icon_wink.gif)
@Mati
, try this :
Go to Administration Panel > Display > Templates > General > viewtopic_body![Edit](/users/3412/19/22/63/smiles/1005357294.png)
Find :
Replace by :
Save and publish![Add](/users/3412/19/22/63/smiles/644535217.png)
Use CSS to change the alignment :
Display > Colors > CSS stylesheet
![Wink](https://2img.net/i/fa/i/smiles/icon_wink.gif)
@Mati
![:tm: ™️](https://cdn.jsdelivr.net/emojione/assets/png/2122.png?v=2.2.7)
Go to Administration Panel > Display > Templates > General > viewtopic_body
![Edit](/users/3412/19/22/63/smiles/1005357294.png)
Find :
- Code:
<div style="position: relative; top: -30px; width: 1px;" id="{postrow.displayed.U_POST_ID}"></div>
Replace by :
- Code:
<div style="position: relative; top: -30px; width: 1px;" id="{postrow.displayed.U_POST_ID}"></div>
<div class="postNumberContainer"><a href="{postrow.displayed.POST_URL}" class="postNumber">#{postrow.displayed.COUNT_POSTS}</a></div>
Save and publish
![Add](/users/3412/19/22/63/smiles/644535217.png)
Use CSS to change the alignment :
Display > Colors > CSS stylesheet
- Code:
.postNumberContainer { text-align:right }
Re: Post Number for phpBB3
@Ange Tuteur
is this code for phpbb2 or can work on any version![Very Happy](https://2img.net/i/fa/i/smiles/icon_biggrin.png)
i like to collect info![Very Happy](https://2img.net/i/fa/i/smiles/icon_biggrin.png)
thanks
and sorry for my unhelpful code
is this code for phpbb2 or can work on any version
![Very Happy](https://2img.net/i/fa/i/smiles/icon_biggrin.png)
i like to collect info
![Very Happy](https://2img.net/i/fa/i/smiles/icon_biggrin.png)
thanks
and sorry for my unhelpful code
Michael_vx- Forumember
-
Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt
Page 1 of 2 • 1, 2
![-](https://2img.net/i/empty.gif)
» Where to find post number???
» Reset Post Number
» Remove post number
» Post Number not showing up in some posts
» The number of topics does not match the number of articles
» Reset Post Number
» Remove post number
» Post Number not showing up in some posts
» The number of topics does not match the number of articles
Page 1 of 2
Permissions in this forum:
You cannot reply to topics in this forum