hicuxunicorniobestbuildpc
|
Posted:
Thu Nov 06, 2014 3:29 pm |
|
Quote: | If you would load a jquery code/file with JSToBody before the header is included, then you would get the next conflict |
This is not true at all and I do have proof of this fact. I willl show u with details but it is incredible how weird you are acting just because you think it won't work for others. Who cares? Like this you won't reach any goal in your life because you think u will fail. Failing is the key to success and I will keep on searching and testing. Why not? Here I show you something I would like you to test yourself.
I created a Master Clock module yesterday evening: I change in jquery.php
Code:addJSToBody('includes/jquery/jquery.js', 'file');
|
If I do this I get a conflict with this module but I created another Music Module which is working properly with the same changed.
Example 1: Master Clock Module
[ Only registered users can see links on this board! Get registered or login! ]
As u see it is not working:
index.php
Code:<?php
//module made by hicux at bestbuildpc.org
/**********************************/
/* Module Configuration */
/* (right side on) v3.1 */
/* Remove the following line */
/* will remove the right side */
/**********************************/
//define('INDEX_FILE', true);
//$index = 1;
if (!defined('MODULE_FILE')) die('You can\'t access this file directly...');
if (!defined('PHP_EOL')) define('PHP_EOL', strtoupper(substr(PHP_OS,0,3) == 'WIN') ? "\r\n" : "\n");
$module_name = 'Master_Clock';
$module_name = basename(dirname(__FILE__));
$pagetitle = '- ' . $module_name . '';
$index = 0;
if (!defined('INDEX_FILE')) define('INDEX_FILE', true); // Set to FALSE to hide right blocks
if (defined('INDEX_FILE') AND INDEX_FILE === true) {
// auto set right blocks for pre patch 3.1 compatibility
$index = 1;
}
$jClockcss= 'modules/' . $module_name . '/css/jClocksGMT.css';
if (function_exists('addCSSToHead')) {
addCSSToHead($jClockcss, 'file');
} else {
echo '<link rel="stylesheet" href="' , $jClockcss , '" type="text/css">';
}
addJSToBody('modules/' . $module_name . '/js/jClocksGMT.js', 'file');
addJSToBody('modules/' . $module_name . '/js/jquery.rotate.js', 'file');
$clockjs = '<script type="text/javascript">
$(document).ready(function(){
$(\'#clock_hou\').jClocksGMT({offset: \'-5\', hour24: true});
$(\'#clock_dc\').jClocksGMT({offset: \'+1\', hour24: true});
$(\'#clock_india\').jClocksGMT({offset: \'+5.5\'});
});
</script>'."\n";
if (function_exists('addJSToBody')) {
addJSToBody($clockjs, 'inline');
} else {
echo $clockjs;
}
include_once 'header.php';
OpenTable();
echo '<div id="clock_hou" class="clock_container">' , PHP_EOL
, '<div class="lbl">Havana, CU, Cuba</div>' , PHP_EOL
, '<div class="clockHolder">' , PHP_EOL
, '<div class="rotatingWrapper"><img class="hour" src="modules/' , $module_name , '/images/clock_hour.png" alt="" /></div>' , PHP_EOL
, '<div class="rotatingWrapper"><img class="min" src="modules/' , $module_name , '/images/clock_min.png" alt="" /></div>' , PHP_EOL
, '<div class="rotatingWrapper"><img class="sec" src="modules/' , $module_name , '/images/clock_sec.png" alt="" /></div>' , PHP_EOL
, '<img class="clock" src="modules/' , $module_name , '/images/clock_face.png" alt="" />' , PHP_EOL
, '</div>' , PHP_EOL
, '<div class="digital">' , PHP_EOL
, '<span class="hr"></span><span class="minute"></span><span class="period"></span>' , PHP_EOL
, '</div>' , PHP_EOL
, '</div>' , PHP_EOL
, '<div id="clock_dc" class="clock_container">' , PHP_EOL
, '<div class="lbl">AMS, Amsterdam</div>' , PHP_EOL
, '<div class="clockHolder">' , PHP_EOL
, '<div class="rotatingWrapper"><img class="hour" src="modules/' , $module_name , '/images/clock_hour.png" alt="" /></div>' , PHP_EOL
, '<div class="rotatingWrapper"><img class="min" src="modules/' , $module_name , '/images/clock_min.png" alt="" /></div>' , PHP_EOL
, '<div class="rotatingWrapper"><img class="sec" src="modules/' , $module_name , '/images/clock_sec.png" alt="" /></div>' , PHP_EOL
, '<img class="clock" src="modules/' , $module_name , '/images/clock_face.png" alt="" />' , PHP_EOL
, '</div>' , PHP_EOL
, '<div class="digital">' , PHP_EOL
, '<span class="hr"></span><span class="minute"></span><span class="period"></span>' , PHP_EOL
, '</div>' , PHP_EOL
, '</div>' , PHP_EOL
, '<div id="clock_india" class="clock_container">' , PHP_EOL
, '<div class="lbl">New Delhi, India</div>' , PHP_EOL
, '<div class="clockHolder">' , PHP_EOL
, '<div class="rotatingWrapper"><img class="hour" src="modules/' , $module_name , '/images/clock_hour.png" alt="" /></div>' , PHP_EOL
, '<div class="rotatingWrapper"><img class="min" src="modules/' , $module_name , '/images/clock_min.png" alt="" /></div>' , PHP_EOL
, '<div class="rotatingWrapper"><img class="sec" src="modules/' , $module_name , '/images/clock_sec.png" alt="" /></div>' , PHP_EOL
, '<img class="clock" src="modules/' , $module_name , '/images/clock_face.png" alt="" />' , PHP_EOL
, '</div> ' , PHP_EOL
, '<div class="digital">' , PHP_EOL
, '<span class="hr"></span><span class="minute"></span><span class="period"></span>' , PHP_EOL
, '</div>' , PHP_EOL
, '</div>' , PHP_EOL;
CloseTable();
include_once 'footer.php';
|
Example: 2
[ Only registered users can see links on this board! Get registered or login! ]
This one works properly without any conflict and I am doing the same procedure.
index.php
Code:<?php
if (!defined('MODULE_FILE')) die('You can\'t access this file directly...');
if (!defined('PHP_EOL')) define('PHP_EOL', strtoupper(substr(PHP_OS,0,3) == 'WIN') ? "\r\n" : "\n");
$module_name = 'Master_Clock';
$module_name = basename(dirname(__FILE__));
$pagetitle = '- ' . $module_name . '';
$index = 0;
if (!defined('INDEX_FILE')) define('INDEX_FILE', true); // Set to FALSE to hide right blocks
if (defined('INDEX_FILE') AND INDEX_FILE === true) {
// auto set right blocks for pre patch 3.1 compatibility
$index = 1;
}
$jClockcss= 'modules/' . $module_name . '/css/jClocksGMT.css';
if (function_exists('addCSSToHead')) {
addCSSToHead($jClockcss, 'file');
} else {
echo '<link rel="stylesheet" href="' , $jClockcss , '" type="text/css">';
}
addJSToBody('modules/' . $module_name . '/js/jClocksGMT.js', 'file');
addJSToBody('modules/' . $module_name . '/js/jquery.rotate.js', 'file');
$clockjs = '<script type="text/javascript">
$(document).ready(function(){
$(\'#clock_hou\').jClocksGMT({offset: \'-5\', hour24: true});
$(\'#clock_dc\').jClocksGMT({offset: \'+1\', hour24: true});
$(\'#clock_india\').jClocksGMT({offset: \'+5.5\'});
});
</script>'."\n";
if (function_exists('addJSToBody')) {
addJSToBody($clockjs, 'inline');
} else {
echo $clockjs;
}
include_once 'header.php';
OpenTable();
echo '<div id="clock_hou" class="clock_container">' , PHP_EOL
, '<div class="lbl">Havana, CU, Cuba</div>' , PHP_EOL
, '<div class="clockHolder">' , PHP_EOL
, '<div class="rotatingWrapper"><img class="hour" src="modules/' , $module_name , '/images/clock_hour.png" alt="" /></div>' , PHP_EOL
, '<div class="rotatingWrapper"><img class="min" src="modules/' , $module_name , '/images/clock_min.png" alt="" /></div>' , PHP_EOL
, '<div class="rotatingWrapper"><img class="sec" src="modules/' , $module_name , '/images/clock_sec.png" alt="" /></div>' , PHP_EOL
, '<img class="clock" src="modules/' , $module_name , '/images/clock_face.png" alt="" />' , PHP_EOL
, '</div>' , PHP_EOL
, '<div class="digital">' , PHP_EOL
, '<span class="hr"></span><span class="minute"></span><span class="period"></span>' , PHP_EOL
, '</div>' , PHP_EOL
, '</div>' , PHP_EOL
, '<div id="clock_dc" class="clock_container">' , PHP_EOL
, '<div class="lbl">AMS, Amsterdam</div>' , PHP_EOL
, '<div class="clockHolder">' , PHP_EOL
, '<div class="rotatingWrapper"><img class="hour" src="modules/' , $module_name , '/images/clock_hour.png" alt="" /></div>' , PHP_EOL
, '<div class="rotatingWrapper"><img class="min" src="modules/' , $module_name , '/images/clock_min.png" alt="" /></div>' , PHP_EOL
, '<div class="rotatingWrapper"><img class="sec" src="modules/' , $module_name , '/images/clock_sec.png" alt="" /></div>' , PHP_EOL
, '<img class="clock" src="modules/' , $module_name , '/images/clock_face.png" alt="" />' , PHP_EOL
, '</div>' , PHP_EOL
, '<div class="digital">' , PHP_EOL
, '<span class="hr"></span><span class="minute"></span><span class="period"></span>' , PHP_EOL
, '</div>' , PHP_EOL
, '</div>' , PHP_EOL
, '<div id="clock_india" class="clock_container">' , PHP_EOL
, '<div class="lbl">New Delhi, India</div>' , PHP_EOL
, '<div class="clockHolder">' , PHP_EOL
, '<div class="rotatingWrapper"><img class="hour" src="modules/' , $module_name , '/images/clock_hour.png" alt="" /></div>' , PHP_EOL
, '<div class="rotatingWrapper"><img class="min" src="modules/' , $module_name , '/images/clock_min.png" alt="" /></div>' , PHP_EOL
, '<div class="rotatingWrapper"><img class="sec" src="modules/' , $module_name , '/images/clock_sec.png" alt="" /></div>' , PHP_EOL
, '<img class="clock" src="modules/' , $module_name , '/images/clock_face.png" alt="" />' , PHP_EOL
, '</div> ' , PHP_EOL
, '<div class="digital">' , PHP_EOL
, '<span class="hr"></span><span class="minute"></span><span class="period"></span>' , PHP_EOL
, '</div>' , PHP_EOL
, '</div>' , PHP_EOL;
CloseTable();
include_once 'footer.php';
|
Note: as you see it is already proof. It didn't work the first above. There is something maybe we need to change. so others can have new ideas to handle better jquery.js. I do not care people think. I care about improving and get better performance. |
|
|