Tom tom@hutch4.us writes:
Hmmm
Thanks for replying Tom.
That would probably be a "won't fix" for this reason...
Foreground uses a top nav bar with a dropdown on hover. The output is a different type from the extension, div container and js. We don't specifically include that type $box['content']; because what would be the point? You can't see it unless you hover over it then there's the whole issue with what would it look like in mobile view. Foreground specifically only outputs links for that reason.
Fair enough.
The sidebar placement by the extension is a little bit odd. There's definitely better hooks that could be used to put that type of content below the output of the page content. Putting it in the side bar makes it virtually useless on any type of mobile friendly framework.
You could "hack" the code into the skin above category output or after the div close for the content of the page before the footer.
I've hacked it in, so the bottom of 'Foreground.skin.php' now shows -
--8<---------------cut here---------------start------------->8--- <footer class="row"> <div id="footer"> <!-- Start of StatCounter Code --> <script> var sc_project={$projectId}; var sc_invisible=0; var sc_security="{$security}"; var scJsHost = (("https:" == document.location.protocol) ? "https://secure." : "http://www."); document.write("<sc"+"ript type='text/javascript' src='"+scJsHost +"statcounter.com/counter/counter.js'></"+"script>"); </script> <noscript><div><a title="free hit counter" href="http://statcounter.com/free-hit-counter/" target="_blank"><img src="http://c.statcounter.com/{$projectId}/0/{$security}/0/" alt="free hit counter" /></a></div></noscript> <!-- End of StatCounter Code --> <?php if ($wgForegroundFeatures['addThisFollowPUBID'] != '') { ?> --8<---------------cut here---------------end--------------->8---
Its a bit ugly by having a small amount (perhaps 2 or 3 lines) of blank space before showing "This page was last modified on foo". Perhaps someone else could show me how to remove that blank space as I don't know php at all? But setting up the extension with its [[MediaWiki:Statcounter-project-id]] and [[MediaWiki:Statcounter-security]] seems to propagate the relevant script variables. But at the moment its what I would call 'alpha code/hack' as I'm waiting for some people to visit my drugfacts site where its all set up and running to actually test it out.
I've tried hacking the extension itself but I haven't found how to do remove the "Site statistics" from the sidebar. But, as the statcounter code is now "built-into" the skin, providing [[MediaWiki:Statcounter-project-id]] and [[MediaWiki:Statcounter-security]] it might be possible to remove the extension completely, which would also remove the "Site statistics" from the sidebar? But I don't know enough about php or javascript to know for definite, its just speculation on my part.
Thanks Sharon.
Tom
On Apr 13, 2017, at 4:00 PM, Sharon Kimble boudiccas@skimble.plus.com wrote:
For several weeks now I've been trying to get the 'StatCounter.com Integration' [1] extension working with foreground, which I really like. And each time I've failed. The only time the extension is called is to appear on line #92 of any page of my website, where its calling the 'Site statistics' in the sidebar. This is the actual coding that appears in the web-page source -
--8<---------------cut here---------------start------------->8---
</li><li class="has-dropdown active" id="p-statcounter"> <a href="#">Site statistics</a> </li></ul> --8<---------------cut here---------------end--------------->8---
However, using the 'vector' skin the same call of statcounter shows -
--8<---------------cut here---------------start------------->8---
</div> <div class="portal" role="navigation" id="p-statcounter" aria-labelledby="p-statcounter-label"> <h3 id="p-statcounter-label">Site statistics</h3>
<div class="body"> <!-- Start of StatCounter Code -->
<script> var sc_project=123456; var sc_invisible=0; var sc_security="5abcde3d"; var scJsHost = (("https:" == document.location.protocol) ? "https://secure." : "http://www."); document.write("<sc"+"ript type='text/javascript' src='"+scJsHost +"statcounter.com/counter/counter.js'></"+"script>"); </script><script type="text/javascript" src="https://secure.statcounter.com/counter/counter.js"></script><span class="statcounter"><a class="statcounter" href="http://www.statcounter.com" target="_blank"><img src="https://c.statcounter.com/t.php?sc_project=11274564&java=1&security=5a6d142d&u1=96C66B1A959E4FE2CE19F1EB971E96D1&sc_random=0.912624096730724&jg=3&rr=40.31.25.20.14.8.4.4.4&resolution=1920&h=1080&camefrom=https%3A//drugfacts.org.uk/index.php%3Ftitle%3DSpecial%3APreferences&u=https%3A//drugfacts.org.uk/index.php%3Ftitle%3DCocaine&t=Cocaine%20-%20DrugFacts&sc_snum=1&sess=a181b5&p=0" alt="StatCounter - Free Web Tracker and Counter" border="0"></a></span>
<noscript><div><a title="free hit counter" href="http://statcounter.com/free-hit-counter/" target="_blank"><img src="http://c.statcounter.com/11274564/0/5a6d142d/0/" alt="free hit counter" /></a></div></noscript>
<!-- End of StatCounter Code --> </div>
--8<---------------cut here---------------end--------------->8---
Is there any chance that this could be fixed please, as 'foreground' is a really great skin and I like using it, but I also like my statcounter stats as well. Ideally I'd like both of them to work together which would be really great :).
Oh, and I've redacted the project ID and security ID, which is a bit pointless really because the extension page shows how to access them! :)
Thanks Sharon.
[1] - https://www.mediawiki.org/wiki/Extension:StatCounter.com_Integration
A taste of linux = http://www.sharons.org.uk TGmeds = http://www.tgmeds.org.uk DrugFacts = https://www.drugfacts.org.uk Debian 8.6, fluxbox 1.3.5-2, emacs 25.1.1.1 _______________________________________________ Foreground mailing list Foreground@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/foreground
Foreground mailing list Foreground@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/foreground