I wanna create a new function Not Like near i like..
The function I like is this on u module???
function liked($url = 0) {
global $client, $content, $nav, $apps, $uhome, $ubase, $offset, $num_per_page, $page,$config, $menuon;
$profile = $this->settabmenu($url, 1,'u');
$res = sql_query("select stream_id from ".tb()."liked where uid='{$profile['id']}' order by id DESC limit 10");
while ($row = sql_fetch_array($res)) {
$res2 = sql_query("select s.*,u.username,u.avatar from ".tb()."streams as s left join ".tb()."accounts as u on u.id=s.uid where s.id='{$row['stream_id']}'");
$stream = sql_fetch_array($res2);
$stream['attachment'] = unserialize($stream['attachment']);
$output .= stream_display($stream);
}
if (substr_count($output,'user_post_left') > 9) {
$output .= '
<div id="morestream_box"></div>
<div>
<script>
$(document).ready(function(){
$("#morestream_button").click(function() {
$(this).hide();
$("#morestream_box").html("<img src=\"'.uhome().'/files/loading.gif\" /> Carregant");
$.post("'.uhome().'/index.php?p=jquery/morelikestream",
{offset:$("#stream_offset").val(),uid:'.$profile['id'].'},
function(data){
var currentVal = parseInt( $("#stream_offset").val() );
$("#stream_offset").val(currentVal + 10);
$("#morestream_box").before(data);
if (data) {
$("#morestream_button").show();
}
$("#morestream_box").html("");
},"html"
);
return false;
});
});
</script>
<input type="hidden" id="stream_offset" value="10" />
<a href="#" id="morestream_button"><strong>'.t('See More').'</strong></a>
</div>';
}
$current_sub_menu['href'] = 'u/'.$profile['username'].'/liked';
section(array('title'=>t('Liked'),'content'=>$output)
);
}
|