Post Bookmark Error

Overall I was able to get this plugin working. I had to adjust where the plugin was looking for the wp-config.php file but now when I try to use the “Insert scheduler’s bookmark” button in a post it generates the following error:

Fatal error: Class 'SchedulerConfig' not found in /services5/webpages/util/b/d/bdalibrary.site.aplus.net/public/wordpress/wordpress-content/plugins/event-calendar-scheduler/mce_scheduler/dialog.php on line 4

When I look at the line 4 I see the following"

$cfg = new SchedulerConfig('scheduler_config_xml', $wpdb->dbh, $scheduler_table, $scheduler_fieldName, $scheduler_fieldValue, $scheduler_table_name, $scheduler_userIdField, $scheduler_userLoginField, $scheduler_tableUsers, $scheduler_prefix, $scheduler_userid);

Any help in getting this working? I can’t figure out where to check next.

Hi.
Have a look at file wp-settings.php and modify code like here:

foreach ( wp_get_active_and_valid_plugins() as $plugin )
	include_once( $plugin );
unset( $plugin );
// add the follow code
var_dump(class_exists('SchedulerConfig'));
die();

It looks like you’ll have false when you’ll try to load page.
Function wp_get_active_and_valid_plugins() gives plugins list (it’s located in wp-includes/load.php).
Try to analize this function why it doesn’t return you scheduler plugin in a list.

Unfortunately my hosting company doesn’t allow me to edit wp-settings.php or to access the wp-includes directory. Certain files in the hosting company’s automated Wordpress install are linked files/directories and while I can physically see them, I cannot view their contents, copy them or edit them.

Was you editing any another Wordpress files before plugin was broken?

No. This particular feature has never worked.

Did some searching and found that the SchedulerConfig class is defined in the file dhtmlxSchedulerConfigurator.php so I added the following statement to dialog.php:

require('../codebase/dhtmlxSchedulerConfigurator.php');

This gets the dialog to appear and I can see the event options however I also get the following errors:

[code]Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in
/services5/webpages/util/b/d/bdalibrary.site.aplus.net/public/wordpress/wordpress-content/plugins/event-calendar-scheduler/
codebase/dhtmlxSchedulerConfigurator.php on line 35

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in
/services5/webpages/util/b/d/bdalibrary.site.aplus.net/public/wordpress/wordpress-content/plugins/event-calendar-scheduler/
codebase/dhtmlxSchedulerConfigurator.php on line 37

Warning: mysql_result(): supplied argument is not a valid MySQL result resource in
/services5/webpages/util/b/d/bdalibrary.site.aplus.net/public/wordpress/wordpress-content/plugins/event-calendar-scheduler/
codebase/dhtmlxSchedulerConfigurator.php on line 45

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in
/services5/webpages/util/b/d/bdalibrary.site.aplus.net/public/wordpress/wordpress-content/plugins/event-calendar-scheduler/
codebase/dhtmlxSchedulerConfigurator.php on line 103

Warning: mysql_num_fields(): supplied argument is not a valid MySQL result resource in
/services5/webpages/util/b/d/bdalibrary.site.aplus.net/public/wordpress/wordpress-content/plugins/event-calendar-scheduler/
codebase/dhtmlxSchedulerConfigurator.php on line 219[/code]
If I try to create the event anyway I get an error “Error of addition event in Scheduler!” I am getting a little closer to figuring this out. Is this the correct SchedulerConfig class that I am calling from the dhtmlxSchedulerConfigurator.php file?

This warnings were caused by incorrect MySQL-connection in $wpdb->dbh property.
Usually it should be created automatically. But in your case something is wrong, so try to create connection manually:

$res = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
mysql_select_db(DB_NAME, $res);
$cfg = new SchedulerConfig('scheduler_config_xml', $res, $scheduler_table, $scheduler_fieldName, $scheduler_fieldValue, $scheduler_table_name, $scheduler_userIdField, $scheduler_userLoginField, $scheduler_tableUsers, $scheduler_prefix, $scheduler_userid);

I tested and the database connection is correct however I included

print mysql_error();

and saw that it wasn’t including a MySQL table name. I tried including the scheduler.php (using the require statement) however this just generated more errors. Finally I hardcoded the values as follows:

$cfg = new SchedulerConfig('scheduler_config_xml', $wpdb->dbh, 'options', 'option_name', 'option_value', 'events_rec', 'ID', 'user_login', 'users', 'wp_', '1');

This finally gets rid of all the errors however I still get “Error of addition event in Scheduler!” when trying to add the post as an event. I am still confused as to why I am having such a hard time with this dialog.php file. Is this common? I know my webhosting company Aplus does a pretty funky Wordpress install (I have issues with half of the plugins I install) but it just seems strange that no one else has seen these issues before. I am spending so much time troubleshooting the issue since I really want to use this plugin.

Could you provide error which was returned by mysql_error() function?
Make sure you have correct structure of tables wp_events_rec, wp_options using mysql-client.

There aren’t any mysql errors returned now. I just get a popup dialog saying “Error of addition event in Scheduler!” when I try to add the post as an event. I still don’t understand why the calendar from the webpage works fine but this dialog in the post editor doesn’t. How does the call to the database or the SchedulerConfig class differ between the webpage interface and the dialog.php. I am a PHP programmer but I don’t understand the structure of this plugin.

Hi.
Try to modify dialog.php file a littlebit:

dhtmlxAjax.get(url, function(loader) {
				if (loader.xmlDoc.responseText != '1') {
					alert("loader.xmlDoc.responseText");
					alert("Error of addition event in Scheduler!");
					tinyMCEPopup.close();
				} else {
					var reg = /\//g;
					start = start.replace(reg, '-');

This will alert result of saving link in database and can help us to figure out your issue.
Something wrong occurs in scheduler_ajax.php

I get the following error when I insert that snippet in dialog.php:

Parse error: syntax error, unexpected T_FUNCTION 

Is error line specified?
Please, have a look at file scheduler_ajax.php - issue is caused by some error in this file.

Thanks for all your help radyno, but I am having other issues with this web hosting company so I will be moving this website to a different web hosting company.