×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: no future comments for an article

no future comments for an article 15 years 10 months ago #1936

  • jani
  • jani's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 0
Hi,

I'd like to close specified articles from future comments. So the comments displayed but user couldn't post a new comment. Like in a forum. Any idea? To do it was very easy in Akocomment, Ako had only two files :-)

Merry Xmass!

no future comments for an article 15 years 10 months ago #1939

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
yep, I was thinking about this. We will make a list with all user wishes and then post a poll, which one should come in 4.1 (I believe this one will make it :))

no future comments for an article 15 years 10 months ago #1945

  • jani
  • jani's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 0
thanks in advance :-)

'till waiting for 4.1 I'm trying to solve the thing

in comment.class.php I added plus two simple lines:
function isBlocked($ip)
    {
$id = intval( mosGetParam( $_REQUEST, 'id', null ) );
if ( $id == "12555" ) return true;
 
        if ($this->_ban != '') {
            $ipList = split(',', $this->_ban);
            foreach($ipList as $item) {
                if (trim($item) == $ip) return true;
            }
        }
        return false;
    }

if I make an $id = "12555" it works on article with id 12555.

but something wrong with first line, I unable to get actual content's id :-(((


EDITED
$closed = $this->_content_id;
    if ( $closed == '12555' ) return true;

now I need an array with content ids and I almost done :-)

no future comments for an article 15 years 10 months ago #1947

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
try with
JRequest::getVar('id')

no future comments for an article 15 years 10 months ago #1950

  • jani
  • jani's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 0
tested with joomla 1.0.12, works like a penguin :)
function isBlocked($ip)
    {
 
//get actual content id
$lezart = $this->_content_id;
 
//get closed contents id from blacklist.txt - you need to create it
$zartcikkek = file('components/com_comment/joscomment/blacklist.txt');
 foreach($zartcikkek as $rip) {
 $rip = strtolower(trim($rip));
    if (strstr(strtolower($lezart), $rip)) return true;
 }
 
 
        if ($this->_ban != '') {
            $ipList = split(',', $this->_ban);
            foreach($ipList as $item) {
                if (trim($item) == $ip) return true;
            }
        }
        return false;
    }

blacklist.txt for example:
11071
11117
10881
9943
10037

(separated with enter, except the last, there are no empty lines!)

merry xmass and a happy new year! :)

no future comments for an article 15 years 5 months ago #4556

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
:) I've added this feature for the next release (beta1)
dev.compojoom.com/issues/show/13

coming out soon :)
  • Page:
  • 1
Time to create page: 0.116 seconds