
Modul script likes for JohnCMS
Coding by Fast666
http://waphacker.net
 
1. Upload like.png to folder /images
2. Upload install.php to root directory your host and run it http://yourdomain/install.php and delete it after installation finish..
3. Edit index.php on directory forum, the code below
4. Default script using indonesian language..You c
an change it to your language..Or visit my site if you confuse to coding it..Thanks
@Fast666
########## open and edit file forum/index.php
* first :
########## Find code below..#############################
                forum_new(1);
                if ($rights < 7 && $type1['close'] == 1) {
                    echo '<div class="rmenu"><p>Topik dihapus!<br/><a href="?id=' . $type1['refid'] . '">Sub forum</a></p></div>';
                    require_once ("../incfiles/end.php");
                    exit;
                }
############ put code below, after code above #############                ##############Likes submit
            $checklikedau = mysql_query('SELECT COUNT(*) FROM `forum_like` WHERE `userlike` = "' . $user_id . '" and `topic` = "' . $_GET['likes'] . '" and `user` = "' . $_GET['user'] . '"');
                if ($user_id && $user_id != $_GET['user'] && (mysql_result($checklikedau, 0) < 1)) {
                if ((isset ($_GET['like']))&&(isset ($_GET['user']))&&(isset ($_GET['likes']))) {
               
                   
                   echo '<div class="menu" id="likesyou"><b>anda telah menyukai artikel ini !</b></div>';
                               mysql_query("INSERT INTO `forum_like` SET
         `user` = '".trim($_GET['user'])."',
         `topic` = '".trim($_GET['likes'])."' ,
         `time` = '$realtime',
         `userlike` = '$user_id',
         `chude` = '".$_GET["id"]."'
                        ");
         $congcamonz=mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "' . trim($_GET['user']) . '"'));
            mysql_query("UPDATE `users` SET `like_duoc`='" . ($congcamonz['like_duoc'] + 1) . "' WHERE `id` = '" . trim($_GET['user']) . "'");
            mysql_query("UPDATE `users` SET `like_di`='" . ($datauser['like_di'] + 1) . "' WHERE `id` = '" . $user_id . "'");
                  
                }
}
                                  
                ##########end likes!
* NEXT:
############# find code below #######################
                    if (!empty ($res['status']))
                        echo '<div class="status"><img src="../theme/' . $set_user['skin'] . '/images/label.png" alt="" align="middle"/>' . $res['status'] . '</div>';
############################ put code below, after code above

                    //get data likes
                    $checklike = mysql_query('SELECT COUNT(*) FROM `forum_like` WHERE `userlike` = "' . $user_id . '" and `topic` = "' . $res['id'] . '" and `user` = "' . $res['user_id'] . '"');
                    if ($user_id && $user_id != $res['user_id'] && (mysql_result($checklike, 0) < 1)) {
                    echo'<a href="index.php?id=' . $id . '&amp;likes=' . $res['id'] . '&amp;user=' . $res['user_id'] . '&amp;start=' . $start . '&amp;like#likesyou"><img src="../images/like.png" width="60" height="20" alt="likes!"/>';
                    echo '</a>';
                    }


* next:
############ find this code
                        echo 'Download: ' . $fres['dlcount'] . ' time.</span>';
                    }
###########################
put code below, after code above

$thongkelike = mysql_query("SELECT COUNT(*) from `forum_like` where `topic`='" . $res["id"] . "'");
$thongkelikes = mysql_result($thongkelike, 0); 
                   // $thongkelikes=mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_like` WHERE `topic` = "' . $res['id'] . '"')), 0);
                          $thongkeaz= @mysql_query("select * from `forum_like` where `topic` = '" . $res['id'] . "'");
                    $thongkez=mysql_fetch_array($thongkeaz);
                    $idthongkez=trim($_GET['idthongkez']);
                      if($thongkelikes>0&&(empty($_GET['idthongkez'])))
                    {echo'<div><b style="color:red;"><a href="index.php?id=' . $id . '&amp;start=' . $start . '&amp;idthongkez='.$thongkez['id'].'#'.$thongkez['id'].'">'.$thongkelikes.'</a> orang menyukai artikel ini</b></div>';}
                    if(!empty($idthongkez)&&$thongkez['id']==$idthongkez)
                    {echo'<div id="'.$idthongkez.'" class="camon">Poeple Liked: ';
                             $thongkeaaz= @mysql_query("select * from `forum_like` where `topic` = '" . $res['id'] . "'");
while ($thongkeaz = mysql_fetch_array($thongkeaaz))
{
    {
   $dentvz=mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$thongkeaz['userlike'].'"'));
   echo '<a href="/str/anketa.php?id='.$thongkeaz['userlike'].'">'.$dentvz['name'].'</a>, ';
                    }
    ++$f;
}
   echo'</div>';}

####### Save & close forum/index.php

//Thank you for using my script.hope you allway happy when go to my forum waphacker.net