function showmosttwittedposts() { $content = file_get_contents("http://otter.topsy.com/search.json?q=site:gestiopolis.com&window=d&perpage=50&order=influence"); $retweets_count = json_decode($content); $retweets = objectToArray($retweets_count->response->list); $retweets = orderMultiDimensionalArray($retweets, 'trackback_total', true); //print_r($retweets); //echo '<ol>'; for ($i = 0; $i < 5; $i++) { $retweet_actual[$i] = $retweets[$i]; $title = str_replace(' | GestioPolis', '', $retweet_actual[$i]["title"]); echo "<p><a href='" . $retweet_actual[$i]["url"] . "' title='" . $title . "'>" . $title . "</a> (" . $retweet_actual[$i]["trackback_total"] . ")</p>"; } //echo'</ol>'; }
'staff_id' => $citacion->getStaffId() ); // cargo los array de citaciones y respuestas, para despues ordenarlos y mostrarlos if ( $var_citacion == 1 ) $tod['citaciones'] = array( 'fecha' => $citacion->getFecha(), 'data' => $array_citacion, 'tipo' => 'citaciones' ); if ( $var_citacion == 2 ) { while ( $row = mysql_fetch_assoc($citacion->getCitaciones()) ) { $tod[$row["fecha"]] = array( 'fecha' => $row["fecha"], 'data' => $row, 'tipo' => 'citaciones' ); } } if ( $var_historial == true ) { while ( $row = mysql_fetch_assoc($var_historial) ) { $tod[$row["fecha"]] = array( 'fecha' => $row["fecha"], 'data' => $row, 'tipo' => 'historial' ); } } $tod_ordenado = ( count($tod) > 0 ) ? orderMultiDimensionalArray( $tod, 'fecha' ) : 0; if ( $tod_ordenado != 0 ) { ?> <!-- Timeline Style Block --> <?php if ($var_tipo_tramite == 24) {?> <div id = "hist_pend" style="width:100%;height:100;"> <div class="block-title"> </div><!-- END Timeline Style Title --> <?php echo ($titulosPendientes != null) ? '<div id = "historial" class="block" style="width:50%;float: left; max-height: 355px;overflow: scroll;overflow-x: hidden;">' : '<div class="block">'; ?> <?php }else{ ?> <div id = "hist_pend" style="width:100%"> <div class="block"> <?php } ?>
function most_read($userid, $section = 'cat'){ global $wpdb; switch($section) : case 'cat': $recs = $wpdb->get_results($wpdb->prepare("SELECT catids FROM {$wpdb->prefix}recommendations WHERE user_id = %d", $userid)); $i = 1; foreach($recs as $rec){ if($i == 1){ $catids = $rec->catids; }else{ $catids .= ','.$rec->catids; } $i++; } $catsa = explode(',',$catids); $catsc = array_count_values($catsa); $catsarray = array(); $maxcount=0; $mincount=0; foreach($catsc as $catid => $catcount){ $catsarray[] = array("catid" => $catid,"catcount" => $catcount); } $cats = orderMultiDimensionalArray($catsarray, 'catcount', true); $min_count = min( $catsc ); $spread = max( $catsc ) - $min_count; if ( $spread <= 0 ) $spread = 1; $font_spread = 100 - 25; if ( $font_spread < 0 ) $font_spread = 1; $font_step = $font_spread / $spread; echo '<table cellspacing="0" cellpadding="0" border="0" class="recommendationBarCats" style="font-size:1em;"><tbody>'; $i = 1; foreach($cats as $cat){ $count = $cat['catcount']; $val = round( 25 + ( ( $count - $min_count ) * $font_step ) ); echo '<tr><td class="catname" style="font-weight:bold; text-align:right; width:35%; font-size:1.3em; margin:0;border-top: 1px solid #E2E2E2; padding:8px 0 8px 10px;">'.get_cat_name($cat['catid']).'</td> <td style="width:55%; font-size:1.3em; margin:0;border-top: 1px solid #E2E2E2; padding:8px 0 8px 10px;"><div class="bar" style="width:'.$val.'%; background-color:#123456; height:10px;"> </div></td> <td class="catval" style="font-weight:bold; text-align:right; width:10%; font-size:1.3em; margin:0;border-top: 1px solid #E2E2E2; padding:8px 0 8px 10px;">'.$count.'</td></tr>'; if($i == 5)break; $i++; } echo '</tbody></table>'; break; case 'tag': $recs = $wpdb->get_results($wpdb->prepare("SELECT tagids FROM {$wpdb->prefix}recommendations WHERE user_id = %d", $userid)); $i = 1; foreach($recs as $rec){ if($i == 1){ $tagids = $rec->tagids; }else{ $tagids .= ','.$rec->tagids; } $i++; } $tagsa = explode(',',$tagids); $tagsc = array_count_values($tagsa); $tagsarray = array(); $maxcount=0; $mincount=0; foreach($tagsc as $tagid => $tagcount){ $tagsarray[] = array("tagid" => $tagid,"tagcount" => $tagcount); } $tags = orderMultiDimensionalArray($tagsarray, 'tagcount', true); echo '<ul>'; $i = 1; foreach($tags as $tag){ $count = $tag['tagcount']; //$val = round( 25 + ( ( $count - $min_count ) * $font_step ) ); $tagg = &get_tag( $tag['tagid'] ); echo '<li><a href="'.get_tag_link($tag['tagid']).'" title="Leer más de '.$tagg->name.' ('.$count.')">'.$tagg->name.'</a></li>'; if($i == 5)break; $i++; } echo '</ul>'; break; case 'author': $recs = $wpdb->get_results($wpdb->prepare("SELECT display_name, authorid, COUNT(authorid) AS countaut FROM {$wpdb->prefix}recommendations, {$wpdb->prefix}users WHERE user_id=%d AND ID = authorid GROUP BY authorid ORDER BY countaut DESC LIMIT 5", $userid)); echo '<ul>'; foreach($recs as $rec){ echo '<li><a href="'.get_author_link($echo = false, $rec->authorid).'" title="Leer más de '.$rec->display_name.' ('.$rec->countaut.')">'.$rec->display_name.'</a></li>'; } echo '</ul>'; break; endswitch; }