Current time: 01-09-2009, 03:54 AM Hello There, Guest! (LoginRegister)


Post Reply 
Removing Postbit from Announcements
08-23-2008, 12:57 AM
Post: #11
RE: Removing Postbit from Announcements
Okay, thanks everyone for your help thus far. Its embarrassing how little I know about PHP, but I'm learning (slowly and surely ..slowly) Toungue.

With the PHP you guys helped me with, I'm almost done with this plugin (all the backend components are 100%). I do have one more question, however.

With my new announcements.php page, only text will show up from the contents of the announcements. I would also like the MyCode to be active as well as HTML to be working on these announcements. How do I get these items enabled on the following page?

PHP Code:
<?php
define
("IN_MYBB"1);
require 
'./global.php';
require_once 
MYBB_ROOT.'inc/class_parser.php';
$parser = new postParser;

$aid intval($mybb->input['aid']);
$ann $db->fetch_array($db->simple_select('announcements''*''aid='.$aid));
if(!
$ann)
error('Invalid announcement'); // use the correct langvar here if you wish

// set the parser options here appropriately
$options = array();
$message $parser->parse_message($ann['message'], $options);

echo 
$message;
?>

Thanks again, I really appreciate it! Smile

[Image: button16.png] - My Host of Choice for 2 Years
Coupon Codes:
KodaksFive - $5 Off Your Order
KodaksFifteen - 15% Off Your Order
Visit this user's website Find all posts by this user
Quote this message in a reply
08-23-2008, 01:35 AM
Post: #12
RE: Removing Postbit from Announcements
Find:

PHP Code:
$options = array(); 

Replace with:

PHP Code:
$options = array(
    
'allow_html'    => $ann['allowhtml'],
    
'allow_mycode'  => $ann['allowmycode'],
    
'allow_smilies' => $ann['allowsmilies'],
    
'allow_imgcode' => 1,
); 

That code will use the options you set when you created the announcement. If you want to override an option, just replace the $ann['...'] variable with 1 or 0.
Visit this user's website Find all posts by this user
Quote this message in a reply
08-23-2008, 01:59 AM
Post: #13
RE: Removing Postbit from Announcements
(08-23-2008 01:35 AM)WDZ Wrote:  Find:

PHP Code:
$options = array(); 

Replace with:

PHP Code:
$options = array(
    
'allow_html'    => $ann['allowhtml'],
    
'allow_mycode'  => $ann['allowmycode'],
    
'allow_smilies' => $ann['allowsmilies'],
    
'allow_imgcode' => 1,
); 

That code will use the options you set when you created the announcement. If you want to override an option, just replace the $ann['...'] variable with 1 or 0.
Thank you so much, it works great.

[Image: button16.png] - My Host of Choice for 2 Years
Coupon Codes:
KodaksFive - $5 Off Your Order
KodaksFifteen - 15% Off Your Order
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: