Area51 @ 4seven.de

Mod Base and Testarea
It is currently 23 Feb 2025, 18:28

All times are UTC + 1 hour




Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: [DEV] JQ Who is where
PostPosted: 02 Jul 2012, 18:49 
Offline
Tiptop
Tiptop
User avatar

Joined: 02 Jul 2012, 12:23
Posts: 1
Location: Florida, USA
If you already have a mod loading jquery.min.js, how would you change the code?
Would changing
!window.jQuery && document.write('<script type="text\/javascript" src="http:\/\/code.jquery.com\/jquery.min.js"><\/script>');
to
!window.jQuery && document.write;
work?

or do I need to change it some other way? I am a total newbie in coding.

Had to join your forum so I wouldn't lose your talents now that phpBB stupidly banned you.
If you ever write your own forum software, just let me know! I'll switch in a minute!

_________________
Image


Top
 Profile  
Reply with quote  
PostPosted: 02 Jul 2012, 19:52 
Offline
Tiptop
Tiptop
User avatar

Joined: 20 Jun 2012, 16:55
Posts: 318
Just leave the mod code in styles/prosilver/template/index_body.html, bcs. this code loads the jquery core only, if its not loaded anyway ;)

_________________
Current Mods | Mod Base | php(BB) programming | No help via PM


Top
 Profile  
Reply with quote  
PostPosted: 09 Jul 2012, 21:59 
Offline
Tiptop
Tiptop
User avatar

Joined: 20 Jun 2012, 16:55
Posts: 318
Hi victory1

seems you mean these features:
http://www.phpbb.com/community/viewtopi ... #p13162136

timeline:
http://www.phpbb.com/community/viewtopi ... #p13162375

_________________
Current Mods | Mod Base | php(BB) programming | No help via PM


Top
 Profile  
Reply with quote  
PostPosted: 05 Sep 2012, 13:58 
Offline
Tiptop
Tiptop
User avatar

Joined: 13 Aug 2012, 12:04
Posts: 8
Hi, again me, and again problem with my Artoida Helion Theme...

4seven wrote:
Just leave the mod code in styles/prosilver/template/index_body.html, bcs. this code loads the jquery core only, if its not loaded anyway ;)


In overall_header i have declared jQ
Code:
 <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>


and in index_body I have deleted this:
Code:

<script type="text/javascript">
// <![CDATA[ 
!window.jQuery && document.write('<script type="text\/javascript" src="http:\/\/code.jquery.com\/jquery.min.js"><\/script>');
// ]]>     
</script>


so it should work but it is not. on prosilver MOD works perfectly..

sorry 4 my bad english

_________________
Sorry 4 my bad english...


Top
 Profile  
Reply with quote  
PostPosted: 05 Sep 2012, 16:09 
Offline
Tiptop
Tiptop
User avatar

Joined: 20 Jun 2012, 16:55
Posts: 318
better reverse the intention.

remove this in overall_header.html

Code:
 <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>

and put this there instead

Code:

<script type="text/javascript">
// <![CDATA[ 
!window.jQuery && document.write('<script type="text\/javascript" src="http:\/\/code.jquery.com\/jquery.min.js"><\/script>');
// ]]>     
</script>

and remove this

Code:

<script type="text/javascript">
// <![CDATA[ 
!window.jQuery && document.write('<script type="text\/javascript" src="http:\/\/code.jquery.com\/jquery.min.js"><\/script>');
// ]]>     
</script>

from index_body.html.

_________________
Current Mods | Mod Base | php(BB) programming | No help via PM


Top
 Profile  
Reply with quote  
PostPosted: 05 Sep 2012, 16:50 
Offline
Tiptop
Tiptop
User avatar

Joined: 13 Aug 2012, 12:04
Posts: 8
nope, still the same + MOD mChat stop working.

It is working only when i completely delete from overall_header.html my declaration of jQ ... but then others MOD's using jQ not working

_________________
Sorry 4 my bad english...


