aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-07-19 01:43:23 -0700
committerfriendica <info@friendica.com>2012-07-19 01:43:23 -0700
commit3b1c2ce0012eab78482e9695bb7f1ca60feca050 (patch)
tree2df212e5659e8eec4f6ccbd93dda45328fb721df
parentf0fd22d01bbf57dd5d50e36f6b1e1a1cc7bd2af5 (diff)
downloadvolse-hubzilla-3b1c2ce0012eab78482e9695bb7f1ca60feca050.tar.gz
volse-hubzilla-3b1c2ce0012eab78482e9695bb7f1ca60feca050.tar.bz2
volse-hubzilla-3b1c2ce0012eab78482e9695bb7f1ca60feca050.zip
the main slider sort of works for testing now
-rw-r--r--mod/network.php44
-rw-r--r--view/contact_slider.tpl2
-rw-r--r--view/main_slider.tpl10
-rw-r--r--view/theme/duepuntozero/style.css9
4 files changed, 45 insertions, 20 deletions
diff --git a/mod/network.php b/mod/network.php
index 8c8d9140d..bb4c3e419 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -92,21 +92,6 @@ function network_init(&$a) {
);
}
- $tpl = get_markup_template('main_slider.tpl');
- $a->page['content'] .= replace_macros($tpl,array(
- '$me' => t('Me'),
- '$intimate' => t('Best Friends'),
- '$friends' => t('Friends'),
- '$coworkers' => t('Co-workers'),
- '$oldfriends' => t('Former Friends'),
- '$acquaintances' => t('Acquaintances'),
- '$world' => t('Everybody')
- ));
-
- // search terms header
- if(x($_GET,'search')) {
- $a->page['content'] .= '<h2>' . t('Search Results For:') . ' ' . htmlspecialchars($search) . '</h2>';
- }
$a->page['aside'] .= group_side('network','network',true,$group_id);
$a->page['aside'] .= posted_date_widget($a->get_baseurl() . '/network',local_user(),false);
@@ -401,6 +386,25 @@ function network_content(&$a, $update = 0) {
}
if(! $update) {
+
+
+ $tpl = get_markup_template('main_slider.tpl');
+ $o .= replace_macros($tpl,array(
+ '$val' => intval($cmin) . ';' . intval($cmax),
+ '$refresh' => t('Refresh'),
+ '$me' => t('Me'),
+ '$intimate' => t('Best Friends'),
+ '$friends' => t('Friends'),
+ '$coworkers' => t('Co-workers'),
+ '$oldfriends' => t('Former Friends'),
+ '$acquaintances' => t('Acquaintances'),
+ '$world' => t('Everybody')
+ ));
+
+ // search terms header
+ if($search)
+ $o .= '<h2>' . t('Search Results For:') . ' ' . htmlspecialchars($search) . '</h2>';
+
if($group) {
if(($t = group_public_members($group)) && (! get_pconfig(local_user(),'system','nowarn_insecure'))) {
notice( sprintf( tt('Warning: This group contains %s member from an insecure network.',
@@ -604,6 +608,13 @@ function network_content(&$a, $update = 0) {
$pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage']));
}
+
+ if(($cmin != 0) || ($cmax != 99)) {
+
+ $sql_nets .= " AND `contact`.`closeness` >= " . intval($cmin) . " ";
+ $sql_nets .= " AND `contact`.`closeness` <= " . intval($cmax) . " ";
+ }
+
$simple_update = (($update) ? " and `item`.`unseen` = 1 " : '');
if($nouveau) {
@@ -653,7 +664,7 @@ function network_content(&$a, $update = 0) {
}
else {
-
+dbg(1);
$r = q("SELECT `item`.`id` AS `item_id`, `contact`.`uid` AS `contact_uid`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
@@ -663,6 +674,7 @@ function network_content(&$a, $update = 0) {
ORDER BY `item`.$ordering DESC $pager_sql ",
intval(local_user())
);
+dbg(0);
}
// Then fetch all the children of the parents that are on this page
diff --git a/view/contact_slider.tpl b/view/contact_slider.tpl
index 9b8a52320..1334f58b1 100644
--- a/view/contact_slider.tpl
+++ b/view/contact_slider.tpl
@@ -1,4 +1,4 @@
-<div id="slider" style="height: 32px; position: relative; left: 5%; width: 90%;"><input id="contact-range" type="text" name="fake-closeness" value="$val" /></div>
+<div id="contact-slider" class="slider" style="height: 32px; position: relative; left: 5%; width: 90%;"><input id="contact-range" type="text" name="fake-closeness" value="$val" /></div>
<script>
$("#contact-range").slider({ from: 0, to: 99, step: 1, scale: ['$me', '$intimate', '|', '$friends', '|', '$coworkers', '|', '$oldfriends', '|', '$acquaintances', '|', '$world' ], onstatechange: function(v) { $("#contact-closeness-mirror").val(v); } });
</script>
diff --git a/view/main_slider.tpl b/view/main_slider.tpl
index 8792fe1dc..bc9a60ed1 100644
--- a/view/main_slider.tpl
+++ b/view/main_slider.tpl
@@ -1,10 +1,14 @@
-<div id="slider" style="height: 32px; position: relative; left: 5%; width: 90%;"><input id="main-range" type="text" name="cminmax" value="0;99" /></div>
+<div id="main-slider" class="slider" style="height: 32px; position: relative; left: 5%; width: 80%;"><input id="main-range" type="text" name="cminmax" value="$val" /></div>
+<input id="slider-refresh" type="submit" name="submit" value="$refresh" onclick="networkRefresh();" /><div class="clear"></div>
<script>
$("#main-range").slider({ from: 0, to: 99, step: 1, scale: ['$me', '$intimate', '|', '$friends', '|', '$coworkers', '|', '$oldfriends', '|', '$acquaintances', '|', '$world' ], onstatechange: function(v) {
var carr = v.split(";");
network_cmin = carr[0];
network_cmax = carr[1];
- var newcmd = buildCmd();
- var f;
} });
+
+ function networkRefresh() {
+ window.location.href = buildCmd();
+ }
+
</script>
diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css
index 1be81d738..30f92dd85 100644
--- a/view/theme/duepuntozero/style.css
+++ b/view/theme/duepuntozero/style.css
@@ -3273,3 +3273,12 @@ ul.menu-popup {
#datebrowse-sidebar select {
margin-left: 25px;
}
+
+#main-slider {
+ float: left;
+}
+#slider-refresh {
+ float: right;
+ margin-right: 25px;
+ margin-top: 7px;
+}