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

Reply
 
Thread Tools Display Modes
  #11  
Old 08-22-2012, 01:46 PM
Ziki's Avatar
Ziki Ziki is offline
 
Join Date: Nov 2005
Posts: 2,704
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
Hmm...well, when I save after doing an inline edit, it seems to make 2 calls - one is to ajax.php with do=editorswitch, which seems to allow it to convert the message text based on the editor mode. Then it calls editpost with do=updatepost, and it looks to me like that ends up calling construct_postbit, which should run the postbit_display_complete hook code. I guess I'll have to experiment more to see if code on that hook can actually change the postbit in that situation.
Yes, that is correct, that's why I was baffled when it didn't work :-/
Reply With Quote
  #12  
Old 08-22-2012, 01:51 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Ziki View Post
Yes, that is correct, that's why I was baffled when it didn't work :-/
If you take away your "if" statements and hardcode your $links and $scans, does it work then? (Assuming it's a test forum - you wouldn't want to do that on a live forum of course). I was going to set up that test but it's probably easier for you.
Reply With Quote
  #13  
Old 08-22-2012, 01:53 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Scanu View Post
Yes it's a bit difficult, there is only one hook for ajax edit, i serached for other mods and i found this: https://vborg.vbsupport.ru/showthread.php?t=250948 but if you disable redirecting plugins and try to do a quick edit it deletes the link, so he had the same problem. Another mod was this: https://vborg.vbsupport.ru/showthread.php?t=269667. But the ajax thing is a pro feature so nothing to do with it.
I'm not sure I understand, but if you're working with form fields that exist only when you're creating the post, then yeah, you'd need to save them somewhere so you can have them if the post is being edited (or somehow arrange for them to be submitted when the edited post is submitted, like hidden fields?). Edit: it seems like you'd have the same problem when non-inline editing a post, unless you expect the user to re-enter the info.
Reply With Quote
  #14  
Old 08-22-2012, 02:59 PM
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Posts: 829
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well i've added a field to the new thread page then i saved it, after this i can use threadinfo['myfield'] in postbit_display_complete, i added the field to editpost.php too, where you can update this field, until now everything is ok i create a new thread and i put a value to my field and i can see it in the showthread page, if i click edit post and go advanced i can edit this value and it works fine, the problem was adding this field to quickedit so i decided to leave it just on editpost.php but actually if i click edit post and then save it deletes my value, i hope i made myself clear and again, sorry for my english
Reply With Quote
  #15  
Old 08-22-2012, 03:07 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, I guess I'd have to study the mod to understand it completely. But at hook postbit_display_complete, you should have the thread info in $thread. The difference of course is that that's called when it's displayed instead of when it's saved in the db.
Reply With Quote
  #16  
Old 08-22-2012, 03:32 PM
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Posts: 829
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok i will try to add global $vbulletin and $thread instead of $threadinfo
Reply With Quote
  #17  
Old 08-22-2012, 03:37 PM
Ziki's Avatar
Ziki Ziki is offline
 
Join Date: Nov 2005
Posts: 2,704
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
If you take away your "if" statements and hardcode your $links and $scans, does it work then? (Assuming it's a test forum - you wouldn't want to do that on a live forum of course). I was going to set up that test but it's probably easier for you.
Nah it works fine, when the code is in postbit_display_complete and the thread is loaded the boxes show up, they just disappear for some reason after saving quick edit. I looked at the code I think postbit_display_complete should be called somewhere around that part, just not sure why it's not working.
Reply With Quote
  #18  
Old 08-22-2012, 03:46 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, something's got to be different during the edit. I'll play around and see if I can figure out anything.
Reply With Quote
  #19  
Old 08-22-2012, 03:51 PM
Ziki's Avatar
Ziki Ziki is offline
 
Join Date: Nov 2005
Posts: 2,704
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It somehow must go through inlinemod.php as well I think
Reply With Quote
  #20  
Old 08-22-2012, 04:03 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh well, I'm already stumped. I added a variable to the postbit_legacy template and used preRegister to set the value in a plugin on postbit_display_complete using values from $vbulletin and $forum, and it works even if I inline edit.
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 09:51 AM.


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.05500 seconds
  • Memory Usage 2,256KB
  • 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
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete