Beta testers for new version needed

Download and support for PhpBB3 Top Stats Mod
User avatar
martin123456
BBCoder VI
BBCoder VI
Posts: 765
Joined: 25 Jul 2011, 13:29
BBCodes: 34
Favourite MOD: Ban button
Location: Down south!
Contact:

Beta testers for new version needed

Post by martin123456 »

doktornotor wrote:So, back to the jQuery check... Changed the mod to use this in overall_header.html

Code: Select all

<script type="text/javascript">
if (typeof jQuery == 'undefined') {
    document.write(unescape('%3Cscript src="{ROOT_PATH}script/jquery-1.7.min.js" type="text/javascript"%3E%3C/script%3E'));
}
</script>
Works nicely. :)
Neat little trick ty
User avatar
doktornotor
BBCoder IV
BBCoder IV
Posts: 167
Joined: 14 Sep 2011, 23:20
BBCodes: 30
Favourite MOD: Thanks for Posts
Contact:

Beta testers for new version needed

Post by doktornotor »

Some more bugs noted here

Additionally, there is a bunch of bugs in the subsilver2 recent_active_body.html template, a redundant </td> and unclosed <img> tag... Posting a fixed one here:

Code: Select all

<!-- Start Recent Active Topics -->
<table class="tablebg" cellspacing="1" width="100%">
<tr>
	<th colspan="2">&nbsp;{L_RECENT_ACTIVE}&nbsp;</th>
	<th width="50">&nbsp;{L_REPLIES}&nbsp;</th>
	<th width="50">&nbsp;{L_VIEWS}&nbsp;</th>
	<th>&nbsp;{L_LAST_POST}&nbsp;</th>
</tr>
<!-- BEGIN recent_active -->
		<tr>
			<td class="row1" width="50" align="center"><img src="{ROOT_PATH}images/starimg.png" width="27" height="27" alt="" /></td>
			<td class="row1" width="100%">
				<a class="forumlink" href="{recent_active.U_FIRST_TOPIC}">{recent_active.TOPIC_TITLE}</a>
				<p class="forumdesc">{L_POST_BY_AUTHOR} <a style="font-weight:bold; color: #{recent_active.TOPIC_FIRST_POSTER_COLOUR};" href="{recent_active.USERNAME_FIRST}">{recent_active.TOPIC_FIRST_POSTER_NAME}</a> {recent_active.TOPIC_TIME}</p>
			</td>
			<td class="row2" align="center"><p class="topicdetails">{recent_active.TOPIC_REPLIES}</p></td>
			<td class="row2" align="center"><p class="topicdetails">{recent_active.TOPIC_VIEWS}</p></td>
			<td class="row2" align="center" nowrap="nowrap">
					<p class="topicdetails">{recent_active.TOPIC_LAST_POST_TIME}</p>
					<p class="topicdetails"><a style="font-weight:bold; color: #{recent_active.TOPIC_LAST_POSTER_COLOUR};" href="{recent_active.USERNAME_LAST}">{recent_active.TOPIC_LAST_POSTER_NAME}</a> <a href="{recent_active.U_LAST_TOPIC}">{LAST_POST_IMG}</a>
					</p>
			</td>
		</tr>
<!-- END recent_active -->
</table>
<br />
<!-- End Recent Active Topics -->
Support requests via PM go straight to /dev/null!
User avatar
martin123456
BBCoder VI
BBCoder VI
Posts: 765
Joined: 25 Jul 2011, 13:29
BBCodes: 34
Favourite MOD: Ban button
Location: Down south!
Contact:

Beta testers for new version needed

Post by martin123456 »

Verson 103 don't keep the speed setting once submit is clicked the setting are blank

so i set it on the overall header as

Code: Select all

row_height	:	'41px',
				max_items   :   4,
				speed       :   700,
				interval    :   2000,
				mousestop	:	true,
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Beta testers for new version needed

Post by Stoker »

Are you 100% sure this is bug free doktornotor?

