vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   End-User Options - Secret Admirer / Crush System (https://vborg.vbsupport.ru/showthread.php?t=61632)

carolmyt 01-24-2005 10:09 PM

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?

buro9 01-25-2005 05:00 AM

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 :)

carolmyt 01-25-2005 10:45 PM

Perfectly clear, and now running perfectly! Many thanks!

docvader 01-25-2005 10:56 PM

Buro, I've looked in my phpadmin, and found a table called "TABLE_PREFIXsecretadmirer". Now, I have no table prefixes in my config file, so I'm not sure how this got created. And, the hack is working fine.

Suggestions???

buro9 02-02-2005 01:20 PM

Quote:

Originally Posted by docvader
Buro, I've looked in my phpadmin, and found a table called "TABLE_PREFIXsecretadmirer". Now, I have no table prefixes in my config file, so I'm not sure how this got created. And, the hack is working fine.

Suggestions???

See two posts above.

You must've run the SQL and then modified it to remove the TABLE_PREFIX bit and then ran it again. So just deleted the unused table :)

carolmyt 02-04-2005 02:54 PM

Would it be possible to make this feature accessible from the user's postbit? So if you wanted to register admiration, you wouldn't have to go to the profile.

Wifey 02-10-2005 02:49 AM

Okay here's my problem.

No longer have the blank page problem - for some reason when I FTPed the file it didn't come up with the entire code. Who knows.

Anyhow, the PM's aren't sending like they're supposed to and neither are the e-mails.

Any idea?

buro9 02-10-2005 06:53 AM

Quote:

Originally Posted by ashkarita
Okay here's my problem.

No longer have the blank page problem - for some reason when I FTPed the file it didn't come up with the entire code. Who knows.

Anyhow, the PM's aren't sending like they're supposed to and neither are the e-mails.

Any idea?

Check the install guide again and verify that you did everything.

Note these bits:
Code:

PHRASE WORK:

Under the phrase type: Front-End Redirect Messages

Add these phrases:

secretadmirer_acknowledged
  Your admiration for that user has been successfully registered.

secretadmirer_duplicate
  You've already registered your admiration for that user.<br/> Maybe it's time to PM them and let them know you like them?

secretadmirer_report_sent
  Your secret admirer report has been dispatched to your registered e-mail address.

secretadmirer_limit
  Sorry! You may only admire a maximum of 5 people within the last month.


buro9 02-10-2005 06:54 AM

Quote:

Originally Posted by ashkarita
Okay here's my problem.

No longer have the blank page problem - for some reason when I FTPed the file it didn't come up with the entire code. Who knows.

Anyhow, the PM's aren't sending like they're supposed to and neither are the e-mails.

Any idea?

Ooops. I replied above to the other problem ;)

Check that you created the templates:
Code:

TEMPLATE WORK

For each of the text files, you need to add it as a template of the same name.
Change the values within them to match your forum and personal preference :)
There are five in total:

  secret_admirer_alert_email
  secret_admirer_alert_pm
  secret_admirer_match_email
  secret_admirer_match_pm
  secret_admirer_report_email

The text files are in the install Zip file.

buro9 02-10-2005 06:55 AM

Quote:

Originally Posted by carolmyt
Would it be possible to make this feature accessible from the user's postbit? So if you wanted to register admiration, you wouldn't have to go to the profile.

Yup, you just need to add the link:
Code:

<a href="profile.php?$session[sessionurl]do=admire&amp;userid=$userinfo[userid]">Register your admiration for $userinfo[username]</a>
You may need to check and change the $userinfo array name to match that of the post... but effectively you should add the above link to the relevant part of the postbit or postbit_legacy templates.


All times are GMT. The time now is 04:58 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01143 seconds
  • Memory Usage 1,755KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (9)bbcode_code_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete