Author Topic: How to add new BBcode [center] & [/center] ?  (Read 5859 times)

0 Members and 1 Guest are viewing this topic.

Offline YUnir

  • Pre-Newbie
  • Posts: 6
    • View Profile
How to add new BBcode [center] & [/center] ?
« on: May 21, 2009, 03:13:42 PM »
Translator:  :oops:

It is necessary new BBcode.

I switched off the html-code. Without centering bad tag displays information entered by users.

If there are links, then please show.

Offline YUnir

  • Pre-Newbie
  • Posts: 6
    • View Profile
Re: How to add new BBcode [center] & [/center] ?
« Reply #1 on: May 21, 2009, 03:33:23 PM »
I guess that here add. How?

functions.php

Code: [Select]
    $search_array = array(
      "/(\[)(list)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/list)(((=)(\\4)([^\"']*)(\\4]))|(\]))/siU",
      "/(\[)(list)(])(.*)(\[\/list\])/siU",
      "/(\[\*\])/siU",
      "/(\[\/\*\])/siU",
      "/(\[)(url)(=)(['\"]?)(www\.)([^\"']*)(\\4])(.*)(\[\/url\])/siU",
      "/(\[)(url)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/url\])/siU",
      "/(\[)(url)(])(www\.)([^\"]*)(\[\/url\])/siU",
      "/(\[)(url)(])([^\"]*)(\[\/url\])/siU",
      "/(\[)(code)(])(\r\n)*(.*)(\[\/code\])/siU",
      "/javascript:/si",
      "/about:/si"
    );
    $replace_array = array(
      "<ol type=\"\\5\">\\7</ol>",
      "<ul>\\4</ul>",
      "<li>",
      "</li>",
      "<a href=\"http://www.\\6\" target=\"_blank\" rel=\"nofollow\">\\8</a>",
      "<a href=\"\\5\" target=\"_blank\" rel=\"nofollow\">\\7</a>",
      "<a href=\"http://www.\\5\" target=\"_blank\" rel=\"nofollow\">www.\\5</a>",
      "<a href=\"\\4\" target=\"_blank\" rel=\"nofollow\">\\4</a>",
      "<pre>Code:<hr size=1>\\5<hr size=1></pre>",
      "java script:",
      "about :"
    );
« Last Edit: May 21, 2009, 04:22:19 PM by YUnir »

Offline YUnir

  • Pre-Newbie
  • Posts: 6
    • View Profile
Re: How to add new BBcode [center] & [/center] ?
« Reply #2 on: May 21, 2009, 03:49:07 PM »
Oh, I understand. Earned!

1. functions.php

find
Code: [Select]
$search_array = array(add below
Code: [Select]
"/(\[)(center)(])(\r\n)*(.*)(\[\/center\])/siU",
find
Code: [Select]
$replace_array = array(add below
Code: [Select]
"<center>\\5</center>",

2. bbcode.html

find
Code: [Select]
<input type="button" value="List" title="LIST" onclick="dolist(this.form)" name="button" class="button" />add below
Code: [Select]
<input type="button" value="Center" title="CENTER" onclick="bbcode(this.form,'center','')" name="button" class="button" />
« Last Edit: May 22, 2009, 09:48:37 AM by YUnir »