latest releases

30.1.2010

Added Unicode and Youtube support.

read more ...

21.1.2010

No bugs found in Recruiting Parser heretofore.

read more ...

related content

Manual

Even though Recruiting Parser is big and complex program, it doesn't mean its usage is complex. It is incredibly easy, any programmer can integrate Recruiting Parser to its Site. Here you can find detailed documentation on how to use Recruiting Parser. If you want a Rich Text Editor (WYSIWYG), please check the Download, or if you want to know how to use Recruiting Parsers' external extras, check out page called Extras.
It's also worth to mention that there's a brief Manual in Recruiting Parsers' main file (parser.php) itself.


» Simplest Usage

This demonstrates how to load Recruiting Parsers' file, start it up and parse some text.


<?php
/* we assume there's some text that needs parsing
 stored in variable called $text */

require_once('parser.php'); // path to Recruiting Parsers' file
$parser = new parser//  start up Recruiting Parsers

$parsed $parser->p($text); // p() is function which parses

/* parsed text is now stored in $parsed, if you want
to output simply output $parsed, thusly: */

echo $parsed;
    
?>


Recruiting Parser is a application that is completely made inside one class (1 file). That's why we firstly included that file (called parser.php), and then created a new instance of Recruiting Parser. Class containing whole Recruiting Parser is called parser. That is very important! We called it $parser, but it can be anything (as long it obeys PHP's variable guidelines).

Recruiting Parsers' main function, which handles all the parsing work is called p. p stands for parse. It has many arguments available, but only is enough, the first one, the one which represents the text you want to parse. We called it $text, pretending there's text we want to parse. All p()'s arguments and their explanation is available below. So, PARSED text is now in $parsed.

And that's actually it! If you want to output that text/data, simply output it like any other string. In this example, echo() is used.

» Advanced Usage

... or how to use all available arguments.


<?php
require_once('parser.php'); // load Recruiting Parsers' file
$parser = new parser// start Recruiting Parser...

// output $text using all arguments available
$parser->p($text100001"echo 'End of work.';");
    
?>


So, what just happened? This shows Recruiting Parser with all its arguments vica-versa.

First Argument ($text) - text to parse

Second argument (1) - by default, Recruiting Parser won't change newlines (\n) to HTML new lines (<br />). But, when enabled, Recruiting Parser will automatically do that. It's recommended to have it on, but most people like to handle that theirself, so having this by default on (1) would mess their layout, so it's up to you to turn it on. You can turn it by putting anything that doesn't mean FALSE, e.g. - 0, false, null.

Third argument(0) - do you want to only parse the text or also output it? By default, Recruiting Parser "only" parses the text, leaving it in a variable you specify. You can set this argument to negative meaning to automatically output data. If this would have been in positive meaning, Recruiting Parser wouldn't output, but save parsed data in a variable.

Fourth argument (0) - use smilies or not? Turned on by default, but you should know that smilies are the biggest slower in whole application. So, if you don't want to have smilies in parsed text, you can turn this off, and also increase parsing speed. Normal parsing time is of a bigger text is about 0.2 seconds, but if you have this argument on, it usually takes a whole second and half to parse.
Note: if you have this argument OFF, fifth argument will also be turned off.

Fifth argument (0) - this one relies on fourth argument; if fourth argument is negative, then this one will OFF too. This one expands smilies features. Generally, you can get smilies by more native way via this argument. See part about smilies to know more.

Sixth argument (0) - internal extra, crypt mails and protect them from spam-robots. It is STRONGLY recommended to not turn this argument off! This crypts your email from spam-robots. Normal viewers, people, don't notice a difference.

Seventh argument (1) - this argument does 2 things. Firstly, at the end of document, it shows parsed text once again, but in "formated" shape. That's hard to explain, so you'll have to try it. In addition, it saves parsed AND formated text in a constant called RP_BUFFER. This gives you an opportunity to access parsed AND formated text anywhere (constants are accessible through whole document).

Eighth argument ("echo 'End of work.';") [string] - is there any PHP Code you'd like to output after Recruiting Parser finishes its work? If so, put it in quotes and type it. To unlimited comlexity.

» Deparse

Deparse function (deparse()) is function to reverse parse process (p()).
It supports 3 arguments, 1(first) necessary:

deparse(string, <br /> mode, output mode)

As with p(), it's incredibly easy to use it. This function is supposed for situations like these: you take user's post and parse it for showing, however, user decides to alter that post, so you firstly have to deparse it back to BBCode, so it can understand what he is writting. There's not a big amount of people who understand HTML. Recruiting Parser is exactly that. It changes BBCode to browser-readable HTML Code. This function changes HTML code to readable BBCode.
In addition, deparse process also optimizes BBCode, therefore makes it (in most cases) smaller. Generally:


<?php
// $text is fictional again
require_once('parser.php');
$repa = new parser// repa = RecruitingParser

// parse
$parsed $repa->p($text);

// now deparse
$deparsed $repa->deparse($text);

// $deparsed is now same as $text
    
?>


This example is simple. Firstly, we parsed the text, and then deparsed it. Deparsed data should equal to $text, possibly optimized (which is good).

Now about the another two arguments, <br /> mode and output mode.

<br /> mode is just like 2nd argument in parse function, except that it here defaults to on. In parse mode, having that argument (1st argument) on would cause newlines being automatically changed to HTML's new line, the <br /> tag. Here, in deparse mode, it defaults to on, and it changes all HTML new lines to PHP's new lines (\n).

The output mode argument is just like 3rd argument in parse function, and, unlike <br/> mode argument, it also defaults to return. That is, text will not be outputed, but saved in desired variable.

I don't want to leave you confused about the <br /> mode, so I'll re-explain.
If you haven't changed second argument in parse function p(), then this argument won't matter to you a lot. However, if there's still some <br />'s, they will be removed.
But, if you have turned on second argument in parsed function, then it's again good to leave this on. But you can also turn it off, but that could mess up. It's up to you.

» BBCode

Here's a list of supported BBCodes:

BBCode Preview
[u]text[/u] text
[i]text[/i] text
[b]text[/b] text
[cool]text[/cool] text
[code]text[/code]
text
[indent]text[/indent]
text
[lyrics]text[/lyrics] text
[smallcaps]text[/smallcaps] text
[big]text[/big] text
[small]text[/small] text
[tt]text[/tt] text
[sub]text[/sub] text
[sup]text[/sup] text
[url]www.recgr.com[/url] www.recgr.com
[url=http://www.recgr.com]Recruiting Grounds[/url] Recruiting Grounds
[img]linux.gif[/img] (long live Linux!) (long live Linux!)
[email=nino@recgr.com]Nino[/email] Nino
[email]nino@recgr.com[/email] nino@recgr.com
[font=Arial]Text in Arial font[/font] Text in Arial font
[color=red]Red Text[/color] Red Text
[color=#FF66FF]Light Pink Text[/color] Light Pink Text
[bull /]
[copyright /] ©
[registered /] ®
[tm /]

 

[php], [list], [list=dec] tags
Yep, there's more!

[php]...[/php]
Usage of Recruiting Parsers' [php] tag is viewable through whole this page. Exactly, all these PHP source highlights are made by Recruiting Parser.


[list]...[/list]

BBCode [list] unordered thing one unordered thing two unordered thing three unordered thing four [/list]

Preview
  • unordered thing one
  • unordered thing two
  • unordered thing three
  • unordered thing four


[list=dec]...[/list]

BBCode [list=dec] ordered thing one ordered thing two ordered thing three ordered thing four [/list]

Preview
  1. ordered thing one
  2. ordered thing two
  3. ordered thing three
  4. ordered thing four



[cool], [code], [indent], [lyrics] tags

Even though already represented, we think it's smart to showcase them once more, just to see them more right.

[cool] tag - made for things like what's currently going, flash news etc.

[code] tag - made for various code. use [php] tag for PHP-only code.

[indent] tag - indent your text.

[lyrics] tag - recommended for song lyrics, or speeches.


» Smilies

Now about smilies, which are a part of Recruiting Parsers' core. You can call them in two ways.

Appearance Code #1 Code #2
:confident: :)
:happy: :D
:crying: ;(
:friendly: ;)
:evil: >:)
:panic: :O
:indifferent: :|
:angel: O:)
:teasing: :P
:angry: :(
:polite: :3
:mad: :X
:tearing: :@
:yelling: :()
:sad: :/
:sceptical: :\

» Updater

Updater is a function in Recruiting Parser which allows you to check for newer version of Recruiting Parser without even going to this site. It also requires no arguments, just call it, and you'll clearly see if you have the latest version.

update();

Example:


<?php
require('parser.php');
$p = new parser;
$p->update();
// and that's it, answer will be output
    
?>


Speed of this function relies on 2 factors. First is current site load(speed), and second is your speed. For instance, it takes a second to receive an anwser via dial up.