Esempio n. 1
0
if (@is_dir('attachments/') && @is_dir('attachments/' . $id) && isset($PMF_CONF['disatt'])) {
    $files = 0;
    $outstr = "";
    $dir = opendir('attachments/' . $id);
    while ($dat = readdir($dir)) {
        if ($dat != '.' && $dat != '..') {
            $files++;
            $outstr .= '<a href="attachments/' . $id . '/' . $dat . '" target="_blank">' . $dat . '</a>, ';
        }
    }
    if ($files > 0) {
        $content .= '<p>' . $PMF_LANG['msgAttachedFiles'] . ' ' . substr($outstr, 0, -2) . '</p>';
    }
}
$writeMultiCategories = '';
$multiCats = $tree->getCategoriesFromArticle($id);
if (count($multiCats) > 1) {
    $writeMultiCategories .= '        <div id="article_categories">';
    $writeMultiCategories .= '        <fieldset>';
    $writeMultiCategories .= '                <legend>' . $PMF_LANG['msgArticleCategories'] . '</legend>';
    $writeMultiCategories .= '            <ul>';
    foreach ($multiCats as $multiCat) {
        $writeMultiCategories .= sprintf('<li><a href="%s?%saction=show&amp;cat=%d">%s</a></li>', $_SERVER['PHP_SELF'], $sids, $multiCat['id'], $multiCat['name']);
        $writeMultiCategories .= "\n";
    }
    $writeMultiCategories .= '            </ul>';
    $writeMultiCategories .= '        </fieldset>';
    $writeMultiCategories .= '    </div>';
}
$tpl->processTemplate("writeContent", array("writeRubrik" => $writeCategory, 'solution_id' => $solution_id, "writeThema" => preg_replace_callback('/(' . $highlight . '="[^"]*")|((href|src|title|alt|class|style|id|name)="[^"]*' . $highlight . '[^"]*")|(' . $highlight . ')/mis', "highlight_no_links", getThema($id, $lang)), 'writeArticleCategories' => $writeMultiCategories, "writeContent" => preg_replace_callback("/<code([^>]*)>(.*?)<\\/code>/is", 'hilight', $content), "writeDateMsg" => $PMF_LANG["msgLastUpdateArticle"] . $writeDateMsg, 'writeRevision' => $PMF_LANG['ad_entry_revision'] . ': 1.' . $revision_id, "writeAuthor" => $PMF_LANG["msgAuthor"] . $writeAuthor, "writePrintMsg" => $printMsg, "writePDF" => $writePDF, "writeSend2FriendMsg" => $printS2F, "writeXMLMsg" => $writeXml, "writePrintMsgTag" => $PMF_LANG["msgPrintArticle"], "writePDFTag" => $PMF_LANG["msgPDF"], "writeSend2FriendMsgTag" => $PMF_LANG["msgSend2Friend"], "writeXMLMsgTag" => $PMF_LANG["msgMakeXMLExport"], "saveVotingPATH" => $votingPath, "saveVotingID" => $id, "saveVotingIP" => $_SERVER["REMOTE_ADDR"], "msgAverageVote" => $PMF_LANG["msgAverageVote"], "printVotings" => generateVoting($id), "switchLanguage" => $switchLanguage, "msgVoteUseability" => $PMF_LANG["msgVoteUseability"], "msgVoteBad" => $PMF_LANG["msgVoteBad"], "msgVoteGood" => $PMF_LANG["msgVoteGood"], "msgVoteSubmit" => $PMF_LANG["msgVoteSubmit"], "writeCommentMsg" => $comment == 'n' ? $PMF_LANG['msgWriteNoComment'] : $writeComment, "writeComments" => generateComments($id)));
$tpl->includeTemplate("writeContent", "index");
Esempio n. 2
0
<?php

/**
* $Id: writecomment.php,v 1.3.2.6.2.7 2006/04/25 12:07:24 matteo Exp $
*
* @author       Thorsten Rinne <*****@*****.**>
* @since        2002-08-29
* @copyright    (c) 2001-2006 phpMyFAQ Team
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*/
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($db, $sids, $pmf->language, $_SERVER['HTTP_USER_AGENT'], $_SERVER['REMOTE_ADDR']);
if (isset($_GET['gen'])) {
    $captcha->showCaptchaImg();
    exit;
}
Tracking('write_comment', $_GET['id']);
$tpl->processTemplate('writeContent', array('msgCommentHeader' => $PMF_LANG['msgWriteComment'], 'writeSendAdress' => $_SERVER['PHP_SELF'] . '?' . $sids . 'action=savecomment', 'ID' => $_GET['id'], 'LANG' => $_GET['artlang'], 'writeThema' => getThema($_GET['id'], $_GET['artlang']), 'msgNewContentName' => $PMF_LANG['msgNewContentName'], 'msgNewContentMail' => $PMF_LANG['msgNewContentMail'], 'defaultContentMail' => getEmailAddress(), 'defaultContentName' => getFullUserName(), 'msgYourComment' => $PMF_LANG['msgYourComment'], 'msgNewContentSubmit' => $PMF_LANG['msgNewContentSubmit'], 'captchaFieldset' => printCaptchaFieldset($PMF_LANG['msgCaptcha'], $captcha->printCaptcha('writecomment'), $captcha->caplength), 'copyright_eintrag' => unhtmlentities($PMF_CONF['copyright_eintrag'])));
$tpl->includeTemplate('writeContent', 'index');
Esempio n. 3
0
    if (!setcookie('pmf_lang', $LANGCODE, time() + 3600)) {
        $sids = 'lang=' . $LANGCODE . '&amp;';
    } else {
        $sids = '';
    }
}
// found a article language?
if (isset($_POST["artlang"]) && PMF_Init::isASupportedLanguage($_POST["artlang"])) {
    $lang = $_POST["artlang"];
} else {
    $lang = $LANGCODE;
}
// found a record ID?
if (isset($_REQUEST['id']) && is_numeric($_REQUEST['id']) === true) {
    $id = $_REQUEST['id'];
    $title = ' - ' . stripslashes(getThema($id, $lang));
    $keywords = ' ' . stripslashes(getKeywords($id, $lang));
} else {
    $id = '';
    //$title = ' -  powered by phpMyFAQ '.$PMF_CONF['version'];
    $keywords = '';
}
// found a solution ID?
if (isset($_REQUEST['solution_id']) && is_numeric($_REQUEST['solution_id']) === true) {
    $solution_id = $_REQUEST['solution_id'];
    //$title = ' -  powered by phpMyFAQ '.$PMF_CONF['version'];
    $keywords = '';
    $a = getIdFromSolutionId($solution_id);
    if (is_array($a)) {
        $id = $a['id'];
        $lang = $a['lang'];