Display the top 15 tags on the side bar
This commit is contained in:
parent
cd931befd6
commit
e0fb512c37
@ -39,7 +39,7 @@ class G3_Client_Controller extends Template_Controller {
|
|||||||
$post = new Validation($_POST);
|
$post = new Validation($_POST);
|
||||||
$post->add_rules("user", "required");
|
$post->add_rules("user", "required");
|
||||||
$post->add_rules("password", "required");
|
$post->add_rules("password", "required");
|
||||||
if ($valid =$post->validate()) {
|
if ($valid = $post->validate()) {
|
||||||
try {
|
try {
|
||||||
$token = G3Remote::instance()->get_access_token($post["user"], $post["password"]);
|
$token = G3Remote::instance()->get_access_token($post["user"], $post["password"]);
|
||||||
Session::instance()->set("g3_client_access_token", $token);
|
Session::instance()->set("g3_client_access_token", $token);
|
||||||
@ -76,11 +76,21 @@ class G3_Client_Controller extends Template_Controller {
|
|||||||
print $this->_get_detail($response->resource);
|
print $this->_get_detail($response->resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function tagged_album() {
|
||||||
|
$tags = $this->input->get("tags", "");
|
||||||
|
$response = G3Remote::instance()->get_resource("tag/$tags");
|
||||||
|
$this->auto_render = false;
|
||||||
|
print $this->_get_detail($response->resource);
|
||||||
|
}
|
||||||
|
|
||||||
public function block($type) {
|
public function block($type) {
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case "random":
|
case "random":
|
||||||
print $this->_get_image_block();
|
print $this->_get_image_block();
|
||||||
break;
|
break;
|
||||||
|
case "tags":
|
||||||
|
print "";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
print "";
|
print "";
|
||||||
}
|
}
|
||||||
@ -105,7 +115,7 @@ class G3_Client_Controller extends Template_Controller {
|
|||||||
$v->album_tree = $this->_get_album_tree($resource);
|
$v->album_tree = $this->_get_album_tree($resource);
|
||||||
$v->detail = $this->_get_detail($resource);
|
$v->detail = $this->_get_detail($resource);
|
||||||
$v->image_block = $this->_get_image_block();
|
$v->image_block = $this->_get_image_block();
|
||||||
$v->tag_block = " ";
|
$v->tag_block = $this->_get_tag_block();
|
||||||
return $v;
|
return $v;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,4 +141,16 @@ class G3_Client_Controller extends Template_Controller {
|
|||||||
}
|
}
|
||||||
return $v;
|
return $v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function _get_tag_block() {
|
||||||
|
$response = G3Remote::instance()->get_resource("tag", array("limit" => "15"));
|
||||||
|
if ($response->status == "OK") {
|
||||||
|
$v = new View("tag_block.html");
|
||||||
|
$v->tags = $response->tags;
|
||||||
|
$v->max_count = $response->tags[0]->count;;
|
||||||
|
} else {
|
||||||
|
$v = "";
|
||||||
|
}
|
||||||
|
return $v;
|
||||||
|
}
|
||||||
} // End G3 Client Controller
|
} // End G3 Client Controller
|
||||||
|
@ -317,3 +317,80 @@ button.wc-button {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Tag cloud ~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||||
|
#wc-tag-cloud {
|
||||||
|
border: 3px inset;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wc-tag-cloud ul {
|
||||||
|
font-size: 1.2em;
|
||||||
|
text-align: justify;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wc-tag-cloud ul li {
|
||||||
|
display: inline;
|
||||||
|
line-height: 1.5em;
|
||||||
|
text-align: justify;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wc-tag-cloud ul li a {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wc-tag-cloud ul li span {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wc-tag-cloud ul li.size1 a {
|
||||||
|
color: #FF9933;
|
||||||
|
font-size: 80%;
|
||||||
|
font-weight: 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wc-tag-cloud ul li.size2 a {
|
||||||
|
color: #FF9933;
|
||||||
|
font-size: 90%;
|
||||||
|
font-weight: 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wc-tag-cloud ul li.size3 a {
|
||||||
|
color: #FF9933;
|
||||||
|
font-size: 100%;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wc-tag-cloud ul li.size4 a {
|
||||||
|
color: #FF9933;
|
||||||
|
font-size: 110%;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wc-tag-cloud ul li.size5 a {
|
||||||
|
color: #FF9933;
|
||||||
|
font-size: 120%;
|
||||||
|
font-weight: 900;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wc-tag-cloud ul li.size6 a {
|
||||||
|
color: #FF9933;
|
||||||
|
font-size: 130%;
|
||||||
|
font-weight: 900;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wc-tag-cloud ul li.size7 a {
|
||||||
|
color: #FF9933;
|
||||||
|
font-size: 140%;
|
||||||
|
font-weight: 900;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wc-tag-cloud ul li a:hover {
|
||||||
|
color: #f30;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wc-tag-cloud h3 {
|
||||||
|
color: #FF9933;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user