Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 07-14-2011, 01:11 PM
kevin.kool kevin.kool is offline
 
Join Date: Nov 2009
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Select and display elements in postbit

Hello guys,

I'm using Gifts (i also attached this mod below) modification for vb3.8, the original code of this mod doesn't show gifts on postbit, so i would like to do some changes to list gift on postbit.

I'm so bad in PHP and MySQL You guys please give me some advices.

Thank you very much.

Edit: Attachment removed, please note reason below in post #3. - TheLastSuperman
Reply With Quote
  #2  
Old 07-18-2011, 01:57 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could try this: create a plugin usign hook location showthread_query and this code:

Code:
$hook_query_fields .= ", gifts.*, gift_type.* ";
$hook_query_joins .= " LEFT JOIN " . TABLE_PREFIX . "gifts AS gifts ON(user.userid = gifts.recipientid)  LEFT JOIN " . TABLE_PREFIX . "gift_type AS gift_type ON(gifts.gifttypeid = gift_type.gifttypeid) ";

Then in the postbit template you should be able to use $post['description'] or whatever else you need from the gifts and gitft_type tables.

BTW, when you create the plugin, if you leave the product as "vbulletin" then after you uninstall "gifts" you're going to get errors because those tables won't exist any more. But if you select the "gifts" product, the plugin wil be deleted when you uninstall the gifts product and you'll lose it. So I think the thing to do is select "gifts" as the product then export the product (or just the plugin) so you'll have a copy of it saved.

--------------- Added [DATE]1311012205[/DATE] at [TIME]1311012205[/TIME] ---------------

Thanks for the "like", but I just realized that this probably won't work right when someone has received more than one gift (you may end up with duplicate posts in the thread display).

I guess then you'd have to do a separate query of the gift table for each postbit and loop through them.
Reply With Quote
Благодарность от:
kevin.kool
  #3  
Old 07-18-2011, 05:30 PM
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
Senior Member
 
Join Date: Sep 2008
Location: North Carolina
Posts: 5,844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, I don't believe you should post an entire modification in this manner, it's from a third party and that in a sense is re-distribution per say as they cannot track nor do they know it's available here as complete download, they may not wish that, basically it's uploading a modification w/o the authors consent.

Please link to the modification on here or via their site for someone to review next time .
Reply With Quote
Reply

Thread Tools
Display Modes

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 11:42 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03891 seconds
  • Memory Usage 2,177KB
  • Queries Executed 13 (?)
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
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (1)post_thanks_box_bit
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (3)post_thanks_postbit_info
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)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_postinfo_query
  • fetch_postinfo
  • 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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete