vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How to call up your own postbit? (https://vborg.vbsupport.ru/showthread.php?t=101459)

Harald_T 11-24-2005 12:05 PM

How to call up your own postbit?
 
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...
Code:

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

PHP Code:

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

PHP Code:

# 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 == 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.


All times are GMT. The time now is 06:26 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01147 seconds
  • Memory Usage 1,722KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete