function loop($id_usr, $type, $userloop, $follow, $tabnumber, $id_group) { include './inc/config.php'; $connuni = @mysql_connect($host, $user, $pass); @mysql_select_db($db, $connuni); echo "<!-- START TAB " . $tabnumber . " -->"; echo "<div id=\"country" . $tabnumber . "\" class=\"tabcontent\">\n\t<div id=\"statuses\">"; //Choose type! if ($type == "Public timeline") { $sql0 = "SELECT status_id,user_id,status, DATE_FORMAT(date_set,'%M %e, %Y @ %l:%i:%s %p') AS ds FROM mt_statuses ORDER BY date_set DESC"; } elseif ($type == "Following") { $long = strlen($follow); //echo $long; $long_m = $long - 1; //echo $long_m; $follow_m = substr($follow, -$long, $long_m); //echo $follow_m; $sql0 = "SELECT status_id,user_id,status, DATE_FORMAT(date_set,'%M %e, %Y @ %l:%i:%s %p') AS ds FROM mt_statuses WHERE user_id IN (" . avoid_injection($follow_m) . ") ORDER BY date_set DESC"; //This is to show user updates with following option to show OR user_id='$id_usr' } elseif ($type == "User") { $usern = name_hide($userloop); $sql0 = "SELECT status_id,user_id,status, DATE_FORMAT(date_set,'%M %e, %Y @ %l:%i:%s %p') AS ds FROM mt_statuses WHERE user_id='" . avoid_injection($userloop) . "' OR status LIKE '%@" . avoid_injection($usern) . "%' ORDER BY date_set DESC"; } /*For all*/ /*get page*/ $registros = 15; $pagina = $_GET["pagina"]; if (!$pagina) { $inicio = 0; $pagina = 1; } else { $inicio = ($pagina - 1) * $registros; } /*end get page*/ $r0 = mysql_query($sql0, $connuni) or die('La consulta falló:' . mysql_error($enlace)); $total_registros = mysql_num_rows($r0); if ($type == "User") { $usern = name_hide($userloop); $query = "SELECT status_id,user_id,status, DATE_FORMAT(date_set,'%M %e, %Y @ %l:%i:%s %p') AS ds FROM mt_statuses WHERE user_id='" . avoid_injection($userloop) . "' OR status LIKE '%@" . avoid_injection($usern) . "%' ORDER BY date_set DESC LIMIT {$inicio}, {$registros}"; } elseif ($type == "Following") { $long = strlen($follow); //echo $long; $long_m = $long - 1; //echo $long_m; $follow_m = substr($follow, -$long, $long_m); //echo $follow_m; $query = "SELECT status_id,user_id,status, DATE_FORMAT(date_set,'%M %e, %Y @ %l:%i:%s %p') AS ds FROM mt_statuses WHERE user_id IN (" . avoid_injection($follow_m) . ") ORDER BY date_set DESC LIMIT {$inicio}, {$registros}"; //This is to show user updates with following option to show OR user_id='$id_usr' } elseif ($type == "Public timeline") { $query = "SELECT status_id,user_id,status, DATE_FORMAT(date_set,'%M %e, %Y @ %l:%i:%s %p') AS ds FROM mt_statuses ORDER BY date_set DESC LIMIT {$inicio}, {$registros}"; } $result = mysql_query($query, $connuni) or die(mysql_error() . ': ' . $query); $total_paginas = ceil($total_registros / $registros); //This table was for pagination but I changed it for another one without js //Page links an title echo "<table width=\"445\"><thead>\n\t\n\t<tr>\n\t<td>"; if ($id_group != "") { echo "<form style=\"float: right;margin-top: 3px; margin-right: 3px; position: absolute;\" action=\"\" name=\"delete_group\" method=\"post\">"; echo "<input type=\"image\" src=\"" . $pth . "inc/icons/gr_dl.png\" name=\"delete_group_id\" value=\"" . $id_group . "\">"; echo "</form>"; $des = "SELECT group_desc, members FROM mt_group WHERE id_group='" . avoid_injection($id_group) . "'"; $resultdes = mysql_query($des, $connuni) or die(mysql_error() . ': ' . $query); while ($row = mysql_fetch_assoc($resultdes)) { echo "<div style=\"margin-left: 25px;\">"; echo $row["group_desc"]; $members_message = explode(",", $row["members"]); $b = 0; while ($members_message[$b]) { $namem = name_hide($members_message[$b]); $group_replie .= "@" . $namem . " "; $b = $b + 1; } echo " <a href=\"#\" style=\"border: 0px;float: right;\" onclick=\"insertAtCaret('status','" . $group_replie . "');\"><img border=0 src=\"./inc/icons/group_go.png\"></a>"; echo "</div>"; } } echo "</td></tr></thead><tbody>"; //loop while ($row = mysql_fetch_assoc($result)) { echo '<tr><td> <div class="status-box"> <div style="float: left; width: 430px;">'; echo "<form style=\"float: right;\" action=\"\" method=\"post\">"; if ($id_usr == $row['user_id']) { echo "<input type=\"image\" src=\"" . $pth . "inc/icons/dl.png\" name=\"status_id\" value=\"" . $row["status_id"] . "\">"; } echo "</form>"; echo "<form style=\"float: right;\" action=\"\" method=\"post\">"; if ($id_usr != $row['user_id']) { if (strstr($follow, $row['user_id']) == true) { } else { echo "<input type=\"image\" src=\"" . $pth . "inc/icons/+.png\" name=\"status_id_mas\" value=\"" . $row["user_id"] . "\">"; } } echo "</form>"; echo "<form style=\"float: right; "; if (strstr($follow, $row['user_id']) == true) { } else { echo "margin-top: 12px; margin-right: -9px;"; } echo "\" action=\"\" method=\"post\">"; if ($id_usr != $row['user_id']) { if (strstr($follow, $row['user_id']) == true) { echo "<input type=\"image\" src=\"" . $pth . "inc/icons/-.png\" name=\"status_id_menos\" value=\"" . $row["user_id"] . "\">"; } else { } } echo "</form>"; //avatar if (gravatar($row['user_id']) == "yes") { $grav_correo = correo($row["user_id"]); echo "<a class=\"avatar\" href=\"index.php?user="******"user_id"] . "\">"; echo "<img width=\"48\" height=\"48\" align=\"left\" style=\"margin-right: 5px;\" border=\"1\" src=\""; echo getGravatarUrl($grav_correo, $defImg, "80", "G"); echo "\" alt=\"Gravatar\"></a>"; } else { if (file_exists("./avatar/" . $row['user_id'] . ".jpg") == true) { echo "<a class=\"avatar\" href=\"index.php?user="******"user_id"] . "\">"; echo '<img align="left" width="48" height="48" style="margin-right: 5px;" border=\\"1\\" src="' . $pth . 'avatar/', $row['user_id'], '.jpg"></a>'; } else { echo "<a class=\"avatar\" href=\"index.php?user="******"user_id"] . "\">"; echo '<img align="left" width="48" height="48" style="margin-right: 5px;" border=\\"1\\" src="' . $defImg . '"></a>'; } } //user echo "<b>"; echo "<a href=\"#\" onclick=\"insertAtCaret('status','@"; name($row['user_id']); echo " ');\">"; name($row['user_id']); echo "</a>"; echo " </b>"; //sms //echo replies(emoticons(replace_urls(stripslashes($row['status'])))) $status = replace_urls(stripslashes($row['status'])); $status = replace_unu($status); $status = emoticons($status); $status = channels($status); echo replies($status); echo '</div><span class="time">', $row['ds'], '</span>'; echo " <a href=\"index.php?user="******"\" style=\"border: 0px;\">\n\t<img style=\"border: 0px;\" src=\"" . $pth . "inc/icons/u.png\" alt=\"u\"/></a> \n\t<a href=\"#\" style=\"border: 0px;\" onclick=\"insertAtCaret('status','@"; name($row['user_id']); echo " ');\">\n\t<img style=\"border: 0px;\" src=\"" . $pth . "inc/icons/r.png\" alt=\"r\"/></a>"; //echo "<img src=\"inc/icons/d.png\" alt=\"d\"/> //<img src=\"inc/icons/f.png\" alt=\"f\"/> "; echo "</div></td></tr>"; } ?> <!-- foot table with link pages buttoms--> </tbody> <tfoot> <td> <center> <?php if ($pagina - 1 > 0) { if ($type == "User") { echo "<a id=\"nuevo\" href=\"index.php?user="******"&pagina=" . ($pagina - 1) . "\"> Newer </a>"; } else { echo "<a id=\"nuevo\" href=\"index.php?pagina=" . ($pagina - 1) . "\"> Newer </a>"; } } else { if ($type == "User") { echo "<a id=\"nuevorss\" href=\"rss.php?user="******"\"> Rss </a>"; } else { echo "<a id=\"nuevorss\" href=\"rss.php\"> Rss </a>"; } } if ($pagina + 1 <= $total_paginas) { if ($type == "User") { echo "<a id=\"viejo\" href=\"index.php?user="******"&pagina=" . ($pagina + 1) . "\"> Older </a>"; } else { echo "<a id=\"viejo\" href=\"index.php?pagina=" . ($pagina + 1) . "\"> Older </a>"; } } else { } ?> </center> </td> </tfoot> </table> </div> <br><br> <div style="clear: both;"></div> <!-- END TAB <?php echo $tabnumber; ?> --> </div> <?php }
?> )</h3> <br> <?php $i = 0; $x = 0; while ($row = mysql_fetch_assoc($result)) { if ($row["gravatar"] == "yes") { echo "<a title=\"" . $row["nick"] . "\" href=\"index.php?user="******"id_usr"] . "\" onmouseover=\"Tip('"; echo "<b>" . $row["nick"] . ": </b>"; echo last($row["id_usr"]); echo "', BALLOON, true, ABOVE, true, OFFSETX, -17, PADDING, 8)\" onmouseout=\"UnTip()\">"; echo "<img width=\"48\" border=\"1\" align=\"left\" style=\"margin: 3px;\" src=\""; $grav_correo = $row["correo"]; echo getGravatarUrl($grav_correo, $defImg, "80", "G"); echo "\" alt=\"Gravatar\"></a>"; $x = $x + 1; } else { if (file_exists("./avatar/" . $row["id_usr"] . ".jpg") == true) { echo "<a title=\"" . $row["nick"] . "\" href=\"index.php?user="******"id_usr"] . "\" onmouseover=\"Tip('"; echo "<b>" . $row["nick"] . ": </b>"; echo last($row["id_usr"]); echo "', BALLOON, true, ABOVE, true, OFFSETX, -17, PADDING, 8)\" onmouseout=\"UnTip()\">\n<img border=\"1\" align=\"left\" style=\"margin: 3px;\" src=\"" . $pth . "avatar/" . $row["id_usr"] . ".jpg\" width=\"48\" height=\"48\"></a>"; $x = $x + 1; } else { //echo "<a title=\"".$row["nick"]."\" href=\"index.php?user="******"id_usr"]."\"><img border=\"1\" align=\"left\" style=\"margin: 3px;\" src=\"".$pth."avatar/default.jpg\" width=\"48\" height=\"48\"></a>"; $sn = $sn + 1; } //$x=$x+1; }
<?php if (file_exists("./avatar/" . $rowopt["id_usr"] . ".jpg") == true) { echo "<img border=\"1\" align=\"left\" hspace=\"4\" src=\"./avatar/" . $rowopt["id_usr"] . ".jpg\">"; } else { echo "<img border=\"1\" align=\"left\" hspace=\"4\" src=\"" . $defImg . "\" width=\"48\" height=\"48\">"; } ?> <!-- input type="file" name="imgfile" --> <input name="new_image" id="new_image" size="30" type="file" class="fileUpload" /> </td> <td colspan="2"> <b>Gravatar</b><br> <?php echo "<img width=\"48\" border=\"1\" align=\"left\" style=\"margin: 3px;\" src=\""; echo getGravatarUrl($rowopt["correo"], $defImg, "80", "G"); echo "\" alt=\"Gravatar\">"; ?> <input type="checkbox" name="gravatar" value="yes" <?php if ($rowopt["gravatar"] == "yes") { echo "checked"; } ?> > ¿Do you want to use your avatar from gravatar.com? </td> </tr> <tr> <td colspan="4"> <b>One line Bio</b><br>