ActionApps PHP Cross Reference Groupware Applications

Source: /go.php3 - 107 lines - 3341 bytes - Summary - Text - Print

Description: Does what?? Parameters: <pre> expected  type      // = fed  - go to item, where the item is fed from expected  sh_itm    // id of item optionaly url       // show found item on url (if not specified, the url is // taken from slice </pre>

   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 2441 2007-06-29 12:41:44Z honzam $
  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 $value the variable or array to quote (add slashes)
  39   * @return mixed the quoted variables (with added slashes)
  40   */
  41  function AddslashesDeep($value) {
  42      return is_array($value) ? array_map('AddslashesDeep', $value) : addslashes($value);
  43  }
  44  
  45  if (!get_magic_quotes_gpc()) {
  46      // Overrides GPC variables
  47      foreach ($_GET as $k => $v) {
  48          $kk = AddslashesDeep($v);
  49      }
  50      foreach ($_POST as $k => $v) {
  51          $kk = AddslashesDeep($v);
  52      }
  53      foreach ($_COOKIE as $k => $v) {
  54          $kk = AddslashesDeep($v);
  55      }
  56  }
  57  
  58  /** APC-AA configuration file */
  59  require_once  "./include/config.php3";
  60  /** Set of useful functions used on most pages */
  61  require_once  AA_INC_PATH. "util.php3";
  62  /** Main include file for using session management function on a page */
  63  require_once  AA_INC_PATH. "locsess.php3";
  64  
  65  if ( !$sh_itm )
  66    exit;
  67  
  68  $db  = new DB_AA;
  69  $p_id = q_pack_id($sh_itm);
  70  
  71  switch( $type ) {
  72    case "fed":
  73    default:
  74      // get source item id and slice
  75  
  76      $SQL = "SELECT source_id, slice_url
  77                FROM slice, relation, item
  78               WHERE relation.destination_id='$p_id'
  79                 AND relation.source_id=item.id
  80                 AND slice.id = item.slice_id
  81                 AND relation.flag = '". REL_FLAG_FEED ."'";  // feed bit
  82  
  83      $db->query($SQL);
  84      if ( $db->next_record() ) {
  85        $item = unpack_id128($db->f(source_id));
  86        $slice_url = ($db->f(slice_url));
  87      }
  88      else { // if this item is not fed - give its own id
  89        $SQL = "SELECT slice_url FROM slice, item
  90                 WHERE item.slice_id=slice.id
  91                   AND item.id = '$p_id'";
  92        $db->query($SQL);
  93        if ( $db->next_record() ) {
  94          $item = $sh_itm;
  95          $slice_url = ($db->f(slice_url));
  96        }
  97      }
  98  }
  99  
 100  if ( !$url )   // url can be given by parameter
 101    $url = $slice_url;
 102  
 103  if ( !$url )   // url can be given by parameter
 104    $url = $slice_url;
 105  
 106  go_url(con_url($url,"sh_itm=$item"));
 107  ?>

title

Description

title

Description

title

Description

title

title

Body