Previous Thread
Next Thread
Print Thread
Rating: 5
Page 2 of 8 1 2 3 4 5 6 7 8
Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
[]Astaran said:
Maybe a bit offtopic, but where can i find some technical details about Hivemail(
especially the backend)?
Does it parse all incoming mail from a catch all account and inserts the data into a MySQL table? [/]
Yes that is what it does Astaran. A cron script or a scheduled task in windows is responsible for this. The data is stored either in the database (the whole message) or in a file and the database (some data like the headers etc.)


Nikos
Sponsored Links
Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
Also Stefan if I may a couple of corrections:

1. ubbt.inc.php
Function send_header. You need to include in the authenticate function the hm_emails field, otherwise it will always return zero. Hence you need to find this:

// -------------------------------------------------------------------
// If we don't have a status then they we need to try and authenticate
if (!isset($user['U_Status'])) {
$userob = new user;
$user = $userob -> authenticate();
}

and replace it with this:

// -------------------------------------------------------------------
// If we don't have a status then they we need to try and authenticate
if (!isset($user['U_Status'])) {
$userob = new user;
$user = $userob -> authenticate("hm_emails");
}

if (!isset($user['hm_emails'])) {
$userob = new user;
$user = $userob -> authenticate("hm_emails");
}

2. ubbthreads_plugin.php
Function update_newmail

Change the function to :

function update_newmail() {
global $dbh, $config;

$userob = new user;
$user = $userob -> authenticate("hm_userid");

if ($user['U_Number']) {

$Uid = addslashes($user['U_Number']);
$hiveid = $user['hm_userid'];

if ($hiveid != "0") {
$query = "SELECT userid FROM {$options['database']}.hive_message WHERE userid = $hiveid AND status = 0";
$sth = $dbh -> do_query($query);
$count=mysql_num_rows($sth);
if ($count > 0) {
$newemail = $count;
} else {
$newemail = 0;
}
$dbh -> do_query("UPDATE {$config['dbname']}.{$config['tbprefix']}Users SET hm_emails = '$newemail' WHERE hm_userid = $hiveid");
}
}

}

This will use the .threads authenticate to see if the user is logged in and with one query retrieve the hm_userid as well. Also please note that the UPDATE query needs the {$config['dbname']) and not the 'dbserver', otherwise it points to the localhost (or wherever your DB is stored) instead of the database name.

It is working great for me!! Great job!

(now all I have to do is create some templates to match those of the .threads )


Nikos
Joined: Oct 2000
Posts: 2,667
Veteran
Veteran
Offline
Joined: Oct 2000
Posts: 2,667
dimopoulos I don't think this is needed.

The way I chose was to have hm_email by default in the userob routine so it is part of the default just like new PM, maybe I missed that part will documenting the hack but It should work like this.

OK, checking the code I did forget something gimme a minute to tell you what it is supposed to be.


Do you believe in love at first sight,
or should I walk by again?
Joined: Oct 2000
Posts: 2,667
Veteran
Veteran
Offline
Joined: Oct 2000
Posts: 2,667
there my code in ubbt.inc.php was
Code
  // ----------------------------------------------------------------- <br />  // We are automatically adding StyleSheet, Status, Privates and <br />  // FrontPage and Number to each SQL call because this information is needed by <br />  // every script that makes a call to authenticate <br />     if ($Query != "*") { <br />        if ($Query) { $Query .=","; } <br />        $Query .= "U_Username,U_Password,U_SessionId, U_StyleSheet, U_Status, U_Privates, U_FrontPage, U_Number, U_Banned, hm_emails"; <br />      } <br /> 


since hm_emails is used on all pages we need it here, sorry for the bug


Do you believe in love at first sight,
or should I walk by again?
Joined: Feb 2002
Posts: 67
Power User
Power User
Offline
Joined: Feb 2002
Posts: 67
[]Astaran said:
Maybe a bit offtopic, but where can i find some technical details about Hivemail(especially the backend)?
Does it parse all incoming mail from a catch all account and inserts the data into a MySQL table? [/]

It's choosable ... saving in MySQL or flatfile ...

english / german features list


