vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   problems with autosubmitting templates and phrases (https://vborg.vbsupport.ru/showthread.php?t=91613)

Ron1n 07-04-2005 04:59 PM

problems with autosubmitting templates and phrases
 
Meh, ok... im really sort of confused here.

I am making an installer script for a hack - and I wanted to have it autosubmit different phrases and templates. Everything seems to be going OK on the admincp side of things, but when I access the hack it gives me tons of errors.

When I submit the templates and rebuild styles the new templates are visible in the admincp style editor, but when I access them in my mod they give me errors like:
Code:

Parse error: parse error, unexpected '{' in /home/mdzaman/public_html/demo2/downloads.php(832) : eval()'d code on line 2
That '{' error refers to
Code:

{$stylevar['htmldoctype']}
When I was testing this out, I found that when I click save on the template in the admincp it fixes the problem - but I dont know why. I tried searching for the template submission code in vBulletin but I didnt find anything that stood out.

When I submit phrases, they are visible when searched for and when I am viewing all phrase groups, but my own phrase group (downloads, id=411) is not visible and I cannot find out why. Furthermore, when I try to cache phrasegroups for the specific page
Code:

$phrasegroups = array('downloads');
I get a vbulletin database error when viewing the page.

If someone could help solve some/all of these problems ... that would be great. Thanks for reading down this far - hopefully you have an answer.

Andreas 07-04-2005 05:13 PM

What do you mean with "autosubmit"?

Ron1n 07-04-2005 06:04 PM

Quote:

Originally Posted by KirbyDE
What do you mean with "autosubmit"?

Where the install script (my code) inserts templates/phrases so the user doesnt have to.

PHP Code:

function create_phrase($phrase)
{
    global 
$downloads$db;
    
$db->query_write("INSERT INTO `phrase` (`languageid`,`varname`,`text`,`phrasetypeid`,`product`) VALUES(".
                                
prep($downloads['phrase'][$phrase]['languageid']).",".
                                
prep($downloads['phrase'][$phrase]['varname']).",".
                                
prep($downloads['phrase'][$phrase]['text']).",".
                                
prep($downloads['phrase'][$phrase]['phrasetypeid']).",".
                                
prep($downloads['phrase'][$phrase]['product']).")");


PHP Code:

function create_template($template)
{
    global 
$downloads$db;
    
$db->query_write("INSERT INTO `template` (`styleid`,`title`,`template`,`template_un`,`dateline`,`username`,`product`) VALUES(".
                            
prep(-1).",".
                            
prep($template).",".
                            
prep($downloads['template'][$template]).",".
                            
prep($downloads['template'][$template]).",".
                            
prep(TIMENOW).",".
                            
prep('Ronin').",".
                            
prep($downloads['product']).")");


But btw, I do rebuild styles and languages after editing, and ... yea - i think i explained the rest.

Andreas 07-04-2005 06:08 PM

You are not compiling the Templates ...

Ron1n 07-04-2005 06:20 PM

Quote:

Originally Posted by KirbyDE
You are not compiling the Templates ...

Ok, checking that out. Any suggestions about the phrases not showing up?

Andreas 07-04-2005 06:22 PM

Are you using an existing Phrasetype?
If not: Have you altered Table language and inserted a record in Table Phrasetype?

Ron1n 07-04-2005 11:24 PM

I submit a phrasetype and a table in language...
PHP Code:

function delete_phrasetype()
{
    global 
$downloads$db;
    
$db->query_write("DELETE FROM `phrasetype` WHERE `phrasetypeid`=".prep($downloads['phrasetype']['id'])." AND `product`=".prep($downloads['phrasetype']['product']));
    
$db->query_write("ALTER TABLE `language` DROP `phrasegroup_" $downloads['phrasetype']['fieldname'] . "`");
}

function 
create_phrasetype()
{
    global 
$downloads$db;
    
$db->query_write("INSERT INTO `phrasetype` (`phrasetypeid`,`fieldname`,`title`,`product`) VALUES(".
                                
prep($downloads['phrasetype']['id']).",".
                                
prep($downloads['phrasetype']['fieldname']).",".
                                
prep($downloads['phrasetype']['title']).",".
                                
prep($downloads['phrasetype']['product']).")");
    
$db->query_write("ALTER TABLE `language` ADD `phrasegroup_" $downloads['phrasetype']['fieldname'] . "` MEDIUMTEXT NOT NULL");


Any other suggestions?

Andreas 07-04-2005 11:33 PM

Yes - use add_phrase_type() in adminfunctions_language.php instead of your own function :)

Ron1n 07-05-2005 12:11 AM

mmk.

When removing it, is there anything I need to remove that I didnt before - or is there a function to remove it? (I didnt see a remove function in the same file as the add function you just showed me).

Edit: i found the problem, it was the editrows thing. Personally, I dont want to use that add_phrase_type thing until vBulletin supports add_phrase_type and remove_phrase_type for OCD reasons. :P

Thanks for your help :D


All times are GMT. The time now is 09:31 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.01935 seconds
  • Memory Usage 1,769KB
  • 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
  • (3)bbcode_code_printable
  • (3)bbcode_php_printable
  • (2)bbcode_quote_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