Completed
Push — master ( c1777d...d193e2 )
by Michael
13:22
created

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * $Id: print.php v 1.0 8 May 2004 hsalazar Exp $
4
 * Module: Lexikon - glossary module
5
 * Version: v 1.00
6
 * Release Date: 8 May 2004
7
 * Author: hsalazar
8
 * Changes: Yerres
9
 * Licence: GNU
10
 */
11
 
12
include( "header.php" );
13
14
foreach ($_POST as $k => $v) {
15
    ${$k} = $v;
16
}
17
18
foreach ($_GET as $k => $v) {
19
    ${$k} = $v;
20
}
21
22
if (empty($entryID)) {
23
    redirect_header("index.php");
24
}
25
26
function printPage($entryID) {
27
    global $xoopsConfig, $xoopsDB, $xoopsModule, $xoopsModuleConfig, $myts;
28
    $result1 = $xoopsDB->query("SELECT * FROM ".$xoopsDB->prefix("lxentries")." WHERE entryID = '$entryID' and submit = '0' order by datesub");
29
    $Ok = $xoopsDB -> getRowsNum( $result1 );
30
    if ( $Ok <= 0 ) {
31
        redirect_header( "javascript:history.go(-1)", 3, _ERRORS );
32
        exit();
0 ignored issues
show
Coding Style Compatibility introduced by
The function printPage() contains an exit expression.

An exit expression should only be used in rare cases. For example, if you write a short command line script.

In most cases however, using an exit expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.

Loading history...
33
    }
34
    list( $entryID, $categoryID, $term, $init, $definition, $ref, $url, $uid, $submit, $datesub, $counter, $html, $smiley, $xcodes, $breaks, $block, $offline, $notifypub ) = $xoopsDB -> fetchrow($result1);
35
36
    $result2 = $xoopsDB -> query ( "SELECT name FROM " . $xoopsDB -> prefix ("lxcategories") . " WHERE categoryID = '$categoryID'");
37
    list ($name) = $xoopsDB -> fetchRow ($result2);
38
39
    $result3 = $xoopsDB->query("SELECT name, uname FROM ".$xoopsDB->prefix("users")." WHERE uid = '$uid'");
40
    list($authorname, $username) = $xoopsDB -> fetchRow($result3);
41
42
    $datetime = formatTimestamp($datesub,"D, d-M-Y, H:i");
43
    $categoryname = $myts->htmlSpecialChars($name);
44
    $term = $myts->htmlSpecialChars($term);
45
    $definition = str_replace("[pagebreak]","<br style=\"page-break-after:always;\">",$definition);
46
    $definition = $myts->displayTarea($definition, $html, $smiley, $xcodes, '', $breaks);
47
    if ($authorname == '') {
48
        $authorname = $myts->htmlSpecialChars($username);
49
    } else {
50
        $authorname = $myts->htmlSpecialChars($authorname);
51
    }
52
    echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n";
53
    echo "<html>\n<head>\n";
54
    echo "<title>" . $xoopsConfig['sitename']." ".$term." ". _MD_LEXIKON_PRINTTERM. "</title>\n";
55
    echo "<meta http-equiv='Content-Type' content='text/html; charset=" . _CHARSET . "' />\n";
56
    echo "<meta name='keywords' content= $term  />\n";
57
    echo "<meta name='AUTHOR' content='" . $xoopsConfig['sitename'] . "' />\n";
58
    echo "<meta name='COPYRIGHT' content='Copyright (c) 2004 by " . $xoopsConfig['sitename'] . "' />\n";
59
    echo "<meta name='DESCRIPTION' content='" . $xoopsConfig['slogan'] . "' />\n";
60
    echo "<meta name='GENERATOR' content='" . XOOPS_VERSION . "' />\n\n\n";
61
62
    echo "<body bgcolor='#ffffff' text='#000000'>
63
    <div style='width: 650px; border: 1px solid #000; padding: 20px;'>
64
    <div style='text-align: center; display: block; padding-bottom: 12px; margin: 0 0 6px 0; border-bottom: 2px solid #ccc;'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule -> dirname() . "/images/lx_slogo.png' border='0' alt='' /><h2 style='margin: 0;'>" . $term . "</h2></div>
65
    <div></div>";
66
    if ($xoopsModuleConfig['multicats'] == 1) {
67
        echo "<div>"._MD_LEXIKON_ENTRYCATEGORY."<b>".$categoryname."</b></div>";
68
    }
69
    echo "<div style='padding-bottom: 6px; border-bottom: 1px solid #ccc;'>"._MD_LEXIKON_SUBMITTER."<b>".$authorname."</b></div>
70
    <h3 style='margin: 0;'>".$term."</h3>
71
    <p>".$definition."</p>
72
    <div style='padding-top: 12px; border-top: 2px solid #ccc;'><b>"._MD_LEXIKON_SENT."</b>&nbsp;" . $datetime . "<br /></div>
73
    </div>
74
    <br />
75
    </body>
76
    </html>";
77
}
78
79
printPage($entryID);
80