Thread: End-User Options - Secret Admirer / Crush System
View Single Post
  #83  
Old 01-25-2005, 05:00 AM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01098 seconds
  • Memory Usage 1,782KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete