foreach ($oneforall_mods as $oneforall_mod_name) { $oneforall_mod_name = trim($oneforall_mod_name); if (in_array($oneforall_mod_name, $modules)) { $sql = "SELECT `section_id`, `page_id`, `link`, `modified_when`\r\n\t\t\t\tFROM `" . TABLE_PREFIX . "mod_" . $oneforall_mod_name . "_items`\r\n\t\t\t\tWHERE `active` = '1'"; $rs_oneforall = $database->query($sql); if ($rs_oneforall->numRows() > 0) { while ($oneforall = $rs_oneforall->fetchRow()) { if (!in_array($oneforall['section_id'], $public)) { continue; } $page = $database->get_one("SELECT `link` FROM `" . TABLE_PREFIX . "pages` WHERE `page_id`='" . $oneforall['page_id'] . "'"); $checked = check_link($page . $oneforall['link'], $exclude); if ($checked === true) { $link = htmlspecialchars($wb->page_link($page . $oneforall['link'])); $lastmod = gmdate("Y-m-d", $oneforall['modified_when'] + TIMEZONE); output_xml($link, $lastmod, $oneforall_frequency, $oneforall_priority); $counter++; } else { $debug_info[] = $checked; } } } } } // Add another module here... // Example code /* if (in_array('xxxxxx', $modules)) { $sql = "SELECT `section_id`, `link`, `modified_when` FROM `".TABLE_PREFIX."mod_xxxxxx_items` WHERE `active` = '1'";
$data['party'] = 'DUP'; output_xml($num++, $data, '2004-01-15', '9999-12-31', 'changed_party', 'still_in_office'); } elseif (substr($data['last_name'], 0, 7) == '†') { $data['last_name'] = ucwords(substr($data['last_name'], 7)); $data['party'] = 'DUP'; output_xml($num++, $data, '2003-11-26', '2006-02-20', 'general_election', 'changed_party'); $data['party'] = 'Independent'; output_xml($num++, $data, '2006-02-21', '9999-12-31', 'changed_party', 'still_in_office'); } elseif ($data['first_name'] == 'Raymond' && $data['last_name'] == 'McCartney') { output_xml($num++, array('first_name' => 'Mary', 'last_name' => 'Nelis', 'constituency' => 'Foyle', 'party' => 'Sinn Féin'), '2003-11-26', '2004-07-14', 'general_election', 'resigned'); output_xml($num++, $data, '2004-07-15', '9999-12-31', 'appointed', 'still_in_office'); } elseif ($data['first_name'] == 'Sue' && $data['last_name'] == 'Ramsey') { output_xml($num++, array('first_name' => 'Bairbre', 'last_name' => 'de Brun', 'constituency' => 'Belfast West', 'party' => 'Sinn Féin'), '2003-11-26', '2004-10-27', 'general_election', 'resigned'); output_xml($num++, $data, '2004-11-29', '9999-12-31', 'appointed', 'still_in_office'); } else { output_xml($num++, $data, '2003-11-26', '9999-12-31', 'general_election', 'still_in_office'); } } print "</publicwhip>\n"; function output_xml($num, $data, $from_date, $to_date, $from_why, $to_why) { if ($data['url']) { $data['url'] = "\turl=\"" . $data['url'] . "\"\n"; } # Patches $data['constituency'] = strip_tags($data['constituency']); if ($data['first_name'] == 'Pj') { $data['first_name'] = 'P J'; } if ($data['last_name'] == 'Shipley-dalton') { $data['last_name'] = 'Shipley-Dalton';
// // // // //print_r($data); // // // // foreach($data as $key=>$val){ // // // // echo "$key => "; // // // // foreach($val as $k=>$v){ // // // // echo "$k:$v;"; // // // // } // // // // echo "<br />"; // // // // } //// TES POTONGAN KODE IVAN R. LANIN define(LF, "\r\n"); // Tampilkan hasil if ($data) { $rows = count($data); switch ($_GET['f']) { case 'xml': $ret .= output_xml($data); break; case 'json': $ret .= output_json($data); break; case 'csv': foreach ($data[0] as $column => $value) { $head .= ($head ? ',' : '') . $column; } $ret .= $head . LF; foreach ($data as $rows) { $row = ''; foreach ($rows as $column => $value) { $row .= ($row ? ',' : '') . $value; } $ret .= $row . LF;
$sql = "SELECT `section_id`, `link`, `modified_when`\n\t\t\tFROM `" . TABLE_PREFIX . "mod_showcase_items`\n\t\t\tWHERE `active` = '1'"; $rs_showcase = $database->query($sql); if ($rs_showcase->numRows() > 0) { while ($showcase = $rs_showcase->fetchRow()) { if (!in_array($showcase['section_id'], $public)) { continue; } $checked = check_link($showcase['link'], $exclude); if ($checked === true) { if (!empty($showcase['link'])) { $path = $database->get_one("SELECT `link` FROM `" . TABLE_PREFIX . "pages` WHERE `page_id` = (SELECT `page_id` FROM `" . TABLE_PREFIX . "mod_showcase_items` WHERE `link` = '" . $showcase['link'] . "' LIMIT 1);"); $showcase['link'] = $path . $showcase['link']; } $link = htmlspecialchars($wb->page_link($showcase['link'])); $lastmod = gmdate("Y-m-d", $showcase['modified_when'] + TIMEZONE); output_xml($link, $lastmod, $showcase_frequency, $showcase_priority); $counter++; } else { $debug_info[] = $checked; } } } } // Add another module here... // Example code /* if (in_array('xxxxxx', $modules)) { $sql = "SELECT `section_id`, `link`, `modified_when` FROM `".TABLE_PREFIX."mod_xxxxxx_items` WHERE `active` = '1'"; $rs_xxxxxx = $database->query($sql);
/** * The standard log function for Open-AudIT. Writes logs to a text file in the desired format (json or syslog). * * @access public * * @category Function * * @author Mark Unwin <*****@*****.**> * * @param Object log_details An object containing details you wish to log * * @return NULL [logs the provided string to the log file] */ function output() { error_reporting(E_ALL); $CI =& get_instance(); if ($CI->response->meta->id == 888888888888.0) { $CI->response->meta->id = NULL; unset($CI->response->data); $CI->response->data = array(); } if (!empty($CI->response->data) and count($CI->response->data) > 0) { $CI->response->data = output_convert($CI->response->data); } if (!empty($CI->response->included) and $CI->response->meta->collection != 'scripts') { $CI->response->included = output_convert($CI->response->included); } create_links(); // if we have errors set, make sure we remove the data object / array if (count($CI->response->errors) > 0) { unset($CI->response->data); } else { unset($CI->response->errors); } switch ($CI->response->meta->format) { case 'screen': output_screen($CI->response); break; case 'json_data': output_json_data(); break; case 'datatables': output_datatables(); break; case 'excel': output_excel($CI->response); break; case 'csv': output_csv($CI->response); break; case 'html': output_html($CI->response); break; case 'table': output_report($CI->response); break; case 'html_formatted': output_html_formatted($CI->response); break; case 'table_formatted': output_table_formatted($CI->response); break; case 'xml': output_xml($CI->response); break; case 'json': output_json($CI->response); break; case 'rss': output_rss($CI->response); break; case 'pdf': // TODO: need to insert the PDF function here output_screen($CI->response); break; case 'doc': // TODO: need to insert the doc / docx function here output_screen($CI->response); break; default: output_screen($CI->response); break; } }