-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcommon_content.php
More file actions
97 lines (76 loc) · 4.17 KB
/
Copy pathcommon_content.php
File metadata and controls
97 lines (76 loc) · 4.17 KB
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
<?php
//
//echo basename( __FILE__ . ':' . __LINE__ ) . '<br>' . "\n";
//
$arr_global_main = array(
'tmp.cf_dienthoai' => $__cf_row[ 'cf_dienthoai' ],
'tmp.cf_call_dienthoai' => $__cf_row[ 'cf_call_dienthoai' ],
'tmp.cf_hotline' => $__cf_row[ 'cf_hotline' ],
'tmp.cf_call_hotline' => $__cf_row[ 'cf_call_hotline' ],
'tmp.cf_diachi' => $__cf_row[ 'cf_diachi' ],
'tmp.cf_email' => $__cf_row[ 'cf_email' ],
'tmp.cf_mailto_email' => '<a href="mailto:' . $__cf_row[ 'cf_email' ] . '" rel="nofollow" target="_blank">' . $__cf_row[ 'cf_email' ] . '</a>',
'tmp.cf_yahoo' => $__cf_row[ 'cf_yahoo' ],
// 'tmp.theme_static_url' => EB_URL_OF_THEME,
'tmp.web_version' => $web_version,
'tmp.web_name' => $web_name,
'tmp.web_link' => web_link,
// tìm và tạo sidebar luôn (nếu có)
'tmp.str_sidebar' => $id_for_get_sidebar == '' ? '' : _eb_echbay_sidebar( $id_for_get_sidebar ),
'tmp.search_advanced_sidebar' => _eb_echbay_sidebar( 'search_product_options', 'widget-search-advanced cf', 'div', 1, 0 ),
// kích thước sản phẩm trên mobile, table
'tmp.cf_product_mobile_size' => $__cf_row[ 'cf_product_mobile_size' ],
'tmp.trv_mobile_img' => $__cf_row[ 'cf_product_mobile_size' ],
'tmp.cf_product_table_size' => $__cf_row[ 'cf_product_table_size' ],
'tmp.trv_table_img' => $__cf_row[ 'cf_product_table_size' ],
// kích thước ảnh blog
'tmp.cf_blog_size' => $__cf_row[ 'cf_blog_size' ],
// css định dạng chiều rộng cho phần danh sách blog
'tmp.custom_blog_css' => $__cf_row[ 'cf_blog_class_style' ],
//
'tmp.fb_num_comments' => EBE_get_lang( 'fb_comments' ),
// phần option cho link của mục blog
'tmp.blog_link_option' => '',
'tmp.post_zero' => EBE_get_lang( 'post_zero' )
);
//print_r( $arr_global_main );
// riêng với trang chủ -> nếu có set chiều rộng -> bỏ phần chiệu rọng bên trong các module con đi
if ( $act == '' && $__cf_row[ 'cf_home_class_style' ] != '' ) {
// $arr_global_main['tmp.custom_blog_css'] = $__cf_row['cf_home_class_style'];
$arr_global_main[ 'tmp.custom_blog_css' ] = '';
}
/*
else {
$arr_global_main['tmp.custom_blog_css'] = $__cf_row['cf_blog_class_style'];
}
*/
//
foreach ( $arr_global_main as $k => $v ) {
$main_content = str_replace( '{' . $k . '}', $v, $main_content );
}
// chuyển sang dùng CDN (nếu có)
// URL tương đối
//$main_content = str_replace( web_link . EB_DIR_CONTENT . '/', EB_DIR_CONTENT . '/', $main_content );
// URL từ thư mục wp-content
// $main_content = str_replace ( web_link . EB_DIR_CONTENT . '/', $__cf_row['cf_dns_prefetch'] . EB_DIR_CONTENT . '/', $main_content );
// URL từ thư mục uploads
// $main_content = str_replace ( web_link . EB_DIR_CONTENT . '/uploads/', $__cf_row['cf_dns_prefetch'] . EB_DIR_CONTENT . '/uploads/', $main_content );
// $main_content = str_replace ( '"' . EB_DIR_CONTENT . '/uploads/', '"' . $__cf_row['cf_dns_prefetch'] . EB_DIR_CONTENT . '/uploads/', $main_content );
// chỉnh lại url tuyệt đối cho phần header -> do mạng xã hội nó chỉ nhận tuyệt đối
//echo EB_DIR_CONTENT . '<br>' . "\n";
$main_content = str_replace( '" content="' . EB_DIR_CONTENT . '/', '" content="' . web_link . EB_DIR_CONTENT . '/', $main_content );
$main_content = str_replace( 'link href="' . EB_DIR_CONTENT . '/uploads/', 'link href="' . web_link . EB_DIR_CONTENT . '/uploads/', $main_content );
//$main_content = str_replace( ' href="./', ' href="' . web_link, $main_content );
//
if ( $__cf_row[ 'cf_replace_content' ] != '' ) {
$main_content = WGR_replace_for_all_content( $__cf_row[ 'cf_replace_content' ], $main_content );
}
// nếu tồn tại tham số URL cũ -> thay nội dung cũ sang mới
if ( $__cf_row[ 'cf_old_domain' ] != '' ) {
// $main_content = str_replace ( '/' . $__cf_row['cf_old_domain'] . '/', '/' . $_SERVER['HTTP_HOST'] . '/', $main_content );
$main_content = WGR_sync_old_url_in_content( $__cf_row[ 'cf_old_domain' ], $main_content );
}
// chuyển URL sang dạng SSL
$main_content = _eb_ssl_template( $main_content );
// chyển các thẻ title động sang thẻ theo config
$main_content = EBE_dynamic_title_tag( $main_content );