Example #1
0
            foreach ($ignored_phrases as $ignored_phrase) {
                if (stripos($topic_headline, $ignored_phrase) !== false || stripos($topic_body, $ignored_phrase) !== false) {
                    // We've encountered an ignored phrase, so skip the rest of this while() iteration.
                    $table->num_rows_fetched++;
                    continue 2;
                }
            }
        }
        // Decide what to use for the last seen marker and the age/last bump column.
        if ($topics_mode) {
            $order_time = $topic_time;
        } else {
            $order_time = $topic_last_post;
        }
        // Process the values for this row of our table.
        $values = array('<a href="/topic/' . $topic_id . '">' . htmlspecialchars($topic_headline) . '</a>', snippet($topic_body), replies($topic_id, $topic_replies), format_number($topic_visits), '<span class="help" title="' . format_date($order_time) . '">' . calculate_age($order_time) . '</span>');
        if ($_COOKIE['spoiler_mode'] != 1) {
            array_splice($values, 1, 1);
        }
        $table->LastSeenMarker($last_seen, $order_time);
        $table->Row($values);
    }
}
$num_rows_fetched = $table->num_rows_fetched;
echo $table->Output('topics');
// Navigate backward or forward ...
$navigation_path = 'topics';
if ($_GET['bumps']) {
    $navigation_path = 'bumps';
}
page_navigation($navigation_path, $current_page, $num_rows_fetched);
Example #2
0
		'IP address',
		'Replies',
		'Visits',
		'Age ▼'
	);
	$topics->DefineColumns($columns, 'Headline');
	$topics->SetTDClass('Headline', 'topic_headline');
	
	while($row=$res->FetchRow()) 
	{
		list($topic_id, $topic_time, $topic_replies, $topic_visits, $topic_headline, $topic_ip_address)=$row;
		$values = array 
		(
			'<a href="/topic/' . $topic_id . '">' . htmlspecialchars($topic_headline) . '</a>',
			'<a href="/IP_address/' . $topic_ip_address . '">' . $topic_ip_address . '</a>',
			replies($topic_id, $topic_replies),
			format_number($topic_visits),
			'<span class="help" title="' . format_date($topic_time) . '">' . calculate_age($topic_time) . '</span>'
		);
								
		$topics->Row($values);
	}
	echo $topics;
}

if($id_num_replies > 0)
{
	echo '<h4 class="section">Replies</h4>';

	$sql=DB::Prepare('SELECT replies.id, replies.parent_id, replies.time, replies.body, replies.author_ip, topics.headline, topics.time FROM {P}Replies as replies INNER JOIN {P}Topics as topics ON replies.parent_id = topics.id WHERE replies.author = ? ORDER BY id DESC');
	$res=DB::Execute($sql,array($_GET['uid']));
Example #3
0
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&oacute;:' . 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) . "\">&nbsp;Newer&nbsp;</a>";
        } else {
            echo "<a id=\"nuevo\" href=\"index.php?pagina=" . ($pagina - 1) . "\">&nbsp;Newer&nbsp;</a>";
        }
    } else {
        if ($type == "User") {
            echo "<a id=\"nuevorss\" href=\"rss.php?user="******"\">&nbsp;Rss&nbsp;</a>";
        } else {
            echo "<a id=\"nuevorss\" href=\"rss.php\">&nbsp;Rss&nbsp;</a>";
        }
    }
    if ($pagina + 1 <= $total_paginas) {
        if ($type == "User") {
            echo "<a id=\"viejo\" href=\"index.php?user="******"&pagina=" . ($pagina + 1) . "\">&nbsp;Older&nbsp;</a>";
        } else {
            echo "<a id=\"viejo\" href=\"index.php?pagina=" . ($pagina + 1) . "\">&nbsp;Older&nbsp;</a>";
        }
    } else {
    }
    ?>
			</center>
		</td>
		</tfoot>
	</table>
	</div>
<br><br>
<div style="clear: both;"></div>
<!-- END TAB <?php 
    echo $tabnumber;
    ?>
 -->
</div>

<?php 
}
Example #4
0
    foreach ($_POST['rejects'] as $reject_id) {
        if ($i > 0) {
            $sql .= ' OR ';
        }
        $sql .= '(uid = \'' . $User->UID . '\' AND topic_id = ' . intval($reject_id) . ')';
    }
    DB::Execute($sql);
    $_SESSION['notice'] = 'Selected topics unwatched.';
}
echo '<form name="fuck_off" action="" method="post">';
$topics = new TablePrinter('watchlist');
$topic_column = '<script type="text/javascript"> document.write(\'<input type="checkbox" name="master_checkbox" class="inline" onclick="checkOrUncheckAllCheckboxes()" title="Check/uncheck all" /> \');</script>Topic';
$columns = array($topic_column, 'Replies', 'Visits', 'Age', 'Last Post');
$db_columns = array('t.headline', 't.replies', 't.visits', 't.time', 'last_post');
$topics->DefaultSorting('last_post', SORT_DESC, $db_columns);
$topics->DefineColumns($columns, $topic_column);
$topics->SetTDClass($topic_column, 'topic_headline');
DB::ToggleDebug();
$res = DB::Execute('SELECT w.topic_id, t.headline, t.replies, t.visits, t.time, last_post FROM {P}Watchlists as w INNER JOIN {P}Topics as t ON w.topic_id = t.id WHERE w.uid = \'' . $User->ID . '\' ' . $topics->GetOrderSQL());
DB::ToggleDebug();
while (list($topic_id, $topic_headline, $topic_replies, $topic_visits, $topic_time, $last_post) = $res->FetchRow()) {
    $values = array('<input type="checkbox" name="rejects[]" value="' . $topic_id . '" class="inline" /> <a href="/topic/' . $topic_id . '">' . htmlspecialchars($topic_headline) . '</a>', replies($topic_id, $topic_replies), format_number($topic_visits), '<span class="help" title="' . format_date($topic_time) . '">' . calculate_age($topic_time) . '</span>', '<span class="help" title="' . format_date($last_post) . '">' . calculate_age($last_post) . '</span>');
    $topics->Row($values);
}
$num_topics_fetched = $topics->num_rows_fetched;
echo $topics;
if ($num_topics_fetched !== 0) {
    echo '<div class="row"><input type="submit" value="Unwatch selected" onclick="return confirm(\'Really remove selected topic(s) from your watchlist?\');" class="inline" /></div>';
}
echo '</form>';
require 'includes/footer.php';
Example #5
0
     $sql = DB::Prepare('SELECT id, time, replies, visits, headline FROM {P}Topics WHERE headline LIKE ? OR body LIKE ? ORDER BY id DESC LIMIT 50');
     $res = DB::Execute($sql, array($search_query, $search_query));
 } else {
     $sql = DB::Prepare('SELECT id, time, replies, visits, headline FROM {P}Topics WHERE headline LIKE ? ORDER BY id DESC LIMIT 50');
     $res = DB::Execute($sql, array($search_query));
 }
 if ($res->RecordCount() > 0) {
     echo '<h4 class="section">Topics</h3>';
     $search_topics->bind_result;
     $topics = new table();
     $columns = array('Headline', 'Replies', 'Visits', 'Age ▼');
     $topics->define_columns($columns, 'Headline');
     $topics->add_td_class('Headline', 'topic_headline');
     while ($row = $res->FetchRow()) {
         list($topic_id, $topic_time, $topic_replies, $topic_visits, $topic_headline) = $row;
         $values = array('<a href="/topic/' . $topic_id . '">' . str_ireplace($_GET['q'], '<em class="marked">' . htmlspecialchars($_GET['q']) . '</em>', htmlspecialchars($topic_headline)) . '</a>', replies($topic_id, $topic_replies), format_number($topic_visits), '<span class="help" title="' . format_date($topic_time) . '">' . calculate_age($topic_time) . '</span>');
         $topics->row($values);
     }
     $num_topics_fetched = $topics->num_rows_fetched;
     echo $topics->output('', true);
     if ($num_topics_fetched == 50) {
         echo '<p class="unimportant">(Tons of results found; stopping here.)</p>';
     }
 } else {
     echo '<p>(No matching topic headlines';
     if ($_GET['deep_search']) {
         echo ' or bodies';
     }
     echo '.)</p>';
 }
 if ($_GET['deep_search']) {