PDA

View Full Version : Write This To Run.. MySQL


Osterling
12-22-2004, 02:36 AM
alright i have this mysql:

setting_add('v3 Articles Introduction', 'This introduction text will appear at the top of the main v3 Articles page. Use it to describe the purpose of the Articles section.', 'articleintroduction', '', '', 'textarea', '1');
setting_add('Comments Per Page', 'The number of comments to display on each page.', 'commentsperpage', '10', '10', '', '20');
setting_add('Comment Character Limit', 'The maximum character length of a user\'s comment.', 'commentlimit', '500', '500', '', '30');
setting_add('Articles Per Page', 'The number of articles to display on each page.', 'articlesperpage', '10', '10', '', '40');
setting_add('Article Attachment Limit', 'The maximum number of files which can be attached to an article.', 'maxarticleattachments', '10', '10', '', '50');
setting_add('Thumbnails Per Row', 'The number of "thumbnails", or media items to display per row.', 'artthumbsperrow', '4', '4', '', '60');
setting_add('Featured Article Preview Length', 'The number of characters to display before the preview text is truncated.', 'featuredlength', '550', '550', '', '70');

but when i run it it says..

#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'setting_add('v3 Articles Introduction', 'This introduction text

I am trying to run it so it goes into the Setting table.. any help would be apperciated.

Zachery
12-22-2004, 03:06 AM
setting_add(); is a function, its not raw sql, you need to just run the script it came with.

Osterling
12-22-2004, 03:14 AM
the script it came with doesn't seem to have ran it.. so i wanted to just run the query myself..

Dean C
12-22-2004, 07:46 AM
I've closed your other thread, please do not double-post. Thanks :)

Osterling
12-22-2004, 04:26 PM
Sorry bout that..

Is there anyone who can help me with this problem though.

Osterling
12-23-2004, 07:46 PM
Can anyone tell me how to ether run a queery to set this up, or how to add it through vbulletin if that makes sense

Osterling
12-24-2004, 04:13 AM
can someone please help me :(

Brad
12-24-2004, 05:21 AM
What you posted is not SQL, it is a collection of functions that will build SQL and excute it. Without knowing what these functions are doing no one will be able to help you.

Where did you get this code from (the vB articles hack?).

Osterling
12-24-2004, 05:59 AM
What you posted is not SQL, it is a collection of functions that will build SQL and excute it. Without knowing what these functions are doing no one will be able to help you.

Where did you get this code from (the vB articles hack?).

Yes.. but for some reason this did not install it fully.. since those are the things that would show up on the vboption > v3 article page, but it doesn't. So what I need to do is figure out a way to set it up... So I am so confused, and no one seems to be able to help me on figuring out why that didn't install it for me..

help please

Osterling
12-24-2004, 04:12 PM
Here is the full install part

// Add v3 Article settings
if ($_REQUEST['caction'] == 2)
{

$DB_site->query("INSERT INTO " . TABLE_PREFIX . "settinggroup (grouptitle, displayorder, volatile) VALUES ('v3_articles', '2000', '0')");
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "phrase (phraseid, languageid, varname, text, phrasetypeid) VALUES (NULL, '0', 'settinggroup_v3_articles', 'v3 Articles', '5000')");

setting_add('v3 Articles Introduction', 'This introduction text will appear at the top of the main v3 Articles page. Use it to describe the purpose of the Articles section.', 'articleintroduction', '', '', 'textarea', '1');
setting_add('Comments Per Page', 'The number of comments to display on each page.', 'commentsperpage', '10', '10', '', '20');
setting_add('Comment Character Limit', 'The maximum character length of a user\'s comment.', 'commentlimit', '500', '500', '', '30');
setting_add('Articles Per Page', 'The number of articles to display on each page.', 'articlesperpage', '10', '10', '', '40');
setting_add('Article Attachment Limit', 'The maximum number of files which can be attached to an article.', 'maxarticleattachments', '10', '10', '', '50');
setting_add('Thumbnails Per Row', 'The number of "thumbnails", or media items to display per row.', 'artthumbsperrow', '4', '4', '', '60');
setting_add('Featured Article Preview Length', 'The number of characters to display before the preview text is truncated.', 'featuredlength', '550', '550', '', '70');

Can anyone either put this into a query so I can run it, or tell me how to add these settings through admincp.. please

Osterling
12-25-2004, 05:06 PM
can anyone help me please

Zachery
12-25-2004, 05:11 PM
Here is the full install part

// Add v3 Article settings
if ($_REQUEST['caction'] == 2)
{

$DB_site->query("INSERT INTO " . TABLE_PREFIX . "settinggroup (grouptitle, displayorder, volatile) VALUES ('v3_articles', '2000', '0')");
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "phrase (phraseid, languageid, varname, text, phrasetypeid) VALUES (NULL, '0', 'settinggroup_v3_articles', 'v3 Articles', '5000')");

setting_add('v3 Articles Introduction', 'This introduction text will appear at the top of the main v3 Articles page. Use it to describe the purpose of the Articles section.', 'articleintroduction', '', '', 'textarea', '1');
setting_add('Comments Per Page', 'The number of comments to display on each page.', 'commentsperpage', '10', '10', '', '20');
setting_add('Comment Character Limit', 'The maximum character length of a user\'s comment.', 'commentlimit', '500', '500', '', '30');
setting_add('Articles Per Page', 'The number of articles to display on each page.', 'articlesperpage', '10', '10', '', '40');
setting_add('Article Attachment Limit', 'The maximum number of files which can be attached to an article.', 'maxarticleattachments', '10', '10', '', '50');
setting_add('Thumbnails Per Row', 'The number of "thumbnails", or media items to display per row.', 'artthumbsperrow', '4', '4', '', '60');
setting_add('Featured Article Preview Length', 'The number of characters to display before the preview text is truncated.', 'featuredlength', '550', '550', '', '70');

Can anyone either put this into a query so I can run it, or tell me how to add these settings through admincp.. please
We need the function setting_add

Osterling
12-25-2004, 05:17 PM
Here is the install file.. i just took out the template html to make it not as long.. i hope what you are looking for is in this...

<?php

// Set the PHP enviroment
error_reporting(E_ALL & ~E_NOTICE);

// File includes
require_once('./global.php');
require_once('./includes/adminfunctions_template.php');
require_once('./includes/adminfunctions_language.php');

print_cp_header('v3 Articles Installation Script', '', '');

$phase = $_REQUEST['phase'];
if (empty($phase))
{
$phase = '0';
}

// ########################
// INSTALLATION FUNCTIONS #
// ########################

// template_insert
function template_insert($name, $content)
{
global $DB_site;
$template = compile_template($content);
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "template (templateid, title, template, template_un, styleid, templatetype, dateline, username, version) VALUES (NULL, '$name', '" . addslashes($template) . "', '" . addslashes($content) ."', '-1', 'template', '" . time() . "', 'Tigga', '3.0.0 Gamma')");
}

// template_delete
function template_delete($title)
{
global $DB_site;
$DB_site->query("DELETE FROM " . TABLE_PREFIX . "template WHERE title = '$title'");
}

// template_rebuild
// For future upgrade scripts, might as well have it here!
function template_rebuild($name, $content)
{
global $DB_site;
$template = compile_template($content);
$DB_site->query("UPDATE " . TABLE_PREFIX . "template SET title = '$name', template = '" . addslashes($template) ."', template_un = '" . addslashes($content) . "' WHERE title = '$name'");
}

// setting_add
function setting_add($title, $description, $varname, $value, $defaultvalue, $optioncode, $displayorder)
{
global $DB_site;
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "phrase (phraseid, languageid, varname, text, phrasetypeid) VALUES (NULL, '0', 'setting_" . $varname . "_title', '" . addslashes($title) ."', '5000')");
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "phrase (phraseid, languageid, varname, text, phrasetypeid) VALUES (NULL, '0', 'setting_" . $varname . "_desc', '" . addslashes($description) ."', '5000')");
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "setting (varname, grouptitle, value, defaultvalue, optioncode, displayorder, advanced, volatile) VALUES ('$varname', 'v3_articles', '$value', '$defaultvalue', '$optioncode', '$displayorder', '0', '0')");
}

