.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt ============= EXT: Pagehits ============= :Author: Kasper Skårhøj :Created: 2002-11-01T00:32:00 :Changed by: Armin Rüdiger Vieweg :Changed: 2011-03-29T00:23:59.480000000 :Classification: pagehits :Keywords: pagehits, pages, hits :Author: Armin Ruediger Vieweg :Email: info@professorweb.de :Info 4: :Language: en |img-1| |img-2| EXT: Pagehits - pagehits .. _EXT-Pagehits: EXT: Pagehits ============= Extension Key: pagehits Language: en Keywords: pagehits, pages, hits Copyright 2000-2011, Armin Ruediger Vieweg, This document is published under the Open Content License available from http://www.opencontent.org/opl.shtml The content of this document is related to TYPO3 \- a GNU/GPL CMS/Framework available from `www.typo3.or `_ g .. _Table-of-Contents: Table of Contents ----------------- `EXT: Pagehits 1 <#__RefHeading__143834_1880895096>`_ **`Introduction 3 <#__RefHeading__143836_1880895096>`_** `What does it do? 3 <#__RefHeading__143838_1880895096>`_ `Usage 3 <#__RefHeading__742_1253375793>`_ **`Administration 4 <#__RefHeading__47286_349685753>`_** `Requirements 4 <#__RefHeading__47288_349685753>`_ `Installations 4 <#__RefHeading__47290_349685753>`_ `For developers 4 <#__RefHeading__47292_349685753>`_ **`Configuration 5 <#__RefHeading__47294_349685753>`_** `Enable count of pagehits 5 <#__RefHeading__744_1253375793>`_ `Output the pagehits of current page 5 <#__RefHeading__746_1253375793>`_ `Property of lib.pagehits 5 <#__RefHeading__47679_349685753>`_ `Example 5 <#__RefHeading__47685_349685753>`_ **`Known problems 6 <#__RefHeading__748_1253375793>`_** `lib.showPagehits shows pagehits before it counts 6 <#__RefHeading__750_1253375793>`_ .. _Introduction: Introduction ------------ .. _What-does-it-do: What does it do? ^^^^^^^^^^^^^^^^ The pagehits extension extends the pages table with a new column which contains the number of visitors' hits on this page. To prevent imprecisions, counted pages are stored in the visitor's session and will be counted once for each session/user. This can be disabled in the setup. .. _Usage: Usage ^^^^^ You can use the stored pagehits value to: show it on the current page use it to order pages by its popularity (in typoscript or in your own extension) .. _Administration: Administration -------------- .. _Requirements: Requirements ^^^^^^^^^^^^ The pagehits extension has no known requirements, except TYPO3 of course. .. _Installations: Installations ^^^^^^^^^^^^^ You can fetch the pagehits extension like every extension from the TER (TYPO3 Extension Repository), which has been integrated very elegant, since TYPO3 4.5. In installation progress you'll have to confirm the add of new column to pages table. If the installation has been successful, you should add the static template to your TYPO3-Template: |img-3| Libs of pagehits are available now, but to count pagehits you'll have to integrate the libraries to your page, as explained in the `configuration chapter <#1.3.Configuration|outline>`_ . .. _For-developers: For developers ^^^^^^^^^^^^^^ If you are developer, you may checkout the latest version of pagehits out of the TYPO3 SVN. You do this, on your own risk. Versions which has been uploaded to TER are tested and should work as expected. SVN Link of pagehits extension: `https://svn.typo3.org/TYPO3v4/Extensions/pagehits/trunk/ `_ .. _Configuration: Configuration ------------- .. _Enable-count-of-pagehits: Enable count of pagehits ^^^^^^^^^^^^^^^^^^^^^^^^ To enable the count of pagehits, you'll have to add the pagehits library anywhere in typoscript, like in the following example: :code:`page = PAGE` :code:`page {` :code:`typeNum = 0` :code:`5 < lib.pagehits` :code:`10 < styles.content.get` :code:`}` You can use typoscript conditions for example: to disable count of pagehits for logged in users exclude specified IP addresses from logging .. _Output-the-pagehits-of-current-page: Output the pagehits of current page ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ To show the pagehits of current page on the page itself, you can use the lib.showPagehits: :code:`pagehits = COA` :code:`pagehits.10 < lib.showPagehits` :code:`pagehits.wrap =

\|

` .. _Property-of-lib-pagehits: Property of lib.pagehits ^^^^^^^^^^^^^^^^^^^^^^^^ .. ### BEGIN~OF~TABLE ### .. _lib-pagehits-userFunc-filterBySession: lib.pagehits.userFunc.filterBySession """"""""""""""""""""""""""""""""""""" .. container:: table-row Key lib.pagehits.userFunc.filterBySession Data type boolean Default 1 Description If set to 1 the pages which have been counted by each visitor are stored in the visitor's session. If the visitor refreshs or revisits the page again, this will be NOT counted. You can disable with the value 0. Then every pageimpression will be counted. .. ###### END~OF~TABLE ###### .. _Example: Example ^^^^^^^ The following example shows the full setup in static template: :code:`includeLibs.user\_Pagehits = EXT:pagehits/Classes/class.userPagehits.php` :code:`lib.pagehits = USER\_INT` :code:`lib.pagehits {` :code:`userFunc = user\_Pagehits->addHits` :code:`userFunc {` :code:`filterBySession = 1` :code:`}` :code:`}` :code:`lib.showPagehits = USER\_INT` :code:`lib.showPagehits {` :code:`userFunc = user\_Pagehits->showHits` :code:`}` .. _Known-problems: Known problems -------------- .. _lib-showPagehits-shows-pagehits-before-it-counts: lib.showPagehits shows pagehits before it counts ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If lib.showPagehits is included to typoscript before lib.pagehits the user get the current pagehits without including his hit. In that case you show the pagehits first and after that you'll increase them by one. You can pass this problem, if you insert the lib.pagehits before the contents of page, like in `the first example of confguration chapter <#1.3.1.Enable%20count%20of%20pagehits|outline>`_ . 6 .. ######CUTTER_MARK_IMAGES###### .. |img-1| image:: img-1.png .. :align: left .. |img-2| image:: img-2.png .. :border: 0 .. :height: 21 .. :hspace: 9 .. :id: Grafik2 .. :name: Grafik2 .. :width: 87 .. |img-3| image:: img-3.png .. :align: left .. :border: 0 .. :height: 249 .. :id: Grafik1 .. :name: Grafik1 .. :width: 482