Page 3 of 9

Beta testers for new version needed

Posted: 10 Nov 2011, 01:09
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

Beta testers for new version needed

Posted: 10 Nov 2011, 02:34
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 -->

Beta testers for new version needed

Posted: 10 Nov 2011, 03:31
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,

Beta testers for new version needed

Posted: 10 Nov 2011, 08:30
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.

Beta testers for new version needed

Posted: 10 Nov 2011, 10:32
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.)

Beta testers for new version needed

Posted: 10 Nov 2011, 10:35
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.

Beta testers for new version needed

Posted: 10 Nov 2011, 11:36
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)

Beta testers for new version needed

Posted: 10 Nov 2011, 11:44
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.

Beta testers for new version needed

Posted: 10 Nov 2011, 11:48
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.

Beta testers for new version needed

Posted: 10 Nov 2011, 12:05
by Stoker
That would be a good reason for excluding a forum.
And thanks for posting the code ;)