The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

How to create a HTML page that displays the last 20 posts on your forum?

View previous topic View next topic Go down

How to create a HTML page that displays the last 20 posts on your forum?

Post by Soulmonster on December 29th 2013, 10:01 pm

I would like to create a HTML page that displays the last 20 posts on my forum. With "displays" I mean that contents of the entire posts are shown, not just the title. Members looking at the page should also be able to reply to posts directly from this page.

I believe this will be a useful feature for my members who only stop by my forum once in a while. This is quite similar to "View posts since last visit", but it actually shows the entire posts in one page and with the possibility of members to reply directly, hence giving them a very quick and easy way to keep abreast with what is happening and replying without having to navigate the whole forum and read complete threads.

Thanks and I hope you all are having a great holiday!

Soulmonster
Forumember

Posts : 203
Reputation : 2
Language : Norwegian

Back to top Go down

Re: How to create a HTML page that displays the last 20 posts on your forum?

Post by Luffy on December 29th 2013, 11:43 pm

I was thinking of creating the same thing my friend and i started by my self to create that by adding a specific page like the portal and having these topics. I haven't managed to finish it yet but if u like i could give it a try. I only need to know your forum version to see if i can give it a try or not because versions are different, so as the templates.

Νote that this will take time to accomplish and a lot of patience.
I am still working on mine! Very Happy

Luffy
Manager
Manager

Male Posts : 4258
Reputation : 424
Language : Greek, English
Location : Greece

http://helpgr.forumgreek.com/forum

Back to top Go down

Re: How to create a HTML page that displays the last 20 posts on your forum?

Post by Ultron's Vision on December 30th 2013, 12:12 am

I can *easily* build such page for the last 10 posts, if that is enough for you.

20 posts is a little tricky as the /rss page only gives information about the last 10 posts.

Ultron's Vision
Forumember

Male Posts : 634
Reputation : 45
Language : English | German | HTML | JavaScript | PHP | C++ | Perl | Java
Location : Vienna, Austria

http://duelacademy.net

Back to top Go down

Re: How to create a HTML page that displays the last 20 posts on your forum?

Post by Luffy on December 30th 2013, 12:16 am

I am trying to create this page even though i don't have that much knowledge but if u could make it for me that would ease my very much. Even tho i will keep on trying to build it my own with the 20.. Very Happy (if i manage to do it) But for me its ok with the 10 recent ones.

If u could make it for punbb i would be great full to you!






Luffy
Manager
Manager

Male Posts : 4258
Reputation : 424
Language : Greek, English
Location : Greece

http://helpgr.forumgreek.com/forum

Back to top Go down

Re: How to create a HTML page that displays the last 20 posts on your forum?

Post by Ultron's Vision on December 30th 2013, 12:28 am

It's version-independant for the most part. Below a rough JavaScript draft (assumes jQuery is included in the HTML page). I'll just leave out the version selector as I'm on my phone right now.

