Ejemplo n.º 1
0
/**
 * 
 * 
 */
function parse_template_vars($path, $param)
{
    if ($content = get_template_contents($path)) {
        foreach ($param as $k => $v) {
            $content = preg_replace("/{([\\s]*" . $k . "[\\s]*)}/", $v, $content);
        }
        return $content;
    }
}
Ejemplo n.º 2
0
function prepare_emails_for_not_deleting($REPORT, $COMMENT, $FORMURL)
{
    // From the view() function, the user has chosen NOT to delete the comment.
    // Now they can prepare the appropriate emails, or choose not to send them.
    global $this_page;
    $reportermail = preg_replace("/\n/", "<br>\n", get_template_contents('report_declined'));
    ?>
        <p><strong>You have chosen not to delete this comment.</strong> You can now send an email to the person who made the report (uncheck the box to send no email). The report will not be resolved until you click the button below.</p>

        <form action="<?php 
    echo $FORMURL->generate();
    ?>
" method="post">
            <p>&nbsp;<br><strong><input type="checkbox" name="sendtoreporter" value="true" checked id="sendtoreporter"> <label for="sendtoreporter">Send this email to the person who reported the comment:</label></strong></p>

            <p class="email-template"><?php 
    echo $reportermail;
    ?>
</p>

            <p>Enter a reason to replace {REASON}: <input type="text" name="declinedreason" size="40"></p>

            <p><input type="submit" name="resolve" value=" Resolve this report ">
            <input type="hidden" name="deletecomment" value="false">
            <input type="hidden" name="rid" value="<?php 
    echo _htmlentities($REPORT->report_id());
    ?>
">
            <input type="hidden" name="cid" value="<?php 
    echo _htmlentities($REPORT->comment_id());
    ?>
"></p>
        </form>
<?php 
}