Sponsored Links
Joined: Oct 2000
Posts: 2,667
Veteran
Veteran
Offline
Joined: Oct 2000
Posts: 2,667
the zip was updated in order to reflect my mistake

*Baaaad Charles*


Do you believe in love at first sight,
or should I walk by again?
Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
Thanks Charles


Nikos
Joined: Oct 2000
Posts: 2,667
Veteran
Veteran
Offline
Joined: Oct 2000
Posts: 2,667
also just for your info your update email function cannot work because we need to know if we have new emails BEFORE we identify otherwise the flashing image will use the old data. The goal is to update the data before we actually call for it


Do you believe in love at first sight,
or should I walk by again?
Joined: Oct 2000
Posts: 2,667
Veteran
Veteran
Offline
Joined: Oct 2000
Posts: 2,667
I am writing a small installer to handle the sql part.

for those who can't wait you can run the following command to update your login template

Code
 <br />UPDATE hive_template SET user_data = REPLACE(user_data,"vb_","ubbt_"), parsed_data = REPLACE(parsed_data,"vb_","ubbt_") WHERE title = 'login' <br />


hope this will help some of you

Updated to replace both cells, untested let me know if it works.


Do you believe in love at first sight,
or should I walk by again?
Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
Charles, do we need to change the parsed_data field as well or just the user_data?


Nikos
Sponsored Links
Joined: Oct 2000
Posts: 2,667
Veteran
Veteran
Offline
Joined: Oct 2000
Posts: 2,667
well I tried the hivemail CP and apparently the only thing tou can edit is the user_data field. the other one is used I think to know which ones have been changed but I am not sure.


Do you believe in love at first sight,
or should I walk by again?
Joined: Feb 2002
Posts: 67
Power User
Power User
Offline
Joined: Feb 2002
Posts: 67
[]dimopoulos said:
Charles, do we need to change the parsed_data field as well or just the user_data? [/]

the parsed template parts of hm will be updated on saving the template ... forget about this.

Joined: Oct 2000
Posts: 2,667
Veteran
Veteran
Offline
Joined: Oct 2000
Posts: 2,667
well yes but since we don't edit through the CP should I modify it too in my query?

what is it used for?


Do you believe in love at first sight,
or should I walk by again?
Joined: Feb 2002
Posts: 67
Power User
Power User
Offline
Joined: Feb 2002
Posts: 67
Right Charles, forgot about this ... we need to update this too

Joined: Feb 2002
Posts: 67
Power User
Power User
Offline
Joined: Feb 2002
Posts: 67
... only if we're using your install - script

Joined: Oct 2000
Posts: 2,667
Veteran
Veteran
Offline
Joined: Oct 2000
Posts: 2,667
ok updated the query


Do you believe in love at first sight,
or should I walk by again?
Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
Let me know when everything is figured out... then I'll try to install it again

Joined: Oct 2000
Posts: 2,667
Veteran
Veteran
Offline
Joined: Oct 2000
Posts: 2,667


Do you believe in love at first sight,
or should I walk by again?
Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
oh sure, right when I prepare myself to take a nice break, it's ready I need a nap, you guys make my head spin

Joined: Oct 2000
Posts: 2,667
Veteran
Veteran
Offline
Joined: Oct 2000
Posts: 2,667
well it works great when I do it but I need you guys to tell me when I forgot to put all the code in the files now if I did everything were would the fun be?


Do you believe in love at first sight,
or should I walk by again?
Joined: Jun 2002
Posts: 670
Code Monkey
Code Monkey
Offline
Joined: Jun 2002
Posts: 670
Hi. Can I use the PIPE gateway for Hivemail instead of the POP gateway with this integration? Also, would you recommend merging the two databases into one?

Joined: Feb 2002
Posts: 67
Power User
Power User
Offline
Joined: Feb 2002
Posts: 67
[]donJulio said:
Hi. Can I use the PIPE gateway for Hivemail instead of the POP gateway with this integration?[/]

This is irrelevant for the hack

[]Also, would you recommend merging the two databases into one?[/]

Not really ... if it runs fine, why change?

