'
. _( 'The realm of destinations you seek has eluded our grasp, spirited away by elusive knomes. Rally the grid managers, let them venture forth to curate a grand tapestry of remarkable places for your exploration!' )
. '
';
return $content;
}
// Rest of the class remains unchanged...
private function place_thumbnail() {
// Replace this with the actual URL for the thumbnail placeholder
return $this->internal_url . '/no-img.jpg';
}
private function place_traffic() {
// Replace this with the actual traffic placeholder value
return null;
}
private function place_people() {
// Replace this with the actual number of people placeholder value
return null;
}
private function is_main_script() {
if ( defined( 'OPENSIM_GUIDE_SOURCE' ) ) {
return false;
}
if ( defined( 'ABSPATH' ) ) {
return false;
}
if ( function_exists( 'debug_backtrace' ) ) {
$trace = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS );
foreach ( $trace as $trace_info ) {
if ( isset( $trace_info['function'] ) && in_array( $trace_info['function'], array( 'include', 'require' ) ) ) {
return false;
}
}
}
return true; // Probably true actually
}
private function html_prefix() {
$content = '';
if ( $this->fullHTML ) {
$content = ''
. ''
. ''
. ''
. ''
. 'Destination Guide'
. ''
. '';
}
$content .= ''
. '
';
$content .= '';
if ( $this->fullHTML ) {
$content .= '';
}
return $content;
}
private function get_public_url() {
$protocol = isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] === 'on' ? 'https://' : 'http://';
$host = $_SERVER['HTTP_HOST'];
$request_uri = $_SERVER['REQUEST_URI'];
// Parse the request URI to extract only the path part
$parsed_url = parse_url( $request_uri );
$path = $parsed_url['path'];
return $protocol . $host . $path;
}
private function build_url( $category = null ) {
$args = array_filter(
array_merge(
$this->url_args,
array(
'category' => $category,
)
)
);
if ( empty( $args ) ) {
return $this->public_url;
}
return $this->public_url . '?' . http_build_query( $args );
}
// ... (other methods in the OpenSim_Guide class)
private function get_child_script_url() {
// Get the full path of the current file (the helper script)
$helper_script_path = __FILE__;
// Get the directory path of the current file
$directory_path = dirname( $helper_script_path );
// Get the server's document root path
$document_root = $_SERVER['DOCUMENT_ROOT'];
// Convert the directory path to a URL by replacing the document root with an empty string
$child_script_url = str_replace( $document_root, '', $directory_path );
// Ensure the URL starts with a slash to make it an absolute URL
$child_script_url = '/' . ltrim( $child_script_url, '/' );
// Get the current protocol (http or https)
$protocol = isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] === 'on' ? 'https://' : 'http://';
// Get the host
$host = $_SERVER['HTTP_HOST'];
// Combine the protocol, host, and child script URL to get the full URL of the child script
$full_child_script_url = $protocol . $host . $child_script_url;
return $full_child_script_url;
}
}
$destinations_guide = new OpenSim_Guide();