vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   postparsed table...how is it updated? (https://vborg.vbsupport.ru/showthread.php?t=126709)

minboost 09-15-2006 06:00 PM

postparsed table...how is it updated?
 
I noticed that the postparsed table is updated when a new post is made (and probably when it is updated) as well as when a post is viewed (if a record doesn't exist for that post in the table).

When else is it updated?

I'm trying to write a plug-in that circumvents the forum permissions for things like posting html, bbcode, etc...so that no matter what the permissions are I can put in any post I want.

I was thinking that if I insert a record directly into the postparsed table for my post, that will do it. But I'm just not sure if/when vbulletin may delete that record and re-parse the post.

I understand only a limited number of posts are stored in the postparsed table. Would setting the dateline column to an arbitrary date in the future help to keep it from being removed from the postparsed table? How does vBulletin decide when to look in the postparsed table and when to insert/update/remove records from it?

Any ideas?

Thanks guys!

timetunnel 11-20-2006 03:08 AM

Hello.

I'd like to know how the 'postparsed' table is updated also. From which file? All I've seem to see so far is 'DELETE' from that table.

Thanks in advance.

Adrian Schneider 11-20-2006 03:15 AM

When you view a post in a style that hasn't had it cached yet, it will create the cache for that post.

So, viewing a newly created/edited post would cause it to update the postparsed table.

timetunnel 11-20-2006 03:20 AM

Thanks for your reply, SirAdrian.

Which file updates that postparsed table for new posts? All I've found so far is the 'DELETE' from that table vs. INSERT.

Thanks again in advance.

Adrian Schneider 11-20-2006 03:27 AM

from showthread.php, here is its time-out check,
PHP Code:

$post_cachable = (
    
$vbulletin->options['cachemaxage'] > AND
    (
TIMENOW - ($vbulletin->options['cachemaxage'] * 60 60 24)) <= $thread['lastpost'] AND
    
$vbulletin->session->vars['sessionurl'] == ''
); 

So it goes through each post, and if thats set or if the post has no cache, it will update it with this:
PHP Code:

if (!empty($saveparsed))
{
    
$db->shutdown_query("
        REPLACE INTO " 
TABLE_PREFIX "postparsed (postid, dateline, hasimages, pagetext_html, styleid, languageid)
        VALUES 
$saveparsed
    "
);
    unset(
$saveparsed);



timetunnel 11-20-2006 03:44 AM

Thanks again for your reply.

If I add a 2nd field to the 'newthread' that also uses e.g. the WYSIWYG editor, would I need to create a 2nd 'pagetext_html' (different name of course) in that 'postparsed' table OR would it use the same original 'pagetext_html' table field since it belongs to the ENTIRE post and therefore would just tack on the 2nd field's data onto the 1st field's data?

Thanks again in advance.

Adrian Schneider 11-20-2006 03:54 AM

You would need to add a second field if you want to to save the cache of it.

BTW, I think you would be better off having it NOT cache the post rather than duplicating the content.

timetunnel 11-20-2006 04:57 AM

Got it.

Thanks for your assistance!

dd009 09-08-2011 05:24 AM

Very helpful.

Thanks


All times are GMT. The time now is 04:29 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.00984 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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