]> git.mxchange.org Git - friendica-addons.git/blobdiff - page/page.php
SN apply debugging info to the log as for Twitter
[friendica-addons.git] / page / page.php
index 584ac55647f4d70f6dcb424899b85220d098596d..129af41249f05a5a4cb03fc8d580524dfcec9f29 100755 (executable)
@@ -1,7 +1,7 @@
 <?php
 /**
  * Name: Page
- * Description: Shows lists of community pages (improved performance over 'pages)
+ * Description: Shows lists of community pages (improved performance over 'pages')
  * Version: 1.0
  * Author: Mike Macgirvin <mike@macgirvin.com>
  * based on pages plugin by
@@ -24,7 +24,8 @@ function page_getpage($uid) {
        $pagelist = array();
 
        $contacts = q("SELECT `id`, `url`, `name`, `micro`FROM `contact`
-                       WHERE `network`= 'dfrn' AND `forum` = 1 AND `uid` = %d",
+                       WHERE `network`= 'dfrn' AND `forum` = 1 AND `uid` = %d
+                       order by name asc ",
                        intval($uid)
        );
 
@@ -44,17 +45,31 @@ function page_page_end($a,&$b) {
 
        $page = '<div id="page-sidebar" class="widget">
                        <div class="title tool">
-                       <h3>'.t("Community Pages").'</h3></div>
+                       <h3>'.t("Forums").'</h3></div>
                        <div id="sidebar-page-list"><ul>';
 
+
        $contacts = page_getpage($a->user['uid']);
 
+       $total_shown = 0;
+       $more = false;
+
        foreach($contacts as $contact) {
-               $page .= '<li style="list-style-type: none;" class="tool"><img height="16" width="16" src="' . $contact['micro'] .'" alt="' . $contact['url'] . '" /> <a href="'.$a->get_baseurl().'/redir/'.$contact["id"].'" class="label" target="external-link">'.
+               $page .= '<li style="list-style-type: none;" class="tool"><img height="20" width="20" src="' . $contact['micro'] .'" alt="' . $contact['url'] . '" /> <a href="'.$a->get_baseurl().'/redir/'.$contact["id"].'" title="' . $contact['url'] . '" class="label" target="external-link">'.
                                $contact["name"]."</a></li>";
+               $total_shown ++;
+               if($total_shown == 6) {
+                       $more = true;
+                       $page .= '</ul><div id="hide-comments-page-widget" class="fakelink" onclick="showHideComments(\'page-widget\');" >' . t('show more') 
+                               . '</div><div id="collapsed-comments-page-widget" style="display: none;" ><ul>';
+               } 
        }
+       if($more)
+               $page .= '</div>';
        $page .= "</ul></div></div>";
        if (sizeof($contacts) > 0)
                $a->page['aside'] = $page . $a->page['aside'];
 }
-?>
+
+
+