Links
[ class tree: Links ] [ index: Links ] [ all elements ]

Source for file portal.php

Documentation is available at portal.php

  1. <?php
  2.  
  3. /* Reminder: always indent with 4 spaces (no tabs). */
  4. // +---------------------------------------------------------------------------+
  5. // | Geeklog 1.6                                                               |
  6. // +---------------------------------------------------------------------------+
  7. // | portal.php                                                                |
  8. // |                                                                           |
  9. // | Geeklog portal page that tracks link click throughs.                      |
  10. // +---------------------------------------------------------------------------+
  11. // | Copyright (C) 2000-2009 by the following authors:                         |
  12. // |                                                                           |
  13. // | Authors: Tony Bibbs        - tony AT tonybibbs DOT com                    |
  14. // |          Mark Limburg      - mlimburg AT users.sourceforge DOT net        |
  15. // |          Jason Whittenburg - jwhitten AT securitygeeks DOT com            |
  16. // |          Dirk Haun         - dirk AT haun-online DOT de                   |
  17. // +---------------------------------------------------------------------------+
  18. // |                                                                           |
  19. // | This program is free software; you can redistribute it and/or             |
  20. // | modify it under the terms of the GNU General Public License               |
  21. // | as published by the Free Software Foundation; either version 2            |
  22. // | of the License, or (at your option) any later version.                    |
  23. // |                                                                           |
  24. // | This program is distributed in the hope that it will be useful,           |
  25. // | but WITHOUT ANY WARRANTY; without even the implied warranty of            |
  26. // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             |
  27. // | GNU General Public License for more details.                              |
  28. // |                                                                           |
  29. // | You should have received a copy of the GNU General Public License         |
  30. // | along with this program; if not, write to the Free Software Foundation,   |
  31. // | Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.           |
  32. // |                                                                           |
  33. // +---------------------------------------------------------------------------+
  34.  
  35. /** 
  36.  * Geeklog portal page that tracks link click throughs.
  37.  * 
  38.  * @package Links
  39.  * @subpackage public_html
  40.  * @filesource
  41.  * @version 2.0
  42.  * @since GL 1.4.0
  43.  * @copyright Copyright &copy; 2005-2008
  44.  * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
  45.  * @author Trinity Bays, trinity93 AT gmail.com
  46.  * @author Tony Bibbs, tony AT tonybibbs DOT com
  47.  * @author Tom Willett, twillett AT users DOT sourceforge DOT net
  48.  * @author Blaine Lang, langmail AT sympatico DOT ca
  49.  * @author Dirk Haun, dirk AT haun-online DOT de
  50.  * 
  51.  */
  52.  
  53. /**
  54. * Geeklog common function library
  55. */
  56. require_once '../lib-common.php';
  57.  
  58. if (!in_array('links'$_PLUGINS)) {
  59.     echo COM_refresh($_CONF['site_url''/index.php');
  60.     exit;
  61. }
  62.  
  63.  
  64. // MAIN
  65.  
  66. $url '';
  67.  
  68. COM_setArgNames(array('what''item'));
  69. $what COM_getArgument('what');
  70.  
  71. if ($what == 'link'{
  72.  
  73.     $item COM_applyFilter(COM_getArgument('item'));
  74.     if (!empty($item)) {
  75.         // Hack: due to PLG_afterSaveSwitch settings, we may get
  76.         // an attached &msg - strip it off
  77.         $i explode('&'$item);
  78.         $item $i[0];
  79.     }
  80.  
  81.     if (!empty($item)) {
  82.         $url DB_getItem($_TABLES['links']'url'"lid = '{$item}'");
  83.         if (!empty($url)) {
  84.             DB_change($_TABLES['links']'hits','hits + 1''lid',$item''true);
  85.         }
  86.     }
  87.  
  88. }
  89.  
  90. if (empty($url)) {
  91.     $url $_CONF['site_url'];
  92. }
  93. header('HTTP/1.1 301 Moved');
  94. header('Location: ' $url);
  95. header('Connection: close');
  96.  
  97. ?>

Documentation generated on Fri, 25 May 2012 02:10:07 -0400 by phpDocumentor 1.4.3