Quote:
Originally Posted by carolmyt
Well, mine installed just fine, with just one strange problem: the first time you click to send admiration, you get the duplicate phrase. I've double checked the code, and its all correct. Any ideas why this is happening?
You know, I think I may know what the problem is: I missed "NOTE: You must replace TABLE_PREFIX with the prefix that you use on your VB3
installation... OR remove it if you are not using a table_prefix." So . . . can somebody explain that to me? I'm new to the SQL queries. How do I know if I'm using a table prefix, and if I am, what it is?
|
Good good, just got the email notification and thought... nope... not installed correctly.
The hack cunningly uses MySql trickery to detect duplicates... the trickery is that when two identical rows get inserted it causes an error. I detect the error and that's how I know that an admiration already exists.
However, it means I am basically masking MySql errors.
Anyhow... table prefix.
In your /includes/config.php file there is a bit that looks like this:
Code:
// Prefix that your vBulletin tables have in the database.
// For example: $tableprefix = 'vb3_';
$tableprefix = 'vb3_';
Now, in my instructions I ask you to do this:
Code:
DATABASE WORK
In phpMyAdmin or from the MySql command line, run the applicable piece of SQL.
NOTE: You must replace TABLE_PREFIX with the prefix that you use on your VB3
installation... OR remove it if you are not using a table_prefix.
FOR A FRESH INSTALL:
CREATE TABLE TABLE_PREFIXsecretadmirer (
userid INT(10) NOT NULL,
admiresuserid INT(10) NOT NULL,
datecreated INT(10) NOT NULL,
PRIMARY KEY (userid, admiresuserid),
KEY admiresuserid_ix (admiresuserid),
KEY userid_ix (userid)
) TYPE = MYISAM;
FOR AN UPGRADE FROM A VB2 VERSION:
RENAME TABLE secret_admirer TO TABLE_PREFIXsecretadmirer;
Because you are a new install you are doing the CREATE TABLE bit.
Now, in that CREATE TABLE bit the first line says:
Code:
CREATE TABLE TABLE_PREFIXsecretadmirer (
If your $tableprefix in your config.php file was blank (''), then that should be:
Code:
CREATE TABLE secretadmirer (
If your $tableprefix in your config.php file contained vb3_ ('vb3_'), then that should be:
Code:
CREATE TABLE vb3_secretadmirer (
So whatever your table prefix is... adjust the name of the database table to be created accordingly.
You only need to do this once, in that piece of SQL. The script can work it out when running, but because I didn't build an installer, I couldn't work out whether you have a table prefix.
Oh, and you will also want to run this which will delete the table that you made by accident:
Code:
DROP TABLE TABLE_PREFIXsecretadmirer;
Hope that all makes sense to you