<commit_before><?
require_once("bootstrap.inc.php");

class PouetBoxGroupMain extends PouetBox
{
  var $id;
  var $group;

  function PouetBoxGroupMain($id) {
    parent::__construct();
    $this->uniqueID = "pouetbox_groupmain";
    $this->id = (int)$id;
  }

  function BuildURL( $param ) {
    $query = array_merge($_GET,$param);
    unset( $query["reverse"] );
    if($param["order"] && $_GET["order"] == $param["order"] && !$_GET["reverse"])
      $query["reverse"] = 1;
    return _html("groups.php?" . http_build_query($query));
  }
  function LoadFromDB() {
    $s = new SQLSelect();

    $this->group = PouetGroup::Spawn($this->id);
    $this->addeduser = PouetUser::Spawn($this->group->added);
    
    // not to boast or anything, but this is fucking beautiful.

    $sub = new SQLSelect();
    $sub->AddField("comments.quand");
    $sub->AddField("comments.who");
    $sub->AddField("comments.which");
    $sub->AddField("comments.rating");
    $sub->AddTable("comments");
    $sub->AddJoin("left","prods","prods.id = comments.which");
    $sub->AddOrder("comments.quand desc");
    $sub->AddWhere(sprintf_esc("(prods.group1 = %d) or (prods.group2 = %d) or (prods.group3 = %d)",$this->id,$this->id,$this->id));<commit_msg>ws bs<commit_after><?
require_once("bootstrap.inc.php");

class PouetBoxGroupMain extends PouetBox
{
  var $id;
  var $group;

  function PouetBoxGroupMain($id) {
    parent::__construct();
    $this->uniqueID = "pouetbox_groupmain";
    $this->id = (int)$id;
  }

  function BuildURL( $param ) {
    $query = array_merge($_GET,$param);
    unset( $query["reverse"] );
    if($param["order"] && $_GET["order"] == $param["order"] && !$_GET["reverse"])
      $query["reverse"] = 1;
    return _html("groups.php?" . http_build_query($query));
  }
  function LoadFromDB() {
    $s = new SQLSelect();

    $this->group = PouetGroup::Spawn($this->id);
    $this->addeduser = PouetUser::Spawn($this->group->added);

    // not to boast or anything, but this is fucking beautiful.

    $sub = new SQLSelect();
    $sub->AddField("comments.quand");
    $sub->AddField("comments.who");
    $sub->AddField("comments.which");
    $sub->AddField("comments.rating");
    $sub->AddTable("comments");
    $sub->AddJoin("left","prods","prods.id = comments.which");
    $sub->AddOrder("comments.quand desc");
    $sub->AddWhere(sprintf_esc("(prods.group1 = %d) or (prods.group2 = %d) or (prods.group3 = %d)",$this->id,$this->id,$this->id));
{'fraction_non_alphanumeric': 0.21172638436482086, 'fraction_numerical': 0.003257328990228013, 'mean_word_length': 4.11875, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6829734', 'n_tokens_mistral': 868, 'n_tokens_neox': 863, 'n_words': 144}