Please login or register.

Login with username, password and session length
Advanced search  

News:

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

Pages: 1 2 [3] 4 5

Author Topic: Categories and pages  (Read 27622 times)

centered

  • Guest
Re: Categories and pages
« Reply #30 on: October 04, 2007, 05:13:23 PM »

Pages = Position 3?
My apology EQ... right on... It slipped my mind... my search was quick, only to find references in snews.php (1.3) to "pages"... in the comment functions.  :P

No worries.  Now In addition to me trying to figure out a proper sql for this discussion, would it be neccessary to maintain the Positions or just think anew?

A similar structure could be

Position   Name
   1      Page
   2      Category
   3      Article
   4      Extra
   5      Floating Extra (my mod for example)
   6      Unpublished
Logged

Joost

  • Guest
Re: Categories and pages
« Reply #31 on: October 04, 2007, 06:13:27 PM »

I see no need for altering positioning. It defines how content is treated. Through positioning we can define whether an article or page can be part of a category or even subcategory. Or am I missing the point?


position 1 = article, position 2 = extra, position 3 = page That how sNews works ;)
Ughhh ... defining requirements in terms of technical implementation details will not help me. Haven't yet met editor who cares if some hidden field is 1,2,3 or 101 :P
That's what I been telling from the start. Editors (and don't forget the visitor), only see the behaviour. So ones that behaviour is altered, for them it gets a different meaning. Glad you finally found out. :-*
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: Categories and pages
« Reply #32 on: October 04, 2007, 06:31:04 PM »

Quote from: Joost
Editors (and don't forget the visitor), only see the behaviour. So ones that behaviour is altered, for them it gets a different meaning.

Oh, goodie -- a philosophical discussion! ;D
Visitors will see the behavior we allow them to see (within the defined range of the app of course). Using some finely tuned techniques and sleight of hand, we can trick them into seeing things they'd never thought of in the first place. But, that's not so much what this is about. Not for me anyway.

From my point of view we do need to alter the current structure. If that requires changing the position (id) of some elements, then that's what needs to be done. It'll break things, certainly. Mods will need to be rewritten. Db's may need reconfiguring. There's a saying that contains eggs, omelettes and the act of breaking ... this is along those lines.

But, the visitor won't notice much of that change, and I'm not entirely sure that the average editor will notice much either (a few new tools to play with, some tools in new places, yay!). Because we're darned good at making people see things our way. Right? No? Ok. ;)

Anyway, this seems pretty sane:
Quote from: equilni
Position   Name
   1      Page
   2      Category
   3      Article
   4      Extra
   5      Floating Extra (my mod for example)
   6      Unpublished
Logged

centered

  • Guest
Re: Categories and pages
« Reply #33 on: October 04, 2007, 09:02:24 PM »

Anyway, this seems pretty sane:
Quote from: equilni
Position   Name
   1      Page
   2      Category
   3      Article
   4      Extra
   5      Floating Extra (my mod for example)
   6      Unpublished

Ok so I guess I don't need my db ideas then?? Or maybe a new look at the db?

Idea 1
-----------------------------
Page 1
Page 2
 - Category 1
 --- Article (x10)
 - Category 2
etc etc

Sql could look like

pid | cid | aid | name | seftitle | etc
 1     0     1     About   about   
 1     0     2     Resume resume
 2     0     3     CMS    cms
 2     1     0     php      php
 2     1     4     Php Based CMS   php-based-cms
 2     2     0     Mysql   mysql
 2     2     5     Mysql Based CMS   mysql-based-cms

idea 2
--------------------------------------------
Page
Pid   Name   Seftitle   Description   Order   Published   Template

Categories
Cid   Name   Seftitle   Description   Order   Published   Pid

Articles
Aid   Rel (page #1 or Cat #2 for assoc)   Title   Seftitle  Text   Date   etc

Comments
Blah blah

Template
TId   name   cssid   pid

CSS
CSSId   Name Tid
Logged

codetwist

  • Hero Member
  • *****
  • Karma: 50
  • Posts: 940
Re: Categories and pages
« Reply #34 on: October 04, 2007, 10:50:29 PM »

I see no need for altering positioning. It defines how content is treated. Through positioning we can define whether an article or page can be part of a category or even subcategory. Or am I missing the point?
Doh ... It's true that one can put a whole mix of meanings into single atribute (type, then filtering, then may be positioning inside other elements, and so on); only problem with this is that it's also true that it's notoriously bad practice unless there are sound arguments for doing that. Haven't seen arguments here why positioning attribute should be as complicated as it's now nor why it should be even made more complex.

position 1 = article, position 2 = extra, position 3 = page That how sNews works ;)
Ughhh ... defining requirements in terms of technical implementation details will not help me. Haven't yet met editor who cares if some hidden field is 1,2,3 or 101 :P
That's what I been telling from the start. Editors (and don't forget the visitor), only see the behaviour. So ones that behaviour is altered, for them it gets a different meaning. Glad you finally found out. :-*
Dunno, all You talk about is positioning ... whatever it means for You. However, you fail to convey significance of that to me. And God forbid, users don't get different meaning the way You described it  IMHO. That way users as a rule are happily getting another service provider and somehow coincidentally showing self-cooked philosopher general direction of the way out :P

P.S. Anyway, one thing is behavior that's planned (not wanted) and another the way how it's going to be implemented (may be cutting off something of the ultimate behavior). For myself I already plotted both for short term and posted about them. Oversimplifying the case I'll go anytime for 80% of behavior wanted with the trade-off of doing just 20% of changes needed for 100% happiness :P
And I already said regarding Your vision - just go ahead and build it - after all this is MOD happy place ;) Or You don't want to churn out code but again are at Your favorite pissing-match sport here?
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: Categories and pages
« Reply #35 on: October 05, 2007, 02:19:13 AM »

Equilni -- Good! Progress! I like it! Idea 2 especially, but only because I understand it more clearly than idea 1. I'll confess to not having considered details like Template and their possible place in the mix, but now that I see where it could fit, it looks good to me.
Need to think more about all this.
Logged

Joost

  • Guest
Re: Categories and pages
« Reply #36 on: October 05, 2007, 02:36:36 AM »

Just to remind:
- I said something like 'positioning is not important.'
- Someone asked 'what's positioning'
- I explained.
That's all. Now that we've cleared the air, lets move on. ;)
Whatever you guys call philosophy, is actual a very practical approach. Take a look at Changing category into a section page (I changed the title a few minutes ago, to a more descriptive one, thanks to Fred).
At the frontend (the visitors side), it is fully functional, creating a clear sitestructure.  However, the workflow at the backend  is a bit crippled, I used extra to add the content, so a non-consistent workflow is being forced.
As soon as I have time (yep,there is the coming soon, I promise ;D sentence again), I will add a textaerea to function form_categories and a text field in table categories. So I am just a few bytes away from a category that behaves like a page or the other way around. :)


Logged

codetwist

  • Hero Member
  • *****
  • Karma: 50
  • Posts: 940
Re: Categories and pages
« Reply #37 on: October 05, 2007, 10:19:16 AM »

@ Joost : I didn't asked anything; so, next time answer to those who asked  >:(
Logged

centered

  • Guest
Re: Categories and pages
« Reply #38 on: October 31, 2007, 05:45:43 PM »

Been away for a bit but had time to think about the future of this idea since I am liking it more and more....

An idea if you will... shown in a new sql based on Page-Category-Article structure

Pages table similar to current 1.6 category table with the addition of pageorder and templateid.  Pageorder should have been default in 1.6.  Templateid for the idea of an inline template/css editor.
Code: [Select]
CREATE TABLE pages (
            id int(8) primary key auto_increment,
            name varchar(100) NOT NULL,
            seftitle varchar(100) default NULL,
            description varchar(255) NOT NULL,
            published varchar(4) NOT NULL default 'YES',
            pageorder smallint(6) NOT NULL default '0',
            templateid varchar(10) NOT NULL default 'Default'
);         
            INSERT INTO pages VALUES (0, 'Home', NULL, 'Home', 'Yes', '0', 1);


Category table similar to 1.6 with the exception of pageid to allow cateories to be a sub-structure to the Page and subcat for subcategories
Code: [Select]
CREATE TABLE categories (
            id int(8) primary key auto_increment,
            name varchar(100) NOT NULL,
            seftitle varchar(100) NOT NULL,
            description varchar(255) NOT NULL,
            published varchar(4) NOT NULL default 'YES',
            catorder smallint(6) NOT NULL default '0',
            pageid smallint(6) NOT NULL default '0',
  subcatof INT(8) NOT NULL default '0'
);         
            INSERT INTO categories VALUES (0, 'Uncategorized', 'uncategorized', 'Articles don't belong anyplace else.', 'Yes', 0, 0, 0);

Article table remains the same but the position structure should change to something similar to the following:

Position   Name
   1      Page
   2      Category
   3      Article
   4      Extra
   5      Floating Extra (my mod for example)
   6      Unpublished

Position 1 for a center() Page article
Position 2 for a center() Category article - hinting from a 1.4 high priority mod
Position 3 for category articles - current function
Position 4 for Extra articles - current function
Position 5 for Floating Extra - my mod
Position 6 Unpublished - current function

Code: [Select]
CREATE TABLE articles (
            id int(11) primary key auto_increment,
            title varchar(100) default NULL,
            seftitle varchar(100) default NULL,
            `text` longtext,
            `date` datetime default NULL,
            category int(8) NOT NULL default '0',
            position int(6) default NULL,
            displaytitle char(3) NOT NULL default 'YES',
            displayinfo char(3) NOT NULL default 'YES',
            commentable varchar(5) NOT NULL default '',
            published int(3) NOT NULL default '1',
            description_meta varchar(255) default NULL,
            keywords_meta varchar(255) default NULL
);

CREATE TABLE comments (
            id int(11) primary key auto_increment,
            articleid int(11) default '0',
            name varchar(50),
            url varchar(100) NOT NULL,
            comment text,
            time datetime NOT NULL default '0000-00-00 00:00:00',
            approved varchar(5) NOT NULL default 'True'
);

/* Template  table for putting templates in the database */
Code: [Select]
CREATE TABLE templates (
            id int(8) primary key auto_increment,
            name varchar(100) NOT NULL,
            description varchar(255) NOT NULL,
            `text` longtext,
            styleid varchar(10) NOT NULL default 'style'
);
            INSERT INTO templates VALUES (1, 'default', 'Default Template', 'INSERT TEMPLATE HERE', 'Style');

CREATE TABLE stylesheet (
            id int(8) primary key auto_increment,
            name varchar(100) NOT NULL,
            description varchar(255) NOT NULL,
            `text` longtext,
            template varchar(10) NOT NULL
);
            INSERT INTO templates VALUES (1, 'style', 'Default Stylesheet', 'INSERT CSS HERE', 1);

CREATE TABLE settings (
            id int(8) primary key auto_increment,
            name varchar(20) NOT NULL,
            `value` varchar(60) NOT NULL
);         
            INSERT INTO settings VALUES (1, 'website_title', 'sNews 1.6');
            INSERT INTO settings VALUES (2, 'home_sef', 'home');
            INSERT INTO settings VALUES (3, 'website_description', 'sNews CMS');
            INSERT INTO settings VALUES (4, 'website_keywords', 'new, site, snews');
            INSERT INTO settings VALUES (5, 'website_email', 'info@mydomain.com');
            INSERT INTO settings VALUES (6, 'contact_subject', 'Contact Form');
            INSERT INTO settings VALUES (7, 'language', 'EN');
            INSERT INTO settings VALUES (8, 'charset', 'UTF-8');
            INSERT INTO settings VALUES (9, 'date_format', 'd.m.Y. H:i');
            INSERT INTO settings VALUES (10, 'article_limit', '3');
            INSERT INTO settings VALUES (11, 'rss_limit', '5');
            INSERT INTO settings VALUES (12, 'display_page', '');
            INSERT INTO settings VALUES (13, 'display_new_on_home', '');
            INSERT INTO settings VALUES (14, 'display_pagination', '');
            INSERT INTO settings VALUES (15, 'num_categories', 'on');
            INSERT INTO settings VALUES (16, 'approve_comments', '');
            INSERT INTO settings VALUES (17, 'comments_order', 'ASC');
            INSERT INTO settings VALUES (18, 'comment_limit', '30');
            INSERT INTO settings VALUES (19, 'word_filter_enable', '');
            INSERT INTO settings VALUES (20, 'word_filter_file', '');
            INSERT INTO settings VALUES (21, 'word_filter_change', '');
            INSERT INTO settings VALUES (22, 'username', '098f6bcd4621d373cade4e832627b4f6');
            INSERT INTO settings VALUES (23, 'password', '098f6bcd4621d373cade4e832627b4f6');

Pages can be viewed as it is currently.  Page add should have the Hide/show option to show the extras and articles associated with it (hinted from mattonik's mod)
Categories can also be viewed the same way with a hide/show option for listing Categories and Category Articles (position 2)
« Last Edit: November 01, 2007, 12:40:22 PM by equilni »
Logged

piXelatedEmpire

  • MIA
  • ULTIMATE member
  • ******
  • Karma: 37
  • Posts: 1401
  • currently MIA
Re: Categories and pages
« Reply #39 on: November 01, 2007, 01:33:17 AM »

just added some code tags to clear it up a little ;)
Logged
my apologies to the sNews crew, but I will be MIA for the forseeable future

centered

  • Guest
Re: Categories and pages
« Reply #40 on: November 01, 2007, 12:44:03 PM »

Thanks piXelated. 

I corrected sql errors and attached a sql dump to develop around. 

I have a few more ideas but i need to test them out first before I post anything.  My subcat mod is on hold because of this if anyone is inquiring....
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: Categories and pages
« Reply #41 on: November 01, 2007, 02:04:54 PM »

I haven't given more thought to a sub-categories mod for a while either. It looks a bit formidable to me for the time being. However, if we can come up with a way of assigning pages by category... that would be quite useful for sites that have a lot of pages and less use for the articles/blog feature.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

centered

  • Guest
Re: Categories and pages
« Reply #42 on: November 01, 2007, 04:58:09 PM »

Well I guess a question would be is to work on this 'idea' which seems to be almost a rewrite or work on the subcat mod I had in process? 

If subcats is in more of a demand then I will work on the subcat mod and complete it.  If not, then I will work on this script.  I have some OOP ideas for this mod that may help... but my experience with OOP is next to NULL! lol
Logged

mike1

  • Full Member
  • ***
  • Karma: 6
  • Posts: 199
Re: Categories and pages
« Reply #43 on: November 01, 2007, 07:37:51 PM »

If subcats is in more of a demand then I will work on the subcat mod and complete it.  If not, then I will work on this script.  I have some OOP ideas for this mod that may help... but my experience with OOP is next to NULL! lol

Subcats, subcats; comon guys, join in the chorus  :)
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: Categories and pages
« Reply #44 on: November 01, 2007, 08:15:09 PM »

bah-- 'cats, schmatz... I'd rather see this mod done first if I may. ;)
And I think the latest development of it is bringing it real close to what I had in mind, so I think it looks very nice.
Remember: this first, then other mods. ;D
Logged
Pages: 1 2 [3] 4 5