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.

Author Topic: sNews 1.6 text-db WIP  (Read 3611 times)

centered

  • Guest
sNews 1.6 text-db WIP
« on: May 24, 2007, 06:57:49 pm »

I have stopped porting 1.5.31 over to text-db in favor of the latest version.  Right now I believe I am close to a release but I need some assistance, more specifically PHP help, which I know is prominent here in these forums.  I am not a programmer, but I need to have the text-db as an option for myself and for future clients that may or may not have a database available.  I thought this would be a simple copy and paste, and I found out I was totally wrong, but with some help I got this far.

Enough on introductions.  I am putting this out here so anyone can look it over and help with errors and code that I may have screwed up on and to help bring make this a usable option.  

This is not a fully working script.  I will repeat:
 
THIS IS NOT A FULLY WORKING SCRIPT!
sNews1.6 text-db http://www.mediafire.com/?6cjfbslvom9

*Please make sure the inc, api and all api files are 755.  Also the dbs folder needs to be 777.  Thats is how I have when I was testing it.

Known bugs:

Categories: Somehow I have two Home links listed, one with Home and another Home(0).  Not sure where or what to look for in fixing this.

Sitemap:  At default it looks like it works properly, but if you add a Page, you will see 3 (or 4) instances of the Page you created.  I believe this is a PHP error on my part, but again not totally sure on how to fix it.

Search: Text-db does not support SUBSTRING.  Gobo from the text-db forums gave me a portion of the script he was working on and included a sample fix for SUBSTRING.  

In Extra Content:
Code: [Select]
$query = "SELECT * FROM ".db('prefix')."articles WHERE SUBSTRING(position, 1, 1) = '2' AND published = 1 ORDER BY id DESC";Text-db would be:
Code: [Select]
$query = "SELECT * FROM ".db('prefix')."articles WHERE published = 1 ORDER BY id DESC";
.....
if (substr($r['position'], 1, 1) != 2) continue;
The search engine has it layed out differently and I have tried different options on how to make it work with no avail.  The Substring line also occurs in the ARTICLES - ADMIN LIST function, which the whole substring call would need to be taken out, I would assume.

Gobo explains more:
Quote
the answer is to take the whole substring clause out of the query. This leads to a bigger returned resultset with data we do not want, but that's easy to discard inside the while loop over the rows returned. At the beginning of each loop check the "position" field's second character. If it is equal to two, just throw a continue for the loop, so no further work is performed on these rows.
Articles/Extra Content in Admin section:  No submit button. No errors either from the debugger I am using.  May be a PHP error

Pages:  I can add a new page and have it show up on the header menu.  When I try to access the page, I get a 404.  When I go back to the Admin section, the Edit Pages part is not even shown.  The database does create the page, it is not being called back correctly, I think.  There may be a similar issue with the Article/Extra Article I am not sure....

Settings: Text-db error "Column ''website_title' LIMIT 1' not found"

RSS Pages link: Does not show up at all

I am looking for PHP help with errors this time around.  Thanks everyone in advance!
Logged

codetwist

  • Hero Member
  • *****
  • Karma: 50
  • Posts: 940
sNews 1.6 text-db WIP
« Reply #1 on: May 24, 2007, 09:58:25 pm »

In php contrary to MySQL first character of string is located at index 0 not 1 ;)
Logged

centered

  • Guest
sNews 1.6 text-db WIP
« Reply #2 on: May 25, 2007, 04:53:44 am »

Hey codetwist,

I am trying to follow but... I am kinda lost ... :/

I know that in PHP (or mysql) that the numbering starts at 0 and not 1
Logged

codetwist

  • Hero Member
  • *****
  • Karma: 50
  • Posts: 940
sNews 1.6 text-db WIP
« Reply #3 on: May 25, 2007, 07:55:42 am »

IMHO if for for MySQL query:
Code: [Select]
WHERE SUBSTRING(position, 1, 1) = '2'then in php only should be:
Code: [Select]
if (substr($r['position'], 0, 1) != 2) continue;
Logged

centered

  • Guest
sNews 1.6 text-db WIP
« Reply #4 on: May 25, 2007, 02:30:50 pm »

Thanks for that.  I will not know if it fully works or not until the Submit button is fixed for the Article/Content admin area.
Logged

centered

  • Guest
sNews 1.6 text-db WIP
« Reply #5 on: June 03, 2007, 04:44:14 am »

Sorry I have lost interest in continuing to develop this, I do not have the full know how to debug and continue.  1.4 works for some of mine and my clients needs.  Thanks to everyone for helping out.
Logged

Joost

  • Guest
sNews 1.6 text-db WIP
« Reply #6 on: June 03, 2007, 01:42:36 pm »

Great effort anyway, thanks for trying. :)
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
sNews 1.6 text-db WIP
« Reply #7 on: June 03, 2007, 02:44:18 pm »

Quote from: centered
Sorry I have lost interest in continuing to develop this, I do not have the full know how to debug and continue.  1.4 works for some of mine and my clients needs.  Thanks to everyone for helping out.
I strongly suggest you keep all your files and references stored in a safe place so that they will be available to work on or have as a reference in the near future. You never know when someone else might have some time to work with you on this... or you might again take a look at it to pursue to more. :)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

centered

  • Guest
sNews 1.6 text-db WIP
« Reply #8 on: June 11, 2007, 10:26:52 pm »

Quote from: keyrocks
I strongly suggest you keep all your files and references stored in a safe place so that they will be available to work on or have as a reference in the near future. You never know when someone else might have some time to work with you on this... or you might again take a look at it to pursue to more. :)
Thanks Keyrocks.  I am taking your advise and going further by trying to immerse myself with 1.4 as you can already see, then try and apply it to 1.5/1.6 which has some great features.  or vice versa and make 1.4 more like 1..5/1.6 (which probably won't happen, but I am slowly coming close ... ya right!).  What is fun is that I am learning as I am doing, seeing and understanding how everthing work.  1.4 seems simplier in design as i look into the code (than to 1.6, I am lost sometimes there), so it is better to understand and see how everything is ticking, as its doing it.

I do like 1.6 alot.  I may take the Pages and 404 function and try and mod it into 1.4 lol!! 404 seems easy but the Pages function seems all over the place, but I do like the Set as Home Page feature....

Thanks everyone again for being a great community supporting a great script!
Logged