Joined: Jun 2002
Posts: 670
Code Monkey
Code Monkey
Offline
Joined: Jun 2002
Posts: 670
Sorry but just one more question. I am going to give this a whirl tomorrow, but I need absolute clarification on which version of Hivemail to use. In the instructions it says version "1.21". I've never heard of that one. Charles said 1.2SP1 causes problems because the tables have different names. Because he is the co-author of this mod, I'm assuming it's not that one. Later jluerken stated that it would be unstable w/ 1.2.1 (which is different than "1.21") because there is a long bug list w/ that version (which is currently a Release Candidate only). I'm running version 1.2 right now. Is that the one I need? I don't know what 1.21 is

Joined: Oct 2002
Posts: 165
Member
Member
Offline
Joined: Oct 2002
Posts: 165
Although not specifically related to the hack... does anyone have a concern of allowing the use of your domain name for the mail? I have concerns of malicious mailings and or SPAM that might get the domain name Blacklisted.

Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
Not me because my forum is by invitation only and I know personally more than 70% of the members. Other people though might want to consider this.


Nikos
Joined: Oct 2000
Posts: 2,667
Veteran
Veteran
Offline
Joined: Oct 2000
Posts: 2,667
don Julio, this hack uses version 1.2.1 of hivemail eventhough it is only a release candidate but I was not going to hack an outdated version


Do you believe in love at first sight,
or should I walk by again?
Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
Hmmm.. I seem to have a slight problem though... When a user goes to change their profile (edit/changebasic.php) they do manage to change their date (clicking Submit) but the forum presents this message:


Fatal error: Cannot redeclare hivemail_check_name() (previously declared in c:\<path here>\mail\includes\ubbthreads_plugin.php:74)
in c:\<path here>\mail\includes\ubbthreads_plugin.php on line 72

Obviously there is a redeclaration somewhere. I tried to replace the require calls with require_once but had little effect...

Any ideas welcome.


Nikos
Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
Ok I managed to sort it out. I changed the call from require to require_once in the ubbt.inc.php and it worked like magic


Nikos
Joined: Oct 2000
Posts: 2,667
Veteran
Veteran
Offline
Joined: Oct 2000
Posts: 2,667
could you test this fix? if it works everywhere I will update the instructions


Do you believe in love at first sight,
or should I walk by again?
Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
I am still not clear why people opt for require. It does produce a fatal error if it there is a problem which is the good side but why not use require_once. If the script has already been included then it will not reload.

This minor change has worked very well for me on a Windows host with Apache. If others can please check if this works (on Linix boxes with Apache etc.) we can update the instructions accordingly.


Nikos
Joined: Feb 2002
Posts: 67
Power User
Power User
Offline
Joined: Feb 2002
Posts: 67
[]sportbikes said:
Although not specifically related to the hack... does anyone have a concern of allowing the use of your domain name for the mail? I have concerns of malicious mailings and or SPAM that might get the domain name Blacklisted.
[/]

Real spammers would'nt use hivemail (or an account anyhwere), cause the admin could restrict the maximum recipients per message and additionally define a time limit between sending two or more mails ... for a better understanding i'll attach a screenshot of the admin area (definition of usergroups) ... click here for a bigger view
Attachments
91926-usergroups.gif (0 Bytes, 235 downloads)

Joined: Oct 2002
Posts: 165
Member
Member
Offline
Joined: Oct 2002
Posts: 165
[]Stefan said:
Real spammers would'nt use hivemail (or an account anyhwere), cause the admin could restrict the maximum recipients per message and additionally define a time limit between sending two or more mails ... for a better understanding i'll attach a screenshot of the admin area (definition of usergroups) ... click here for a bigger view [/]

Thanks! I was unaware of the admin functions.

I was not thinking of real spammers, but just a way for someone who may wish to purposely bring harm to the site, whether it is a banned member coming back under a dynamic IP or the site next door who doesn't like that you are suceeding

Joined: Oct 2000
Posts: 2,667
Veteran
Veteran
Offline
Joined: Oct 2000
Posts: 2,667
this is why you might want to limit this function to specific user groups


Do you believe in love at first sight,
or should I walk by again?
Joined: Jun 2002
Posts: 670
Code Monkey
Code Monkey
Offline
Joined: Jun 2002
Posts: 670
I'm almost done w/ the integration, but I ran into this problem in the Hivemail file changes, and it was right at the end:
login-Template:
---------------

Replace all "vb_" parts with "ubbt_"

What is the file this is in? Where do I go? I'm sure it's a simple "Replace" command from the edit menu, but I don't know where to go to do this part.

Secondly, can you write here the SQL command(s) I would need to integrate and existing forum user w/ their existing email account? Thanks!

---EDIT---
BTW, where do I define the variable [UBBT_PATH] that is on the line that I add to Hivemail global.php? I got an error (many errors, but this was one of them) because of this. I replaced the variable and put the actual path to the config.inc.php file, but thzt's only because I don't recall seeing where to declare that variable.

Last edited by donJulio; 08/15/2003 12:37 AM.
Joined: Oct 2000
Posts: 2,667
Veteran
Veteran
Offline
Joined: Oct 2000
Posts: 2,667
don Julio you can use the following command to update the login Template. There is no file it is in the HIVE database.
Code
<br />UPDATE hive_template SET user_data = REPLACE(user_data,"vb_","ubbt_"), parsed_data = REPLACE(parsed_data,"vb_","ubbt_") WHERE title = 'login'<br />


for updating the user profile I can't think of anything because you would need to know what email adress is associated with which profile. So unless they use the hivemail email in their ubb.threads profile there is no waz no actually know.


Do you believe in love at first sight,
or should I walk by again?
Joined: Jun 2002
Posts: 670
Code Monkey
Code Monkey
Offline
Joined: Jun 2002
Posts: 670
I think I did everything correctly and I'm getting this error in my forums:
[] SQL ERROR: Database error only visible to forum administrators

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/laondal/public_html/foros/mysql.inc.php on line 131
SQL ERROR: Database error only visible to forum administrators

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/laondal/public_html/foros/mysql.inc.php on line 131 [/]

The email seems to be working all right. This is the second time I've done the integration and I solved the email problem (which was that I didn't go to the admin area of hivemail and turn on the integration). But in my forums I'm getting that error. Plus the cookies don't seem to be working because I was logged out. I tried logging back in to see what the database error was and it said that the username and password couldn't be found. I tried again w/ a different user name and the same thing happened However when I replace the forums with the old ones (I'm talking about the forums directory), everything works fine, minius the Hivemail integration. Is there a problem with my database?

--EDIT--

I get this error when trying to read mail:
[] MySQL error: Unknown column 'hm_emails' in 'field list'
MySQL error number: 1054
Script: /correo/read.email.php?messageid=1243
Date: August 15, 2003, 12:15 pm

Invalid query: UPDATE laondal_boards.w3t_Users
SET hm_emails = hm_emails - 1
WHERE hm_userid = 3 [/]
Good damn thing I have both databases backed up from before integration. Any idea on what the problem is?

Last edited by donJulio; 08/15/2003 2:18 PM.
Joined: Mar 2003
Posts: 159
Member
Member
Joined: Mar 2003
Posts: 159
Same problem here. I have done a fresh install like 3 or 4 times now with the latest download.

I think this is a great addition and am looking forward in using it.

BWilliams

Joined: Oct 2000
Posts: 2,667
Veteran
Veteran
Offline
Joined: Oct 2000
Posts: 2,667
did you actually add the fields to your w3t_users tables?

you need to run the sql query to do so


Do you believe in love at first sight,
or should I walk by again?
Joined: Mar 2003
Posts: 159
Member
Member
Joined: Mar 2003
Posts: 159
[]Charles said:
did you actually add the fields to your w3t_users tables?

you need to run the sql query to do so [/]
I did. The only query needed is the one in the download, right?

Joined: Oct 2000
Posts: 2,667
Veteran
Veteran
Offline
Joined: Oct 2000
Posts: 2,667
dunno, it should add 2 fields, hm_userid and hm_emails


Do you believe in love at first sight,
or should I walk by again?
Page 2 of 8 1 2 3 4 5 6 7 8

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Posts: 70
Joined: January 2007
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)