Neat little trick tydoktornotor wrote:So, back to the jQuery check... Changed the mod to use this in overall_header.html
Works nicely.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>
Beta testers for new version needed
- martin123456
- 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
- doktornotor
- BBCoder IV
- Posts: 167
- Joined: 14 Sep 2011, 23:20
- BBCodes: 30
- Favourite MOD: Thanks for Posts
- Contact:
Beta testers for new version needed
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:
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"> {L_RECENT_ACTIVE} </th>
<th width="50"> {L_REPLIES} </th>
<th width="50"> {L_VIEWS} </th>
<th> {L_LAST_POST} </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!
- martin123456
- 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
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
so i set it on the overall header as
Code: Select all
row_height : '41px',
max_items : 4,
speed : 700,
interval : 2000,
mousestop : true,
- Stoker
- 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
Are you 100% sure this is bug free doktornotor?
I have been googling the issue and couldnt find any documentation for a working solution.
I have been googling the issue and couldnt find any documentation for a working solution.
Board rules! No PM support
- doktornotor
- BBCoder IV
- Posts: 167
- Joined: 14 Sep 2011, 23:20
- BBCodes: 30
- Favourite MOD: Thanks for Posts
- Contact:
Beta testers for new version needed
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: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.
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>
(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!
- Stoker
- 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
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.
Jquery is going to be included in 3.1 so I wont do more about it.
Board rules! No PM support
- doktornotor
- BBCoder IV
- Posts: 167
- Joined: 14 Sep 2011, 23:20
- BBCodes: 30
- Favourite MOD: Thanks for Posts
- Contact:
Beta testers for new version needed
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:
Replace with:
(Would be nice to have this in ACP )
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';
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';
Support requests via PM go straight to /dev/null!
- Stoker
- 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
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.
But no, if you remove it from the querie in the top stats file that should do it.
Board rules! No PM support
- doktornotor
- BBCoder IV
- Posts: 167
- Joined: 14 Sep 2011, 23:20
- BBCodes: 30
- Favourite MOD: Thanks for Posts
- Contact:
Beta testers for new version needed
That is not the problem... Say, you have an off-topic forum, no need to advertise that noise in recent topics.Stoker wrote:I see no reasen for excluding forums. If users doesnt have permissions to read in the forum they cant see the topic.
Anyway, thanks, it indeed seems to be enough.
Support requests via PM go straight to /dev/null!
- Stoker
- 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
That would be a good reason for excluding a forum.
And thanks for posting the code
And thanks for posting the code
Board rules! No PM support