![]() |
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? |
Quote:
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. Code:
DATABASE WORK Now, in that CREATE TABLE bit the first line says: Code:
CREATE TABLE TABLE_PREFIXsecretadmirer ( Code:
CREATE TABLE secretadmirer ( Code:
CREATE TABLE vb3_secretadmirer ( 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 :) |
Perfectly clear, and now running perfectly! Many thanks!
|
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??? |
Quote:
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 :) |
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.
|
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? |
Quote:
Note these bits: Code:
PHRASE WORK: |
Quote:
Check that you created the templates: Code:
TEMPLATE WORK |
Quote:
Code:
<a href="profile.php?$session[sessionurl]do=admire&userid=$userinfo[userid]">Register your admiration for $userinfo[username]</a> |
Installed and working perfectly....thanks a bunch....
|
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! |
Quote:
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 :) |
just a shot in the dark here, but in the "functions_secretadmirer.php" could I replace this
Code:
// Code:
// am I close? :ermm: |
Quote:
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:
// 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 :) |
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 |
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; |
Quote:
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 :) |
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 |
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 ;) |
Could you please help me Buro9 when i install I get the error message below
Warning: main(./includes/functions_secretadmirer.php): failed to open stream: No such file or directory in /profile.php on line 2619 Fatal error: main(): Failed opening required './includes/functions_secretadmirer.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/naijawor/public_html/profile.php on line 2619 and my Usercp page is broken on the left side of it which is the menus or items borders is broken. Please help thanks |
I just installed the secret admirer hack. Now I was able to get it to work but when you go to user cp the link it is displaced the table is all messed and the secret admirer report link is outside the from where other links are also, the private message folder inbox is supposed to be at the top not below where it is now. You can see a what i'm talking about using the link below
http://www.naijaworld.com/cpimage.jpg can someone tell me how to correct this please I will truely appreciate it thanks |
osariase, if you can uninstall and wait until mid next week I will create an installer.
If you can't wait, then I think you either put the addition outside of your HTML table or did not close one of the tags. Have you already hacked the UserCP template in any way? Even with an installer these bits you would have to do by hand. You can email me a copy of that template if you wish and I will adjust it for you: david (at) buro9 (dot) com |
Thanks Buro9
I will wait I love this hack too much to have it half and half. How do I know when you have an installer? do I send you an email to ask or u will post it? let me know please thanks man for your efforts |
When I've built the installer I will send an update to those who have marked themselves as having installed this hack.
That means you get an email or PM from this site advising you :) |
Hi Buro9,
I finally got your hack working and its a beautiful hack I must say, kudos to you man. I want to thank you very much for your help, and if there are any additions to this hack please I would like to know about it thanks man good job!! |
Quote:
I think I will mkae some updates... additions to the admincp for the options. It may be a while though... need a computer first ;) |
Hello ,
I dont seem to find what i have done wrong, the process seems easy YET i got , Parse error: parse error, unexpected T_VARIABLE, expecting '(' in /home/personal/public_html/forum/profile.php on line 2268 This is ofcourse when i click on mydomain.xx/forum/profile.php?do=admire&userid=391 The same link that is added on users profile page. Any ideas what could be wrong ? edit : this is the line 2268 $optionselected["$categoryid"] = HTML_SELECTED; Doesnt seem anywrong ! |
Double check the code that you changed in Profile.php.
The line number indicates it was the second change, which was an addition. Using an old version of profile.php (you had a backup right, or you still have the vBulletin originals?), compare that and your modified version. You have done one of two things, either: 1) Removed some existing code when you pasted in the new code. or 2) When you pasted in the new code you only pasted part of it So just check that the // HACK blocks indicate the start and end of the hack, and that you didn't remove any existing code when you added it. |
The line of code you quoted is in my file around the 1500 mark, you must have another large hack installed to make that line number around the 2200 mark.
Please check against the original profile.php file or a backup that you know to be working that you have added the hack in the right place and not touched other code around it :) |
Yes i have large hacks and edits onto my profile pages, anyway i have a backup 3 days ago on my server i just started copying it and i will extract it to get the backup of profile.php
i will update you when this is done :) Thanks for the suggestion. |
I just restored an old profile.php and i also got the same problem when i clicked on the link again.
|
Quote:
Or send me the file as it currently is, and I shall fix the error :) My email: david at buro9 . co m |
Hi ,
I just want to let you know that seems the problem is NOT from your hack, thus i apologize ! Because i tried at the mentioned line : $optionselected["$categoryid"] = HTML_SELECTED; ( line 2268) and btw line 2267 to me was : LIST Anyway i just marked a # on that line to see what effect on your hack and your hack worked fine ! The problem seems older than it is and i will re-download a clean profile.php and compare from the vbulletin.com member site. Anyway thanks for the great hack, am clicking install right now, and i will be checking up my code to see what is exactly wrong with that line ( unfortunatly i dont see whats wrong in it right now ! ) |
Quote:
It's problems that are reported and then appear to be unsolved that put people off installing, so it's very appreciated :) |
Question is the Usergroup defineable? WHY?
well I would use this so members with less access could contact my paid members. Since they cant post to them this does seem cool AT first I thought it took all the info a user puts in its profile and searches for a member of their choice (male male female male what ever) and brings back the closest match. NOW who ever does that gets some paypal from me! |
Hi again,
I think i owe u the solution i downloaded the code into my local pc and in the phpeditor i noticed there was a space breaking the code into two lines ( like <br> ) The line wasnt wrong, except that when am editing it online it was actually being pasted like co<br>de :D |
you shouldnt be able to admire yourself, that kinda sux
|
Quote:
|
Quote:
|
All times are GMT. The time now is 08:34 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|