Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-28-2009, 03:20 PM
svoeric svoeric is offline
 
Join Date: Apr 2008
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default adding userfield in post-bit legacy, under avatar

ok, I'm done editing templates... it sucks everytime you do an upgrade.
So I'm doing all my newest mods with products & plug-ins.

I've done pretty well with all my mods, but I'm having an issue with one of the simplest ones!

I use post-bit_legacy format, and under the avatar, or in that general area, I list $post[field8]

I can't figure out how to get it to display using the hook. I'm always getting an error.

I tried just displaying the variable at the postbit_imicons hook.
I tried adding the code to a custom template, and then displaying the template on the postbit_imicons hook.

I must be making this wayyy harder than it is.
anyone got any help ?

Thanks
Reply With Quote
  #2  
Old 09-28-2009, 04:14 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Let's see what you wrote (and tell us the hook location of the plugin) and then tell us the exact error.
Reply With Quote
  #3  
Old 09-28-2009, 04:22 PM
svoeric svoeric is offline
 
Join Date: Apr 2008
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

oh, guess that would have been helpfull.. altho not much code there..

created template list_field8
with code...
$post['field8']

created plugin...
location postbit_imicons

with code...

$vbulletin->templatecache['list_field8']

Error is (3 times across top of page)

Parse error: syntax error, unexpected $end in /home/public_html/forum/includes/class_postbit.php(1221) : eval()'d code on line 2
Reply With Quote
  #4  
Old 09-28-2009, 05:55 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please use the code tags when writing code in your post, it makes it easier to follow.

You say you created a plugin using the postbit_imicons hook location. Did you look to see where that was evaled in the code?

You have done nothing in your code to add anything to the postbit. Have you looked at any other modifications that add code to the postbit templates? I'd suggest taking a look at a couple and seeing how they did it. It will give you a better idea of how to get it done.
Reply With Quote
  #5  
Old 09-28-2009, 06:07 PM
svoeric svoeric is offline
 
Join Date: Apr 2008
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I had a hard time finding anything that added to post-bit... that's why I posted for help

normally I would use code tags, but it's just 1 line each ...
Reply With Quote
  #6  
Old 09-28-2009, 06:50 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is one regarding adding the gender to the postbit, one for adding country flags.... search for terms regarding those and you can find stuff, I'm sure.

But basically, you have a template hook right in that area - $template_hook[postbit_userinfo_left]. So, you really only need to write a plugin to use that hook (I usually use a postbit_display hook):

PHP Code:
$template_hook[postbit_userinfo_left] .= $post['field8']; 
or
PHP Code:
eval('$template_hook[postbit_userinfo_left] .= " ' fetch_template('your-template') . '";'); 
Go look for those other mods (you can even look in the add-ons section for just mods that add to the postbit/showthread page (I can't remember what the prefix is).
Reply With Quote
  #7  
Old 09-29-2009, 01:23 AM
svoeric svoeric is offline
 
Join Date: Apr 2008
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Lynne, with the little push you gave me, I was able to write up this...
PHP Code:
if ($post['field8'] != "")
$template_hook[postbit_userinfo_left] .= $vbphrase['list_field8_label'] . $post['field8'] ;} 
using the postbit_display_complete hook.
I didn't see a real need for a template, so I left it out...
Reply With Quote
  #8  
Old 09-29-2009, 01:26 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Glad you got it working!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:54 PM.


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.05552 seconds
  • Memory Usage 2,225KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete