Please login or register.

Login with username, password and session length
Advanced search  


Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Author Topic: Pretty cool!  (Read 4699 times)


  • Newbie
  • *
  • Karma: 1
  • Posts: 5
Pretty cool!
« on: September 17, 2008, 09:06:36 pm »

I just discovered sNews CMS. - Pretty cool.  I am still reading through code and postings to learn how it works. 

There's an aweful lot going on in that one file! I think the most confusing aspects so far are how the URLs work and how the URLs fetch pages.

Question: Is there a posting anywhere that talks about how the URLs work?




  • Guest
Re: Pretty cool!
« Reply #1 on: September 18, 2008, 01:55:22 am »

A url like is rewritten by the htaccess file to:

sNews then breaks the get request ($_GET['category'] ) into two parts: 'faq' (category) and 'faq' (article). Then the database is searched for both.



  • Newbie
  • *
  • Karma: 1
  • Posts: 5
Re: Pretty cool! More questions on URL values...
« Reply #2 on: September 18, 2008, 04:40:31 pm »


  • I should assume that $_GET['category'] is an expected parameter for all pages in sNews? 
  • Looks like all this magic is contained in the get_id function is that correct?
  • How does sNews handle multiple GET parameters?

Part of my thinking right now is that I would like to use sNews with my existing client site to drive all but the products page.  I have written a products module (not for sNews) that uses its own set of GET variables for Category, Groups and Product Ids and database.   It's quite elaborate and links to a cart.  But I do not have a any way for clients to edit there static content and would like to use sNews. To that end I am need to better understand how to adapt to sNews.

 I think I would have to specify somehow that when the page is "Products" to use my code instead or rewrite entire module.

I have been looking at several CMS's and Frameworks, all seem way too bloated,  way too complex and require a significant understanding of OOP.  sNews is different.  ALthough I'm not entirely sure I agree with the necessity of a single file.  I like to have some division for clarity of code.




  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: Pretty cool!
« Reply #3 on: September 18, 2008, 05:24:09 pm »

Code: [Select]
$url explode('/'clean($_GET['category']));
$categorySEF $url['0'];

$articleSEF = $url['1'];

but you can have

In this case, is about page 2 of trips category

so, $articleSEF = $url['1'] only if $url['1'] is not 'p_' ..... Again, the number of pages is extracted removing 'p_'

If you worked with several (distinct) pages you will have problems adapting to one single file ... but depends...
« Last Edit: September 18, 2008, 05:27:32 pm by funlw65 »