Skip to content

Commit

Permalink
simple stats ok
Browse files Browse the repository at this point in the history
  • Loading branch information
lud committed Aug 29, 2011
1 parent 10384ff commit 624a06a
Show file tree
Hide file tree
Showing 4 changed files with 262 additions and 463 deletions.
24 changes: 24 additions & 0 deletions classes/application.php
Expand Up @@ -54,6 +54,22 @@ public function get_counter($key, $section) {
return new TWStats_Counter($key, $section, $this);
}

public function get_counter_by_id($id) {

$table_name = $this->get_table_name('counters');
$query = 'select * from counters where id = :id';
$statement = $this->pdo_prepare($query);
$statement->execute(array('id' => $id));
$row = $statement->fetch(PDO::FETCH_ASSOC);
$section_id = $row['section_id'];
$section = $this->get_section_by_id($section_id);


$counter = new TWStats_Counter($row['strkey'], $section, $this);
$counter->set_id($id);
return $counter;
}

/**
*
* @param <type> $path
Expand All @@ -63,6 +79,14 @@ public function get_section($path) {
return new TWStats_Section($path, $this);
}

public function get_section_by_id($id) {
$section = new TWStats_Section(array(), $this);
$section->set_id($id);
$section->set_path_from_id();
return $section;
}




public function create_section($path) {
Expand Down

0 comments on commit 624a06a

Please sign in to comment.