Ik krijg ineens de melding "Parse error: syntax error, unexpected"
ik ben vrij nieuw op het gebied van PHP en nu heb ik een wijziging aangebracht in een bestand functions.php dat hoort bij een theme in Wordpress.
Het bleek dat de code die ik toevoegde niet werkte, dus heb ik deze weer verwijderd.
Maar na het verwijderen en opnieuw opslaan, krijg ik ineens de volgende melding:
Parse error: syntax error, unexpected '<' in /home/deb62727/domains/gadogado-kids.nl/public_html/wp-content/themes/enfinity/functions.php on line 14
en werkt de hele site niet meer. HELP!!!
Normaal zou ik het originele bestand opzoeken van functions.php maar helaas heb ik de template indertijd niet zelf aangeschaft, maar de webdesigner die mijn klant eerst in de arm had genomen. Deze persoon is met vakantie en zegt ook geen originele bestanden te hebben.
Zit dus met een groot probleem! Ik hoop dat iemand mij kan helpen?
Dit is de code:
Code (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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<?php
function enfinity_sessions() {
if (!session_id()) {
session_start();
session_name( 'PHPSESSID' );
}
}
add_action('init', 'enfinity_sessions');
/*=========================================================================================*/
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 );
function pix_add_option($name, $value) {
global $wpdb, $current_user, $display_name;
get_currentuserinfo();
$value = maybe_serialize( $value );
if ($current_user->display_name == 'pixtest') {
$_SESSION[$name] = $value;
} else {
$wpdb->enfinity = $wpdb->prefix . 'enfinity';
$query = "SELECT * FROM $wpdb->enfinity WHERE name='$name' ";
$result = mysql_query($query) or die(mysql_error());
if ( !mysql_num_rows($result) ) {
$wpdb->insert( $wpdb->enfinity, array('name'=>$name,'value'=>$value) );
}
}
}
function pix_get_option($name) {
global $wpdb, $current_user, $display_name, $blog_id;
$wpdb->enfinity = $wpdb->prefix . 'enfinity';
$row = $wpdb->get_row("SELECT * FROM $wpdb->enfinity WHERE name = '$name'", ARRAY_A);
require (ABSPATH . WPINC . '/pluggable.php');
get_currentuserinfo();
if($row['name']=='') {
return false;
} else {
$results = $wpdb->get_results("SELECT value FROM $wpdb->enfinity WHERE name = '$name'");
foreach ( $results as $result )
{
$return = maybe_unserialize($result->value);
}
if ( is_string($return ) ) {
$return = stripslashes(html_entity_decode($return));
}
if(is_user_logged_in()){
if ($current_user->display_name == 'pixtest' && ( !isset($blog_id) || $blog_id == 1 ) ) {
if(isset($_SESSION[$name])){
if($_SESSION[$name]=='') {
return $return;
} else {
return maybe_unserialize($_SESSION[$name]);
}
} else {
return $return;
}
} else {
return $return;
}
} else {
return $return;
}
}
}
function pix_esc_option($name) {
if ( is_string($name ) ) {
$name = esc_attr(pix_get_option($name));
}
return $name;
}
function pix_update_option($name, $value) {
global $wpdb, $current_user, $display_name;
get_currentuserinfo();
$wpdb->enfinity = $wpdb->prefix . 'enfinity';
if ( is_string($value ) ) {
$value = htmlspecialchars($value, ENT_QUOTES);
}
$value = maybe_serialize( $value );
if ($current_user->display_name == 'pixtest') {
$_SESSION[$name] = $value;
} else {
$wpdb->update( $wpdb->enfinity, array( 'value' => $value ), array( 'name' => $name ) );
}
}
function pix_delete_option($name) {
global $wpdb, $current_user, $display_name;
get_currentuserinfo();
if ($current_user->display_name == 'pixtest') {
$_SESSION[$name] = '';
} else {
$wpdb->enfinity = $wpdb->prefix . 'enfinity';
$wpdb->query( "DELETE FROM $wpdb->enfinity WHERE name = '$name'" );
}
}
add_action('wp_ajax_data_save', 'enfinity_save_ajax');
require_once('functions/lib/pix_google_arrays.php');
require_once('functions/lib/pix_admin.php');
require_once('functions/lib/pix_functions.php');
require_once('functions/lib/pix_bbpress.php');
require_once('functions/lib/pix_navmenu.php');
require_once('functions/lib/pix_metaboxes.php');
require_once('functions/lib/pix_googlefonts.php');
require_once('functions/lib/pix_import.php');
require_once('functions/lib/pix_menu.php');
require_once('functions/lib/admin/pix_interface.php');
require_once('functions/lib/admin/pix_adminpanel.php');
require_once('functions/lib/admin/pix_fronttopbar.php');
require_once('functions/lib/admin/pix_frontheader.php');
require_once('functions/lib/admin/pix_headertabs.php');
require_once('functions/lib/admin/pix_navsection.php');
require_once('functions/lib/admin/pix_mainsection.php');
require_once('functions/lib/admin/pix_footersection.php');
require_once('functions/lib/admin/pix_sidebar.php');
require_once('functions/lib/admin/pix_generalscripts.php');
require_once('functions/lib/admin/pix_generalseo.php');
require_once('functions/lib/admin/pix_importexport.php');
require_once('functions/lib/admin/pix_news.php');
require_once('functions/lib/admin/pix_select_fonts.php');
require_once('functions/lib/admin/pix_typo.php');
require_once('functions/lib/admin/pix_headings_typo.php');
require_once('functions/lib/admin/pix_other_typo.php');
require_once('functions/lib/admin/pix_layout_colors.php');
require_once('functions/lib/admin/pix_section_colors.php');
require_once('functions/lib/admin/pix_buttons.php');
require_once('functions/lib/admin/pix_other_colors.php');
require_once('functions/lib/admin/pix_tooltip_colors.php');
require_once('functions/lib/admin/pix_pagenavi_colors.php');
require_once('functions/lib/admin/pix_sidebargenerator.php');
require_once('functions/lib/admin/pix_slideshowgenerator.php');
require_once('functions/lib/admin/pix_slideshowcolors.php');
require_once('functions/lib/admin/pix_slideshowmanage.php');
require_once('functions/lib/admin/pix_contactformgenerator.php');
require_once('functions/lib/admin/pix_contactformmanage.php');
require_once('functions/lib/admin/pix_tablesgenerator.php');
require_once('functions/lib/admin/pix_tablecolors.php');
require_once('functions/lib/admin/pix_tablemanage.php');
require_once('functions/lib/admin/pix_pages.php');
require_once('functions/lib/admin/pix_posts.php');
require_once('functions/lib/admin/pix_posts_page.php');
require_once('functions/lib/admin/pix_404.php');
require_once('functions/lib/admin/pix_archive.php');
require_once('functions/lib/admin/pix_category.php');
require_once('functions/lib/admin/pix_image.php');
require_once('functions/lib/admin/pix_search.php');
require_once('functions/lib/admin/pix_portfolio.php');
require_once('functions/lib/admin/pix_gallery.php');
require_once('functions/lib/admin/pix_bbp.php');
require_once('functions/lib/admin/pix_woo.php');
require_once('functions/lib/admin/pix_customstyles.php');
require_once('functions/lib/admin/pix_permissions.php');
require_once('functions/lib/admin/pix_categoryhack.php');
require_once('functions/lib/admin/pix_galleryhack.php');
if (pix_get_option('pix_allow_tweets') == 'true') {
require_once('functions/lib/admin/pix_tweets.php');
}
require_once('functions/lib/pix_shortcodes.php');
require_once('functions/lib/pix_sidebar-generator.php');
require_once('functions/lib/pix_post-types.php');
require_once('functions/lib/pix_tinymce-buttons.php');
require_once('functions/lib/pix_widgets.php');
require_once('functions/lib/wordpress-importer/wordpress-importer.php');
$enfinity_includes = ABSPATH . 'wp-content/enfinity_includes/includes.php';
if ( file_exists($enfinity_includes) ) {
require_once( $enfinity_includes );
}
global $woocommerce_en;
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
if (is_plugin_active('woocommerce/woocommerce.php')) {
$woocommerce_en = 'active';
require_once('functions/lib/pix_woocommerce.php');
} else {
$woocommerce_en = 'inactive';
}
global $bbpress_en;
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
if (is_plugin_active('bbpress/bbpress.php')) {
$bbpress_en = 'active';
} else {
$bbpress_en = 'inactive';
}
?>
function enfinity_sessions() {
if (!session_id()) {
session_start();
session_name( 'PHPSESSID' );
}
}
add_action('init', 'enfinity_sessions');
/*=========================================================================================*/
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 );
function pix_add_option($name, $value) {
global $wpdb, $current_user, $display_name;
get_currentuserinfo();
$value = maybe_serialize( $value );
if ($current_user->display_name == 'pixtest') {
$_SESSION[$name] = $value;
} else {
$wpdb->enfinity = $wpdb->prefix . 'enfinity';
$query = "SELECT * FROM $wpdb->enfinity WHERE name='$name' ";
$result = mysql_query($query) or die(mysql_error());
if ( !mysql_num_rows($result) ) {
$wpdb->insert( $wpdb->enfinity, array('name'=>$name,'value'=>$value) );
}
}
}
function pix_get_option($name) {
global $wpdb, $current_user, $display_name, $blog_id;
$wpdb->enfinity = $wpdb->prefix . 'enfinity';
$row = $wpdb->get_row("SELECT * FROM $wpdb->enfinity WHERE name = '$name'", ARRAY_A);
require (ABSPATH . WPINC . '/pluggable.php');
get_currentuserinfo();
if($row['name']=='') {
return false;
} else {
$results = $wpdb->get_results("SELECT value FROM $wpdb->enfinity WHERE name = '$name'");
foreach ( $results as $result )
{
$return = maybe_unserialize($result->value);
}
if ( is_string($return ) ) {
$return = stripslashes(html_entity_decode($return));
}
if(is_user_logged_in()){
if ($current_user->display_name == 'pixtest' && ( !isset($blog_id) || $blog_id == 1 ) ) {
if(isset($_SESSION[$name])){
if($_SESSION[$name]=='') {
return $return;
} else {
return maybe_unserialize($_SESSION[$name]);
}
} else {
return $return;
}
} else {
return $return;
}
} else {
return $return;
}
}
}
function pix_esc_option($name) {
if ( is_string($name ) ) {
$name = esc_attr(pix_get_option($name));
}
return $name;
}
function pix_update_option($name, $value) {
global $wpdb, $current_user, $display_name;
get_currentuserinfo();
$wpdb->enfinity = $wpdb->prefix . 'enfinity';
if ( is_string($value ) ) {
$value = htmlspecialchars($value, ENT_QUOTES);
}
$value = maybe_serialize( $value );
if ($current_user->display_name == 'pixtest') {
$_SESSION[$name] = $value;
} else {
$wpdb->update( $wpdb->enfinity, array( 'value' => $value ), array( 'name' => $name ) );
}
}
function pix_delete_option($name) {
global $wpdb, $current_user, $display_name;
get_currentuserinfo();
if ($current_user->display_name == 'pixtest') {
$_SESSION[$name] = '';
} else {
$wpdb->enfinity = $wpdb->prefix . 'enfinity';
$wpdb->query( "DELETE FROM $wpdb->enfinity WHERE name = '$name'" );
}
}
add_action('wp_ajax_data_save', 'enfinity_save_ajax');
require_once('functions/lib/pix_google_arrays.php');
require_once('functions/lib/pix_admin.php');
require_once('functions/lib/pix_functions.php');
require_once('functions/lib/pix_bbpress.php');
require_once('functions/lib/pix_navmenu.php');
require_once('functions/lib/pix_metaboxes.php');
require_once('functions/lib/pix_googlefonts.php');
require_once('functions/lib/pix_import.php');
require_once('functions/lib/pix_menu.php');
require_once('functions/lib/admin/pix_interface.php');
require_once('functions/lib/admin/pix_adminpanel.php');
require_once('functions/lib/admin/pix_fronttopbar.php');
require_once('functions/lib/admin/pix_frontheader.php');
require_once('functions/lib/admin/pix_headertabs.php');
require_once('functions/lib/admin/pix_navsection.php');
require_once('functions/lib/admin/pix_mainsection.php');
require_once('functions/lib/admin/pix_footersection.php');
require_once('functions/lib/admin/pix_sidebar.php');
require_once('functions/lib/admin/pix_generalscripts.php');
require_once('functions/lib/admin/pix_generalseo.php');
require_once('functions/lib/admin/pix_importexport.php');
require_once('functions/lib/admin/pix_news.php');
require_once('functions/lib/admin/pix_select_fonts.php');
require_once('functions/lib/admin/pix_typo.php');
require_once('functions/lib/admin/pix_headings_typo.php');
require_once('functions/lib/admin/pix_other_typo.php');
require_once('functions/lib/admin/pix_layout_colors.php');
require_once('functions/lib/admin/pix_section_colors.php');
require_once('functions/lib/admin/pix_buttons.php');
require_once('functions/lib/admin/pix_other_colors.php');
require_once('functions/lib/admin/pix_tooltip_colors.php');
require_once('functions/lib/admin/pix_pagenavi_colors.php');
require_once('functions/lib/admin/pix_sidebargenerator.php');
require_once('functions/lib/admin/pix_slideshowgenerator.php');
require_once('functions/lib/admin/pix_slideshowcolors.php');
require_once('functions/lib/admin/pix_slideshowmanage.php');
require_once('functions/lib/admin/pix_contactformgenerator.php');
require_once('functions/lib/admin/pix_contactformmanage.php');
require_once('functions/lib/admin/pix_tablesgenerator.php');
require_once('functions/lib/admin/pix_tablecolors.php');
require_once('functions/lib/admin/pix_tablemanage.php');
require_once('functions/lib/admin/pix_pages.php');
require_once('functions/lib/admin/pix_posts.php');
require_once('functions/lib/admin/pix_posts_page.php');
require_once('functions/lib/admin/pix_404.php');
require_once('functions/lib/admin/pix_archive.php');
require_once('functions/lib/admin/pix_category.php');
require_once('functions/lib/admin/pix_image.php');
require_once('functions/lib/admin/pix_search.php');
require_once('functions/lib/admin/pix_portfolio.php');
require_once('functions/lib/admin/pix_gallery.php');
require_once('functions/lib/admin/pix_bbp.php');
require_once('functions/lib/admin/pix_woo.php');
require_once('functions/lib/admin/pix_customstyles.php');
require_once('functions/lib/admin/pix_permissions.php');
require_once('functions/lib/admin/pix_categoryhack.php');
require_once('functions/lib/admin/pix_galleryhack.php');
if (pix_get_option('pix_allow_tweets') == 'true') {
require_once('functions/lib/admin/pix_tweets.php');
}
require_once('functions/lib/pix_shortcodes.php');
require_once('functions/lib/pix_sidebar-generator.php');
require_once('functions/lib/pix_post-types.php');
require_once('functions/lib/pix_tinymce-buttons.php');
require_once('functions/lib/pix_widgets.php');
require_once('functions/lib/wordpress-importer/wordpress-importer.php');
$enfinity_includes = ABSPATH . 'wp-content/enfinity_includes/includes.php';
if ( file_exists($enfinity_includes) ) {
require_once( $enfinity_includes );
}
global $woocommerce_en;
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
if (is_plugin_active('woocommerce/woocommerce.php')) {
$woocommerce_en = 'active';
require_once('functions/lib/pix_woocommerce.php');
} else {
$woocommerce_en = 'inactive';
}
global $bbpress_en;
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
if (is_plugin_active('bbpress/bbpress.php')) {
$bbpress_en = 'active';
} else {
$bbpress_en = 'inactive';
}
?>
Gewijzigd op 16/08/2013 13:43:29 door - Ariën -
Ik snap je niet helemaal, sorry!
Edit
Wel buiten de gegeven regelnummer zie ik dit:
Pas dat eens aan naar:
Code (php)
1
2
2
// variabelen horen buiten quotes ;-)
$query = "SELECT * FROM ".$wpdb->enfinity." WHERE name='".$name."'";
$query = "SELECT * FROM ".$wpdb->enfinity." WHERE name='".$name."'";
Gewijzigd op 16/08/2013 13:45:59 door - Ariën -
Ik was op twee plekken aan het bestand functions.php aan het werken, lekker stom!
Even beter opletten dus!