mirror of https://github.com/bbj-dev/bbjphp.git
Begin work on fixing mentions.
This commit is contained in:
parent
47b7be48fc
commit
8136c2508f
|
@ -1,4 +1,13 @@
|
|||
<?php
|
||||
function lookup($match) {
|
||||
$data = $thread["data"];
|
||||
$usermap = $thread["usermap"];
|
||||
$postnum = $match[1];
|
||||
if ($postnum==0) {
|
||||
return ">>OP";
|
||||
}
|
||||
return ">>".$postnum.$usermap[$data["messages"][$postnum]["author"]]["user_name"];
|
||||
}
|
||||
foreach($thread["data"]["messages"] as $message) {
|
||||
$username = $thread["usermap"][$message["author"]]["user_name"];
|
||||
$time = round($message['created']);
|
||||
|
@ -7,7 +16,8 @@
|
|||
echo "\t\t<div class='well' id='post{$message["post_id"]}'>".PHP_EOL;
|
||||
echo "\t\t\t<p>>{$message['post_id']} {$username} @ {$time}</p>".PHP_EOL;
|
||||
echo "\t\t\t<pre>";
|
||||
echo str_replace(">>0",">>OP",$message["body"]).PHP_EOL;
|
||||
// echo str_replace(">>0",">>OP",$message["body"]).PHP_EOL;
|
||||
echo preg_replace_callback("/>>(\d+)/",'lookup',$message["body"]).PHP_EOL;
|
||||
echo "</pre>".PHP_EOL;
|
||||
echo "\t\t</div>".PHP_EOL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue