You are here:  » Setup.php + makeindex and topsearches

Support Forum



Setup.php + makeindex and topsearches

Submitted by atman on Fri, 2009-04-03 20:37 in

hi david,

whenever i setup a new site. i make 3 database setup.

1. the primary setup.php
2. the makeindex mod
3. topsearches mod

Is it possible to integrate the 2 mods (makeindex and topsearches) and bundle it into the setup.php and run on one go?

I still have the default setup.php.

makeindex
-------------------------------------

<?php
  set_time_limit(0);
  ignore_user_abort();
  require("includes/common.php");
  $sql =
  "CREATE FULLTEXT INDEX namedescription ON ".$config_databaseTablePrefix."products (name,description)";
  database_queryModify($sql,$result);
  print "Done.";
?>

topsearches
----------------------------------

<?php
  require("includes/common.php");
  $sql =
"
CREATE TABLE `querylog` (
`id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`count` INT ( 11 ) NOT NULL ,
`query` VARCHAR( 255 ) NOT NULL ,
UNIQUE (
`query`
)
) ENGINE = MYISAM ;
";
  database_queryModify($sql,$rows);
  print "<p>".mysql_error()."</p>";
  print "<p>Done.</p>";
?>

thanks!

Submitted by support on Sat, 2009-04-04 08:29

Hi Alex,

Sure - i'll email you a modified version of setup.sql with the above modifications included.

Cheers,
David.