Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Secret Admirer / Crush System Details »»
Secret Admirer / Crush System
Version: 1.00, by buro9 buro9 is offline
Developer Last Online: Jul 2012 Show Printable Version Email this Page

Category: End-User Options - Version: 3.0.3 Rating:
Released: 02-15-2004 Last Update: Never Installs: 69
 
No support by the author.

No longer supported by the author.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #92  
Old 02-13-2005, 10:14 PM
Urban51 Urban51 is offline
 
Join Date: Dec 2004
Location: Toronto
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed and working perfectly....thanks a bunch....
Reply With Quote
  #93  
Old 03-27-2005, 01:59 PM
CrazyLady CrazyLady is offline
 
Join Date: Feb 2005
Location: Canada
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I like this idea and it would work perfectly on my board... is it Version 3.0.7 friendly?

I have a little concern though... spam. A lot of my members have chosen not to receive email from other members, and we don't send out any emails from the administrators... my concern is that people would now start to receive emails from the site they don't want. Plus, we have members that don't post, so I don't want them to be caught up in this when they are not interested.

My ideas, if I may be so bold, would be to add that user must have a minimum of X number of posts before they can admire someone or receive admiration from someone and second to only receive emails if they have "receive emails from other members" enabled, otherwise the admirations are just sent to their report when they are ready to view.

just a couple thoughts... but great idea! hope I can add it to my board soon!
Reply With Quote
  #94  
Old 03-27-2005, 02:13 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CrazyLady
I like this idea and it would work perfectly on my board... is it Version 3.0.7 friendly?

I have a little concern though... spam. A lot of my members have chosen not to receive email from other members, and we don't send out any emails from the administrators... my concern is that people would now start to receive emails from the site they don't want. Plus, we have members that don't post, so I don't want them to be caught up in this when they are not interested.

My ideas, if I may be so bold, would be to add that user must have a minimum of X number of posts before they can admire someone or receive admiration from someone and second to only receive emails if they have "receive emails from other members" enabled, otherwise the admirations are just sent to their report when they are ready to view.

just a couple thoughts... but great idea! hope I can add it to my board soon!
It is 3.0.7 friendly... it's mostly self-contained with only one new block needing to be added to the existing code to call the self-contained stuff.

As for the no email thing... take a look through the code and comment that bit out, you'll find it's quit simple

And you can also do the minimum posts thing... when you add the link to the member info page, just put a conditional around it to check that the post qty for that user is above whatever value you want to use
Reply With Quote
  #95  
Old 03-29-2005, 04:15 PM
CrazyLady CrazyLady is offline
 
Join Date: Feb 2005
Location: Canada
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

