Completed
Pull Request — master (#12)
by
unknown
01:54
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
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 29 and the first side effect is on line 12.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

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