vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   HTML Email Feature (https://vborg.vbsupport.ru/showthread.php?t=38199)

Logician 10-01-2002 08:15 AM

Quote:

Originally posted by Dan Flynn
alter command denied to user: 'powerwas@localhost' for table 'user' Any idea why?

Dan as your error states, the problem you are having is related to your MYSQL user rights. You are trying to run a SQL query with a user account that does not hold "changing(alter) database" privileges.. You have to contact your host and ask "with which username and MYSQL password you should run ALTER commands", then use these info to run the SQL command..

Dan Flynn 10-01-2002 11:32 AM

Thanks I'll check into that. I'm pretty sure I have ran them before under that name!!!!

ChurchMedia 02-03-2003 08:24 AM

Another great hack! :)

I have the "threadstarter" hack installed, which emails forum subscribers when new threads are started. I'm trying to implement your hack into that one. It goes into the newthread.php.

Here is what I added, along with a new template, but it doesn't seem to work. It just sends out plain text. See anything wrong?

PHP Code:

// Hack: Send email notification on subscribed forums
      
if ($enableemail and $visible) {
        
$tousers=$DB_site->query("SELECT user.username,user.email
                                     FROM subscribeforum,user
                                     WHERE subscribeforum.forumid='
$forumid'
                                       AND subscribeforum.userid=user.userid
                                       AND user.userid<>'
$bbuserinfo[userid]'");
        
$forumtitle=unhtmlspecialchars($foruminfo['title']);
    
$author=unhtmlspecialchars($bbuserinfo['username']);
    
$postsubject=unhtmlspecialchars($subject);
    
$postcontents=unhtmlspecialchars($message);
        while (
$touser=$DB_site->fetch_array($tousers)) {
          
$touser['username']=unhtmlspecialchars($touser['username']);
// Logician HTML mail hack
if ($touserinfo['htmltext']==0){
// user wants plain text messages
          
eval("\$emailmsg = \"".gettemplate("email_threadstarter",1,0)."\";");
          eval(
"\$emailsubject = \"".gettemplate("emailsubject_threadstarter",1,0)."\";");

          
mail($touser['email'],$emailsubject,$emailmsg,"From: \"$bbtitle Mailer\" <$webmasteremail>");
        }
      else
//user wants HTML messages
{
eval(
"\$emailmsg = \"".gettemplate("email_threadstarter_html",1,0)."\";");
eval(
"\$emailsubject = \"".gettemplate("emailsubject_threadstarter",1,0)."\";");
mail($touser['email'],$emailsubject,$emailmsg,"From: \"$bbtitle \" <$webmasteremail>\nMIME-VERSION: 1.0\nCONTENT-TYPE: TEXT/HTML; CHARSET=iso-8859-9\nCONTENT-DISPOSITION: INLINE\n");
}
// Logician HTML mail hack
      
        
}
      }
      
// End hack 

I think I may have a } out of place...

Logician 02-03-2003 10:00 AM

I didn't understand why you are editing newthread.php while installing my hack? My hack does not modify newthread.php in anyway. Please check hack installations carefully, I believe you installed it incorrectly and this is why it does not work.. :knockedout:

ChurchMedia 02-03-2003 01:10 PM

Quote:

Originally posted by Logician
I didn't understand why you are editing newthread.php while installing my hack? My hack does not modify newthread.php in anyway. Please check hack installations carefully, I believe you installed it incorrectly and this is why it does not work.. :knockedout:
This is a "hack of your hack of a hack". I'm trying to make the threadstarter hack, FOUND HERE, work the same way and send out html emails for thread starts. I also want to do it for moderators....

Your hack as described in the instructions is working perfectly. I was just wondering if you could help me with some additional modifications....:)

Logician 02-03-2003 02:08 PM

Quote:

Originally posted by ChurchMedia

Your hack as described in the instructions is working perfectly. I was just wondering if you could help me with some additional modifications....:)

ok I see..

Give this a shot:
PHP Code:

=================================================================
      
// Hack: Send email notification on subscribed forums
      
if ($enableemail and $visible) {
        
$tousers=$DB_site->query("SELECT user.username,user.email,user.htmltext
                                     FROM subscribeforum,user
                                     WHERE subscribeforum.forumid='
$forumid'
                                       AND subscribeforum.userid=user.userid
                                       AND user.userid<>'
$bbuserinfo[userid]'");
        
$forumtitle=unhtmlspecialchars($foruminfo['title']);
    
$author=unhtmlspecialchars($bbuserinfo['username']);
    
$postsubject=unhtmlspecialchars($subject);
    
$postcontents=unhtmlspecialchars($message);
        while (
$touser=$DB_site->fetch_array($tousers)) {
          
$touser['username']=unhtmlspecialchars($touser['username']);
    
// Logician HTML mail hack
        
if ($touser['htmltext']==0){
        
// user wants plain text messages

                  
eval("\$emailmsg = \"".gettemplate("email_threadstarter",1,0)."\";");
              eval(
"\$emailsubject = \"".gettemplate("emailsubject_threadstarter",1,0)."\";");

              
mail($touser['email'],$emailsubject,$emailmsg,"From: \"$bbtitle Mailer\" <$webmasteremail>");
        }
         else
        
//user wants HTML messages
        
{
        eval(
"\$emailmsg = \"".gettemplate("email_threadstarter_html",1,0)."\";");
        eval(
"\$emailsubject = \"".gettemplate("emailsubject_threadstarter",1,0)."\";");
        
mail($touser['email'],$emailsubject,$emailmsg,"From: \"$bbtitle \" <$webmasteremail>\nMIME-VERSION: 1.0\nCONTENT-TYPE: TEXT/HTML; CHARSET=iso-8859-9\nCONTENT-DISPOSITION: INLINE\n");
        }
// Logician HTML mail hack

        
}
      }
      
// End hack
================================================================= 

Enjoy..

ChurchMedia 02-03-2003 02:52 PM

Worked perfectly! I see where I messed up -- Thanks a ton!

:) :) :)

SpankMe 02-20-2003 03:00 AM

Is there going to be an update for this hack for vBulletin 2.3.0 which has changed its mail code. https://vborg.vbsupport.ru/external/2010/10/3.gif

Logician 02-20-2003 08:51 AM

Quote:

Is there going to be an update for this hack for vBulletin 2.3.0 which has changed its mail code.
Nope sorry.. My access to vb.com member area has expired and I don't plan to renew it until a stable vb3 release which I'll upgrade comes up..

ryancooper 04-08-2003 05:40 PM

will this work wit hteh email all users option in hte Admin CP. If so it is exactly what i am looking for.


All times are GMT. The time now is 01:42 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.01024 seconds
  • Memory Usage 1,780KB
  • 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
  • (2)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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