INSERT INTO wd_g_righttypes VALUES
('67', NULL, '', 'pzone', 'aff_pzone_basic', 'modify', NOW(), 'L_G_PZONE', 'L_G_PZONE_SETTINGS', 'L_G_RT_MODIFY', NULL),
('68', NULL, '', 'pzone', 'aff_pzone_homead', 'modify', NOW(), 'L_G_PZONE', 'L_G_PZONE_FLASHAD', 'L_G_RT_MODIFY', NULL),
('69', NULL, '', 'pzone', 'aff_pzone_footer', 'modify', NOW(), 'L_G_PZONE', 'L_G_PZONE_SETFOOTER', 'L_G_RT_MODIFY', NULL),
('70', NULL, '', 'pzone', 'aff_pzone_article', 'modify', NOW(), 'L_G_PZONE', 'L_G_PZONE_ARTICLES', 'L_G_RT_MODIFY', NULL),
('71', NULL, '', 'pzone', 'aff_pzone_articlecate', 'modify', NOW(), 'L_G_PZONE', 'L_G_PZONE_ARTICLECATES', 'L_G_RT_MODIFY', NULL),
('72', NULL, '', 'pzone', 'aff_pzone_flinks', 'modify', NOW(), 'L_G_PZONE', 'L_G_PZONE_FLINKS', 'L_G_RT_MODIFY', NULL),
('73', NULL, '', 'pzone', 'aff_pzone_setupwizard', 'modify', NOW(), 'L_G_PZONE', 'L_G_SETUPWIZARD', 'L_G_RT_MODIFY', NULL),
('74', NULL, '', 'pzone', 'aff_pzone_themes', 'modify', NOW(), 'L_G_PZONE', 'L_G_PZONE_CHOOSETHEME', 'L_G_RT_MODIFY', NULL),
('75', NULL, '', 'pzone', 'aff_pzone_manualofuse', 'modify', NOW(), 'L_G_PZONE', 'L_G_MANUALOFUSE', 'L_G_RT_VIEW', NULL);

INSERT INTO wd_g_userrights VALUES("g45h4g67", "userpro1", "67");
INSERT INTO wd_g_userrights VALUES("g45h4g68", "userpro1", "68");
INSERT INTO wd_g_userrights VALUES("g45h4g69", "userpro1", "69");
INSERT INTO wd_g_userrights VALUES("g45h4g70", "userpro1", "70");
INSERT INTO wd_g_userrights VALUES("g45h4g71", "userpro1", "71");
INSERT INTO wd_g_userrights VALUES("g45h4g72", "userpro1", "72");
INSERT INTO wd_g_userrights VALUES("g45h4g73", "userpro1", "73");
INSERT INTO wd_g_userrights VALUES("g45h4g74", "userpro1", "74");
INSERT INTO wd_g_userrights VALUES("g45h4g75", "userpro1", "75");

UPDATE wd_g_righttypes SET category = 'pzone', categorylangid = 'L_G_PZONE' WHERE righttypeid = '53';
UPDATE wd_g_righttypes SET category = 'pzone', categorylangid = 'L_G_PZONE' WHERE righttypeid = '55';
UPDATE wd_g_righttypes SET category = 'pzone', categorylangid = 'L_G_PZONE' WHERE righttypeid = '62';
UPDATE wd_g_righttypes SET category = 'pzone', categorylangid = 'L_G_PZONE' WHERE righttypeid = '64';

ALTER TABLE wd_g_users ADD email VARCHAR(60) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL AFTER username;
ALTER TABLE wd_g_users ADD UNIQUE ( username );

INSERT INTO wd_pa_campaigns values ('clickreg', 'default1', '引导注册', '', '', NOW(), 0, 0, 2, 'leadregist');
INSERT INTO wd_pa_campaigncategories VALUES
('d8925d66', 'L_G_UNASSIGNED_USERS', 0, 0, 0, 0, 0, '', NULL, 0, 'clickreg', '$', '$', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0, 0);

UPDATE wd_g_settings SET value = 'yes' WHERE settingsid = '60316024';

UPDATE wd_pa_integrationsteps set textarea='<?php\r\n\trequire_once("/api/marketools/track.php");\r\n\t$params = array(\r\n\t\t"TotalCost"=>"xxxxxx",\r\n\t\t"OrderID"=>"xxxxxx",\r\n\t\t"ProductID"=>"xxxxxx",\r\n\t\t"Data1"=>Marketools_GetTrackToken()\r\n\t);\r\n\tMarketools_SaleNotify($params);\r\n?>' WHERE intstepid='general2';

