vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Quick edit ajax question (https://vborg.vbsupport.ru/showthread.php?t=261495)

Boofo 04-05-2011 08:00 PM

Quick edit ajax question
 
I'm stuck here, guys. I have a replacement variable in my sig. When I do a quick edit of the post, after I save it, you can see the variable. When I refresh the page, the variable is parsed like it should be. Is there a hook that deals with the ajax portion of that so it can be parsed without having to refresh the page first?

Boofo 04-14-2011 11:33 AM

No one has any ideas on this?

Ziki 08-22-2012 11:54 AM

I'd like to know the answer to Boofo's question as well :-/

kh99 08-22-2012 11:59 AM

Can you have replacement variables in a sig? It sounds like a mod that doesn't completely work right.

Ziki 08-22-2012 12:02 PM

I was actually wondering why this doesn't work on postbit_display_complete:

Code:

$ok_ids = $vbulletin->options['allowedforum_ids'];
$ok_ids_array = explode("," , $ok_ids);
if (in_array( $foruminfo['forumid'],$ok_ids_array))
{
$links = explode(',',$thread['links']);
$scans = explode(',',$thread['scans']);
array_pop($links);array_pop($scans);
vB_Template::preRegister('postbit_legacy',array(
'links' => $links,
'scans' => $scans
));
vB_Template::preRegister('postbit',array(
'links' => $links,
'scans' => $scans
));
}

It should display two boxes beneath the post text, which does fine but after using the quick edit it disappears and I have to refresh.

kh99 08-22-2012 12:15 PM

Quote:

Originally Posted by Ziki (Post 2358996)
I was actually wondering why this doesn't work on postbit_display_complete:


Oh, ok. I think the reason is that $vbulletin and $foruminfo don't seem to be available at that hook. For $vbulletin you can put in a "global $vbulletin" or you can use $this->registry instead. And it looks like you can use $forum instead of $foruminfo.

Ziki 08-22-2012 12:23 PM

You're right, but that didn't help either, still after quick saving, the box disappears.

Scanu 08-22-2012 12:25 PM

Lol guess what i'm asking to myself the same question ahaha
However kevin it seems that the code is working well, the problem is just the when you edit via ajax, i have fields for links and scans just on newthread.php and editpost.php when you click edit post (ajax) as you don't have links fields when you click save it seems to update links with empty values

kh99 08-22-2012 12:38 PM

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.

Scanu 08-22-2012 12:44 PM

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.


All times are GMT. The time now is 08:56 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.01601 seconds
  • Memory Usage 1,728KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete