Hello guys
I got a problem with the ad manager mod. I Installed it manual, but I don't know how to do the DB, I'll try it by the packages admi, and all the pages of the forum turn white. Everything desapear.
I got de default theme, an the dir It's this http://argentronicap2p.ueuo.com/
help me please, I don't know what to do, or the way to create de DB tables
<?php
/*
Installing the ad mod for the first time
*/
db_query("
CREATE TABLE IF NOT EXISTS {$db_prefix}ads (
ADS_ID mediumint(8) unsigned NOT NULL auto_increment,
NAME tinytext NOT NULL,
CONTENT text NOT NULL,
BOARDS tinytext,
POSTS tinytext,
HITS mediumint(8) NOT NULL default '0',
TYPE smallint(4) NOT NULL default '0',
show_index smallint(4) NOT NULL default '0',
show_board smallint(4) NOT NULL default '0',
show_threadindex smallint(4) NOT NULL default '0',
show_lastpost smallint(4) NOT NULL default '0',
show_thread smallint(4) NOT NULL default '0',
show_bottom smallint(4) NOT NULL default '0',
show_welcome smallint(4) NOT NULL default '0',
show_topofpage smallint(4) NOT NULL default '0',
show_towerright smallint(4) NOT NULL default '0',
show_towerleft smallint(4) NOT NULL default '0',
show_betweencategories smallint(4) NOT NULL default '0',
show_underchildren smallint(4) NOT NULL default '0',
PRIMARY KEY (ADS_ID)
)", __FILE__, __LINE__);
db_query("
CREATE TABLE IF NOT EXISTS {$db_prefix}ads_settings (
variable tinytext NOT NULL,
value text NOT NULL,
PRIMARY KEY (variable(30))
)", __FILE__, __LINE__);
/*
If you've already had the mod installed this will just make sure that you have the most current version of the database
*/
$result = db_query("SHOW COLUMNS FROM {$db_prefix}ads LIKE 'show_lastpost'", __FILE__, __LINE__);
if (mysql_num_rows($result) == 0)
db_query("
ALTER IGNORE TABLE {$db_prefix}ads
ADD show_lastpost smallint(4) NOT NULL default '0' AFTER show_threadindex", __FILE__, __LINE__);
$result = db_query("SHOW COLUMNS FROM {$db_prefix}ads LIKE 'CATEGORY'", __FILE__, __LINE__);
if (mysql_num_rows($result) == 0)
db_query("
ALTER IGNORE TABLE {$db_prefix}ads
ADD CATEGORY tinytext AFTER POSTS", __FILE__, __LINE__);
$result = db_query("SHOW COLUMNS FROM {$db_prefix}ads LIKE 'show_underchildren'", __FILE__, __LINE__);
if (mysql_num_rows($result) == 0)
db_query("
ALTER IGNORE TABLE {$db_prefix}ads
ADD show_underchildren smallint(4) NOT NULL default '0'", __FILE__, __LINE__);
/*
Inserts into the settings table
*/
db_query("
INSERT IGNORE INTO {$db_prefix}settings
(variable, value)
VALUES ('ads_displayAdsAdmin', '0'),
('ads_updateReports', '0'),
('ads_quickDisable', '0'),
('ads_lookLikePosts', '1')", __FILE__, __LINE__);
?>
Thanks
I will leave this for Jerm to answer as he may know better.
You'll need to use phpmyadmin and add this to your smf table:
CREATE TABLE IF NOT EXISTS {$db_prefix}ads (
ADS_ID mediumint(8) unsigned NOT NULL auto_increment,
NAME tinytext NOT NULL,
CONTENT text NOT NULL,
BOARDS tinytext,
POSTS tinytext,
HITS mediumint(8) NOT NULL default '0',
TYPE smallint(4) NOT NULL default '0',
show_index smallint(4) NOT NULL default '0',
show_board smallint(4) NOT NULL default '0',
show_threadindex smallint(4) NOT NULL default '0',
show_lastpost smallint(4) NOT NULL default '0',
show_thread smallint(4) NOT NULL default '0',
show_bottom smallint(4) NOT NULL default '0',
show_welcome smallint(4) NOT NULL default '0',
show_topofpage smallint(4) NOT NULL default '0',
show_towerright smallint(4) NOT NULL default '0',
show_towerleft smallint(4) NOT NULL default '0',
show_betweencategories smallint(4) NOT NULL default '0',
show_underchildren smallint(4) NOT NULL default '0',
PRIMARY KEY (ADS_ID)
)
can you help us for each step, uploading the data in install.php to database?
Ive opened my phpmyadmin, then open my smf database, but i dont know what to do next. When i tried copying like you said from "Sql" (Run SQL query/queries on database), i got error message.
How do we add all of them into our db?
Quote<?php
/*
Installing the ad mod for the first time
*/
mysql_query("
CREATE TABLE IF NOT EXISTS {$db_prefix}ads (
ADS_ID mediumint(8) unsigned NOT NULL auto_increment,
NAME tinytext NOT NULL,
CONTENT text NOT NULL,
BOARDS tinytext,
POSTS tinytext,
HITS mediumint(8) NOT NULL default '0',
TYPE smallint(4) NOT NULL default '0',
show_index smallint(4) NOT NULL default '0',
show_board smallint(4) NOT NULL default '0',
show_threadindex smallint(4) NOT NULL default '0',
show_lastpost smallint(4) NOT NULL default '0',
show_thread smallint(4) NOT NULL default '0',
show_bottom smallint(4) NOT NULL default '0',
show_welcome smallint(4) NOT NULL default '0',
show_topofpage smallint(4) NOT NULL default '0',
show_towerright smallint(4) NOT NULL default '0',
show_towerleft smallint(4) NOT NULL default '0',
show_betweencategories smallint(4) NOT NULL default '0',
show_underchildren smallint(4) NOT NULL default '0',
PRIMARY KEY (ADS_ID)
)", __FILE__, __LINE__);
mysql_query("
CREATE TABLE IF NOT EXISTS {$db_prefix}ads_settings (
variable tinytext NOT NULL,
value text NOT NULL,
PRIMARY KEY (variable(30))
)", __FILE__, __LINE__);
/*
If you've already had the mod installed this will just make sure that you have the most current version of the database
*/
$result = mysql_query("SHOW COLUMNS FROM {$db_prefix}ads LIKE 'show_lastpost'", __FILE__, __LINE__);
if (mysql_num_rows($result) == 0)
mysql_query("
ALTER IGNORE TABLE {$db_prefix}ads
ADD show_lastpost smallint(4) NOT NULL default '0' AFTER show_threadindex", __FILE__, __LINE__);
$result = mysql_query("SHOW COLUMNS FROM {$db_prefix}ads LIKE 'CATEGORY'", __FILE__, __LINE__);
if (mysql_num_rows($result) == 0)
mysql_query("
ALTER IGNORE TABLE {$db_prefix}ads
ADD CATEGORY tinytext AFTER POSTS", __FILE__, __LINE__);
$result = mysql_query("SHOW COLUMNS FROM {$db_prefix}ads LIKE 'show_underchildren'", __FILE__, __LINE__);
if (mysql_num_rows($result) == 0)
mysql_query("
ALTER IGNORE TABLE {$db_prefix}ads
ADD show_underchildren smallint(4) NOT NULL default '0'", __FILE__, __LINE__);
/*
Inserts into the settings table
*/
mysql_query("
INSERT IGNORE INTO {$db_prefix}settings
(variable, value)
VALUES ('ads_displayAdsAdmin', '0'),
('ads_updateReports', '0'),
('ads_quickDisable', '0'),
('ads_lookLikePosts', '1')", __FILE__, __LINE__);
?>
Do you have problem with Package install procedure?
Yep, i installed at first, but since it didnt work well i uninstall it, after that i cant install anymore package (dunno what i did wrong) o_O Ive edited all theme files now all i have to do is to add those tables,etc into mysql, i just dont know how to do it ::)
So, basically im just clueless, anyone wanna give me a hand? pls? :-\ mammamia.. :'(
Ok.
From PhpMyAdmin you must execute these query, be careful to this php variable {$db_prefix} (present in all query), you must replace it with your SMF Table prefix (usually smf_):
CREATE TABLE IF NOT EXISTS {$db_prefix}ads (
ADS_ID mediumint(8) unsigned NOT NULL auto_increment,
NAME tinytext NOT NULL,
CONTENT text NOT NULL,
BOARDS tinytext,
POSTS tinytext,
HITS mediumint(8) NOT NULL default '0',
TYPE smallint(4) NOT NULL default '0',
show_index smallint(4) NOT NULL default '0',
show_board smallint(4) NOT NULL default '0',
show_threadindex smallint(4) NOT NULL default '0',
show_lastpost smallint(4) NOT NULL default '0',
show_thread smallint(4) NOT NULL default '0',
show_bottom smallint(4) NOT NULL default '0',
show_welcome smallint(4) NOT NULL default '0',
show_topofpage smallint(4) NOT NULL default '0',
show_towerright smallint(4) NOT NULL default '0',
show_towerleft smallint(4) NOT NULL default '0',
show_betweencategories smallint(4) NOT NULL default '0',
show_underchildren smallint(4) NOT NULL default '0',
PRIMARY KEY (ADS_ID)
CREATE TABLE IF NOT EXISTS {$db_prefix}ads_settings (
variable tinytext NOT NULL,
value text NOT NULL,
PRIMARY KEY (variable(30))
INSERT IGNORE INTO {$db_prefix}settings
(variable, value)
VALUES ('ads_displayAdsAdmin', '0'),
('ads_updateReports', '0'),
('ads_quickDisable', '0'),
('ads_lookLikePosts', '1')