To solve the prefix problem...
Try this (I am not where I can test the script... but it should work without any problems)
All it does is add $tableprefix before each table name in the From clause of each sql statement.
* edit - Like the true doofus I am... I did this and then read your post again... which clearly points out that you know all of this... but it should also point out where you were having problems
*
For example....
PHP Code:
$sql="SELECT bob FROM fred where 1=2";
to
PHP Code:
$sql="SELECT bob FROM " . $tableprefix . "fred where 1=2";
------------------------------------------
open last10.php
find
PHP Code:
// ooh a query!
$query = "SELECT thread.lastpost,thread.title,thread.lastposter,thread.replycount,thread.views,user.userid,thread.threadid,thread.forumid$fsel,thread.iconid FROM thread,user$ftitle $wheresql ORDER BY thread.$ob $obdir LIMIT $maxthreads";
and change to
PHP Code:
// ooh a query!
$query = "SELECT thread.lastpost,thread.title,thread.lastposter,thread.replycount,thread.views,user.userid,thread.threadid,thread.forumid$fsel,thread.iconid FROM " . $tableprefix . "thread,user$ftitle $wheresql ORDER BY thread.$ob $obdir LIMIT $maxthreads";
find
PHP Code:
$dtf = mysql_query("SELECT value FROM setting WHERE varname='dateformat' OR varname='timeformat' OR varname='timeoffset' ORDER BY varname");
and change to
PHP Code:
$dtf = mysql_query("SELECT value FROM " . $tableprefix . "setting WHERE varname='dateformat' OR varname='timeformat' OR varname='timeoffset' ORDER BY varname");
find
PHP Code:
$query0 = "SELECT pagetext,postid,dateline,iconid FROM post WHERE threadid='$threads[threadid]' ORDER BY dateline DESC LIMIT 1";
and change to
PHP Code:
$query0 = "SELECT pagetext,postid,dateline,iconid FROM " . $tableprefix . "post WHERE threadid='$threads[threadid]' ORDER BY dateline DESC LIMIT 1";
find
PHP Code:
$smilies = mysql_query("SELECT smilietext,smiliepath FROM smilie");
change to
PHP Code:
$smilies = mysql_query("SELECT smilietext,smiliepath " . $tableprefix . "FROM smilie");
In theory... that should sort it out.
toodles