sNews Forum

Previous sNews versions => sNews 1.7 RC => sNews 1.7 RC => Topic started by: kuazo on October 10, 2008, 12:07:55 PM

Title: IMPROVE SNEWS 1.7 RC2
Post by: kuazo on October 10, 2008, 12:07:55 PM
Hello folks, i really like the RC2 but i have got some good issues here. hope you like something.

[Ay] make it valid

use html tidy firefox addon ( use sgml parser )

1. Logout ( meta refresh content not allowed here )
2. Comment sent ( meta refresh content not allowed here )
3. Ordering Page etc. ( meta refresh content not allowed here )

-> you can't use meta tag outside header
-> better use simple notification or connect it with new var in title function?

4. Your comment was not sent ( ul wrong )
5. New comment waiting for approve in administration ( meta tag before doctype declaration )


[Bi] make it useful

1. put the database host, name and pass into the template or seperate config file !!!
2. i used to have function.php and config.php

function ~ snews.php
config ~ language and system vars, database settings


reason: if you have got serveral projects running with snews. you only want to
update the function files. it is horrible to update snews.php for every new database.

[Ci] make it css

1. i would like to have checkbox class for earch checkbox. so we can style it in
administration - i just realised this in 1.6 - optimized for ie 6, ie 7, mozilla, opera


Quote
.checkbox {
margin-left: -4px;
margin-right: 2px;
vertical-align: middle;}

.checkbox:not([dummy]) {
margin-top: -4px;
margin-left: 0px;
margin-right: 5px;}

@media all and (min-width: 0px) { .checkbox {
margin-top: 0px !important;}}


2. better rename class "date" to "infoline" -> makes more sence to call something what it is :-)

3. use my button css hack ( i renamed searchbutton class to button class, but thats a matter of taste )
this hack kicks ass, i worked many days on it. ( optimized for ie 6, ie 7, mozilla, opera )

Quote
.button, #extra .button {
background-color: #fd8a2c;
padding-top: 4px;
padding-bottom: 2px;
padding-left: 0px;
padding-right: 0px;
color: #b1611f;
text-align: center;
text-transform: uppercase;
border-color: #b1611f;}

.button:not([dummy]), #extra .button:not([dummy]) {
padding-top: 4px;
padding-bottom: 4px;
padding-left: 4px;
padding-right: 5px;}

@media all and (min-width: 0px) { .button, #extra .button {
padding-top: 5px !important;
padding-bottom: 5px !important;
padding-left: 7px !important;
padding-right: 8px !important;}}

[Di] make it similar

1. global email script like a published in mod section
2. use fieldset in sitemap and archive ( is a matter of taste ) - but i realised this in 1.6

[Ee] make it hide

1. I want to be able to hide Contact, Sitemap, Home ( default pages ) from: navigation and sitemap!

reason: i used to make a styled contact page with function inclusion. so i don't need the standard contact
page any more.

[Ee] make it beautiful

1. give this link a try: http://thephppro.com/tools
it makes sence to use a optimizer before releasing a project thats was written by many people.
tried eclipse to do that but i really couln't cope with :-(
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: philmoz on October 10, 2008, 02:47:38 PM
Now, this is feed back.

use html tidy firefox addon ( use sgml parser )

1. Logout ( meta refresh content not allowed here )
2. Comment sent ( meta refresh content not allowed here )
3. Ordering Page etc. ( meta refresh content not allowed here )

-> you can't use meta tag outside header
-> better use simple notification or connect it with new var in title function?
I think directing to new title var is appropriate... but not easy.
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: kuazo on October 10, 2008, 04:33:05 PM
in editing or creating new articles / pages

1. there is still the invalid problem with html tags in a textfield... <br /> and <p></p> is not allowed.

-> i don't know a solution for that? maby [ br ] and [ p ] ... [ /p ] special tag with javascript?

2. id="edit_article" causes invalid failure

this id is used by div and by a input too... = id should be unique as you know for sure
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: skian on October 10, 2008, 08:35:14 PM
Update : fixed in latest RC2
[g] remove all references to script name (this is what _SITE is for, after all)
eg : replace all strings like
Code: [Select]
'._SITE.'index.php?action='; to
Code: [Select]
'._SITE.'?action=';My template name is NOT index.php...
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: Rui Mendes on October 10, 2008, 11:32:16 PM
Hello skian
I'm sorry, change
Quote
define('_SITE',site());_SITE
to
Quote
define('_SITE',site().'index.php');
is bad ideia

