View Single Post
  #112  
Old 07-03-2004, 04:42 PM
Olate Olate is offline
 
Join Date: Feb 2004
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have now installed this hack onto 2 forums sucessfully. However, there are a couple of issues you should be aware of:
  1. If you have specified a table prefix in includes/config.php of your vB installation, this hack will not install correctly because the table prefixes are not used when creating the tables in the installer. Even if you manage to get it to install, it won't work correctly because the table prefixes are not in every SQL query. But if you are not using table prefixes, you will be fine. This hack will install without any problems through the HTL.
  2. I have tried several times to get the manual installation to work. But when it comes to importing the settings, I can't get them to import correctly. The safest way is to use the HTL to install it. If anyone has used the manual installation sucessfully, I'd like to know how they imported the settings from the XML file.

A useful feature I needed was e-mail notification upon the addition of a new bug and a bug not. So I have added this. It is a very simple addition which I intend to improve later this evening (along with some other stuff). It uses a hard coded e-mail address to send the messages to and from. If you wish to add this to your copy, then do the following:

1. Open bugs.php. Locate (around line 463)

PHP Code:
        // Redirect to the bug
        
$url "bugs.php?$session[sessionurl]do=showdetails&id=$bug[id]";
        eval(
print_standard_redirect('redirect_postthanks'));
    } else {
        eval(
print_standard_error('bugnote_text_missing'));    // i think this is causing an error
    
}

Before, add:

PHP Code:
        $message "A new note has been added to bug ID# " $bug[id] . ":\n\n" $text ."\n\nYou can view this bug at http://www.yourdomain.com/directory/bugs.php?do=showdetails&id=".$bug[id];
        
        
// E-Mail
        
mail('to@email.com''[Tracker] New Note'$message,
         
"From: [email]from@email.com[/email]\r\n" .
         
"Reply-To: [email]replyto@email.com[/email]\r\n" .
         
"X-Mailer: PHP/" phpversion()); 
This will send out a simple message when a new bug is added to include the name, description and URL.

2. Open bugs.php. Locate (around line 428)

PHP Code:
        $url "bugs.php?$session[sessionurl]&do=showdetails&id=$id";
        eval(
print_standard_redirect('redirect_postthanks'));    
    } else {    
        
$bugpreview construct_errors($errors);
        
$_REQUEST['do'] = "add";    // go back to the "Submit" bug report screen
    
}

Before, add:
PHP Code:
        $bug_result $DB_site->query('SELECT id, name, description FROM ' TABLE_PREFIX 'bugs WHERE (id = ' $id ')');
        
$bug $DB_site->fetch_array($bug_result);
        
        
$message "A new bug (ID# " $id ") has been submitted: \n\nName: " $bug['name'] . "\nDescription: " $bug['description'] . "\n\nYou can view this bug at http://www.yourdomain.com/directory/bugs.php?do=showdetails&id=" $id;
        
        
// E-Mail
        
mail('to@email.com''[Tracker] New Entry'$message,
         
"From: [email]from@email.com[/email]\r\n" .
         
"Reply-To: [email]replyto@email.com[/email]\r\n" .
         
"X-Mailer: PHP/" phpversion()); 
This will send an e-mail when a new note is added to a bug along with the note itself and a link to the bug.

Finally, for those of you who a) use table prefixes and/or b) don't want to add the mail hacks above themselves, I've attached the bugs.php and admincp/bugsadmin.php files with both those changes/fixes in. Just overwrite your copies.

I will not support these changes officially, although I may help out if I get time in this thread. If you want me to help with the installation or bug fixes, I'll happily do this as commercial paid work if you want to PM me.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01083 seconds
  • Memory Usage 1,809KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete