The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Update style through sql cmd
Hey there.
I've got the current code: Code:
$vbulletin->db->query_write("update " . TABLE_PREFIX . "template set template_un='Dont forget to check out our newest newsletter!' WHERE title='ad_navbar_below'"); When I go to the style manually, it's there, and for it to show, I need to do "Save&Reload" so I think I have to automate the "reload style" part. How do I do that/ Thanks |
#2
|
|||
|
|||
You also need to set the 'template' field to the compiled template, which you can get like this:
Code:
$template_un = "Some message"; require_once(DIR . '/includes/adminfunctions_template.php'); $template = compile_template($template_un); |
#3
|
|||
|
|||
Quote:
Code:
require_once(DIR . '/includes/adminfunctions_template.php'); $template_un = 'message'; $template = compile_template($template_un); $vbulletin->db->query_write("update " . TABLE_PREFIX . "template set template_un='" . $template_un . "' WHERE title='ad_navbar_below'"); $vbulletin->db->query_write("update " . TABLE_PREFIX . "template set template='" . $template ."' WHERE title='ad_navbar_below'"); Thanks --------------- Added [DATE]1352945845[/DATE] at [TIME]1352945845[/TIME] --------------- Actually, Scratch that. I mean; Code:
require_once(DIR . '/includes/adminfunctions_template.php'); $template_un = 'message'; $template = compile_template($template_un); $vbulletin->db->query_write("update " . TABLE_PREFIX . "template set template_un='" . $template_un . "' WHERE title='ad_navbar_below'"); Still requires me to press the save and reload button in the styles manager. --------------- Added [DATE]1352947788[/DATE] at [TIME]1352947788[/TIME] --------------- Think I've found it. print_rebuild_style Let's see.. I'll test it out now. --------------- Added [DATE]1352948337[/DATE] at [TIME]1352948337[/TIME] --------------- Code:
require_once(DIR . '/includes/adminfunctions_template.php'); $template_un = 'message'; $template = compile_template($template_un); $vbulletin->db->query_write("update " . TABLE_PREFIX . "template set template_un='" . $template_un . "' WHERE title='ad_navbar_below'"); $vbulletin->db->query_write("update " . TABLE_PREFIX . "template set template='" . $final_rendered ."' WHERE title='ad_navbar_below'"); print_rebuild_style(-1, '', 0, 0, 0, 0); makes me have to press save and reload in template.php still.. ugh.. --------------- Added [DATE]1352950211[/DATE] at [TIME]1352950211[/TIME] --------------- Well, I'm stumped. I finished w/ this code and it doesnt work either. still requires manual save. Code:
require_once(DIR . '/includes/adminfunctions_template.php'); $template_un = 'messgaaaage'; $template = compile_template($template_un); $vbulletin->db->query_write("update " . TABLE_PREFIX . "template set template_un='" . $template_un . "' WHERE title='ad_navbar_below'"); $vbulletin->db->query_write("update " . TABLE_PREFIX . "template set template='" . $final_rendered . "' WHERE title='ad_navbar_below'"); $vbulletin->db->query_write("update" . TABLE_PREFIX . " template set dateline = " . TIMENOW . " WHERE title='ad_navbar_below'"); print_rebuild_style(-1, '', 0, 0, 0, 0); ...Got it!! Just for future reference, this is how to do it: Code:
require_once(DIR . '/includes/adminfunctions_template.php'); $template_un = "lol7"; $template = compile_template($template_un); $vbulletin->db->query_write("update " . TABLE_PREFIX . "template set template_un='" . $template_un . "' WHERE title='ad_navbar_below'"); $vbulletin->db->query_write("update " . TABLE_PREFIX . "template set template='" . addslashes($template) . "' WHERE title='ad_navbar_below'"); $vbulletin->db->query_write("update" . TABLE_PREFIX . " template set dateline = " . TIMENOW . " WHERE title='ad_navbar_below'"); print_rebuild_style(-1, 'ad_navbar_below', 0, 0, 0, 0); build_style_datastore(); |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|