PDA

View Full Version : How to call up your own postbit?


Harald_T
11-24-2005, 12:05 PM
I'm riddling about this a longer time:

How do i call up my own postbit? I don't want to use the normal postbit any longer for my gallery-hack, but i couldn't get it, to call up my own postbit.

Could anyone be so nice and explain me?

Thanks,

Harald

calorie
11-24-2005, 12:37 PM
Try the following in a plugin...

hook: postbit_display_complete

$postid =& $post['postid'];
eval('$retval = "' . fetch_template('your_template_name') . '";');
return $retval;

Harald_T
11-24-2005, 02:05 PM
Tried, but made no visible effect.

merk
11-24-2005, 09:19 PM
postbit_factory


if($postbit_type == 'yourpostbittype')
{
$out =& new vB_Postbit_Post();
$out->templatename = 'yourpostbittemplate';
$handled_type = true;
}

showthread_postbit_create (you will want to add more conditions depending on your application


# this will change the first post as long as its only a post (not a deleted or ignored or so on, and iirc I added changed so that there would only ever be one change per page. I had trouble with moderated posts.
if ($counter == 1 AND $fetchtype == 'post' AND !$changed)
{
$fetchtype = 'yourpostbittype';
$changed = true;
}

Harald_T
11-24-2005, 09:50 PM
Thanks, this worked great!

thincom2000
04-02-2007, 05:46 PM
Okay, I have made a few of my own postbit templates and used the postbit_display_complete hook to display them correctly.

However, when I Quick Edit the post, and click Save, it changes the postbit from my new postbit to the forum default. Where does this change take place? I have checked showthread.php, ajax.php, includes/functions_editor.php, includes/class_postbit.php, includes/class_xml.php, includes/class_ajax_output.php all to no avail.

EDIT: Need to use hook postbit_display_complete to set $templatename when THIS_SCRIPT == 'editpost' as well.