<?php function getSkypeStatus($username) { $context = stream_context_create(array('http' => array('header' => 'Connection: close'))); $data = @file_get_contents('http://204.9.163.163/' . $username . '.xml', 0, $context); $status = strpos($data, '<presence xml:lang="en">Offline</presence>') ? 'offline' : 'online'; return $status; } //print_r( $_POST['usernames'] ); //$_POST['usernames'] = array("aires.ana","nunomorgadinho"); $result = array(); foreach ($_POST['usernames'] as $key => $username) { $result[$key] = getSkypeStatus($username); } echo json_encode($result);
/** * RoloPress master loop * * Currently handles most situations * * @since 1.2 */ function rolo_loop() { if (!is_single()) { // This class is not needed on single pages ?> <!-- <ul class="item-list"> --> <?php } if (have_posts()) { while (have_posts()) { the_post(); ?> <?php $current_user_id = get_current_user_id(); global $post; $author_id = $post->post_author; $skype_status = ''; if ($current_user_id != $author_id) { continue; } $thumbid = get_post_thumbnail_id($post->ID); $frame_number = get_post_meta($post->ID, 'rolo_contact_framename', true); $thumb = wp_get_attachment_image_src($thumbid, $frame_number); // <------- NAO ESTA A FUNCIONAR $srcimage = $thumb[0]; if (isset($srcimage)) { $style = "background:url(" . $srcimage . ") no-repeat;"; } else { $style = "background: transparent no-repeat"; } $link = get_permalink(); global $_wp_additional_image_sizes; $w = $_wp_additional_image_sizes['frame' . $frame_number]['width']; $h = $_wp_additional_image_sizes['frame' . $frame_number]['height']; if (rolo_type_is('contact')) { $contact = get_post_meta($post->ID, 'rolo_contact', true); if (isset($contact['rolo_contact_phone'])) { $skype_name = $contact['rolo_contact_phone']; $link_skype = "skype:" . $skype_name . " ?call"; } $importance = get_post_meta($post->ID, 'rolo_contact_importance', true); } if (is_archive() || is_home()) { ?> <div id="contact-list"> <div class="photo" id="<?php echo $frame_number; ?> "> <a href="<?php echo $link; ?> "> <span class="<?php echo $frame_number; ?> " style="background: url('') no-repeat;"> <?php the_post_thumbnail($frame_number, array('alt' => $skype_name, 'title' => get_the_title())); // AQUI É ONDE É POSTA A FOTO ?> </span> </a> <img src="<?php echo get_bloginfo('template_url') . '/library/images/frames/' . $frame_number . '.png'; ?> " alt=""> <!-- <div id="title"> --> <?php //the_title(); ?> <!-- </div> --> </div> </div> <!-- close div contact --> <?php continue; } if (is_single()) { if (rolo_type_is('contact')) { if (!empty($skype_name)) { $skype_status = getSkypeStatus($skype_name); } ?> <h2 class="page-title"><?php the_title(); ?> </h2> <div id="contact-single" > <div class="left"> <div style="float:right;"> <div class="photo" id="<?php echo $frame_number; ?> "> <a href="<?php echo $link_skype; ?> "> <span class="<?php echo $frame_number . ' '; ?> " style="background: url('') no-repeat;"> <?php the_post_thumbnail($frame_number, array("alt" => $skype_name, 'title' => get_the_title())); // AQUI É ONDE É POSTA A FOTO ?> </span> </a> <img src="<?php echo get_bloginfo('template_url') . '/library/images/frames/' . $frame_number . '.png'; ?> " alt=""> </div> </div> </div> <?php if (isset($contact['rolo_contact_phone'])) { ?> <div class="right"> <div class="address"> <?php $contact = get_post_meta($post->ID, 'rolo_contact'); $contact = $contact[0]; $address = $contact['rolo_contact_address']; $city = rolo_get_term_list($contact_id, 'city'); $state = rolo_get_term_list($contact_id, 'state'); $zip = rolo_get_term_list($contact_id, 'zip'); $country = rolo_get_term_list($contact_id, 'country'); $city = $city == '' ? '' : $city; // $state = ($state == '') ? 'State' : $state; $zip = $zip == '' ? '' : $zip; $country = $country == '' ? '' : $country; if (isset($address) && ($address != '' || $zip . $city . $country != '')) { echo "Morada:<br/>"; echo $address . ' ' . $zip . ' ' . $city . ' ' . $country; } ?> </div> </div> <?php } the_content(); } rolo_entry_footer(); } elseif (is_search()) { ?> <div id="contact-list"> <div class="photo" id="<?php echo 'frame' . $frame_number; ?> "> <a href="<?php echo $link; ?> "> <span class="<?php echo $frame_number; ?> " style="background: url('') no-repeat;"> <?php the_post_thumbnail($frame_number); // AQUI É ONDE É POSTA A FOTO ?> </span> </a> <img src="<?php echo get_bloginfo('template_url') . '/library/images/frames/' . $frame_number . '.png'; ?> " alt=""> </div> </div> <!-- close div contact --> <?php } elseif (is_page()) { ?> <div id="contact"><?php the_content(); // show the page content if (is_page_template('widgets.php') || is_page_template('widgets-no-sidebar.php')) { // is this a widget page if (is_active_sidebar("widget-page")) { // is the widget area active ?> <div class="widget-area"> <ul class="xoxo"> <?php dynamic_sidebar("widget-page"); ?> </ul> </div><!-- #widget-area --> <?php } else { rolo_add_some_widgets_message(); // if not, show a message } } } else { ?> <div id="contact"> <li id="entry-<?php echo basename(get_permalink()); ?> " class="entry-header"> <?php echo '<img class="entry-icon" src=' . ROLOPRESS_IMAGES . '/icons/rolo-default.jpg />'; ?> <a class="entry-title" href="<?php the_permalink(); ?> " rel="bookmark"><?php the_title(); ?> </a> </li> <?php } ?> <!-- </div> --><!-- .entry-main --> <?php rolopress_after_entry(); // After entry hook ?> </div><!-- #entry-<?php the_ID(); ?> --> <?php } ?> <?php if (!is_single()) { // not needed on single pages ?> <!-- </ul> --><!-- item-list--> <?php } ?> <?php } else { // 404 or no search results ?> <li id="entry-0" class="<?php rolopress_entry_class(); ?> "> <?php rolopress_before_entry(); // Before entry hook ?> <div class="entry-main"> <?php // on inital setup if no contacts or companies are created then // the menu items produce a 404 // This will provide instructions on how to fix $referring_page = $_SERVER['REQUEST_URI']; if ($referring_page == "/type") { rolo_type_tax_message(); } else { //rolo_404_message(); } ?> </div><!-- .entry-main --> <?php rolopress_after_entry(); // After entry hook ?> </li><!-- #entry-0 --> <?php } }
function getSkypeStatusIcon($username) { $status = getSkypeStatus($username); // change the path of the icons folder to match your site echo '<a href="callto:' . $username . '" class="live-chat"><img src="templates/tpl_designcreations/img/' . $status . '.png" alt="call ' . $username . '" /></a>'; }
<?php require_once './includes/skypestatus.inc.php'; $status_burkt4 = getSkypeStatus("burkt4", $lang, "smallicon"); $status_huber3 = getSkypeStatus("surferboy8722", $lang, "smallicon"); $status_nells1 = getSkypeStatus("sebastian.nellen", $lang, "smallicon"); // fill $title, $description, $subTitle switch ($lang) { case "en": $title = 'About us'; $description = 'The <b>BreakFast Company</b> is a start-up, which was founded in early 2014. Our goal is to provide you a good quality breakfast in less time and with less effort.<br /> Our young and dynamic team is waiting to serve you a rich and/or fast breakfast to go - either booked in advance or by ordering in our shop.<br />'; $subTitle = 'Our team'; break; case "de": $title = 'Über uns'; $description = 'Die <b>BreakFast Company</b> ist ein Start-Up, welches Anfang Jahr 2014 gegründet wurde. Unser Ziel ist es, qualitativ hochwertiges Frühstück in kürzerer Zeit mit weniger Aufwand zu liefern.<br /> Unser junges und dynamisches Team freut sich darauf Ihnen ein reiches und/oder schnelles Frühstück "to go" zu servieren - egal ob Sie es im Voraus gebucht haben oder direkt in unserem Laden bestellen.<br />'; $subTitle = 'Unser Team'; break; case "fr": $title = "A propos de BreakFast"; $description = 'L\'entreprise <b>BreakFast Company</b> est un "start-up", qu\'était fondue en 2014.