I have been googling the issue and couldnt find any documentation for a working solution.
Board rules! No PM support
User avatar
doktornotor
BBCoder IV
BBCoder IV
Posts: 167
Joined: 14 Sep 2011, 23:20
BBCodes: 30
Favourite MOD: Thanks for Posts
Contact:

Beta testers for new version needed

Post by doktornotor »

Stoker wrote:Are you 100% sure this is bug free doktornotor?

I have been googling the issue and couldnt find any documentation for a working solution.
It definitely works as it should. Since some JS guys do not like typeof being used to check for variable existence, you can access the variable as a property of the built-in window object insted, like this:

Code: Select all

if (window.jQuery === undefined) { ... }


Cf. JQuery Core Style Guidelines.

So, the check would look like this instead:

Code: Select all

<script type="text/javascript">
if (window.jQuery === undefined) {
    document.write(unescape('%3Cscript src="{ROOT_PATH}script/jquery-1.7.min.js" type="text/javascript"%3E%3C/script%3E'));
}
</script>
Again, tested and working.

(Apparently, there is also a solution which allows multiple (different) jQ versions, using jQuery.noConflict() API - but that seems overly complicated for this.)
Last edited by doktornotor on 10 Nov 2011, 10:39, edited 1 time in total.
Support requests via PM go straight to /dev/null!
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Beta testers for new version needed

Post by Stoker »

Yes, the problem is that is doesnt check for other versions which often is the problem.
Jquery is going to be included in 3.1 so I wont do more about it.
Board rules! No PM support
User avatar
doktornotor
BBCoder IV
BBCoder IV
Posts: 167
Joined: 14 Sep 2011, 23:20
BBCodes: 30
Favourite MOD: Thanks for Posts
Contact:

Beta testers for new version needed

Post by doktornotor »

BTW... I am trying to exclude a forum (say, the id is 1) from recent active topics. Will this edit in includes/functions_top_stats.php work or do I need to mess with more files?

Find:

Code: Select all

	$sql = 'SELECT topic_id, forum_id, topic_title, topic_time, topic_views, topic_poster, topic_replies, topic_first_poster_name, topic_first_poster_colour, topic_last_post_id, topic_last_poster_name, topic_last_poster_colour, topic_last_post_time, topic_last_view_time, topic_last_poster_id
		FROM ' . TOPICS_TABLE . ' WHERE ' . $db->sql_in_set('forum_id', $flist) . ' AND topic_moved_id = 0 AND topic_approved
		ORDER BY topic_last_post_id DESC';
Replace with:

Code: Select all

	$sql = 'SELECT topic_id, forum_id, topic_title, topic_time, topic_views, topic_poster, topic_replies, topic_first_poster_name, topic_first_poster_colour, topic_last_post_id, topic_last_poster_name, topic_last_poster_colour, topic_last_post_time, topic_last_view_time, topic_last_poster_id
		FROM ' . TOPICS_TABLE . ' WHERE ' . $db->sql_in_set('forum_id', $flist) . ' AND topic_moved_id = 0 AND topic_approved AND forum_id <> 1
		ORDER BY topic_last_post_id DESC';
(Would be nice to have this in ACP :P)
Support requests via PM go straight to /dev/null!
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Beta testers for new version needed

Post by Stoker »

I see no reasen for excluding forums. If users doesnt have permissions to read in the forum they cant see the topic.

But no, if you remove it from the querie in the top stats file that should do it.
Board rules! No PM support
User avatar
doktornotor
BBCoder IV
BBCoder IV
Posts: 167
Joined: 14 Sep 2011, 23:20
BBCodes: 30
Favourite MOD: Thanks for Posts
Contact:

Beta testers for new version needed

Post by doktornotor »

Stoker wrote:I see no reasen for excluding forums. If users doesnt have permissions to read in the forum they cant see the topic.
That is not the problem... Say, you have an off-topic forum, no need to advertise that noise in recent topics.

Anyway, thanks, it indeed seems to be enough.
Support requests via PM go straight to /dev/null!
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Beta testers for new version needed

Post by Stoker »

That would be a good reason for excluding a forum.
And thanks for posting the code ;)
Board rules! No PM support
Locked