Login     Sign up
Button Not Like
Jordi Torres (@palsweb)
Join date: Oct 20th 2010
Community posts: 70
View Profile
Send Message

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)
        );

} 
164 months ago
Jordi Torres (@palsweb)
Join date: Oct 20th 2010
Community posts: 70
View Profile
Send Message

function comment_form($stream_id, $flag = '') {
global $config, $client;
if (!$client['id']) {
return '<div>>>'.url('member/login',t('Login to comment') ).'</div>';
}
if (!$flag) $flag = t('Comment');
if (!$config['comment_headed']) {
$comment_head =
'
<script>
$(document).ready( function(){
$(".quick_comment").click(function() {
$(this).next().next().css("display","block");
$(this).next().next().find(".commentmessage").focus();
return false;
});
$(".commentsubmit").click(function() {
if ($(this).prev()[0].value != "") {
var thiscomment = $(this).parents(".quick_comment_form");
var cbox = thiscomment.next().next();
var mbox = thiscomment.find(".commentmessage");
var tbox = thiscomment.next();
cbox.html("<img src=\"'.uhome().'/files/loading.gif\" /> Enviant");
$.post("'.uhome().'/index.php?p=jquery/comment_publish",
{message:mbox[0].value,target_id:tbox[0].value},
function(data){
cbox.html("");
cbox.after(data);
mbox.attr("value","");
},"html"
);
return false;
}
});
$(".dolike").click(function() {
var thiscomment = $(this).next();
var cbox = thiscomment.next().next();
var tbox = thiscomment.next();
cbox.html("<img src=\"'.uhome().'/files/loading.gif\" /> Enviant");
$.post("'.uhome().'/index.php?p=jquery/dolike",
{target_id:tbox[0].value},
function(data){
cbox.html("");
cbox.after(data);
},"html"
);
$(this).css("display","none");
return false;
});
});
</script>
';
$config['comment_headed'] = 1;
}
$res = sql_query("select * from ".tb()."liked where stream_id='$stream_id' and uid='{$client['id']}' limit 1");
if (sql_counts($res)) {
$likeit = '<a href="#" class="dolike">'.t('Unlike').'</a>';
}
else {
$likeit = '<a href="#" class="dolike">'.t('Like').'</a>';

164 months ago
kingmagi (@king10magi)
Join date: Sep 6th 2010
Community posts: 97
View Profile
Send Message

is this work?? and can u give more detail??

164 months ago
Umee (@umee)
Join date: Dec 5th 2011
Community posts: 3
View Profile
Send Message

is location where

151 months ago