front page option, and post links in bbcode
git-svn-id: file:///home/shish/svn/shimmie2/trunk@53 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
35bae4f71d
commit
9bb567aa60
1 changed files with 11 additions and 5 deletions
|
@ -107,6 +107,8 @@ function bbcode_to_html($text) {
|
||||||
$text = preg_replace("/\[b\](.*?)\[\/b\]/s", "<b>\\1</b>", $text);
|
$text = preg_replace("/\[b\](.*?)\[\/b\]/s", "<b>\\1</b>", $text);
|
||||||
$text = preg_replace("/\[i\](.*?)\[\/i\]/s", "<i>\\1</i>", $text);
|
$text = preg_replace("/\[i\](.*?)\[\/i\]/s", "<i>\\1</i>", $text);
|
||||||
$text = preg_replace("/\[u\](.*?)\[\/u\]/s", "<u>\\1</u>", $text);
|
$text = preg_replace("/\[u\](.*?)\[\/u\]/s", "<u>\\1</u>", $text);
|
||||||
|
$text = preg_replace("/>>(\d+)/s",
|
||||||
|
"<a href='".make_link("post/view/\\1")."'>>>\\1</a>", $text);
|
||||||
$text = preg_replace("/\[\[(.*?)\]\]/s",
|
$text = preg_replace("/\[\[(.*?)\]\]/s",
|
||||||
"<a href='".make_link("wiki/\\1")."'>\\1</a>", $text);
|
"<a href='".make_link("wiki/\\1")."'>\\1</a>", $text);
|
||||||
$text = str_replace("\n", "\n<br>", $text);
|
$text = str_replace("\n", "\n<br>", $text);
|
||||||
|
@ -167,6 +169,10 @@ function get_memory_limit() {
|
||||||
|
|
||||||
function get_thumbnail_size($orig_width, $orig_height) {
|
function get_thumbnail_size($orig_width, $orig_height) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
if($orig_width == 0) $orig_width = 192;
|
||||||
|
if($orig_height == 0) $orig_height = 192;
|
||||||
|
|
||||||
$max_width = $config->get_int('thumb_width');
|
$max_width = $config->get_int('thumb_width');
|
||||||
$max_height = $config->get_int('thumb_height');
|
$max_height = $config->get_int('thumb_height');
|
||||||
|
|
||||||
|
@ -246,7 +252,6 @@ function send_event($event) {
|
||||||
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
function _get_query_parts() {
|
function _get_query_parts() {
|
||||||
global $config;
|
|
||||||
if(isset($_GET["q"])) {
|
if(isset($_GET["q"])) {
|
||||||
$path = $_GET["q"];
|
$path = $_GET["q"];
|
||||||
}
|
}
|
||||||
|
@ -254,7 +259,7 @@ function _get_query_parts() {
|
||||||
$path = $_SERVER["PATH_INFO"];
|
$path = $_SERVER["PATH_INFO"];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$path = $config->get_string('front_page', 'index');
|
$path = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
while(strlen($path) > 0 && $path[0] == '/') {
|
while(strlen($path) > 0 && $path[0] == '/') {
|
||||||
|
@ -265,14 +270,15 @@ function _get_query_parts() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_page_request() {
|
function get_page_request() {
|
||||||
|
global $config;
|
||||||
$args = _get_query_parts();
|
$args = _get_query_parts();
|
||||||
|
|
||||||
if(count($args) == 0) {
|
if(count($args) == 0 || strlen($args[0]) == 0) {
|
||||||
$page = "index";
|
$page = $config->get_string('front_page', 'index');
|
||||||
$args = array();
|
$args = array();
|
||||||
}
|
}
|
||||||
else if(count($args) == 1) {
|
else if(count($args) == 1) {
|
||||||
$page = (strlen($args[0]) > 0 ? $args[0] : "index");
|
$page = $args[0];
|
||||||
$args = array();
|
$args = array();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Reference in a new issue