9 | Posts |
I'm trying to install the counter plugin on the gpEasy 2.3 version and I get the following error on the top of every page:
/* File Not Found /www/gm/g/gcremeri/gp/sbx/gp/sbx/data/_addoncode/q7o9pgf/Google_Highlighter.js */
I noticed that the bolded text above is being duplicated and would like to know how to work around that.
Thanks!
483 | Posts |
16.6K | Downloads |
1 | Themes |
1 | Plugins |
Hi, it looks like you probably deleted the Google_Highlighter.js file before or after the installation. You and also Diana have encountered this bug. Can be fixed in mulitple ways:
1: that error message is due to wrong comment tags in html file, should be <!-- -> instead of /* */. You can open the file /include/combine.php in text editor and erase the 165th line (echo "\n/* File Not Found {$dataDir}{$file} */\n";) This removes that incorrect message. It is bug and should be fixed in the next gpEasy release.
2: another solution- you can go to the menu Plugins-> Manage-> Site Counter and there click "Disable" Google Highlighter gadget. (this is also the alternative way to disable unwanted gadget, instead of deleting the javascript file manually)
3: another solution is also to disable the combine function, if you go to Settings-> Configuration and click Interface and uncheck "Combine js files". But recommended is the first or second solution.
9 | Posts |
Hi Stano,
Thanks for your prompt reply. I fixed that line of code with the proper html comment tags and now I'm back to normal. What I still don't understand is that I have not removed the Google_Highlighter.js file at all. It is actually stil there since I isntalled the counter (I believe it was installed with it). I even have no idea what the Google Highlighter does and why I should (or could) disable it... would like to know more about that.
The other point is that the error message I got was actually pointing to a wrong place, due to the duplicated substring I pointet out in bold on my original post. This is still not fixed with the "comment fix" I applied to the code, just hidden now, so I believe that there is still another bug in the code, since the Google_Highlighter.js file is actually there. I guess that Josh S. would have to look into that.
Thanks again for your help and the wonderfull CMS you guys are building here!
9 | Posts |
Stano/Josh
I was checking out Barry J. Ruth's site (www.bjruth.com/a) and he seems to have the same problem I had with the "comment bug", but here you could also see the duplication I was mentioning:
/* File Not Found /home/content/b/a/r/barryjruth/html/a/a/data/_addoncode/Counter/Google_Highlighter.js */
Regards
483 | Posts |
16.6K | Downloads |
1 | Themes |
1 | Plugins |
Hi, thank you for the explanation, you're right from the start and I was wrong. Well, it is the wrong path instead of removed file, I am sorry I didn't realize it.
That google highlighter gadget is only additional javascript code, can be lightly removed/or disabled/. If a visitor enters to your website, then the highlighter highlights the words in the google query string (obtained from the referring page).
So the error notification raises in the gadget, file Google_Highlighter.php on the 4th line-
$page->head_js[] = $addonRelativeCode.'/Google_Highlighter.js';
Exactly as you say, that path is wrong in that doubled '/a/a/'. I suppose, that Josh will know how to fix this, seems like a bug in combine.php file.
Can be also rewritten as $page->head .= '<script type="text/javascript" src="'.$addonRelativeCode.'/Google_Highlighter.js"></script>'; (this can also correct it temporarily)
2K | Posts |
304K | Downloads |
16 | Themes |
18 | Plugins |
It sounds like this is a problem with the use of $page->head_js.
The Problem
The head_js array is set up to be an array of paths relative to the isntallation root (not the server root). The $addonRelativeCode variable contains the path relative to the server root, so it should not be used for the $page->head_js array even though it is the correct variable when adding <script..> tags directly to the $page->head string.
$page->head_js
(The information is also available in the documentation: http://docs.gpeasy.com/Main/Plugins/HTML%20Head#Add_to_Combine)
Since $page->head_js expects paths relative to the installation root, we have to construct the path for the javascript file using the $addonFolderName variable.
global $addonFolderName,$page; $page->head_js[] = '/data/_addoncode/'.$addonFolderName.'/javascript.js';
Sorry for the confusion with the combine.php script.
Update
I'm updating gpEasy so that $page->head_js will work with both types of file paths.
9 | Posts |
483 | Posts |
16.6K | Downloads |
1 | Themes |
1 | Plugins |
1 | Posts |
A new release for Typesetter is in the works with a lot of improvements including the ... Read More
Typesetter 5.1Typesetter 5.1 is now available for download. 5.1 includes bug fixes, UI/UX improvements, ... Read More
More NewsFind out more about our Provider Spotlight
What CMS: Find out what CMS a site is using.
Who Hosts This: Find out who is hosting any web site
WordPress Theme Detect: Find out which theme a WordPress site is using