// setting_rebuild
function setting_rebuild($varname, $title = '', $description = '', $value = '')
{
global $DB_site;
if ($title)
{
$DB_site->query("UPDATE " . TABLE_PREFIX . "phrase SET text = '$title' WHERE varname = 'setting_" . $varname . "_title'");
}
if ($description)
{
$DB_site->query("UPDATE " . TABLE_PREFIX . "phrase SET text = '$description' WHERE varname = 'setting_" . $varname . "_desc'");
}
}
//setting_delete
function setting_delete($title)
{
global $DB_site;
$DB_site->query("DELETE FROM " . TABLE_PREFIX . "phrase WHERE varname = 'setting_" . $title . "_title'");
$DB_site->query("DELETE FROM " . TABLE_PREFIX . "phrase WHERE varname = 'setting_" . $title . "_desc'");
$DB_site->query("DELETE FROM " . TABLE_PREFIX . "setting WHERE varname = '$title'");
}

// phrase_insert
function phrase_insert($varname, $text, $groupid=692)
{
global $DB_site;
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "phrase (phraseid, languageid, varname, text, phrasetypeid) VALUES (NULL, '0', '" . $varname . "', '" . addslashes($text) ."', $groupid)");
}

// phrase_rebuild
function phrase_rebuild($varname, $text)
{
global $DB_site;
$DB_site->query("UPDATE " . TABLE_PREFIX . "phrase SET text = '" . addslashes($text) ."' WHERE varname = '" . $varname . "'");
}

// phrase_rebuild
function phrase_delete($varname)
{
global $DB_site;
$DB_site->query("DELETE FROM " . TABLE_PREFIX . "phrase WHERE varname = '" . $varname . "'");
}