just a shot in the dark here, but in the "functions_secretadmirer.php" could I replace this
Code:
  //
  // Send an email if we couldn't send a PM
  //
  if (!($notifyUser['options'] & $_USEROPTIONS['receivepm'])) {
    //
    // Get the Email message
    //
with this?
Code:
  //
  // Send an email if we couldn't send a PM
  //
  if (!($notifyUser['options'] & $_USEROPTIONS['receivepm'] & $vboptions['showemail'] & $vboptions['adminemail'])) {
    //
    // Get the Email message
    //
all new to this stuff, but my attempt here is to check if the user has enabled both "Receive Email from Administrators" and "receive emails from other members". if not, no email is sent.

am I close? :ermm:
Reply With Quote
  #96  
Old 03-29-2005, 09:24 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CrazyLady
just a shot in the dark here, but in the "functions_secretadmirer.php" could I replace this
Code:
  //
  // Send an email if we couldn't send a PM
  //
  if (!($notifyUser['options'] & $_USEROPTIONS['receivepm'])) {
    //
    // Get the Email message
    //
with this?
Code:
  //
  // Send an email if we couldn't send a PM
  //
  if (!($notifyUser['options'] & $_USEROPTIONS['receivepm'] & $vboptions['showemail'] & $vboptions['adminemail'])) {
    //
    // Get the Email message
    //
all new to this stuff, but my attempt here is to check if the user has enabled both "Receive Email from Administrators" and "receive emails from other members". if not, no email is sent.

am I close? :ermm:
Nice try but that wouldn't work.

There are two bitflag fields that contain the bits that indicate whether a user allows emails on those two criteria.

Those values are defined in includes/init.php

Namely they are these rows in the $_USEROPTIONS array:
'adminemail' => 16,
'showemail' => 256,

And the sum of the bits is the bitflag in $notifyUser['options'].

You would perform the logic roughly like this, but beware, the & is not doing what you think it is... you might want to look at the PHP manual regarding bitwise operators.

Code:
  //
  // Send an email if we couldn't send a PM
  //
  if (!($notifyUser['options'] & $_USEROPTIONS['receivepm']) && 
       ($notifyUser['options'] & $_USEROPTIONS['showemail']) && 
       ($notifyUser['options'] & $_USEROPTIONS['adminemail'])) {
    //
    // Get the Email message
    //
Which basically checks that they cannot already receive PM's, but that they ARE able to receive emails from both other users and admins.

Bitwise operators can be daunting when you first encounter them, so let me show you very quickly how they work.

Basically you take numbers that are of the power of 2.

1
2
4
8
16
32

If we presumed that they represented letters of the alphabet:

1 = A
2 = B
4 = C
8 = D
16 = E
32 = F

Then we could build a value that encapsulated which of those letters we wanted to store.

Example, we want to store options A and C... so it's 1 + 5 = 6.
To store A, D, F it is 1 + 8 +32 = 41.

Given any number you simply subtract the largest value you can to determine your options:
41 - 32 (F) = 9
9 - 8 (D) = 1
1 - 1 (A) = 0

So we know that 41 included the values for F, D and A.

The options field basically stores a bitflag number like that, and the plain & in the logic is not the same as &&, but is a bitwise operator that indicates whether the bitflag contains the desired bits.

So the example above should do it for you
Reply With Quote
  #97  
Old 03-30-2005, 12:17 AM
CrazyLady CrazyLady is offline
 
Join Date: Feb 2005
Location: Canada
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would say you know what you are doing... this is WAY out of my league!!! I am far from knowing anything about php, let alone hacking it... I just came up with that change by looking at other code in vb, which I am still very new to as well.... but if you say your change will work? thanks very much! love it! always want to avoid those unwanted emails for my members anyway I can...

thank you
Reply With Quote
  #98  
Old 03-31-2005, 10:39 PM
osariase osariase is offline
 
Join Date: Mar 2005
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can anyone who has installed this hack successfully please help me with the DATABASE WORK i do not understand this part below help please

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;
Reply With Quote
  #99  
Old 04-01-2005, 03:52 AM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by osariase
Can anyone who has installed this hack successfully please help me with the DATABASE WORK i do not understand this part below help please

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;
Simple.

In your ./includes/config.php file you have a setting named $table_prefix.

In the first line of this query is this line:
CREATE TABLE TABLE_PREFIXsecretadmirer (

If your table prefix setting = "vb3_" then you should change that line to:
CREATE TABLE vb3_secretadmirer (

If your table prefix setting = "forum_" then you should change that line to:
CREATE TABLE forum_secretadmirer (

If your table prefix is blank or empty then you should change that line to:
CREATE TABLE secretadmirer (

Once your have made that change then you should run that SQL query in a program like PhpMySql and it will create the table for you
Reply With Quote
  #100  
Old 04-01-2005, 08:31 AM
Devient Devient is offline
 
Join Date: Mar 2005
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i seem to be getting a blank page when click on the admiration link on the profile, i have done everything except this section - i really couldnt understand it:

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.

-- where on earth do you add this?

vb version: 3.07

any help would be greatly appreciated
Reply With Quote
  #101  
Old 04-01-2005, 08:46 AM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In your admin control panel, in the left hand menu:

AdminCP > Languages & Phrases > Phrase Manager

And then at the bottom of the page there is an "Add New Phrase" button.

When you add a phrase it asks you three things:
Which group to put them in: The answer = Front-End Redirect Messages
What the phrase name is: These are the lines like: secretadmirer_acknowledged
What the phrase text is: These are the lines like: Your admiration for that user has been successfully registered.

You need to insert each phrase.

I need to build an installer
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:37 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08209 seconds
  • Memory Usage 2,320KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete