View Single Post
  #420  
Old 08-27-2006, 10:13 AM
Quarterbore Quarterbore is offline
 
Join Date: Mar 2005
Location: Valley Forge PA
Posts: 538
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I was working on the code a little and I think there might be a couple bugs still...

When a new Ticket is entered by one of my members, I get a PM that says:

Quote:
Support Ticket Updated: Another test

--------------------------------------------------------------------------------

The support ticket has been replied to by testaccount.

Please click here to view the ticket

All the best,
Timeshare Forums
Shouldn't this PM have a subject or "NEW Support Ticket" with the text inside the PM saying "A new support ticket has been entered by ..."

I looked and there are no such phrases! I also checked the vBsupport.php file and in fact in the notify staff area it does use these "Update" phrases as opposed to a "New"!

So, I created two new phrases:

Phrase 1:
Phrase Type: vb_Support Phrases
Product: vbSupport
Varname: vbsupport_pm_new_message
Text (Note spacing matters below - ask me how I found out:

PHP Code:
new support ticket has been submitted by {1}. 
[
url={2}]Please click here to view the ticket[/url

All the best
{
3
Phrase 2:
Phrase Type: vb_Support Phrases
Product: vbSupport
Varname: vbsupport_pm_new_title
Text: New {1} {2} Added: {3}

Next, find:

PHP Code:
                {
                    
// send a private message to the user
                    
$pmtitle construct_phrase($vbphrase['vbsupport_pm_update_title'], $vbphrase['vbsupport_title'], $vbphrase['vbsupport_ticket'], $newpost['title']);
                    
$pmtext construct_phrase($vbphrase['vbsupport_pm_update_message'], $vbulletin->userinfo['username'], $vbulletin->options['bburl'] . $linkurl$vbulletin->options['bbtitle']);
                    
vbsupport_send_pm(0$touser$pmtitle$pmtext);
                } 
Replace with:

PHP Code:

                
// check if it should send a pm
                
if (in_array($userid$pmids))
                {
                    
// send a private message to the Site Staff
                    
$pmtitle construct_phrase($vbphrase['vbsupport_pm_new_title'], $vbphrase['vbsupport_title'], $vbphrase['vbsupport_ticket'], $newpost['title']);
                    
$pmtext construct_phrase($vbphrase['vbsupport_pm_new_message'], $vbulletin->userinfo['username'], $vbulletin->options['bburl'] . $linkurl$vbulletin->options['bbtitle']);
                    
vbsupport_send_pm(0$touser$pmtitle$pmtext);
                } 
This is what the above generated for me!!!

New Support Ticket Added: Another trouble ticket test

--------------------------------------------------------------------------------

A new support ticket has been submitted by Site Staff.

Please click here to view the ticket

All the best,
Quarterbore



-------------------------------------------------------------------------------------------------
//////////// Next Issue \\\\\\\\\
-------------------------------------------------------------------------------------------------

Also, when an Admin or Mod does reply to a ticket the member that started the ticket is not getting a PM. I looked at the code and it looks like the code is written to do this...

See following in vbsupport.php:

PHP Code:
// check if it should send a private message
        
if (($threadinfo['postuserid'] != $vbulletin->userinfo['userid']) && $threadinfo['replynotice'])
        {
            
// fetch the $userinfo for this user
            
$touser fetch_userinfo($threadinfo['postuserid']);

            
// build the $linkurl
            
$touser['repliedby'] = $vbulletin->userinfo['username'];
            
$linkurl "/vbsupport.php?do=viewthread&tid=" $threadinfo['threadid'];

            
// check if it should send a pm
            
if ($threadinfo['replynotice'] & 1)
            {
                
// send a private message to the user
                
$pmtitle construct_phrase($vbphrase['vbsupport_pm_update_title'], $vbphrase['vbsupport_title'], $vbphrase['vbsupport_ticket'], $threadinfo['title']);
                
$pmtext construct_phrase($vbphrase['vbsupport_pm_update_message'], $vbulletin->userinfo['username'], $vbulletin->options['bburl'] . $linkurl$vbulletin->options['bbtitle']);
                
vbsupport_send_pm(0$touser$pmtitle$pmtext);
             }

            
// check if it should send an email
            
if ($threadinfo['replynotice'] & 2)
            {
                
// set the $title used in the email subject
                
$emailtitle $threadinfo['title'];

                
// send an email to the user
                
eval(fetch_email_phrases('ticketreplied'$touser['languageid']));
                
vbmail($touser['email'], $subject$messagetrue);
            }
        } 
Now, when I change the above to as follows, the person that posts the trouble ticket gets a PM when a reply is posted!

PHP Code:
        // check if it should send a private message
        
if ($threadinfo['postuserid'] != $vbulletin->userinfo['userid'])
        
// if (($threadinfo['postuserid'] != $vbulletin->userinfo['userid']) && $threadinfo['replynotice'])
        
{
            
// fetch the $userinfo for this user
            
$touser fetch_userinfo($threadinfo['postuserid']);

            
// build the $linkurl
            
$touser['repliedby'] = $vbulletin->userinfo['username'];
            
$linkurl "/vbsupport.php?do=viewthread&tid=" $threadinfo['threadid'];

            
// check if it should send a pm
            // if ($threadinfo['replynotice'] & 1)
            // {
                // send a private message to the user
                
$pmtitle construct_phrase($vbphrase['vbsupport_pm_update_title'], $vbphrase['vbsupport_title'], $vbphrase['vbsupport_ticket'], $threadinfo['title']);
                
$pmtext construct_phrase($vbphrase['vbsupport_pm_update_message'], $vbulletin->userinfo['username'], $vbulletin->options['bburl'] . $linkurl$vbulletin->options['bbtitle']);
                
vbsupport_send_pm(0$touser$pmtitle$pmtext);
            
// }

            // check if it should send an email
            
if ($threadinfo['replynotice'] & 2)
            {
                
// set the $title used in the email subject
                
$emailtitle $threadinfo['title'];

                
// send an email to the user
                
eval(fetch_email_phrases('ticketreplied'$touser['languageid']));
                
vbmail($touser['email'], $subject$messagetrue);
            }
        } 
So, this tells me that in vB 3.6 that the value of $threadinfo['replynotice'] is not "1" but I have no idea where that is set.... I want members to get a PM when their ticket is updated anyways so this works but I guess I should conditional out unregistered guests "userid = "0"" as I am not sure what that will cause... But, given unregistereds can not use the system yet I will waite on an update...

-------------------------------------------------------------------------------------------------
//////////// Next Issue \\\\\\\\\
-------------------------------------------------------------------------------------------------

There is no code in the script that will notify the staff when a member comes back and updates their ticket (or if it is there it doesn't work on my site and I don't see the code to do this).

EDIT - I did the code as in the following post!


Thanks!
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01545 seconds
  • Memory Usage 1,874KB
  • 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
  • (5)bbcode_php
  • (1)bbcode_quote
  • (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