vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   UPDATE phrase SET text='www.mybackup.com' WHERE varname='backup_server'; (https://vborg.vbsupport.ru/showthread.php?t=229616)

imported_silkroad 12-06-2009 07:28 AM

UPDATE phrase SET text='www.mybackup.com' WHERE varname='backup_server';
 
Hello,

I have script that runs this command against the vB database to update one of the $vbphrases:

UPDATE phrase SET text='www.mybackup.com' WHERE varname='backup_server';

It updates the database just fine, and I can see the new phrase text in the AdminCP, but the old text still shows up in the output.

If I manually change the phrase text in the AdminCP it works fine; however if I do it from my one line MySQL UPDATE, it updates the dB but it does not seem to flush some cache or update right in the templates.

Is there another command I need to issue to flush a cache or something?

I am lost as to why the dB updates with my MySQL query but it does not work; but it works if I do it in the AdminCP.

Thanks.

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

Looking at phrase.php, I noticed that vB actually deleted the old phrase and inserts and new one, incrementing the phraseid and dateline (timestamp).

I guess that is the reason a simple UPDATE to the dB does not work.

kh99 12-06-2009 07:51 AM

Looking at admincp/phrase.php, it looks like after it updates a phrase it redirects to admincp/language.php?do=rebuild. In the language.php "do == rebuild' section, it looks like it essentially does the following (without the HTML status stuff):

PHP Code:

require_once(DIR '/includes/adminfunctions_language.php');

$languages fetch_languages_array();
foreach(
$languages AS $_languageid => $language)
{
    
build_language($_languageid);
}
build_language_datastore(); 


But I haven't tried it at all.


Quote:

Originally Posted by imported_silkroad (Post 1926163)
Looking at phrase.php, I noticed that vB actually deleted the old phrase and inserts and new one, incrementing the phraseid and dateline (timestamp).

I guess that is the reason a simple UPDATE to the dB does not work.

...or it could be that, I don't know.

imported_silkroad 12-06-2009 08:22 AM

Thanks. I missed that in phrase.php.....

It is getting more complicated than I hoped, so I think it is better to shift gears and do this with a PHP Global instead of changing phrases, as you first suggested and I suspected.

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

OK, this code is done using plugin code:

[PHP] Server Check and Failover Code

In case you need something like this .....


All times are GMT. The time now is 01:22 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.01062 seconds
  • Memory Usage 1,720KB
  • 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_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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