source: temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/print.inc.php @ 405

Revision 405, 3.9 KB checked in by root, 20 years ago (diff)
Line 
1<?php
2//  ------------------------------------------------------------------------ //
3//                XOOPS - PHP Content Management System                      //
4//                    Copyright (c) 2000 XOOPS.org                           //
5//                       <http://www.xoops.org/>                             //
6//  ------------------------------------------------------------------------ //
7//  This program is free software; you can redistribute it and/or modify     //
8//  it under the terms of the GNU General Public License as published by     //
9//  the Free Software Foundation; either version 2 of the License, or        //
10//  (at your option) any later version.                                      //
11//                                                                           //
12//  You may not change or alter any portion of this comment or credits       //
13//  of supporting developers from this source code or any supporting         //
14//  source code which is considered copyrighted (c) material of the          //
15//  original comment or credit authors.                                      //
16//                                                                           //
17//  This program is distributed in the hope that it will be useful,          //
18//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
19//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
20//  GNU General Public License for more details.                             //
21//                                                                           //
22//  You should have received a copy of the GNU General Public License        //
23//  along with this program; if not, write to the Free Software              //
24//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
25// ------------------------------------------------------------------------- //
26// Hacker: GIJ=CHECKMATE (AKA GIJOE)                                         //
27// Site: http://www.peak.ne.jp/xoops/                                        //
28// ------------------------------------------------------------------------- //
29
30if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
31
32require_once( XOOPS_ROOT_PATH.'/class/template.php' ) ;
33
34// $myts
35$myts =& MyTextSanitizer::getInstance() ;
36
37extract( $result_array ) ;
38
39// header part
40header( 'Content-Type:text/html; charset='._CHARSET ) ;
41$tpl = new XoopsTpl();
42$tpl->xoops_setTemplateDir(XOOPS_ROOT_PATH.'/themes');
43$tpl->xoops_setCaching(2);
44$tpl->xoops_setCacheTime(0);
45
46$tpl->assign('charset', _CHARSET);
47$tpl->assign('sitename', $xoopsConfig['sitename']);
48$tpl->assign('site_url', XOOPS_URL);
49$tpl->assign('content_url', XOOPS_URL."/modules/$mydirname/index.php?id=$storyid");
50$tpl->assign('lang_comesfrom', sprintf(_TC_THISCOMESFROM, $xoopsConfig['sitename']));
51$tpl->assign('lang_contentfrom', _TC_URLFORSTORY);
52
53$myts =& MyTextSanitizer::getInstance() ;
54$tpl->assign( 'title' , $myts->makeTboxData4Show( $title ) ) ;
55
56$tpl->assign( 'modulename' , $xoopsModule->getVar('name') ) ;
57
58// getting "content"
59if( $link > 0 ) {
60
61    // external (=wrapped) content
62    $wrap_file = "$mymodpath/content/$address" ;
63    if( ! file_exists( $wrap_file ) ) {
64        redirect_header( XOOPS_URL , 2 , _TC_FILENOTFOUND ) ;
65        exit ;
66    }
67
68    ob_start() ;
69    include( $wrap_file ) ;
70    $content = tc_convert_wrap_to_ie( ob_get_contents() ) ;
71    if( $link == TC_WRAPTYPE_CHANGESRCHREF ) $content = tc_change_srchref( $content , XOOPS_URL . "/modules/$mydirname/content" ) ;
72    ob_end_clean() ;
73
74} else {
75
76    $content = tc_content_render( $text , $nohtml , $nosmiley , $nobreaks ,  $xoopsModuleConfig['tc_space2nbsp'] ) ;
77
78}
79
80// convert from {X_SITEURL} to XOOPS_URL
81$content = str_replace( '{X_SITEURL}' , XOOPS_URL , $content ) ;
82
83$tpl->assign( 'content' , $content ) ;
84
85$main_template = empty( $tinyd_singlecontent ) ? "db:tinycontent{$mydirnumber}_print.html" : "db:tinycontent{$mydirnumber}_index.html" ;
86
87$tpl->display( $main_template ) ;
88
89?>
Note: See TracBrowser for help on using the repository browser.