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.
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.
Last edited by AlexisMcDevin on Tue Dec 30, 2014 7:48 pm; 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"));
});
});
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.
@Mati, try this :
Go to Administration Panel > Display > Templates > General > viewtopic_body
Find :
Replace by :
Save and publish
Use CSS to change the alignment :
Display > Colors > CSS stylesheet
@Mati, try this :
Go to Administration Panel > Display > Templates > General > viewtopic_body
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
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
i like to collect info
thanks
and sorry for my unhelpful code
is this code for phpbb2 or can work on any version
i like to collect info
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
Similar topics
» Remove post number
» Where to find post number???
» Reset Post Number
» Post Number not showing up in some posts
» The number of topics does not match the number of articles
» Where to find post number???
» Reset 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