
11-13-2004, 04:29 AM
|
 |
|
|
Join Date: Jan 2003
Location: WagnerTech.net
Posts: 266
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
Quote:
Originally Posted by Harley D
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.
|
Can someone make a txt file for a manual install???
Please
|