I'll explain: see this line
$_SESSION[_SITE.'Logged_In'] = token(); wont work with that change.

@kuazo
[Ay] make it valid
It's not valid? My sNews RC2 it was successfully checked as XHTML 1.0 Strict! (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.engcivil.net%2Fsnews%2Fen%2F&charset=%28detect+automatically%29&doctype=Inline&outline=1&group=0&verbose=1&user-agent=W3C_Validator%2F1.591)

Thank you VERY MUCH for the tips and css.

Karma 2U
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: skian on October 11, 2008, 12:40:09 AM
Hello skian
I'm sorry, change [...] is bad ideia

I'll explain: see this line
$_SESSION[_SITE.'Logged_In'] = token(); wont work with that change.

Sorry, my post wan't clear enough. I only want to remove references to "index.php" : "index.php" is a hard-coded string (this is bad), it doesn't match all snews installations. Again, i only want to remove "index.php" from string repersenting an url to another snews page.

For exemple, I'd like all url that looks like http://example.com/index.php?action=.... to be rewriten http://example.com/?action=...

So URLs should be coded : _SITE.'?action=...' instead of _SITE.'index.php?action=...'

Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: philmoz on October 11, 2008, 12:44:04 AM
@RUI, there may be some parts of admin that don't quite pass inspection...

My template name is NOT index.php...
That raises the question as to whether we should handle templating in a different manner.

currently, index.php is by default the html template with code calls inserted.

a different approach is to make index.php include snews.php, and then include the template.php file (which has the code calls inserted), but index.php doesn't have any html at all.
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: skian on October 11, 2008, 12:49:27 AM

My template name is NOT index.php...
That raises the question as to whether we should handle templating in a different manner.

currently, index.php is by default the html template with code calls inserted.

a different approach is to make index.php include snews.php, and then include the template.php file (which has the code calls inserted), but index.php doesn't have any html at all.


My point is that removing all references to "index.php" from snews.php allows user to choose which template render using appropriate .htaccess rules
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: philmoz on October 11, 2008, 12:51:29 AM
Hello skian
I'm sorry, change [...] is bad ideia

I'll explain: see this line
$_SESSION[_SITE.'Logged_In'] = token(); wont work with that change.

Sorry, my post wan't clear enough. I only want to remove references to "index.php" : "index.php" is a hard-coded string (this is bad), it doesn't match all snews installations. Again, i only want to remove "index.php" from string repersenting an url to another snews page.

For exemple, I'd like all url that looks like http://example.com/index.php?action=.... to be rewriten http://example.com/?action=...

So URLs should be coded : _SITE.'?action=...' instead of _SITE.'index.php?action=...'


yup... I tested a global replace of index.php? with ?  and seems to operate with minimal testing...
but needs thorough testing to ensure we don't break something
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: skian on October 11, 2008, 12:54:55 AM
yup... I tested a global replace of index.php? with ?  and seems to operate with minimal testing...
but needs thorough testing to ensure we don't break something
There is one single line where it should still be there :
Code: [Select]
$l['ignored_items'] = '.,..,cgi-bin,.htaccess,Thumbs.db,snews.php,index.php,lib.php,style.css,admin.js,'.s('language').'.php'; // list of files&folders ignored by upload/file list routine
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: philmoz on October 11, 2008, 01:00:07 AM
There is one single line where it should still be there :

the exact search for replacement I used was  "index.php?" so only those items with questionmark were replaced ;)
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: Joost on October 11, 2008, 01:03:02 AM
There is one single line where it should still be there :

the exact search for replacement I used was  "index.php?" so only those items with questionmark were replaced ;)
38 replacements, to be exact.

is bad ideia

I'll explain: see this line
$_SESSION[_SITE.'Logged_In'] = token(); wont work with that change.


I don't see any issues there.
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: skian on October 11, 2008, 01:11:23 AM
two other suggestions :

1.
In admin.js, let
str = str.replace(/[^a-z 0-9]+/g,'');
be
str = str.replace(/[^a-z 0-9-]+/g,'');
so that char '-' is allowed in SEF

2. I'd like genSEF not to modify the SEF when updating article title (as opposed to when creating a new one) so that existing (and possibly allready indexed by search engines) articles are not "moved" to another location. Of course, if needed, the user would still be able to modify the SEF manually

Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: philmoz on October 11, 2008, 01:15:35 AM
a clarification

... I only want to remove references to "index.php" : "index.php" is a hard-coded string (this is bad), it doesn't match all snews installations....
For exemple, I'd like all url that looks like http://example.com/index.php?action=.... to be rewriten http://example.com/?action=...
So URLs should be coded : _SITE.'?action=...' instead of _SITE.'index.php?action=...'
this doesn't require altering constant _SITE, but relies on htaccess and server to determine site root document -- if I have a handle on it...
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: skian on October 11, 2008, 01:20:36 AM
this doesn't require altering constant _SITE, [...]
no, _SITE should not be changed.
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: kuazo on October 13, 2008, 03:19:47 PM
index.php?action=process&task=deletecomment&articleid=35&id=125

the string for deleting and editing comments has got the articleid inside.
whats the reason for that? i deleted the articledid and it still works. not needed?

index.php?action=process&task=deletecomment&id=125

looks better and also works...
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: centered on October 14, 2008, 11:35:02 PM
index.php?action=process&task=deletecomment&articleid=35&id=125

the string for deleting and editing comments has got the articleid inside.
whats the reason for that? i deleted the articledid and it still works. not needed?

index.php?action=process&task=deletecomment&id=125

looks better and also works...

 I like my way better.... make the whole damn thing sef freindly!
domain.com/admin/process/comment/id=125

Either way, thanks for the feedback so far.. keep it coming!
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: Joost on October 15, 2008, 12:25:03 AM

 I like my way better.... make the whole damn thing sef freindly!
domain.com/admin/process/comment/id=125

Why would you want that?
I am thinking just the opposite: sef-friendliness for the outside world only. No need to make it more complicated.
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: centered on October 15, 2008, 01:22:10 AM
Scratches head**

Firstly, How is that more complicated?
And why would you not what to do that?
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: Joost on October 15, 2008, 01:37:37 AM
Scratches head**

Firstly, How is that more complicated?
And why would you not what to do that?

- It is more complicated, because you need extra steps to retrieve the $_GET.
- I would not do it because it is not needed.

Now I scratch my head.

And back on topic:

index.php?action=process&task=deletecomment&articleid=35&id=125

the string for deleting and editing comments has got the articleid inside.
whats the reason for that? i deleted the articledid and it still works. not needed?

index.php?action=process&task=deletecomment&id=125

looks better and also works...

@ kuazo, you are right. It is not needed and shouldn't be there.

Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: centered on October 15, 2008, 02:10:29 AM
Scratches head**

Firstly, How is that more complicated?
And why would you not what to do that?

- It is more complicated, because you need extra steps to retrieve the $_GET.
- I would not do it because it is not needed.

Now I scratch my head.

No need, I am scratching enough for the whole team.

1. It is no different from the current process. 
     - if logged in & $categorySEF == 'admin' then do your admin function
2. I can't debate whether it is needed or not, which I why I said "my way"
     - check the download in my link, I've already done it and it works nicely!

I see it this way:
 - the whole system is SEF enabled, not only the front end
 - the admin links are semantically correct, other than the id#
    - admin urls like this could be possible:  domain.com/admin/page/edit/page-one/subpage-two/
 - the idea for help , admin notes, etc are now able to be used - see this post (http://snewscms.com/forum/index.php?topic=7720.msg55531#msg55531)

what's neater, the top or bottom?
Code: [Select]
$frm_action = _SITE.'?action=process&amp;task=admin_category&amp;id='.$categoryid;
Code: [Select]
$frm_action = _SITE.'admin/category/process/id='.$categoryid;
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: Joost on October 15, 2008, 03:10:15 AM
It is different from the current process. It is not simply an extension. No doubt.
index.php?action=process&task=deletecomment&id=125 is semantically correct as well and search engines have no business backstage. Therefore there is no need to make it search engine friendly.
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: centered on October 15, 2008, 03:40:35 AM
It is different from the current process. It is not simply an extension. No doubt.
index.php?action=process&task=deletecomment&id=125 is semantically correct as well and search engines have no business backstage. Therefore there is no need to make it search engine friendly.

Dude, chill out. I am not asking to implement this into sNews at all, at least not now.
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: Joost on October 15, 2008, 03:51:53 AM
I am perfectly fine, Jason.

This is the topic title:  IMPROVE SNEWS 1.7 RC2. ;)

This, is your response:
index.php?action=process&task=deletecomment&articleid=35&id=125

the string for deleting and editing comments has got the articleid inside.
whats the reason for that? i deleted the articledid and it still works. not needed?

index.php?action=process&task=deletecomment&id=125

looks better and also works...

 I like my way better.... make the whole damn thing sef freindly!
domain.com/admin/process/comment/id=125

Either way, thanks for the feedback so far.. keep it coming!

How could I know you were referring to anything but  SNEWS 1.7 RC2 ?  ???


Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: centered on October 15, 2008, 03:57:40 AM
Just ask.

you - what are you referring to, that's not in 1.7RC?
me  - sorry, no it's not, I went off topic, my fault

Yes I did go way off topic, my fault and my apologies.
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: Joost on October 15, 2008, 04:30:00 AM
Well, I though you were referring to sNews 1.7 when you talked about sef uri. I didn't understand you were referring to your lite version.
By the way (also off topic), I installed the earliest lite version (http://snewscms.com/forum/index.php?topic=7720.msg55297#msg55297) (back then, it was  not a package) a few weeks ago.  It shows little resemblance with my project.
This project runs on my desktop. I also have a separate homepage, but the backend is the opposite: All admin pages have uri like: ?admin=content&id=3 etc. No sef uri found there, deliberately.
So there's gonna be some discussion about future sNews releases, another time. :D
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: philmoz on October 15, 2008, 12:03:10 PM
not sure if it does work...
I removed code generating articleid=xx in the link, and get mysql errors..

It seems (I totally disown any association with that script :D :D ) that the articleid is used to return to the article after the deletion of the comment.

... but I could be wrong...
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: kuazo on October 15, 2008, 12:15:09 PM
well, i used to have notification with backhome instead of returning with meta refresh.
thats why i didn't get that it is necessary. just worked in 1.6 and not 1.7.

it was just a question... :-)
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: Sven on October 18, 2008, 10:44:14 AM
Hi Dudes
Upgrading to RC2 I have this issue:
Quote
Unknown column 'visible' in 'field list'
???
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: Joost on October 18, 2008, 10:52:52 AM
Good morning Philippe,

'visible' is a new field, it didn't exist in previous versions.  Did create a new database or did you alter an existing one?
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: Sven on October 19, 2008, 10:55:12 AM
Hello Mr Joost
Fixed now.
'visible' is a new field, it didn't exist in previous versions.
I thought it was the same DB...
I've imported my data into the new structure without problemo.
This RC2 seems faster. Am I wrong?
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: Joost on October 19, 2008, 11:00:46 AM
Faster than what?
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: Sven on October 19, 2008, 11:35:41 AM
Previous RC
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: Joost on October 19, 2008, 01:27:01 PM
Previous RC

Shouldn't make any difference. Maybe your webspace is located on the same server as Icesave (http://www.icesave.co.uk/). That would explain. ;D
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: hafing on October 19, 2008, 02:45:01 PM
ICESAVE -  in that case it wouldn't work, no matter how hard you tried.
Even if you used Laws against terrorism.  ;D
hafing  8)
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: philmoz on October 20, 2008, 10:04:17 AM
@sven, there are quite a few token() calls that have been eliminated, although I wouldn't have thought they would have been very heavy :D
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: Sven on October 20, 2008, 03:24:34 PM
Bonjour
this line needed for having an xml sitemap is rejected by the 1.7 rc2 (unknown function):
Quote
if (get_id('category') == "sitemap.xml") {sitemapxml(); die;}
Is there the same piece of code for our new version or is it more complicated to make the Mod working out?

Spam removed. Thanks a lot.

Has anybody got an idea for the sitemap?
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: philmoz on October 23, 2008, 11:01:07 AM
locate down from the connect_db() call in startup area
Code: [Select]
$categorySEF = $url[0];don't know if this is it, but try this immediately after the above line.
Code: [Select]
if ($categorySEF == "sitemap.xml") {sitemapxml(); die;}
...but in general, that mod will probaly need to be rewritten to take into account any subcat levels and the like.
Title: Re: IMPROVE SNEWS 1.7 RC2
Post by: Sven on October 23, 2008, 12:13:51 PM
locate down from the connect_db() call in startup area
Code: [Select]
$categorySEF = $url[0];don't know if this is it, but try this immediately after the above line.
Code: [Select]
if ($categorySEF == "sitemap.xml") {sitemapxml(); die;}
I've tried this too but not in the correct place.  ;D  Now it's working out!  8) And 1 karma to thank you. :)
...but in general, that mod will probaly need to be rewritten to take into account any subcat levels and the like.
I bet you're right. I wish I could. ;)