-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisplayreply.php
132 lines (105 loc) · 2.99 KB
/
displayreply.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?php
/*+**********************************************************************************
* The contents of this file are subject to the 361CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: 361CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
************************************************************************************/
session_start();
require_once (dirname(__FILE__) . "/config.inc.php");
require_once (dirname(__FILE__) . "/util.php");
XN_Application::$CURRENT_URL = "admin";
if( isset($_GET['type']) && $_GET['type'] =='o2o')
{
if( isset($_GET['id']) && $_GET['id'] !='')
{
try
{
$wxrole = XN_Content::load($_GET['id'],"supplier_wxroles");
$reply = $wxrole->my->reply;
$replytitle = $wxrole->my->replytitle;
$supplierid = $wxsetting->my->supplierid;
}
catch ( XN_Exception $e )
{
$replytitle = "错误";
$reply = $e->getMessage ();
}
}
elseif( isset($_GET['wxid']) && $_GET['wxid'] !='')
{
try
{
$wxsetting = XN_Content::load($_GET['wxid'],"supplier_wxsettings");
$reply = $wxsetting->my->welcomewords;
$replytitle = $wxsetting->my->welcometitle;
$supplierid = $wxsetting->my->supplierid;
}
catch ( XN_Exception $e )
{
$replytitle = "错误";
$reply = $e->getMessage ();
}
}
else
{
$replytitle = "错误";
$reply = '链接地址有误!';
}
}
else
{
if( isset($_GET['id']) && $_GET['id'] !='')
{
try
{
$wxrole = XN_Content::load($_GET['id'],"wxroles");
$reply = $wxrole->my->reply;
$replytitle = $wxrole->my->replytitle;
$supplierid = $wxsetting->my->supplierid;
}
catch ( XN_Exception $e )
{
$replytitle = "错误";
$reply = $e->getMessage ();
}
}
elseif( isset($_GET['wxid']) && $_GET['wxid'] !='')
{
try
{
$wxsetting = XN_Content::load($_GET['wxid'],"wxsettings");
$reply = $wxsetting->my->welcomewords;
$replytitle = $wxsetting->my->welcometitle;
$supplierid = $wxsetting->my->supplierid;
}
catch ( XN_Exception $e )
{
$replytitle = "错误";
$reply = $e->getMessage ();
}
}
else
{
$replytitle = "错误";
$reply = '链接地址有误!';
}
}
if($_REQUEST['title']){
$replytitle=$_REQUEST['title'];
}
require_once('util.php');
require_once('Smarty_setup.php');
$smarty = new vtigerCRM_Smarty;
$smarty->assign("id",$_GET['id']);
$smarty->assign("replytitle",$replytitle);
$reply = str_replace("http://www.ttwz168.com","", $reply);
$reply = preg_replace('#<img(.*?)src="(.*?)"(.*?)>#','<img$1 class="img-responsive" src="'.$APISERVERADDRESS.'$2"$3>', $reply);
$reply = str_replace("<p>","", $reply);
$reply = str_replace("</p>","", $reply);
$smarty->assign("reply",$reply);
$smarty->assign("supplier_info",get_supplier_info($supplierid));
$smarty->display('reply.tpl');
?>