Code:
(function($){
 $(function(){
  var cp = "", lp = "", n = 0, i, rss, postselector, v = document.createElement("html"), hr = /<html(.*?)>/, dr = /<!doctype html(.*?)>/i, er = /<\/html>/;
  $.get('/rss',function(d){rss=$.parseXML(d);}
  rss = $(rss)
  for(n,i;(i=$('item link',rss)[n++]);){
  cp = i.innerHTML;
  $.get(cp,{view:'newest'},function(d){v.innerHTML=d.replace(hr,'').replace(dr,'').replace(er,'');lp=$(postselector,v);// now we have the latest post in theory. I'll do something with it later on
});
 }
 });
})(jQuery);

My indentation might be a little off due to writing the code on my phone, but I had to write this draft so that I won't forget the idea later on. Above is not a fully functioning script yet.

Ultron's Vision
Forumember

Male Posts : 634
Reputation : 45
Language : English | German | HTML | JavaScript | PHP | C++ | Perl | Java
Location : Vienna, Austria

http://duelacademy.net

Back to top Go down

Re: How to create a HTML page that displays the last 20 posts on your forum?

Post by Luffy on December 30th 2013, 12:47 am

i am waiting for your complete result!






Luffy
Manager
Manager

Male Posts : 4258
Reputation : 424
Language : Greek, English
Location : Greece

http://helpgr.forumgreek.com/forum

Back to top Go down

Re: How to create a HTML page that displays the last 20 posts on your forum?

Post by Soulmonster on December 30th 2013, 7:46 am

Marios94 wrote:I was thinking of creating the same thing my friend and i started by my self to create that by adding a specific page like the portal and having these topics. I haven't managed to finish it yet but if u like i could give it a try. I only need to know your forum version to see if i can give it a try or not because versions are different, so as the templates.

Νote that this will take time to accomplish and a lot of patience.
I am still working on mine! Very Happy
Thank you, Marios94. I am using phpBB3. Here's the address to the forum: http://www.saltvannsprat.com/

Soulmonster
Forumember

Posts : 203
Reputation : 2
Language : Norwegian

Back to top Go down

Re: How to create a HTML page that displays the last 20 posts on your forum?

Post by Soulmonster on December 30th 2013, 7:46 am

@Ultron's Vision wrote:I can *easily* build such page for the last 10 posts, if that is enough for you.

20 posts is a little tricky as the /rss page only gives information about the last 10 posts.
Thank you! 10 posts would be sufficient!

Soulmonster
Forumember

Posts : 203
Reputation : 2
Language : Norwegian

Back to top Go down

Re: How to create a HTML page that displays the last 20 posts on your forum?

Post by SLGray on December 30th 2013, 5:48 pm

@Soulmonster wrote:
Marios94 wrote:I was thinking of creating the same thing my friend and i started by my self to create that by adding a specific page like the portal and having these topics. I haven't managed to finish it yet but if u like i could give it a try. I only need to know your forum version to see if i can give it a try or not because versions are different, so as the templates.

Νote that this will take time to accomplish and a lot of patience.
I am still working on mine! Very Happy
Thank you, Marios94. I am using phpBB3. Here's the address to the forum: http://www.saltvannsprat.com/

@Soulmonster wrote:
@Ultron's Vision wrote:I can *easily* build such page for the last 10 posts, if that is enough for you.

20 posts is a little tricky as the /rss page only gives information about the last 10 posts.
Thank you! 10 posts would be sufficient!
Please don't double/triple post. Your post need to be separated by 24 hours before bumping, replying or adding more information. Please use the edit button instead!

Since you broke the same rule after being warned, you have received a serious warning.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36735
Reputation : 2447
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Re: How to create a HTML page that displays the last 20 posts on your forum?

Post by Soulmonster on January 2nd 2014, 12:55 pm

@Ultron's Vision wrote:I can *easily* build such page for the last 10 posts, if that is enough for you.

20 posts is a little tricky as the /rss page only gives information about the last 10 posts.
Hi and happy new year Smile

Did you have time to look at this?

Soulmonster
Forumember

Posts : 203
Reputation : 2
Language : Norwegian

Back to top Go down

Re: How to create a HTML page that displays the last 20 posts on your forum?

Post by Ultron's Vision on January 2nd 2014, 9:22 pm

I have holidays right now, sorry for this being a bit tardy.
I'll get back to you later.

Ultron's Vision
Forumember

Male Posts : 634
Reputation : 45
Language : English | German | HTML | JavaScript | PHP | C++ | Perl | Java
Location : Vienna, Austria

http://duelacademy.net

Back to top Go down

Re: How to create a HTML page that displays the last 20 posts on your forum?

Post by Soulmonster on January 2nd 2014, 9:22 pm

@Ultron's Vision wrote:I have holidays right now, sorry for this being a bit tardy.
I'll get back to you later.
No problems at all, enjoy your holidays Smile

Soulmonster
Forumember

Posts : 203
Reputation : 2
Language : Norwegian

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum