Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSS pentru declarații #51

Open
andreicristianpetcu opened this issue Sep 30, 2012 · 1 comment
Open

RSS pentru declarații #51

andreicristianpetcu opened this issue Sep 30, 2012 · 1 comment
Assignees

Comments

@andreicristianpetcu
Copy link
Member

80% complet. Am adăugat RSS pentru pagina de declarații. Mai trebuie să fac puțină curățenie.

--- www/hp-includes/person_class.php    2012-09-29 17:35:56.551697523 +0300
+++ www/hp-includes/person_class.php    2012-09-30 00:19:08.140792747 +0300
@@ -643,5 +643,12 @@

     return $details;
   }
+  
+  /**
+   * Returns the name of the person that can be put in a URL.
+   */
+  public function getNameForUrl() {
+   return str_replace(' ', '+', $this->name);
+  }
 }
 ?>
--- www/index.php   2012-09-29 17:35:56.563697523 +0300
+++ www/index.php   2012-09-29 22:55:43.352840476 +0300
@@ -7,6 +7,14 @@
 // Include the templating engine class.
 include ('smarty/Smarty.class.php');

+/**
+ * Checks whether it is a RSS request
+ * the politics map.
+ * @return {Boolean} True when we should load the blog.
+ */
+function isRssRequest() {
+  return ($_GET['cid'] && $_GET['cid'] >= 50 && $_GET['cid'] <= 100 );  // the rss sections are starting from 50 to 100  
+}

 /**
  * Checks whether we should load the blog instead of loading the main page of
@@ -19,24 +27,32 @@
          (!$_GET['cid'] && $_GET['feed']);        // the rss feed
 }

+if(!isRssRequest()){
+   if (shouldLoadBlog()) {
+     /**
+      * Tells WordPress to load the WordPress theme and output it.
+      * TODO(vivi): I don't remember why this needs to be defined here.
+      * @var bool
+      */
+     define('WP_USE_THEMES', true);
+   
+     // Loads the WordPress Environment and Template.
+     require('./wp-blog-header.php');
+   } else {
+     // If we're not loading the blog, just load our main page. Do load the
+     // wp-config so that we can use the fact that the user is logged in.
+     require_once('./wp-config.php');
+   
+     // Loads the Politics Map front page that displays numbers and stuff.
+     require('./hp-index.php');
+   }
-
-if (shouldLoadBlog()) {
-  /**
-   * Tells WordPress to load the WordPress theme and output it.
-   * TODO(vivi): I don't remember why this needs to be defined here.
-   * @var bool
-   */
-  define('WP_USE_THEMES', true);
-
-  // Loads the WordPress Environment and Template.
-  require('./wp-blog-header.php');
-
 } else {
+   // If we're not loading the blog, just load our main page. Do load the
+   // wp-config so that we can use the fact that the user is logged in.
+   require_once('./wp-config.php');
+
+   // If we're not loading the blog, just load our main page. Do load the
+   // wp-config so that we can use the fact that the user is logged in.
+   require('pages/rss/rss_person_declarations.php');
-  // If we're not loading the blog, just load our main page. Do load the
-  // wp-config so that we can use the fact that the user is logged in.
-  require_once('./wp-config.php');
-
-  // Loads the Politics Map front page that displays numbers and stuff.
-  require('./hp-index.php');
 }
 ?>
@okvivi
Copy link
Member

okvivi commented Oct 17, 2012

O să redeschid issue-ul ăsta. Putem să includem întreg textul declarației în feed? Nu mi-au plăcut niciodată feed-urile care oferă doar un sumar și mă forțează să vizitez site-ul original ca să citesc.

@okvivi okvivi reopened this Oct 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants