Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-04-2005, 04:59 PM
Ron1n Ron1n is offline
 
Join Date: Jun 2004
Posts: 373
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 07-04-2005, 05:13 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What do you mean with "autosubmit"?
Reply With Quote
  #3  
Old 07-04-2005, 06:04 PM
Ron1n Ron1n is offline
 
Join Date: Jun 2004
Posts: 373
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 07-04-2005, 06:08 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You are not compiling the Templates ...
Reply With Quote
  #5  
Old 07-04-2005, 06:20 PM
Ron1n Ron1n is offline
 
Join Date: Jun 2004
Posts: 373
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KirbyDE
You are not compiling the Templates ...
Ok, checking that out. Any suggestions about the phrases not showing up?
Reply With Quote
  #6  
Old 07-04-2005, 06:22 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you using an existing Phrasetype?
If not: Have you altered Table language and inserted a record in Table Phrasetype?
Reply With Quote
  #7  
Old 07-04-2005, 11:24 PM
Ron1n Ron1n is offline
 
Join Date: Jun 2004
Posts: 373
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #8  
Old 07-04-2005, 11:33 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes - use add_phrase_type() in adminfunctions_language.php instead of your own function
Reply With Quote
  #9  
Old 07-05-2005, 12:11 AM
Ron1n Ron1n is offline
 
Join Date: Jun 2004
Posts: 373
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01: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.04120 seconds
  • Memory Usage 2,272KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (3)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete