View Single Post
  #189  
Old 11-12-2004, 05:16 AM
Harley D's Avatar
Harley D Harley D is offline
 
Join Date: Jan 2003
Location: WagnerTech.net
Posts: 266
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I figured out why I can't see anything in the ADMINCP. Its due to a failed install.
So I'm having to manually install phrases, and MYSQL Queries.
Now I've managed to install the phrases, but am really lost when it comes to the Queries!
Would someone please be so kind as to take this text and make the queries in it a cut and paste for MYSQL?

PHP Code:
 if ($_REQUEST['step'] == 6)
{
    require_once(
'./includes/adminfunctions_language.php');
    require_once(
'./includes/adminfunctions_options.php');

    
print_install_table_header($steps[6]);

    
$DB_site->reporterror 0;
    
$DB_site->query("ALTER TABLE " TABLE_PREFIX "language DROP phrasegroup_shoutbox, DROP phrasegroup_shoutmanager");
    
$DB_site->reporterror 1;

    
$DB_site->query("DELETE FROM " TABLE_PREFIX "phrasetype WHERE fieldname = 'shoutbox' OR fieldname = 'shoutmanager'");
    
$DB_site->query("DELETE FROM " TABLE_PREFIX "settinggroup WHERE grouptitle = 'shoutbox'");
    
$DB_site->query("DELETE FROM " TABLE_PREFIX "phrase WHERE varname = 'settinggroup_shoutbox'");

    foreach (
$phrases AS $phrasetype => $phrasebit)
    {
        foreach (
$phrasebit AS $varname => $text)
        {
            if (!empty(
$phraselist))
            {
                
$phraselist .= ',';
            }
            
$phraselist .= "'$varname'";
        }
    }
    
$DB_site->query("DELETE FROM " TABLE_PREFIX "phrase WHERE varname IN ($phraselist)");

    foreach (
$settinggroups AS $settinggroup => $settings)
    {
        foreach (
$settings AS $varname => $vars)
        {
            if (!empty(
$settinglist))
            {
                
$settinglist .= ',';
            }
            
$settinglist .= "'$varname'";
        }
    }
    
$DB_site->query("DELETE FROM " TABLE_PREFIX "setting WHERE varname IN ($settinglist)");

    foreach (
$phrases AS $phrasetype => $blabla)
    {
        if (!empty(
$fieldname))
        {
            
$fieldname .= ", ";
        }
        
$fieldname .= "'$phrasetype'";
    }

    
$phrasetypeidQuery $DB_site->query("SELECT fieldname, phrasetypeid FROM " TABLE_PREFIX "phrasetype WHERE fieldname IN ($fieldname)");
    while (
$fetchedPhrasetypeID $DB_site->fetch_array($phrasetypeidQuery))
    {
        
$phrasetypeids[$fetchedPhrasetypeID['fieldname']] = $fetchedPhrasetypeID['phrasetypeid'];
    }

    
print_install_description_row("Importing Shoutbox Phrase Types...");
    
$phrasetypeids['shoutbox'] = add_phrase_type('shoutbox''Shoutbox');
    
$phrasetypeids['shoutmanager'] = add_phrase_type('shoutmanager''Shout Manager');
    
print_install_description_row('Done');

    
$ordercheck $DB_site->query_first("
        SELECT displayorder
        FROM " 
TABLE_PREFIX "settinggroup
        ORDER BY displayorder DESC
    "
);

    
$displayorder $ordercheck['displayorder'] + 10;

    
print_install_description_row("Importing Shoutbox Setting Groups...");
    
$DB_site->query("INSERT INTO " TABLE_PREFIX "settinggroup (grouptitle, displayorder) VALUES ('shoutbox', $displayorder)");
    
$DB_site->query("INSERT INTO " TABLE_PREFIX "phrase (languageid, phrasetypeid, varname, text) VALUES (-1, " PHRASETYPEID_SETTING ", 'settinggroup_shoutbox', 'Shoutbox')");
    
print_install_description_row('Done');

    foreach (
$phrasetypeids as $name => $phrasetypeid)
    {
        
$phrasetypes[$phrasetypeid] = $name;
    }
    unset(
$phrasetypeids$name$phrasetypeid);

    
print_install_description_row("Importing Shoutbox Phrases...");
    foreach (
$phrasetypes as $phrasetypeid => $name)
    {
        foreach (
$phrases[$name] as $varname => $text)
        {
            if (!empty(
$phrasequery))
            {
                
$phrasequery .= ', ';
            }
            
$phrasequery .= "('$varname', '$text', $phrasetypeid)";
        }
    }
    if (!empty(
$phrasequery))
    {
        
$phrasequery "INSERT INTO " TABLE_PREFIX "phrase (varname, text, phrasetypeid) VALUES " $phrasequery;

        
$DB_site->query($phrasequery);
    }
    
print_install_description_row('Done');

    
print_install_description_row("Importing Shoutbox Settings...");
    foreach (
$settinggroups as $grouptitle => $settings)
    {
        foreach (
$settings as $varname => $vars)
        {
            if (!empty(
$settingquery))
            {
                
$settingquery .= ', ';
            }
            
$settingquery .= "('$varname', '$grouptitle', '$vars[value]', '$vars[defaultvalue]', '" addslashes($vars['optioncode']) . "', '$vars[displayorder]', 0, 0)";
        }
    }
    if (!empty(
$settingquery))
    {
        
$settingquery "INSERT INTO " TABLE_PREFIX "setting (varname, grouptitle, value, defaultvalue, optioncode, displayorder, advanced, volatile) VALUES " $settingquery;

        
$DB_site->query($settingquery);
    }
    
print_install_description_row('Done');

    
// build languages
    
$class fetch_row_bgclass();
    echo(
"<tr valign=\"top\">\n\t<td class=\"$class\" align=\"center\">\n");

    
$languages fetch_languages_array();
    echo(
"<ul>\n");
    foreach(
$languages as $languageid => $language)
    {
        echo(
"<li>Building Language: $language[title]</li>\n");
        
build_language($languageid);
        
flush();
    }
    echo(
"</ul>\n");
    echo(
"<p><strong>Language imported sucessfully!</strong></p>\n");

    echo(
"</td>\n</tr>\n");

    
// build settings
    
print_install_description_row('Building settings...');
    
build_options();
    
print_install_description_row('Done');

    
print_install_submit_row('Continue');

Thanks in advance.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01335 seconds
  • Memory Usage 1,872KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete