diff options
-rw-r--r-- | phpfspot.class.php | 20 | ||||
-rw-r--r-- | phpfspot.js | 6 | ||||
-rw-r--r-- | rpc.php | 4 | ||||
-rw-r--r-- | themes/default/templates/tags.tpl | 2 |
4 files changed, 21 insertions, 11 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php index eaa788a..edf3965 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -523,6 +523,7 @@ class PHPFSPOT { */ public function getAvailableTags() { + /* retrive tags from database */ $this->get_tags(); $output = ""; @@ -566,10 +567,10 @@ class PHPFSPOT { if(isset($_SESSION['selected_tags']) && in_array($key, $_SESSION['selected_tags'])) continue; - // calculate CSS font-size - // find the $value in excess of $min_qty - // multiply by the font-size increment ($size) - // and add the $min_size set above + // calculate CSS font-size + // find the $value in excess of $min_qty + // multiply by the font-size increment ($size) + // and add the $min_size set above $size = $min_size + (($value - $min_qty) * $step); // uncomment if you want sizes in whole %: $size = ceil($size); @@ -594,9 +595,11 @@ class PHPFSPOT { */ public function getSelectedTags() { + /* retrive tags from database */ $this->get_tags(); $output = ""; + foreach($this->avail_tags as $tag) { // return all selected tags @@ -605,8 +608,13 @@ class PHPFSPOT { } } - $output = substr($output, 0, strlen($output)-2); - print $output; + if($output != "") { + $output = substr($output, 0, strlen($output)-2); + return $output; + } + else { + return "no tags selected"; + } } // getSelectedTags() diff --git a/phpfspot.js b/phpfspot.js index b196a68..26e5090 100644 --- a/phpfspot.js +++ b/phpfspot.js @@ -160,10 +160,12 @@ function AskServerWhatToDo() return HTML_AJAX.grab(encodeURI('rpc.php?action=what_to_do')); } -function init_phpfspot() +function init_phpfspot(mode) { + /* always load list of available tags */ refreshAvailableTags(); + /* ask the server what we are currently displaying */ whattodo = AskServerWhatToDo(); if(whattodo == 'showpi' || whattodo == 'showpi_date') { @@ -179,7 +181,7 @@ function init_phpfspot() refreshSelectedTags(); } } -} +} // init_phpfspot() function setBackGrdColor(item, color) { @@ -54,11 +54,11 @@ class PHPFSPOT_RPC { break; case 'show_available_tags': - $fspot->getAvailableTags(); + print $fspot->getAvailableTags(); break; case 'show_selected_tags': - $fspot->getSelectedTags(); + print $fspot->getSelectedTags(); break; case 'addtag': diff --git a/themes/default/templates/tags.tpl b/themes/default/templates/tags.tpl index 4f32ad0..21469d8 100644 --- a/themes/default/templates/tags.tpl +++ b/themes/default/templates/tags.tpl @@ -27,7 +27,7 @@ </tr> <tr> <td class="selected_tags"> - <div id="selected_tags"></div> + <div id="selected_tags">no tags selected</div> </td> </tr> <tr> |