Jump to content

icu222much

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

icu222much's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ty Ollifi. Just using a plain ordinary for loop worked beautifully
  2. I have used the var_dump function and I see all of my data from the JSON file being printed. PHP gives me the following errors: Notice: Trying to get property of non-object in C:\xampp\htdocs\jonTest\test.php on line 6 Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\jonTest\test.php on line 6 The problem is in the foreach loop. I'm not sure how to tell it to print out each person in the people array.
  3. I am trying to extract the list of people in my JSON file, but I keep on receiving an error. I am unsure on how to extract the different people as the names of the people are placed in an array. <?php $jsonFile = file_get_contents('list.json'); $jsonArray = json_decode($jsonFile, true); foreach($jsonArray -> people as $p) { echo $p; } ?> [ { "place": "paris", "people": [ "will", "jake", "melissa" ] }, { "place": "saigon", "people": [ "willis", "john" ] } ]
  4. I changed $calendars[0]->css = "/testingA/testingF/core/css/default.css"; to $calendars[0]->css = $_SERVER['DOCUMENT_ROOT']"/testingA/testingF/core/css/default.css"; but it had no effect. I also tried changing $calendar_open_url="/testingA/testingF/content/calendarAndEvents/upcomingEvents/upcomingEvents.php"; to $calendar_open_url= $_SERVER['DOCUMENT_ROOT']."/testingA/testingF/content/calendarAndEvents/upcomingEvents/upcomingEvents.php"; but then it linked to the wrong page.
  5. I have a php Jax Calendar running on my website http://www.rysa.bc.ca/testingA/testingF/content/calendarAndEvents/upcomingEvents/upcomingEvents.php is not working properly. It seems that it is not reading the location of the CSS and Image folders correctly. The calendar is supposed to look like http://rysa.bc.ca/testingA/testingC/upcommingEvents.php. I tried changing the coding for the location of my CSS and Image files on Line 10. Originally, I had a relative address which was ../../../core/css/default.css but I changed it to an absolute address which is /testingA/testingF/core/css/default.css. I double-checked this address and it is correct. Am I missing something else here, or am I editing the wrong file (I am a PHP noob). <?php //global settings for Jax Calendar v1.34 // Global variables (have to be fitted) : // Title and Data Source $calendars[0]->title = "Community Calendar"; $calendars[0]->data_source = "csvfile"; // CSS template for the Calendar $calendars[0]->css = "/testingA/testingF/core/css/default.css"; $calendars[0]->calendar_file = "mycalendar"; $calendars[0]->event_file = "myevents"; $calendars[0]->db_server = ""; $calendars[0]->db_login = ""; $calendars[0]->db_database = ""; $calendars[0]->db_database = "jax_calendar"; $calendars[0]->db_password = ""; $calendars[0]->status_image_dir = "/testingA/testingF/core/images/status_pics"; // Title and Data Source $calendars[1]->title = "Jax Calendar 2nd"; $calendars[1]->data_source = "csvfile"; // CSS template for the Calendar $calendars[1]->css = "../../../core/css/default.css"; $calendars[1]->calendar_file = "mycalendar2"; $calendars[1]->event_file = "myevents2"; $calendars[1]->db_server = ""; $calendars[1]->db_login = ""; $calendars[1]->db_database = ""; $calendars[1]->db_database = "jax_calendar"; $calendars[1]->db_password = ""; $calendars[1]->status_image_dir = "../../../core/images/status_pics"; // if no calendar id is given in URI, take default (0) if ( empty( $_GET["cal_id"] ) ) { $cal_id = 0; } else { $cal_id = $_GET["cal_id"]; } $title = $calendars[$cal_id]->title; $data_source = $calendars[$cal_id]->data_source; $calendar_file = $calendars[$cal_id]->calendar_file; $event_file = $calendars[$cal_id]->event_file; $db_server = $calendars[$cal_id]->db_server; $db_login = $calendars[$cal_id]->db_login; $db_database = $calendars[$cal_id]->db_database; $db_password = $calendars[$cal_id]->db_password; $css_file = $calendars[$cal_id]->css; $status_img_dir = $calendars[$cal_id]->status_image_dir; // Language localization $default_language = strtolower( "english" ); // choose browser language for default $language_auto_select = true; // language localization if ( empty( $_GET[ "language" ] ) && $language_auto_select ) { echo "\n".'<script language="JavaScript" type="Text/JavaScript" src="'."{$base_url ["jax_cal"]}/modules/lang_auto_select.js".'"></script>'."\n"; $language = $default_language; } else $language = strtolower( $_GET[ "language" ] ); // CALENDAR CONTROL (USERS) // show today_button in calendar $cal_today_selector = true; // emphasize days with events! $cal_show_reserved = true; // use js for month/year quick selection (in calendar control) $use_quick_selectors = true; $calendar_open_url = "/testingA/testingF/content/calendarAndEvents/upcomingEvents/upcomingEvents.php"; $calendar_open_target = ""; // EVENT LIST $view_cal_select = true; $view_default = "m12"; // d1 , d30 , m12 // CALENDAR ADMIN // num of lines each page in calendar admin frontend $admin_page_break = 12; ?>
  6. I have a php Jax Calendar running on my website ( http://rysa.bc.ca/testingA/testingF/content/calendarAndEvents/upcomingEvents/upcomingEvents.php ) that is not working properly. My first issue is that I recieve an error saying that failed to open a stream, and some sort of fatal error. I have tried to fix this by allowing the files permission to write but that had no effect. I also made sure that the php files are in the correct directory. My second issue involves the calendar not displaying properly. It seems that the browser has some issues locating my CSS and Images. I have tried setting an absolute path for the location to my CSS and Image file, but it did not work. The code to the file controlling the location of the CSS and Imge file is: <?php //global settings for Jax Calendar v1.34 // Global variables (have to be fitted) : // Title and Data Source $calendars[0]->title = "Community Calendar"; $calendars[0]->data_source = "csvfile"; // CSS template for the Calendar $calendars[0]->css = "/testingA/testingF/core/css/default.css"; $calendars[0]->calendar_file = "mycalendar"; $calendars[0]->event_file = "myevents"; $calendars[0]->db_server = ""; $calendars[0]->db_login = ""; $calendars[0]->db_database = ""; $calendars[0]->db_database = "jax_calendar"; $calendars[0]->db_password = ""; $calendars[0]->status_image_dir = "../../../core/images/status_pics"; // Title and Data Source $calendars[1]->title = "Jax Calendar 2nd"; $calendars[1]->data_source = "csvfile"; // CSS template for the Calendar $calendars[1]->css = "../../../core/css/default.css"; $calendars[1]->calendar_file = "mycalendar2"; $calendars[1]->event_file = "myevents2"; $calendars[1]->db_server = ""; $calendars[1]->db_login = ""; $calendars[1]->db_database = ""; $calendars[1]->db_database = "jax_calendar"; $calendars[1]->db_password = ""; $calendars[1]->status_image_dir = "../../../core/images/status_pics"; // if no calendar id is given in URI, take default (0) if ( empty( $_GET["cal_id"] ) ) { $cal_id = 0; } else { $cal_id = $_GET["cal_id"]; } $title = $calendars[$cal_id]->title; $data_source = $calendars[$cal_id]->data_source; $calendar_file = $calendars[$cal_id]->calendar_file; $event_file = $calendars[$cal_id]->event_file; $db_server = $calendars[$cal_id]->db_server; $db_login = $calendars[$cal_id]->db_login; $db_database = $calendars[$cal_id]->db_database; $db_password = $calendars[$cal_id]->db_password; $css_file = $calendars[$cal_id]->css; $status_img_dir = $calendars[$cal_id]->status_image_dir; // Language localization $default_language = strtolower( "english" ); // choose browser language for default $language_auto_select = true; // language localization if ( empty( $_GET[ "language" ] ) && $language_auto_select ) { echo "\n".'<script language="JavaScript" type="Text/JavaScript" src="'."{$base_url ["jax_cal"]}/modules/lang_auto_select.js".'"></script>'."\n"; $language = $default_language; } else $language = strtolower( $_GET[ "language" ] ); // CALENDAR CONTROL (USERS) // show today_button in calendar $cal_today_selector = true; // emphasize days with events! $cal_show_reserved = true; // use js for month/year quick selection (in calendar control) $use_quick_selectors = true; $calendar_open_url = "/testingA/testingF/content/calendarAndEvents/upcomingEvents/upcomingEvents.php"; $calendar_open_target = ""; // EVENT LIST $view_cal_select = true; $view_default = "m12"; // d1 , d30 , m12 // CALENDAR ADMIN // num of lines each page in calendar admin frontend $admin_page_break = 12; ?> As you can see, on line 10 I have tried to set an absolute path but it did not seem to work: $calendars[0]->css= "/testingA/testingF/core/css/default.css";. However, on line 86 I have set an absolute value path and it did work: $calendar_open_url= "/testingA/testingF/content/calendarAndEvents/upcomingEvents/upcomingEvents.php";. What is happening? Additional coding for my calendar can be found in the directory: http://www.rysa.bc.ca/testingA/testingF/core/
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.