PDA

View Full Version : [BBCODE] Help please?



Topps
02-01-2008, 07:46 PM
OK, I recently decided to use CuteNews again because I haven't got time to create my own news system with being back to school tomorrow and what-not.
So, because I am using a AJAX Page Fetcher and not an iframe in CuteNews, I tried to edit the BBCode and here is the code I edited the original to...


$find= array(

/* 1 */ "'\[upimage=([^\]]*?) ([^\]]*?)\]'i",
/* 2 */ "'\[upimage=(.*?)\]'i",
/* 3 */ "'\[b\](.*?)\[/b\]'i",
/* 4 */ "'\[i\](.*?)\[/i\]'i",
/* 5 */ "'\[u\](.*?)\[/u\]'i",
/* 6 */ "'\[link\](.*?)\[/link\]'i",
/* 7 */ "'\[color=(.*?)\](.*?)\[/color\]'i",
/* 8 */ "'\[size=(.*?)\](.*?)\[/size\]'i",
/* 9 */ "'\[font=(.*?)\](.*?)\[/font\]'i",
/* 10 */ "'\[align=(.*?)\](.*?)\[/align\]'i",
/* 12 */ "'\[image=(.*?)\]'i",
/* 13 */ "'\[link](.*?)\[/link\]'i",

/* 14 */ "'\[quote=(.*?)\](.*?)\[/quote\]'i",
/* 15 */ "'\[quote\](.*?)\[/quote\]'i",

/* 16 */ "'\[list\]'i",
/* 17 */ "'\[/list\]'i",
/* 18 */ "'\[\*\]'i",

"'{nl}'",
);

$replace=array(
/* 1 */ "<img \\2 src=\"${config_http_script_dir}/skins/images/upskins/images/\\1\" style=\"border: none;\" alt=\"\" />",
/* 2 */ "<img src=\"${config_http_script_dir}/skins/images/upskins/images/\\1\" style=\"border: none;\" alt=\"\" />",
/* 3 */ "<strong>\\1</strong>",
/* 4 */ "<em>\\1</em>",
/* 5 */ "<span style=\"text-decoration: underline;\">\\1</span>",
/* 6 */ "<a href=\"javascript:void(0);\" onclick=\"ajaxpagefetcher.load('main', 'news/\\1', false);\">\\1</a>",
/* 7 */ "<span style=\"color: \\1;\">\\2</span>",
/* 8 */ "<span style=\"font-size: \\1pt;\">\\2</span>",
/* 9 */ "<span style=\"font-family: \\1;\">\\2</span>",
/* 10 */ "<div style=\"text-align: \\1;\">\\2</div>",
/* 12 */ "<img src=\"\\1\" style=\"border: none;\" alt=\"\" />",
/* 13 */ "<a href=\"javascript:void(0);\" onclick=\"ajaxpagefetcher.load('main', 'news/\\1\', false);\">\\2</a>",

But, that just gave me the same as always on the announcements section, which is; http://localhost/Loading.FM/index.ph..._from=&ucat=1& (http://localhost/Loading.FM/index.php?subaction=showfull&id=1199293842&archive=&start_from=&ucat=1&) which is just stupid because it opens in a new frame and not the AJAX Page Fetcher, so can anyone help me please?

Cheers to anyone who helps! ;)

MrCraig
02-01-2008, 07:51 PM
localhost wont work for anyone but you.. so i dont see the point in posting the url :S

And i have no clue what your asking about.

Topps
02-01-2008, 07:54 PM
I know, I was just showing what the link still outcomes as...

Invent
02-01-2008, 08:17 PM
You've done it wrong. Edit shows.inc.php so that all the <a> hrefs use javascript instead of regular html.

Topps
02-01-2008, 08:41 PM
Cheers Simon, how do I fix the division by zero error?

[Oli]
02-01-2008, 08:45 PM
Cheers Simon, how do I fix the division by zero error?

Normally means you're deviding by 0
and in math you cant divide by 0.

Blob
02-01-2008, 08:59 PM
you gonna want to do something like

<a href="javascript:loadpage('whatever');"></a>

Want to hide these adverts? Register an account for free!