// ##################################################
// INSTALLATION START
// ##################################################
if (empty($_REQUEST['do']))
{
print_form_header('install', 'start');
print_table_header('Welcome to v3 Articles');

print_description_row("
Welcome to the <b>v3 Articles</b> installation script.
<p>
Please follow the instructions carefully for a trouble-free installation. This installation script comprises of the following steps:
<p>
1. The v3 Articles setting group is added to the Admin CP, along with settings. <br />
2. Phrases are automatically added to the vBulletin phrase table. <br />
3. New templates are automatically inserted into the database.
<p>
Don't forget to make the required file modifications and template changes, as listed in Instructions.txt.
");

print_table_break();
print_table_header('Installation Options');
print_radio_row('v3 Articles Installation <dfn>Install the v3 Articles system on a standard vBulletin 3 forum.</dfn>', 'iaction', array('1' => 'Full v3 Articles Installation'), '1');
print_radio_row('Upgrade v3 Articles (1.0.0 to 1.0.1) <dfn>Select this option to upgrade your v3 Articles installation.</dfn>', 'iaction', array('4' => 'Upgrade v3 Articles'));
print_radio_row('Install Templates Only <dfn>Adds the v3 Articles templates to the database.</dfn>', 'iaction', array('2' => 'Templates Only'));
print_radio_row('Uninstall v3 Articles <dfn>Reverses the changes made to the database during installation.</dfn>', 'iaction', array('3' => 'Uninstall v3 Articles'));
print_submit_row('Proceed', '');

}
else
{
if ($_REQUEST['iaction'] == 1)
{

$DB_site->query("
CREATE TABLE `" . TABLE_PREFIX . "article` (
`articleid` int(10) unsigned NOT NULL auto_increment,
`title` varchar(250) NOT NULL default '',
`firstpostid` int(10) unsigned NOT NULL default '0',
`lastcommentid` int(10) unsigned default NULL,
`lastcommentdateline` int(10) unsigned NOT NULL default '0',
`lastcommentposter` varchar(50) default NULL,
`lastcommentposterid` int(10) unsigned default NULL,
`categoryid` int(10) unsigned NOT NULL default '0',
`open` smallint(2) NOT NULL default '0',
`commentcount` int(10) unsigned NOT NULL default '0',
`articleusername` varchar(50) NOT NULL default '',
`articleuserid` int(4) unsigned NOT NULL default '0',
`dateline` int(10) unsigned NOT NULL default '0',
`views` int(10) unsigned NOT NULL default '0',
`iconid` int(10) unsigned NOT NULL default '0',
`votenum` smallint(5) unsigned NOT NULL default '0',
`votetotal` smallint(5) unsigned NOT NULL default '0',
`articlehash` varchar(32) NOT NULL default '',
PRIMARY KEY (`articleid`)
) TYPE=MyISAM
");
$DB_site->query("
CREATE TABLE `" . TABLE_PREFIX . "articleattachment` (
`attachmentid` int(10) unsigned NOT NULL auto_increment,
`userid` int(10) unsigned NOT NULL default '0',
`dateline` int(10) unsigned NOT NULL default '0',
`thumbnail_dateline` int(10) unsigned NOT NULL default '0',
`filename` varchar(100) NOT NULL default '',
`filedata` mediumtext NOT NULL,
`visible` smallint(5) unsigned NOT NULL default '0',
`counter` smallint(5) unsigned NOT NULL default '0',
`filesize` int(10) unsigned NOT NULL default '0',
`articleid` int(10) unsigned NOT NULL default '0',
`filehash` varchar(32) NOT NULL default '',
`thumbnail` mediumtext NOT NULL,
`posthash` varchar(32) default NULL,
`caption` varchar(250) default NULL,
PRIMARY KEY (`attachmentid`),
KEY `filesize` (`filesize`),
KEY `filehash` (`filehash`),
KEY `userid` (`userid`),
KEY `articleid` (`articleid`)
) TYPE=MyISAM
");
$DB_site->query("
CREATE TABLE `" . TABLE_PREFIX . "articlecategory` (
`categoryid` smallint(5) unsigned NOT NULL auto_increment,
`styleid` smallint(5) unsigned NOT NULL default '0',
`title` varchar(100) NOT NULL default '',
`description` varchar(250) NOT NULL default '',
`extdescription` mediumtext,
`options` int(10) unsigned NOT NULL default '0',
`displayorder` smallint(6) NOT NULL default '0',
`lastpost` int(11) NOT NULL default '0',
`lastcommentin` int(11) NOT NULL default '0',
`lastposter` varchar(50) NOT NULL default '',
`lastpostin` varchar(250) NOT NULL default '',
`lastarticle` varchar(250) NOT NULL default '',
`lastarticleid` int(10) unsigned NOT NULL default '0',
`lastauthor` varchar(50) NOT NULL default '',
`lasticonid` smallint(6) NOT NULL default '0',
`articlecount` mediumint(8) unsigned NOT NULL default '0',
`newcommentemail` varchar(250) NOT NULL default '',
`newarticleemail` varchar(250) NOT NULL default '',
`parentid` smallint(6) NOT NULL default '0',
`parentlist` varchar(250) NOT NULL default '',
`childlist` varchar(250) NOT NULL default '',
PRIMARY KEY (`categoryid`)
) TYPE=MyISAM
");
$DB_site->query("
CREATE TABLE `" . TABLE_PREFIX . "articlepost` (
`postid` int(10) unsigned NOT NULL auto_increment,
`posticonid` int(10) unsigned NOT NULL default '0',
`articleid` int(10) unsigned NOT NULL default '0',
`posttitle` varchar(250) default NULL,
`postbody` longtext NOT NULL,
`postdateline` int(10) unsigned NOT NULL default '0',
`postusername` varchar(250) NOT NULL default '',
`postuserid` int(10) unsigned NOT NULL default '0',
`type` tinyint(1) unsigned NOT NULL default '1',
`posthash` varchar(32) NOT NULL default '',
`valid` tinyint(1) unsigned NOT NULL default '1',
PRIMARY KEY (`postid`)
) TYPE=MyISAM
");
$DB_site->query("
CREATE TABLE `" . TABLE_PREFIX . "articlerating` (
`ratingid` int(10) unsigned NOT NULL auto_increment,
`articleid` int(10) unsigned NOT NULL default '0',
`userid` int(10) unsigned NOT NULL default '0',
`rating` tinyint(1) unsigned NOT NULL default '0',
PRIMARY KEY (`ratingid`)
) TYPE=MyISAM
");
$DB_site->query("
ALTER TABLE `" . TABLE_PREFIX . "usergroup`
ADD COLUMN `articlepermissions` int(10) unsigned NOT NULL DEFAULT 0
");
$DB_site->query("UPDATE " . TABLE_PREFIX . "usergroup SET articlepermissions=2051 WHERE usergroupid=1");
$DB_site->query("UPDATE " . TABLE_PREFIX . "usergroup SET articlepermissions=3103 WHERE usergroupid=2");
$DB_site->query("UPDATE " . TABLE_PREFIX . "usergroup SET articlepermissions=3075 WHERE usergroupid=3");
$DB_site->query("UPDATE " . TABLE_PREFIX . "usergroup SET articlepermissions=4095 WHERE usergroupid IN (5,6,7)");

$DB_site->query("INSERT INTO `" . TABLE_PREFIX . "articlecategory` (`categoryid`, `styleid`, `title`, `description`, `extdescription`, `options`, `displayorder`, `lastpost`, `lastposter`, `lastpostin`, `lastarticle`, `lastarticleid`, `lastauthor`, `lasticonid`, `articlecount`, `newcommentemail`, `newarticleemail`, `parentid`, `parentlist`, `childlist`) VALUES (1,0,'Main Category','Main Category Description','',7875,1,0,'','','',0,'',0,0,'','',-1,'1,-1','1,2,-1')");
$DB_site->query("INSERT INTO `" . TABLE_PREFIX . "articlecategory` (`categoryid`, `styleid`, `title`, `description`, `extdescription`, `options`, `displayorder`, `lastpost`, `lastposter`, `lastpostin`, `lastarticle`, `lastarticleid`, `lastauthor`, `lasticonid`, `articlecount`, `newcommentemail`, `newarticleemail`, `parentid`, `parentlist`, `childlist`) VALUES (2,0,'Main Sub-Category','Main Sub-Category Description','Extended Main Sub-Category Description',7879,1,0,'','','',0,'',0,0,'','',1,'2 ,1,-1','2,-1')");

print_form_header('install', 'start');
print_table_header('v3 Article Installation - Step 1');
construct_hidden_code('caction', '2');
print_description_row("Database modifications complete.");
print_submit_row('Proceed to Step 2', '');
}

// Add v3 Article settings
if ($_REQUEST['caction'] == 2)
{

$DB_site->query("INSERT INTO " . TABLE_PREFIX . "settinggroup (grouptitle, displayorder, volatile) VALUES ('v3_articles', '2000', '0')");
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "phrase (phraseid, languageid, varname, text, phrasetypeid) VALUES (NULL, '0', 'settinggroup_v3_articles', 'v3 Articles', '5000')");

setting_add('v3 Articles Introduction', 'This introduction text will appear at the top of the main v3 Articles page. Use it to describe the purpose of the Articles section.', 'articleintroduction', '', '', 'textarea', '1');
setting_add('Comments Per Page', 'The number of comments to display on each page.', 'commentsperpage', '10', '10', '', '20');
setting_add('Comment Character Limit', 'The maximum character length of a user\'s comment.', 'commentlimit', '500', '500', '', '30');
setting_add('Articles Per Page', 'The number of articles to display on each page.', 'articlesperpage', '10', '10', '', '40');
setting_add('Article Attachment Limit', 'The maximum number of files which can be attached to an article.', 'maxarticleattachments', '10', '10', '', '50');
setting_add('Thumbnails Per Row', 'The number of "thumbnails", or media items to display per row.', 'artthumbsperrow', '4', '4', '', '60');
setting_add('Featured Article Preview Length', 'The number of characters to display before the preview text is truncated.', 'featuredlength', '550', '550', '', '70');

print_form_header('install', 'start');
print_table_header('v3 Article Installation - Step 2');
construct_hidden_code('caction', '3');
print_description_row("Setting additions complete.");
print_submit_row('Proceed to Step 3', '');

}

if ($_REQUEST['caction'] == 3)
{

phrase_insert('dupecomment', 'You have already submitted the same comment to this article once before.', 1000);
phrase_insert('comment_deleted', 'Comment deleted.', 2000);
phrase_insert('comment_edited', 'Comment edited.', 2000);
phrase_insert('article_deleted', 'Article deleted.', 2000);
phrase_insert('article_edited', 'Article edited.', 2000);
phrase_insert('featured', 'This article has now been featured.', 2000);
phrase_insert('comment_too_long', 'Sorry, your comment is too long. Comments must be shorter than $vboptions[commentlimit] characters long.', 1000);
build_language(-1);


print_form_header('install', 'start');
print_table_header('v3 Article Installation - Step 3');
construct_hidden_code('caction', '4');
print_description_row("Phrase additions complete.");
print_submit_row('Proceed to Step 4', '');

}
if ($_REQUEST['caction'] == 4)
{

template_insert('ARTICLES', "$articles");
template_insert('article_rating', "$article_rating");
template_insert('article_new_attachment', "$article_new_attachment");
template_insert('article_new', "$article_new");
template_insert('article_level2_post', "$article_level2_post");
template_insert('article_level2_nopost', "$article_level2_nopost");
template_insert('article_level1_post', "$article_level1_post");
template_insert('article_level1_nopost', "$article_level1_nopost");
template_insert('article_lastcommentby', "$article_lastcommentby");
template_insert('article_lastarticleby', "$article_lastarticleby");
template_insert('article_featured', "$article_featured");
template_insert('article_edit_comment', "$article_edit_comment");
template_insert('article_edit', "$article_edit");
template_insert('article_display_thumbrow', "$article_display_thumbrow");
template_insert('article_display_thumb', "$article_display_thumb");
template_insert('article_display_file', "$article_display_file");
template_insert('article_display', "$article_display");
template_insert('article_commentbit', "$article_commentbit");
template_insert('article_categorylist', "$article_categorylist");
template_insert('article_attachment_newbit', "$article_attachment_newbit");
template_insert('article_attachment_new', "$article_attachment_new");
template_insert('article_attachment_bit', "$article_attachment_bit");
template_insert('article_articlelist_noresults', "$article_articlelist_noresults");
template_insert('article_articlelist', "$article_articlelist");
template_insert('article_articlebit_lastcommentby' , "$article_articlebit_lastcommentby");
template_insert('article_articlebit', "$article_articlebit");

build_all_styles(0, 0, "install.php?$session[sessionurl]do=start&caction=5");
}

if ($_REQUEST['caction'] == 5)
{
print_form_header('install', '');
print_table_header('v3 Article Installation Complete!');
print_description_row("
Congratulations, you've successfully installed the v3 Articles system for vBulletin 3.x.x.
<p>
Please remember to delete this file, in order to prevent changes being made to the installation in the future.
<p>
For v3 Articles support, updates and modifications, please visit the support forum <a href=\"http://www.v3arcade.com/play/forumdisplay.php?f=12\"><b>here</b></a>.
");
print_table_footer();
}

if ($_REQUEST['iaction'] == 2)
{

template_insert('ARTICLES', "$articles");
template_insert('article_rating', "$article_rating");
template_insert('article_new_attachment', "$article_new_attachment");
template_insert('article_new', "$article_new");
template_insert('article_level2_post', "$article_level2_post");
template_insert('article_level2_nopost', "$article_level2_nopost");
template_insert('article_level1_post', "$article_level1_post");
template_insert('article_level1_nopost', "$article_level1_nopost");
template_insert('article_lastcommentby', "$article_lastcommentby");
template_insert('article_lastarticleby', "$article_lastarticleby");
template_insert('article_featured', "$article_featured");
template_insert('article_edit_comment', "$article_edit_comment");
template_insert('article_edit', "$article_edit");
template_insert('article_display_thumbrow', "$article_display_thumbrow");
template_insert('article_display_thumb', "$article_display_thumb");
template_insert('article_display_file', "$article_display_file");
template_insert('article_display', "$article_display");
template_insert('article_commentbit', "$article_commentbit");
template_insert('article_categorylist', "$article_categorylist");
template_insert('article_attachment_newbit', "$article_attachment_newbit");
template_insert('article_attachment_new', "$article_attachment_new");
template_insert('article_attachment_bit', "$article_attachment_bit");
template_insert('article_articlelist_noresults', "$article_articlelist_noresults");
template_insert('article_articlelist', "$article_articlelist");
template_insert('article_articlebit_lastcommentby' , "$article_articlebit_lastcommentby");
template_insert('article_articlebit', "$article_articlebit");


build_all_styles(0, 0, "install.php?$session[sessionurl]do=start&caction=6");
}
if ($_REQUEST['caction'] == 6)
{
print_form_header('install', '');
print_table_header('v3 Article Template Installation Complete');
print_description_row("
All v3 Articles templates have been added to the database.
<p>
Please remember to delete this file, in order to prevent changes being made to the installation in the future.
<p>
For v3 Articles support, updates and modifications, please visit the support forum <a href=\"http://www.v3arcade.com/play/forumdisplay.php?f=12\"><b>here</b></a>.
");
print_table_footer();
}

if ($_REQUEST['iaction'] == 3)
{

template_delete('ARTICLES');
template_delete('article_rating');
template_delete('article_new_attachment');
template_delete('article_new');
template_delete('article_level2_post');
template_delete('article_level2_nopost');
template_delete('article_level1_post');
template_delete('article_level1_nopost');
template_delete('article_lastcommentby');
template_delete('article_lastarticleby');
template_delete('article_featured');
template_delete('article_edit_comment');
template_delete('article_edit');
template_delete('article_display_thumbrow');
template_delete('article_display_thumb');
template_delete('article_display_file');
template_delete('article_display');
template_delete('article_commentbit');
template_delete('article_categorylist');
template_delete('article_attachment_newbit');
template_delete('article_attachment_new');
template_delete('article_attachment_bit');
template_delete('article_articlelist_noresults');
template_delete('article_articlelist');
template_delete('article_articlebit_lastcommentby' );
template_delete('article_articlebit');

setting_delete('articleintroduction');
setting_delete('commentsperpage');
setting_delete('commentlimit');
setting_delete('articlesperpage');
setting_delete('maxarticleattachments');
setting_delete('artthumbsperrow');
setting_delete('featuredlength');

phrase_delete('dupecomment');
phrase_delete('comment_deleted');
phrase_delete('comment_edited');
phrase_delete('article_deleted');
phrase_delete('article_edited');
phrase_delete('featured');
phrase_delete('comment_too_long');
build_language(-1);


print_form_header('install', '');
print_table_header('v3 Articles Uninstalled');
print_description_row("
The database changes made to this vBulletin installation have been undone.
<p>
However, tables containing content and category information still remain. For security reasons, these tables must be deleted manually.
");
print_table_footer();
}

if ($_REQUEST['iaction'] == 4)
{
template_rebuild('article_articlebit', "$article_articlebit");
template_rebuild('article_level2_post', "$article_level2_post");
s
print_form_header('install', '');
print_table_header('v3 Articles Upgraded to 1.0.1');
print_description_row("
You've successfully upgraded your v3 Articles installation. Please make sure you overwrite all the files with the updated version in the Files directory of the zip.
<p>
Please delete this file.
");
print_table_footer();
}

}
print_cp_footer();
?>

Osterling
12-25-2004, 05:19 PM
Is this what you are looking for, I found it in the code above:

// setting_add
function setting_add($title, $description, $varname, $value, $defaultvalue, $optioncode, $displayorder)

Paul M
12-25-2004, 06:46 PM
Either ;

1. Run the install.php script again and choose the uninstall option - and then re-run it and choose full install

or

2. Run install.php with caction set to two (i.e. ....../admincp/install.php?caction=2) and then close the script, do not proceed to step 3.

Osterling
12-25-2004, 06:53 PM
i feel really stupid but where or how do i set the caction to 2.. i wanna do number 2 as i already have tried the uninstall and reinstall..

so how do i set the caction to 2?

Osterling
12-25-2004, 07:15 PM
When I run caction=2 it just takes me to the first step like it won't let me skip.. but it doesnt seem to be going and installing the setting_add so i don't know what to do..

Paul M
12-25-2004, 07:54 PM
Try this cut down script - I haven't tested it, but in theory it should re-install the settings.

Osterling
12-25-2004, 08:08 PM
thank you...

when i ran it, i clicked procced and it took me to a blank page.. i wasn't sure if it installed it or not so i opened phpmyadmin to see if anything was there in the setting table and nothing was there...

Paul M
12-25-2004, 08:26 PM
Okay;

these are the actual sql inserts - if these fail then your system is screwed beyond help.



INSERT INTO `setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('articleintroduction', 'v3_articles', '', '', 'textarea', 10, 0, 0);
INSERT INTO `setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('commentsperpage', 'v3_articles', '10', '10', '', 20, 0, 0);
INSERT INTO `setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('commentlimit', 'v3_articles', '500', '500', '', 30, 0, 0);
INSERT INTO `setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('articlesperpage', 'v3_articles', '10', '10', '', 40, 0, 0);
INSERT INTO `setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('maxarticleattachments', 'v3_articles', '10', '10', '', 50, 0, 0);
INSERT INTO `setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('artthumbsperrow', 'v3_articles', '4', '4', '', 60, 0, 0);
INSERT INTO `setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('featuredlength', 'v3_articles', '550', '550', '', 70, 0, 0);

Osterling
12-25-2004, 09:11 PM
Paul.. you have made my christmas.. thank you. It worked! :)