Show
Ignore:
Timestamp:
09/07/06 04:38:25 (5 years ago)
Author:
benoitg
Message:
  • Fix #63
  • Fix problem with my Splash only user fix (I used match on the

user_id instead of the username).

  • Prevent the Splash only user from logging out, wrecking havock

in the tokens.

  • Do not allow SplashOnlyUser? to set his preferences.
  • Assigning a reusable content to a contentgroup element would

make it non-reusable.
Usability and UI fixes:

  • Allow other users to log in when they are at a splash only

node.

  • Make isSimpleContent class available for Simple content types.

Make it borderless and backgroundless in the default theme_pack.

  • Simplify HTML output for simple content.
  • Fix IE layout bug in node admin
  • Content linked to nodes and networks now edits in a new

window.

  • Remove "Add new node" menu item for consistency.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog-auth/wifidog/classes/Content/RssAggregator/RssAggregator.php

    r1090 r1092  
    6464class RssAggregator extends Content { 
    6565    /** 
    66  
     66     
    6767     */ 
    6868    private $content_rss_aggregator_row; 
    6969 
    7070    /** 
    71  
     71     
    7272     */ 
    7373    private $content_rss_aggregator_feeds_rows; 
    7474 
    7575    /** 
    76  
     76     
    7777     */ 
    7878    private $press_review; 
     
    114114        if ($content_rss_aggregator_rows != null) { 
    115115            $this->content_rss_aggregator_feeds_rows = $content_rss_aggregator_rows; 
    116         } 
    117         else { 
     116        } else { 
    118117            $this->content_rss_aggregator_feeds_rows = array (); 
    119118        } 
     
    139138                } 
    140139            } 
    141         } 
    142         else { 
     140        } else { 
    143141            $html = _("RSS support is disabled"); 
    144142        } 
     
    182180 
    183181            $retval = false; 
    184         } 
    185         else { 
     182        } else { 
    186183            /* 
    187184             * Successfull, but nothing modified 
     
    239236 
    240237            $retval = true; 
    241         } 
    242         else { 
     238        } else { 
    243239            /* 
    244240             * Successfull, but nothing modified 
     
    305301 
    306302            $retval = false; 
    307         } 
    308         else { 
     303        } else { 
    309304            /* 
    310305             * Successfull, but nothing modified 
     
    405400        $html .= "<div class='admin_element_label'>\n"; 
    406401        $html .= _("How much bonus feeds that do not publish as often get over feed that publish more often. 
    407                             The default is 0.75, with a typical range between 0 and 1. 
    408                             At 0, you have a classic RSS aggregator, meaning the n most recent entries picked from all feeds 
    409                             will be displayed. 1 is usually as high as you'll want to go:  Assuming that all 
    410                             an homogenous internal distribution (ex:  one feed publishes exactly one entry a day, the 
    411                             second once every two days, and the third once every three days), and you ask for 15 entries, 
    412                             there will be 5 of each.  While that may not sound usefull, it still is, as the feed's distribution is 
    413                             usually not homogenous."); 
     402                                            The default is 0.75, with a typical range between 0 and 1. 
     403                                            At 0, you have a classic RSS aggregator, meaning the n most recent entries picked from all feeds 
     404                                            will be displayed. 1 is usually as high as you'll want to go:  Assuming that all 
     405                                            an homogenous internal distribution (ex:  one feed publishes exactly one entry a day, the 
     406                                            second once every two days, and the third once every three days), and you ask for 15 entries, 
     407                                            there will be 5 of each.  While that may not sound usefull, it still is, as the feed's distribution is 
     408                                            usually not homogenous."); 
    414409        $html .= ": </div>\n"; 
    415410        $html .= "<div class='admin_element_data'>\n"; 
     
    428423        $html .= "<div class='admin_element_label'>\n"; 
    429424        $html .= _("Set the oldest entries (in seconds) you are willing to see.  Any entries older than this will not 
    430                             be considered at all for display, even if it means that the configured number of items to be displayed isn't reached. 
    431                             It's only usefull if all your feed publish very rarely, and you don't want very old entries to show up."); 
     425                                            be considered at all for display, even if it means that the configured number of items to be displayed isn't reached. 
     426                                            It's only usefull if all your feed publish very rarely, and you don't want very old entries to show up."); 
    432427        $html .= ": </div>\n"; 
    433428        $html .= "<div class='admin_element_data'>\n"; 
     
    473468 
    474469        $sql = "SELECT count, content_rss_aggregator_feeds.url, title FROM content_rss_aggregator_feeds 
    475                         JOIN (SELECT url, count(content_rss_aggregator_feeds.url) as count 
    476                         FROM content_rss_aggregator_feeds 
    477                         WHERE content_rss_aggregator_feeds.url NOT IN (SELECT url FROM content_rss_aggregator_feeds WHERE content_id='{$this->id}') 
    478                         GROUP BY content_rss_aggregator_feeds.content_id, content_rss_aggregator_feeds.url) 
    479                         AS available_feeds 
    480                         ON (available_feeds.url=content_rss_aggregator_feeds.url) 
    481                         ORDER by count DESC"; 
     470                                        JOIN (SELECT url, count(content_rss_aggregator_feeds.url) as count 
     471                                        FROM content_rss_aggregator_feeds 
     472                                        WHERE content_rss_aggregator_feeds.url NOT IN (SELECT url FROM content_rss_aggregator_feeds WHERE content_id='{$this->id}') 
     473                                        GROUP BY content_rss_aggregator_feeds.content_id, content_rss_aggregator_feeds.url) 
     474                                        AS available_feeds 
     475                                        ON (available_feeds.url=content_rss_aggregator_feeds.url) 
     476                                        ORDER by count DESC"; 
    482477 
    483478        $db->execSql($sql, $feed_urls, false); 
    484  
    485         foreach ($feed_urls as $feed_row) { 
    486             $tab[$i][0] = $feed_row['url']; 
    487             empty ($feed_row['title']) ? $title = $feed_row['url'] : $title = $feed_row['title']; 
    488             $tab[$i][1] = sprintf(_("%s, used %d times"), $title, $feed_row['count']); 
    489             $i++; 
    490         } 
    491  
     479        if ($feed_urls) { 
     480            foreach ($feed_urls as $feed_row) { 
     481                $tab[$i][0] = $feed_row['url']; 
     482                empty ($feed_row['title']) ? $title = $feed_row['url'] : $title = $feed_row['title']; 
     483                $tab[$i][1] = sprintf(_("%s, used %d times"), $title, $feed_row['count']); 
     484                $i++; 
     485            } 
     486        } 
    492487        $name = "rss_aggregator_{$this->id}_feed_add"; 
    493488        $html .= "<input type='text' size='60' value='' name='$name' id='$name'>\n"; 
     
    563558     * 
    564559     * @return string HTML code for the administration interface 
    565  
     560     
    566561     */ 
    567562    private function getFeedAdminUI($feed_row) { 
     
    602597        if ($calculated_pub_interval == true) { 
    603598            $html .= sprintf(_("The feed publishes an item every %.2f day(s)"), $calculated_pub_interval / (60 * 60 * 24)); 
    604         } 
    605         else { 
     599        } else { 
    606600            $html .= "<div class='admin_element_label'><span class='warningmsg'>" . _("WARNING:  This feed does not include the publication dates. 
    607                                                                                                  The system needs to be able to compute approximate publication 
    608                                                                                                  date for each entry, so the entry can be weighted against the 
    609                                                                                                  others. In order for the aggregator to do a good job, you need 
    610                                                                                                  to estimate fublication frequency of the items, in days. 
    611                                                                                                  If unset, defaults to one day.") . ": </span></div>\n"; 
     601                                                                                                                             The system needs to be able to compute approximate publication 
     602                                                                                                                             date for each entry, so the entry can be weighted against the 
     603                                                                                                                             others. In order for the aggregator to do a good job, you need 
     604                                                                                                                             to estimate fublication frequency of the items, in days. 
     605                                                                                                                             If unset, defaults to one day.") . ": </span></div>\n"; 
    612606            $html .= "<div class='admin_element_data'>\n"; 
    613607            $name = "rss_aggregator_" . $this->id . "_feed_" . md5($feed_row['url']) . "_default_publication_interval"; 
     
    615609            if (!empty ($feed_row['default_publication_interval'])) { 
    616610                $value = $feed_row['default_publication_interval'] / (60 * 60 * 24); 
    617             } 
    618             else { 
     611            } else { 
    619612                $value = ''; 
    620613            } 
     
    631624        $html .= "<li class='admin_element_item_container'>\n"; 
    632625        $html .= "<div class='admin_element_label'>" . _("The bias to be given to the source by the selection algorithm. 
    633                                                                 Bias must be > 0 , typical values would be between 0.75 and 1.5 
    634                                                                 and default is 1 (no bias).  A bias of 2 will cause the items 
    635                                                                 to \"look\" twice as recent to the algorithm. A bias of 0.5 to 
    636                                                                 look twice as old. Be carefull, a bias of 2 will statistically 
    637                                                                 cause the feed to have MORE than twice as many items displayed.") . ": </div>\n"; 
     626                                                                                    Bias must be > 0 , typical values would be between 0.75 and 1.5 
     627                                                                                    and default is 1 (no bias).  A bias of 2 will cause the items 
     628                                                                                    to \"look\" twice as recent to the algorithm. A bias of 0.5 to 
     629                                                                                    look twice as old. Be carefull, a bias of 2 will statistically 
     630                                                                                    cause the feed to have MORE than twice as many items displayed.") . ": </div>\n"; 
    638631        $html .= "<div class='admin_element_data'>\n"; 
    639632 
     
    656649     * 
    657650     * @return void 
    658  
     651     
    659652     */ 
    660653    private function processFeedAdminUI($feed_row) { 
     
    680673        elseif (!is_numeric($bias) || $bias <= 0) { 
    681674            echo _("The bias must be a positive real number"); 
    682         } 
    683         else { 
     675        } else { 
    684676            /* 
    685677             * Successfull, but nothing modified 
     
    709701            elseif (!is_numeric($bias) || $bias <= 0) { 
    710702                echo _("The default publication must must be a positive integer or empty"); 
    711             } 
    712             else { 
     703            } else { 
    713704                /* 
    714705                 * Successfull, but nothing modified 
     
    732723        elseif (empty ($url)) { 
    733724            echo _("The URL cannot be empty!"); 
    734         } 
    735         else { 
     725        } else { 
    736726            /* 
    737727             * Successfull, but nothing modified 
     
    754744            try { 
    755745                $html = $this->press_review->get_rss_html($this->content_rss_aggregator_row['number_of_display_items']); 
    756             } 
    757             catch (Exception $e) { 
     746            } catch (Exception $e) { 
    758747                $html = sprintf(_("Could not get RSS feed: %s"), $feed_row['url']); 
    759748            } 
    760         /* Handle hyperlink clicktrough logging */ 
    761         $html = $this->replaceHyperLinks($html); 
    762  
    763         } 
    764         else { 
     749            /* Handle hyperlink clicktrough logging */ 
     750            $html = $this->replaceHyperLinks($html); 
     751 
     752        } else { 
    765753            $html = _("RSS support is disabled"); 
    766754        } 
     
    780768     * 
    781769     * @return void 
    782  
     770     
    783771     */ 
    784772    private function refresh() {