[CDB] Live topic update

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Scam Warning
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
Ger
Recognised Extension Developer
Posts: 1922
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

[CDB] Live topic update

Post by Ger »

Extension Name: Live topic update
Author: Ger

Extension Description: Inpired by the Idea from Theriddler1 this extensions checks if there are new posts in a topic currently viewed by the user. If so, a bar indicating the new posts is placed below the latest post of the page. Clicking on the bar loads the new posts.

Features:
  1. Config for the interval to check for new posts (In ACP -> Load settings), default every 30 seconds
  2. Check only when on last page of a topic
  3. When new posts are made, a bar indicating the number of new posts appears below the latest post
  4. Short indicator prepended to page title (in tab)
  5. Clicking the bar loads de new posts
Extension Version: 1.0.2-RC

Requirements:
  • phpBB 3.2
  • PHP 5.4+
  • Visitors need Javascript for this to work
Screenshot
Image

Extension Download: https://github.com/GerB/livetopicupdate
Last edited by Ger on Wed Jan 31, 2018 10:39 am, edited 7 times in total.
My extensions:
Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update, Modern Quote, Quoted Where (GDPR) and Autoresponder.
Newest: FAQ manager for 3.2

Like my work? Buy me a coffee to keep it coming. :ugeek:
-Available for custom work-

Bermudez
Registered User
Posts: 145
Joined: Mon Aug 15, 2011 11:56 pm
Location: Spain
Name: Juan Antonio
Contact:

Re: [3.2][ALPHA] Live topic update

Post by Bermudez »

Interesting extension.
Thank you for the development.

User avatar
eunaumtenhoid
Registered User
Posts: 927
Joined: Wed Jun 03, 2009 12:46 am
Location: ????

Re: [3.2][ALPHA] Live topic update

Post by eunaumtenhoid »

nice work dude ^^^congratulations
My translations of the extensions for Brazilian Portuguese
https://github.com/phpBBTraducoes

User avatar
Ger
Recognised Extension Developer
Posts: 1922
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: [3.2][ALPHA] Live topic update

Post by Ger »

Thanks guys :)
My extensions:
Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update, Modern Quote, Quoted Where (GDPR) and Autoresponder.
Newest: FAQ manager for 3.2

Like my work? Buy me a coffee to keep it coming. :ugeek:
-Available for custom work-

User avatar
Theriddler1
Registered User
Posts: 448
Joined: Sat Aug 27, 2011 11:00 pm
Location: NL
Name: Theriddler❶
Contact:

Re: [3.2][ALPHA] Live topic update

Post by Theriddler1 »

Nice work Ger, +10 for making my idea into a extension :ugeek:
Theriddler - Moderator @ phpBB.nl | phpBBservice.nl Team-member
ImageSupport Tools | Image My Extensions | buy me a beer Image

User avatar
ViolaF
Registered User
Posts: 1469
Joined: Tue Aug 14, 2012 11:52 pm

Re: [3.2][ALPHA] Live topic update

Post by ViolaF »

better use

Code: Select all

<script type="text/javascript">
// <![CDATA[
    var ltu_checkurl = '{U_LIVEUPDATE}';
    var ltu_refreshurl = '{U_REFRESH}';
// ]]>
</script>
instead of

Code: Select all

<script>
    var ltu_checkurl = '{U_LIVEUPDATE}';
    var ltu_refreshurl = '{U_REFRESH}';
</script>
in viewtopic_body_topic_actions_before.html

User avatar
Ger
Recognised Extension Developer
Posts: 1922
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: [3.2][ALPHA] Live topic update

Post by Ger »

According to W3 cdata is no longer needed nor allowed for raw text as javascript elements.
https://www.w3.org/TR/html5/syntax.html ... strictions
My extensions:
Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update, Modern Quote, Quoted Where (GDPR) and Autoresponder.
Newest: FAQ manager for 3.2

Like my work? Buy me a coffee to keep it coming. :ugeek:
-Available for custom work-

User avatar
ViolaF
Registered User
Posts: 1469
Joined: Tue Aug 14, 2012 11:52 pm

Re: [3.2][ALPHA] Live topic update

Post by ViolaF »

shure,but what about other or older browsers ;)

User avatar
Ger
Recognised Extension Developer
Posts: 1922
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: [3.2][ALPHA] Live topic update

Post by Ger »

Any browser a sane user should use (e.g. that is still supported by its maker), recognises the HTML5 document, the text/html content-type and know that HTML is not XHTML nor XML. Therefore the browser knows that we're talking about javascript (default for script tags) and that that is cosidered as raw text. Just look at the source code for this very page, you'll find a similar construct:

Code: Select all

<script>
		WebFontConfig = {
			google: {
				families: ['Open Sans:n6']
			}
		};

		(function(d) {
			var wf = d.createElement('script'), s = d.scripts[0];
			wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js';
			wf.async = true;
			s.parentNode.insertBefore(wf, s);
		})(document);
	</script>
My extensions:
Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update, Modern Quote, Quoted Where (GDPR) and Autoresponder.
Newest: FAQ manager for 3.2

Like my work? Buy me a coffee to keep it coming. :ugeek:
-Available for custom work-

User avatar
Ger
Recognised Extension Developer
Posts: 1922
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: [3.2][ALPHA] Live topic update

Post by Ger »

I've updated the extension. It now has a setting for the interval to check for new posts and it only executes the check when the user is on the last page of a topic.
Also some modifications to the style and language.
My extensions:
Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update, Modern Quote, Quoted Where (GDPR) and Autoresponder.
Newest: FAQ manager for 3.2

Like my work? Buy me a coffee to keep it coming. :ugeek:
-Available for custom work-

User avatar
jackennils
Registered User
Posts: 227
Joined: Mon Jun 01, 2009 7:48 pm

Re: [3.2][ALPHA] Live topic update

Post by jackennils »

Super cool idea! I'll give it a try later today. Keep it up!

User avatar
ViolaF
Registered User
Posts: 1469
Joined: Tue Aug 14, 2012 11:52 pm

Re: [3.2][ALPHA] Live topic update

Post by ViolaF »

found this on the phpbb.com main-page in source-code, but nevermind....

Code: Select all

<script type="text/javascript">
// <![CDATA[
	var _gaq = _gaq || [];
	_gaq.push(['_setAccount', 'UA-93879-2']);
	_gaq.push(['_trackPageview']);

	(function() {
	var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
	ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
	var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
	})();
// ]]>
</script>

User avatar
canonknipser
Registered User
Posts: 2096
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: [3.2][ALPHA] Live topic update

Post by canonknipser »

As anybody can see on a quick glance, that is the javascript for google analytics (ga), which has nothing to do with phpBB itself.
And, when you check the ga web site, the code used here seems to be quite old (but still working), a newer version you find on the ga site. Maybe you can open a ticket on the website tracker to fix this old snipplet
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB

pkbarbiedoll
Registered User
Posts: 93
Joined: Sat Dec 01, 2007 12:10 am

Re: [3.2][ALPHA] Live topic update

Post by pkbarbiedoll »

Nice job, look forward to implementing on my board.

pkbarbiedoll
Registered User
Posts: 93
Joined: Sat Dec 01, 2007 12:10 am

Re: [3.2][ALPHA] Live topic update

Post by pkbarbiedoll »

Ger wrote:
Tue Oct 10, 2017 11:59 am
I've updated the extension. It now has a setting for the interval to check for new posts and it only executes the check when the user is on the last page of a topic.
So if a user is on the last page, the live updates won't appear?

Locked

Return to “Extensions in Development”