UPDATE wd_pa_integrationsteps set textarea='/*----------------------------------MARKETOOLS TRACK START----------------------------------*/\r\nrequire_once(ROOT_PATH . "api/marketools/track.php"); //调用API文件\r\n$smarty->assign("__mt_clicktrack", "disable"); //禁止此页面的点击跟踪\r\n/* 使用MT JS跟踪方式，不建议使用 */\r\n/*\r\n$smarty->assign("__mt_jsaletrack", "enable"); //开启此页面的JS方式的销售跟踪\r\nif($_POST["payment"]==1) { //你网店系统余额支付方式的ID可能不是1\r\n$smarty->assign("__mt_token", Marketools_GetTrackToken());\r\n}\r\n*/\r\n\r\n/* 使用 MT SOCKET/PHP API 方式跟踪，推荐使用 */\r\n$smarty->assign("__mt_jsaletrack", "disable"); //禁止此页面的JS方式的销售跟踪\r\nif($_POST["payment"]==1) { //你网店系统余额支付方式的ID可能不是1\r\n$params = array(\r\n\t"TotalCost"=>$total["amount"], //销售总价\r\n\t"OrderID"=>$order["order_sn"], //外部订单ID\r\n\t//"ProductID"=>"", //产品ID\r\n\t"Data1"=>Marketools_GetTrackToken() //令牌串\r\n);\r\n\r\n//触发跟踪事件\r\nMarketools_SaleNotify($params);\r\n}\r\n/*----------------------------------MARKETOOLS TRACK END----------------------------------*/' WHERE intstepid='ecshop2';

UPDATE wd_pa_integrationsteps set textarea='/*----------------------------------MARKETOOLS TRACK START----------------------------------*/\r\n$smarty->assign("__mt_clicktrack", "disable"); //禁止此页面的点击跟踪\r\nrequire_once(ROOT_PATH . "api/marketools/track.php"); //调用API\r\n\r\n/* 使用MT JS跟踪方式，需修改对应模板，不推荐使用 */\r\n/*\r\n$smarty->assign("__mt_jsaletrack", "enable"); //开启此页面的JS方式的销售跟踪\r\nif($respond_result) {\r\n$mtparam = $payment->getmtparam();\r\n$smarty->assign("__mt_token", Marketools_GetTrackToken());\r\n$smarty->assign("__mt_order_sn", $mtparam["order_sn"]);\r\n$smarty->assign("__mt_total_fee", $mtparam["total_fee"]);\r\n}\r\n*/\r\n\r\n/* 使用 MT SOCKET/PHP API 方式跟踪，推荐使用 */\r\n$smarty->assign("__mt_jsaletrack", "disable"); //禁止此页面的JS方式的销售跟踪\r\nif($respond_result) {\r\n$mtparam = $payment->getmtparam();\r\n$params = array(\r\n\t"TotalCost"=>$mtparam["total_fee"], //销售总价\r\n\t"OrderID"=>$mtparam["order_sn"], //外部订单ID\r\n\t"data1"=>Marketools_GetTrackToken() //令牌串\r\n);\r\n//触发跟踪\r\nMarketools_SaleNotify($params);\r\n}\r\n/*----------------------------------MARKETOOLS TRACK END----------------------------------*/' WHERE intstepid='ecshop4';

INSERT INTO wd_pa_integrationsteps
VALUES('general3', 'general1', 2,
'<b>退款通知：</b><br />当您的商城系统产生一笔退款事件时，可整合退款跟踪代码，取消该交易产生的佣金。其中$orderid是销售跟踪时发送的订单ID。您可以<a href="index.php?md=Affiliate_Merchants_Views_Commisionsettings">点此设置退款期限</a>时长。',
'<?php\r\n\trequire_once("/api/marketools/track.php");\r\n\tMarketools_RefundNotify($orderid);\r\n?>',NULL,'zh-CN');

UPDATE wd_g_settings SET value = '<a href=$DESTINATION><img src=$IMAGE_SRC alt="$ALT" title="$ALT" border="0" /></a>' WHERE settingsid = 'a476eee6';
