Welcome Guest, Not a member yet? Register   Sign In
Example?
#1

[eluser]tonyhh[/eluser]
How would I go by using this?

http://codeigniter.com/wiki/Another_BBCode_Helper
#2

[eluser]pickupman[/eluser]
The code is several years old, but by looking at it you would something like this:

Code:
//In controller
$this->load->helper('bbcode');

//In view
< head >
  <?php echo js_insert_bbcode('form_name', 'field_to_insert');?>
</ head >
< body >

  <?php echo form_open('form_name');?>
  &lt;?php echo get_bbcode_buttons();?&gt;<br/>
  &lt;?php echo form_textarea('field_to_insert');?&gt;<br/>
  &lt;?php echo form_submit('submit', 'Submit');?&gt;
  &lt;?php echo form_close();?&gt;

< /body>

//In controller method processing form input
$textarea = $this->input->post('field_to_insert');

//Replace bbCode
$textarea = parse_bbcode($textarea);

Haven't tested any of the code, but should give a decent idea. I have never used this helper before.
#3

[eluser]tonyhh[/eluser]
Thanks for the quick reply.
#4

[eluser]tonyhh[/eluser]
I get:

Your application/config/bbcode.php file does not appear to contain a valid configuration array.

When trying to load the config because im trying to load the buttons

#5

[eluser]pickupman[/eluser]
The config file was posted in the wiki article you linked. You need to copy the config code to /application/config/bbcode.php
#6

[eluser]tonyhh[/eluser]
Yeah, I've done that, but it says does not appear to contain a valid configuration array after loading it, maybe it's outdated?

Sorry fixed it, forgot it was an array
#7

[eluser]pickupman[/eluser]
The config file is done via a include, rather than loading the config file. Perhaps it's a file path error. Just check where it is trying to use the config values, and see what the file path is to make sure you have saved to the right spot.

And the code is 4 years old.
#8

[eluser]tonyhh[/eluser]
Fixed big thanks!




Theme © iAndrew 2016 - Forum software by © MyBB