Top
 Profile  
Reply with quote  
PostPosted: 05 Sep 2012, 20:36 
Offline
Tiptop
Tiptop
User avatar

Joined: 20 Jun 2012, 16:55
Posts: 318
Hm, seems bad luck or template/js related.
But, also good news, v.0.0.3 is near.

_________________
Current Mods | Mod Base | php(BB) programming | No help via PM


Top
 Profile  
Reply with quote  
PostPosted: 06 Sep 2012, 01:33 
Offline
Tiptop
Tiptop
User avatar

Joined: 13 Aug 2012, 12:04
Posts: 8
I can't wait for new release :)


btw at the moment I found the solution:

in overall_header.html file i have my jQ declaration:
Code:
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>

right after the <head> code


and before </head> code in overall_header.html and remove this part from index_body.html
Code:

<!-- IF S_DISPLAY_ONLINE_LIST || U_VIEWONLINE -->
<
script type="text/javascript">
// <![CDATA[
 
$(document).ready(function() { 
     <!-- IF 
S_DISPLAY_ONLINE_LIST -->
     $(
'#who_is_online_total').load('{ROOT_PATH}who_is_online_total.php?sid={SESSION_ID}', {dol '{S_DISPLAY_ONLINE_LIST}'});
     $(
'#who_is_online_reg').load('{ROOT_PATH}who_is_online_reg.php?sid={SESSION_ID}', {dol '{S_DISPLAY_ONLINE_LIST}'});
     <!-- ENDIF -->
     <!-- IF 
U_VIEWONLINE -->
     $(
'#who_is_where').load('{ROOT_PATH}who_is_where.php?sid={SESSION_ID}');
     <!-- ENDIF -->
     var 
refreshId setInterval(function() {
     <!-- IF 
S_DISPLAY_ONLINE_LIST -->
     $(
'#who_is_online_total').load('{ROOT_PATH}who_is_online_total.php?sid={SESSION_ID}', {dol '{S_DISPLAY_ONLINE_LIST}'});
     $(
'#who_is_online_reg').load('{ROOT_PATH}who_is_online_reg.php?sid={SESSION_ID}', {dol '{S_DISPLAY_ONLINE_LIST}'});
     <!-- ENDIF -->
     <!-- IF 
U_VIEWONLINE -->
     $(
'#who_is_where').load('{ROOT_PATH}who_is_where.php?sid={SESSION_ID}');
     <!-- ENDIF -->
     }, 
2000);
   $.
ajaxSetup({ cachefalse });
 });
// ]]>
</script>
<!-- ENDIF -->



If you can't go left... go right ;) thx for help

_________________
Sorry 4 my bad english...


Top
 Profile  
Reply with quote  
PostPosted: 06 Sep 2012, 17:00 
Offline
Tiptop
Tiptop
User avatar

Joined: 20 Jun 2012, 16:55
Posts: 318
Fine that it works now. Multiple (and old) jquery and crappy jq/js codings often makes problems.
Because of that i build up to 99% codes, which works always with (latest) jquery/full_or_min.js
and i code all modules (mostly) completely by myself.

Also i use always this code to prevent multiple includes:

Code:
    <script type="text/javascript">
    // <![CDATA[ 
    !window.jQuery && document.write('<script type="text\/javascript" src="http:\/\/code.jquery.com\/jquery.min.js"><\/script>');
    // ]]>     
    </script>

Means, if not loaded, load. Otherwise, do nothing.

_________________
Current Mods | Mod Base | php(BB) programming | No help via PM


Top
 Profile  
Reply with quote  
PostPosted: 08 Sep 2012, 07:51 
Offline
Tiptop
Tiptop
User avatar

Joined: 13 Aug 2012, 12:04
Posts: 8
Thanks for your advice, I just edited my overall_header.html file and paste the code, everything works as it should ;)

_________________
Sorry 4 my bad english...


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2, 3  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
[ Time : 0.026s | 24 Queries | GZIP : Off ]