[ PHPXref.com ] [ Generated: Sun Jul 20 16:25:17 2008 ] [ ActionApps 2.8.1b ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> go.php3 (source)

   1  <?php
   2  /**
   3   * Does what??
   4   *
   5   * Parameters:
   6   * <pre>
   7   * expected  type      // = fed  - go to item, where the item is fed from
   8   * expected  sh_itm    // id of item
   9   * optionaly url       // show found item on url (if not specified, the url is
  10   *                     // taken from slice
  11   * </pre>
  12   * @package UserOutput
  13   * @version $Id: go.php3,v 1.7 2005/04/24 21:48:11 honzam Exp $
  14   * @author Honza Malik <honza.malik@ecn.cz>
  15   * @copyright Copyright (C) 1999, 2000 Association for Progressive Communications 
  16  */                      
  17  /* 
  18  Copyright (C) 1999, 2000 Association for Progressive Communications 
  19  http://www.apc.org/
  20  
  21      This program is free software; you can redistribute it and/or modify
  22      it under the terms of the GNU General Public License as published by
  23      the Free Software Foundation; either version 2 of the License, or
  24      (at your option) any later version.
  25  
  26      This program is distributed in the hope that it will be useful,
  27      but WITHOUT ANY WARRANTY; without even the implied warranty of
  28      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  29      GNU General Public License for more details.
  30  
  31      You should have received a copy of the GNU General Public License
  32      along with this program (LICENSE); if not, write to the Free Software
  33      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  34  */
  35  
  36  /** 
  37   * Handle with PHP magic quotes - quote the variables if quoting is set off 
  38   * @param mixed $val the variable or array to quote (add slashes)
  39   * @return mixed the quoted variables (with added slashes)
  40   */
  41  function Myaddslashes($val, $n=1) {
  42    if (!is_array($val)) {
  43      return addslashes($val);
  44    }  
  45    for (reset($val); list($k, $v) = each($val); )
  46      $ret[$k] = Myaddslashes($v, $n+1);
  47    return $ret;
  48  }    
  49  
  50  if (!get_magic_quotes_gpc()) { 
  51    // Overrides GPC variables 
  52    if ( isset($HTTP_GET_VARS) AND is_array($HTTP_GET_VARS))
  53      for (reset($HTTP_GET_VARS); list($k, $v) = each($HTTP_GET_VARS); ) 
  54        $$k = Myaddslashes($v); 
  55    if ( isset($HTTP_POST_VARS) AND is_array($HTTP_POST_VARS))
  56      for (reset($HTTP_POST_VARS); list($k, $v) = each($HTTP_POST_VARS); ) 
  57        $$k = Myaddslashes($v); 
  58    if ( isset($HTTP_COOKIE_VARS) AND is_array($HTTP_COOKIE_VARS))
  59      for (reset($HTTP_COOKIE_VARS); list($k, $v) = each($HTTP_COOKIE_VARS); ) 
  60        $$k = Myaddslashes($v); 
  61  }
  62  
  63  /** APC-AA configuration file */
  64  require_once  "./include/config.php3";
  65  /** Set of useful functions used on most pages */
  66  require_once $GLOBALS['AA_INC_PATH']. "util.php3";
  67  /** Main include file for using session management function on a page */
  68  require_once $GLOBALS['AA_INC_PATH']. "locsess.php3";
  69  
  70  if ( !$sh_itm )
  71    exit;
  72  
  73  $db  = new DB_AA;
  74  $p_id = q_pack_id($sh_itm);
  75  
  76  switch( $type ) {
  77    case "fed":
  78    default:
  79      // get source item id and slice
  80  
  81      $SQL = "SELECT source_id, slice_url
  82                FROM slice, relation, item 
  83               WHERE relation.destination_id='$p_id'
  84                 AND relation.source_id=item.id
  85                 AND slice.id = item.slice_id
  86                 AND relation.flag = '". REL_FLAG_FEED ."'";  // feed bit
  87  
  88      $db->query($SQL);
  89      if ( $db->next_record() ) {
  90        $item = unpack_id128($db->f(source_id));
  91        $slice_url = ($db->f(slice_url));
  92      }
  93      else { // if this item is not fed - give its own id
  94        $SQL = "SELECT slice_url FROM slice, item 
  95                 WHERE item.slice_id=slice.id
  96                   AND item.id = '$p_id'";
  97        $db->query($SQL);
  98        if ( $db->next_record() ) {
  99          $item = $sh_itm;
 100          $slice_url = ($db->f(slice_url));
 101        }
 102      }  
 103  }
 104  
 105  if ( !$url )   // url can be given by parameter
 106    $url = $slice_url;
 107  
 108  if ( !$url )   // url can be given by parameter
 109    $url = $slice_url;
 110    
 111  go_url(con_url($url,"sh_itm=$item"));
 112  
 113  /*
 114  $Log: go.php3,v $
 115  Revision 1.7  2005/04/24 21:48:11  honzam
 116  a bit more beauty code - some coding standards setting applied
 117  
 118  Revision 1.6  2003/02/05 14:50:43  jakubadamek
 119  changing require to require_once, deleting the "if (defined) return" constructs and changing GLOBALS[AA_INC_PATH] to GLOBALS["AA_INC_PATH"]
 120  
 121  Revision 1.5  2003/01/21 06:58:30  mitraearth
 122  cron.php3
 123  
 124  Revision 1.4  2002/12/18 13:32:14  drifta
 125  Just changes in comments - moving to phpdoc style.
 126  
 127  Revision 1.3  2002/06/17 22:09:19  honzam
 128  removed call-time passed-by-reference variables in function calls; better variable handling if magic_qoutes are not set (no more warning displayed)
 129  
 130  Revision 1.2  2001/12/18 11:37:38  honzam
 131  scripts are now "magic_quotes" independent - no matter how it is set
 132  
 133  Revision 1.1  2001/04/17 19:18:20  honzam
 134  no message
 135  
 136  */
 137  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]