Example #1
0
    // $time = formatDate($timestamp);
    $name = getUserName($uid);
    $msg = formatMsg($msg);
    $delbtn = deleteBtnComment($cid, $uid, $event_id);
    return "<div class='eventComment'>\n                <span style='font-size:50%;'>\n                    <span>{$date}</span>\n                    &nbsp;&nbsp;\n                    |\n                    &nbsp;&nbsp;\n                    <span style='font-size:75%;'>\n                        {$name}</span>\n                    </span>\n                    <span>\n                        {$delbtn}\n                        </span>\n                <br />\n                <span class='eventCommentText'>\n                    " . strip_tags($msg) . "\n                </span>\n            </div>\n            ";
}
// end comment prep
$event_id = $_REQUEST['eventID'];
//echo "<br />eventid=".$event_id;
$event_id = preg_replace("#[^0-9]#", "", $event_id);
//echo "<br />eventid=".$event_id;
$qry = "SELECT * FROM event_comments\n        WHERE event_id='{$event_id}'\n        ORDER BY timestamp DESC";
$res = mysqli_query($cxn, $qry);
$numRows = mysqli_num_rows($res);
//echo "<br />result nums:".$numRows." eventid=".$event_id;
if ($numRows > 0) {
    // parse results
    $txt = "";
    while ($row = mysqli_fetch_assoc($res)) {
        $msg = $row['message'];
        $timestamp = $row['timestamp'];
        $uid = $row['user_id'];
        $cid = $row['message_id'];
        $txt .= prepareComment($msg, $timestamp, $uid, $cid, $event_id);
    }
    $arr = array("status" => 1, "messages" => $txt);
    echo json_encode($arr);
} else {
    $arr = array("status" => 1, "messages" => "There are none yet!");
    echo json_encode($arr);
}
Example #2
0
        if (!$i['isInterface']) {
            $out .= "{}";
        } else {
            $out .= ";";
        }
        $out .= "\n\n";
        $declarationCount++;
    }
    if ($class != 'global') {
        $out .= "}\n";
    }
}
foreach ($constants as $c => $ctype) {
    if (strpos($c, '::') === false) {
        if (isset($constants_comments[$c])) {
            $out .= prepareComment($constants_comments[$c], array());
        }
        $out .= "define('{$c}', " . constTypeValue($ctype) . ");\n";
        $declarationCount++;
    }
}
chdir(dirname(__FILE__));
if (!DEBUG) {
    echo "saving phpfunctions.php file\n";
    file_put_contents("phpfunctions.php", $out);
    if (shell_exec("which php-parser")) {
        echo "making sure phpfunctions file is valid...\n";
        system("php-parser phpfunctions.php", $ret);
        if ($ret != 0) {
            die("could not parse file, aborting\n");
        }