[ PHPXref.com ] [ Generated: Sun Jul 20 17:05:41 2008 ] [ Coppermine 1.4.5 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> displayecard.php (source)

   1  <?php
   2  /*************************

   3    Coppermine Photo Gallery

   4    ************************

   5    Copyright (c) 2003-2006 Coppermine Dev Team

   6    v1.1 originally written by Gregory DEMAR

   7  

   8    This program is free software; you can redistribute it and/or modify

   9    it under the terms of the GNU General Public License as published by

  10    the Free Software Foundation; either version 2 of the License, or

  11    (at your option) any later version.

  12    ********************************************

  13    Coppermine version: 1.4.5

  14    $Source: /cvsroot/coppermine/stable/displayecard.php,v $

  15    $Revision: 1.13 $

  16    $Author: gaugau $

  17    $Date: 2006/03/02 08:17:40 $

  18  **********************************************/
  19  
  20  define('IN_COPPERMINE', true);
  21  define('DISPLAYECARD_PHP', true);
  22  
  23  require ('include/init.inc.php');
  24  require ('include/smilies.inc.php');
  25  
  26  if (!isset($_GET['data'])) cpg_die(CRITICAL_ERROR, $lang_errors['param_missing'], __FILE__, __LINE__);
  27  
  28  $data = array();
  29  $data = @unserialize(@base64_decode($_GET['data']));
  30  
  31  // attempt to obtain full link from db if ecard logging enabled and min 12 chars of data is provided and only 1 match

  32  if ((!is_array($data)) && $CONFIG['log_ecards'] && (strlen($_GET['data']) > 12)) {
  33          $result = cpg_db_query("SELECT link FROM {$CONFIG['TABLE_ECARDS']} WHERE link LIKE '{$_GET['data']}%'");
  34          if (mysql_num_rows($result) === 1) {
  35                  $row = mysql_fetch_assoc($result);
  36                  $data = @unserialize(@base64_decode($row['link']));
  37          }
  38  }
  39  
  40  if (is_array($data)) {
  41  
  42  // Remove HTML tags as we can't trust what we receive

  43  foreach($data as $key => $value) $data[$key] = strtr($value, $HTML_SUBST);
  44  // Load template parameters

  45  $params = array('{LANG_DIR}' => $lang_text_dir,
  46      '{TITLE}' => sprintf($lang_ecard_php['ecard_title'], $data['sn']),
  47      '{CHARSET}' => $CONFIG['charset'] == 'language file' ? $lang_charset : $CONFIG['charset'],
  48      '{VIEW_ECARD_TGT}' => '',
  49      '{VIEW_ECARD_LNK}' => '',
  50      '{PIC_URL}' => $data['p'],
  51      '{URL_PREFIX}' => '',
  52      '{GREETINGS}' => $data['g'],
  53      '{MESSAGE}' => bb_decode(process_smilies($data['m'])),
  54      '{SENDER_EMAIL}' => $data['se'],
  55      '{SENDER_NAME}' => $data['sn'],
  56      '{VIEW_MORE_TGT}' => $CONFIG['ecards_more_pic_target'],
  57      '{VIEW_MORE_LNK}' => $lang_ecard_php['view_more_pics'],
  58      '{PID}' => $data['pid'],
  59      '{PIC_TITLE}' => $data['pt'],
  60      '{PIC_CAPTION}' => $data['pc'],
  61      );
  62  // Parse template

  63  echo template_eval($template_ecard, $params);
  64  
  65  } else {
  66          cpg_die(CRITICAL_ERROR, $lang_displayecard_php['invalid_data'], __FILE__, __LINE__);
  67  }
  68  ?>


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