Jump to content
  • 0

How to exclude this?


HristDead

Question


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.01
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

Hi rAthena,

 

I'm using Feefty's support ticket system and this script came along with it (see bottom)

 

this script checks for support tickets. As of now, all the support tickets are showing except the ones that got deleted... I want the "solved" and "closed" ones to not appear when I use @checkunread / @cu in-game. In the sql database status 0 and status 2 are closed and resolved if that helps anything. I need a query for that to exclude these statuses but i cant figure it out, this is what i have so far:

 

query_sql("SELECT status = 0 FROM cp_support_tickets");
set .@sql$, .@sql$ - "1";

 

 

Thanks so much who can figure this out for me!

 

Whole script (unedited yet):

 

- script atcmd_ticket_notify -1,{
OnInit:
bindatcmd("checkunread", "atcmd_ticket_notify::OnAtcommand");
bindatcmd("cu", "atcmd_ticket_notify::OnAtcommand");
end;
 
OnAtcommand:
set .@unreadmsg$, "You have %d unread support tickets.";
set .@sql$, "SELECT id, department, ticket_read FROM cp_support_tickets WHERE ";
 
if (getgmlevel() > 0) {
set .@sql$, .@sql$ + "1";
} else {
set .@sql$, .@sql$ + "account_id = " + getcharid(3) + " AND unread = 1";
}
set .@count, query_sql(.@sql$, @id, @department, @ticket_read$);
if (.@count) {
if (getgmlevel() == 0) {
dispbottom(sprintf(.@unreadmsg$, .@count));
end;
}
 
if (.@count > 1) {
set .@ticket_count, 0;
 
for (set .@i, 0; .@i < getarraysize(@id); .@i++) {
set .@isRead, 0;
 
query_sql("SELECT group_id FROM cp_support_dep WHERE id = " + @department[.@i], @group_id);
 
if (@ticket_read$ != "") {
explode(.@tickets_read$, @ticket_read$[.@i], ",");
 
for (set .@j, 0; .@j < getarraysize(.@tickets_read$); .@j++) {
if (atoi(.@tickets_read$[.@j]) == getcharid(3)) {
set .@isRead, 1;
break;
}
}
}
 
if (@group_id <= getgmlevel() && .isRead == 0) {
.@ticket_count++;
}
}
dispbottom(sprintf(.@unreadmsg$, .@count));
end;
} else {
query_sql("SELECT group_id FROM cp_support_dep WHERE id = " + @department, @group_id);
set .@isRead, 0;
 
if (@ticket_read$ != "") {
explode(.@tickets_read$, @ticket_read$, ",");
 
for (set .@j, 0; .@j < getarraysize(.@tickets_read$); .@j++) {
if (atoi(.@tickets_read$[.@j]) == getcharid(3)) {
set .@isRead, 1;
break;
}
}
}
 
if (@group_id <= getgmlevel() && .@isRead == 0) {
dispbottom(sprintf(.@unreadmsg$, .@count));
end;
} else {
dispbottom(sprintf(.@unreadmsg$, 0));
end;
}
}
} else {
dispbottom(sprintf(.@unreadmsg$, 0));
end;
}
end;
}
Edited by HristDead
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...