sNews Forum

Previous sNews versions => sNews 1.4 Final => Mods and Addons => Topic started by: fray_zack on July 07, 2006, 04:52:06 pm

Title: [megaMOD] for snews1.4-txtdb
Post by: fray_zack on July 07, 2006, 04:52:06 pm
Today I exagerately modded...
I can't do a single explained MOD so *url removed*

(txtdb! easy to convert in mysql)

/*NEW*/

fix: new articles for editor
fix: captacha error on sending comment resulting in "Your comment was not sent" error

old changes:
- 2 user: editor and admin
- High priority to keep fix an article at the top
- Multiple attachment transfer MOD (by keyrocks)
- fixed download of attachments
- Default settings are in snews-txtdb.php again.
- new way to include sNews in index.php to allow Per-site settings

Code: [Select]
$thispage="index.php";
$snews_overriding_configfile="snews-config.php";
include ("../snews/snews-txtdb.php");
?>
-support for TinYMCE
-support for FCKeditor

(FTF: from this forum)
(FTF&M: from this forum and modded)
- choose if use contact or not
- my server can't read .htaccess -> all code rewritten to do without it
- internal use of s('thispage'))
- added an alternative layout for read_more...
- added a management of attachments on articles
- Added FCKeditor
- added breadcrumbs (FTF&M)
- javascript_head only if logged in (FTF)
- articles are displayed only per category on every page
- ip logging (FTF)
- code validation using alternatively GD (FTF) or textually with Text(THaCAA)
- custom_block position (position=153) (FTF&M)
- different positionning in menu for fixed items and  category related ones (position=154)
- custom_block(categoryname) display only articles of categoryname
- archives show articles by category,year,month (FTF&M)
- all class="someclass"  moved to // CSS SETTINGS
- description and keyword for metatag (FTF)
- inclusion mod (FTF)
- print friendly (FTF)
- RSS use description for metatag instead of article text (only for published ones)
- admin_comment (FTF)
- selective_center(n,m) -> n articles on homepage m on others (FTF)
- fix: update_articles for txtdb (FTF)
- archives even shows unpublished article if logged in for every position
- fix: email header (FTF)
- by deleting an article its comments are deleted too
- added last_update()  -> "last updated: YYYY-MM-DD" based on last updated article
- added getattachment(id) -> download attachment and count an Hit !
- added showattachments() -> lists all attachments in a configurable table by: $s['showattachments_columns']= "#name#description#version#"; // available colums:"#name#description#version#license#platform#"
- showattachments() -> when logged in even shows the hit counter for each file


feel free to analyse my code and.... destroy it ... ;)
Title: [megaMOD] for snews1.4-txtdb
Post by: Keyrocks on July 07, 2006, 06:44:31 pm
You have been a busy little bird fray-zack - an excellent contribution!

Would it be possible to provide a narrative description that introduces what you had set out to do when you started this project, and a clearer idea of what it is that you added, changed and/or deleted from the snews.php file (non-mysql version), to arrive at what new level of functionality. Also, since it is easy to convert for the MySQL version, would you be willing to create a working snews.php file will all of your mods incorporated? This would allow us to test-run it easier. :)
Title: [megaMOD] for snews1.4-txtdb
Post by: chiskop on July 07, 2006, 07:52:47 pm
Sheesh ... I'm not sure I even unnerstand the code you used to annotate your mods!

It's all good. And thanks for all the work you've obviously put into this.
Title: [megaMOD] for snews1.4-txtdb
Post by: Mika on July 08, 2006, 07:52:51 am
my compliments, fray_zack. i will destroy it :D when time permits me
Title: [megaMOD] for snews1.4-txtdb
Post by: albert on July 08, 2006, 01:27:54 pm
Hi

been trying the code out.

it would be better to zip up the code or make into a txt file for all to test.
plus a working demo.

so fare I get this

Php-Txt-Db-Access Error:
Column Type ) not supported

Php-Txt-Db-Access Error:
Query 'CREATE TABLE articles(id inc, title str, seftitle str, text str, textlimit int default '0', date int, category int default '0', position str, displaytitle str default 'YES', displayinfo str default 'YES', commentable str, image str,attachment str, published int default '1',description_meta str,keywords_meta)' failed

Php-Txt-Db-Access Error:
readTable(): Cannot open Table articles

Php-Txt-Db-Access Error:
Reading Table articles failed

Php-Txt-Db-Access Error:
Query 'SELECT * FROM articles WHERE published = 0' failed

Php-Txt-Db-Access Error:
Column Type ) not supported

Php-Txt-Db-Access Error:
Query 'CREATE TABLE articles(id inc, title str, seftitle str, text str, textlimit int default '0', date int, category int default '0', position str, displaytitle str default 'YES', displayinfo str default 'YES', commentable str, image str,attachment str, published int default '1',description_meta str,keywords_meta)' failed

Php-Txt-Db-Access Error:
Column Type ) not supported

Php-Txt-Db-Access Error:
Query 'CREATE TABLE articles(id inc, title str, seftitle str, text str, textlimit int default '0', date int, category int default '0', position str, displaytitle str default 'YES', displayinfo str default 'YES', commentable str, image str,attachment str, published int default '1',description_meta str,keywords_meta)' failed

Php-Txt-Db-Access Error:
readTable(): Cannot open Table articles

Php-Txt-Db-Access Error:
Reading Table articles failed

Php-Txt-Db-Access Error:
Query 'SELECT * FROM articles WHERE position = 1 AND published <> 0 AND category = 0' failed

after setting it all up

can you help on this :)


Albert
Title: [megaMOD] for snews1.4-txtdb
Post by: fray_zack on July 10, 2006, 09:50:32 am
Hi! I uploaded a working(fixed) copy *url removed*
Title: [megaMOD] for snews1.4-txtdb
Post by: fray_zack on July 10, 2006, 10:44:55 am
/*all the needed files are included in the testSite zip linked in the first post*/

Now I try to explain what the major changes I made (not already explained in this forum) are doing....

(and I'm sorry for my english...)

- Added FCKeditor
   When you add or edit articles you can format it using  this simple editor

- code validation using alternatively GD (FromTthisForum) or textually with Text(THaCAA)
    When people submit a form it has to be validated by a code using a random generated image (if GD library installed) or using a random quiz (Text(THaCAA))

- choose if use contact or not
new option in SETTINGS:
Code: [Select]
  $s['use_contact'] = "NO" //or YES- added an alternative layout for read_more...
   by clicking on a read_more link it opens a different page (if enabled).
new options in SETTINGS:
Code: [Select]
/*MOD:if you want to change layout to read all the article*/
$s['read_more_in_other_page']='YES'; //or not
$s['read_more_page']='alternative.php';
- added a management of attachments on articles
  in menu_items -> attachments
  you can manage attachements like images: an attachment can be linked to an article.
new option in SETTINGS:
Code: [Select]
$s['attachment_folder'] = "attach"; // Folder to save attachments- articles are displayed only per category on every page
when you choose a category center(), left() and right() now
only show articles of that category to fix one or more articles on a page you have to use:

-new function:  custom_block('yourcategorysef') or custom_block('yourcategoryname')
it fixes a specified articles on a page.
for example:
create an article and put it in category 'notes', position 15 ('Custom Block') and then show it like so:
Code: [Select]


- RSS use description for metatag (if found) instead of article text (only for published ones)

- archives even shows unpublished article if logged in for every position

- by deleting an article its comments are deleted too

- new function: last_update()  ->
Code: [Select]
shows:
Code: [Select]
last updated: 2006-07-08based on last updated article

new INTERNAL function getattachment(id)
   download attachment and count a Hit !

new function: showattachments()
used  in menu_items -> lists all attachments in a configurable table.
Options in SETTINGS:
Code: [Select]
$s['showattachments_columns']= "#name#description#version#"; // available colums:"#name#description#version#license#platform#"when you are logged in, it even shows the hit counter for each file


...........

I didn't add useful comment in my code because of time.... You can look for 'MOD:' string but don't expect to find all differences....

...........

:)
Title: [megaMOD] for snews1.4-txtdb
Post by: Sjoerd on July 11, 2006, 01:02:54 pm
Hmm It look like a great mod but why don't you make a download package that's easy to install? And it would be great to get some help of using it.
Title: [megaMOD] for snews1.4-txtdb
Post by: fray_zack on July 11, 2006, 02:54:23 pm
OK! I'just finished a test site and you can download all my mods *url removed*

please verify your configuration in testSite/snews-config.php

Hi!
Title: [megaMOD] for snews1.4-txtdb
Post by: Patric Ahlqvist on July 11, 2006, 02:57:14 pm
There isn't an uploaded version of this ? Do you have an URL to show off an existing copy that works ??

Patric.
Title: [megaMOD] for snews1.4-txtdb
Post by: fray_zack on July 11, 2006, 03:31:15 pm
Not yet....
I'm converting my website but it takes time...
Title: [megaMOD] for snews1.4-txtdb
Post by: Patric Ahlqvist on July 11, 2006, 03:45:17 pm
Goodie, post a link when you're done, eh ? Nice work, fray...really nice ;)
Title: [megaMOD] for snews1.4-txtdb
Post by: albert on July 12, 2006, 05:39:09 am
Hi

Got the baby working Now :)

had to make lttle ajustments, removed fck editor fr fast install.

adding text ok but when changing the text after a few times you notice things not showing up. like meta even though you put it in. Go back then to advanced and it comes back.

function menu_items()

moved up as the side links was not showing, works now, but still not happy.

try a search, as I feel this is not working.

but great addition to sNews thanks fray_zack, will play some more...

Albert
Title: [megaMOD] for snews1.4-txtdb
Post by: mejobloggs on July 12, 2006, 05:55:33 am
What's the opinion on TinyMCE vs FCKeditor?
Title: [megaMOD] for snews1.4-txtdb
Post by: fray_zack on July 12, 2006, 10:49:25 am
Hi!

@albert
fixed problem with meta & search function now is working..

Quote from: albert
function menu_items()
moved up as the side links was not showing, works now, but still not happy.
??????

try to download the complete testSite in the zip (the url is in the first post of this thread)
Title: [megaMOD] for snews1.4-txtdb
Post by: fray_zack on July 12, 2006, 11:02:00 am
Quote from: mejobloggs
What's the opinion on TinyMCE vs FCKeditor?
mmh... I downloaded TinyMCE just now for the first time....
and tried the included examples...

I see it has more advanced options and it has not more files to install than FCK....

Maybe I change direction.... :)

making some test now...
Title: [megaMOD] for snews1.4-txtdb
Post by: mejobloggs on July 12, 2006, 12:19:57 pm
FCKeditor seemed to load a LOT faster for me. I don't like too much options either (e.g. if I was using TinyMCE, I would only use the 'advanced' example, and not the 'full' example as seen on their website)
Title: [megaMOD] for snews1.4-txtdb
Post by: albert on July 12, 2006, 01:47:22 pm
Hi

Testing the zip later today

1 Point when adding editors, always give an opton if you want to use them ie YES/NO
that way you do not need to install it.

I have noticed 2 folders in the zip

snews-
testSite

the index.php has this in the header

$thispage="index.php";
$dbname="test";
include ("snews-config.php");
include ("../snews/snews-txtdb.php");
?>

This must be very much a testing only zip file :)


------------------

add

function contact()
      



--------------
had to do this to make work
//if (!(function_exists('gd_info'))) {
   include("../snews/inc/textTHaCAA_options.php");
   include("../snews/inc/textTHaCAA.php");
//}
//--

must be my gd thing on server !!

-----------------------------------------

Albert


Quote from: fray_zack
Hi!

@albert
fixed problem with meta & search function now is working..

Quote from: albert
function menu_items()
moved up as the side links was not showing, works now, but still not happy.
??????

try to download the complete testSite in the zip (the url is in the first post of this thread)
Title: [megaMOD] for snews1.4-txtdb
Post by: fray_zack on July 12, 2006, 02:37:27 pm
New version (download the zip at the usual link in 1st post):
it uses TinyMCE only if found
else it searches for FCKeditor
else it use simple textareas

All without options... just testing for file existence...

Quote from: albert
This must be very much a testing only zip file
sure!

but my questionable idea is to re-utilize snews as engine for multiple sites
so the structure in a server is:
Code: [Select]
 /
  - home.html
  - snews
       - ...
  - site1
      -... (include ../snews)
  - site2
     -... (include ../snews)
  - site3
     -... (include ../snews)
  - site...
so every file has a connection with a specific "db"
and every site needs its config file...
Title: [megaMOD] for snews1.4-txtdb
Post by: albert on July 13, 2006, 12:48:21 pm
hi  fray_zack

Now on the second zip test

contact and comments keep getting this:
Your message was not sent
Possible reasons: You left name or message field blank or email address does not exist

--------
added this to both as was not showing image
<p><img width="120" height="30" src="../snews/inc/button.php" alt="" /></p>

--------

click on
Attachment: only for attachment
page pops up and you loose the web site as the page does blank, so you have to back clck to get back to the web site

-------------

more later

Albert
Title: [megaMOD] for snews1.4-txtdb
Post by: fray_zack on July 13, 2006, 02:47:16 pm
Hi!
New update at the link above (1st post)

new: 2 user: editor and admin
new: High priority to keep fix an article at the top

new: Multiple attachment transfer MOD (by keyrocks)
new: Default settings are in snews-txtdb.php again.
new: Per-site settings are overridden using global $snews_overriding_configfile
new: new way to include sNews in index.php (see included index.php)



Quote from: albert
click on
Attachment: only for attachment
page pops up and you loose the web site as the page does blank, so you have to back clck to get back to the web site
fixed


-> comment not sent: I've no GD installed on server so I'm unable to test it.
with Text(THaCAA)) it works...

could it be a session problem?
Title: [megaMOD] for snews1.4-txtdb
Post by: Keyrocks on July 14, 2006, 03:52:16 am
Hey there fray-zack, howzit goin?

It would be very nice if you could take a moment and fix the links you have to your .zip file in all your posts above... You need to remove the url=http// so the links will work. :)
Quote
http://url=http//fray.host.sk/snews-1.4-megamod-testsite.zip
should be:
Quote
http://fray.host.sk/snews-1.4-megamod-testsite.zip
Title: [megaMOD] for snews1.4-txtdb
Post by: fray_zack on July 14, 2006, 09:05:05 am
Quote from: keyrocks
Hey there fray-zack, howzit goin?

It would be very nice if you could take a moment and fix the links you have to your .zip file in all your posts above... You need to remove the url=http// so the links will work. :)
Quote
http://url=http//fray.host.sk/snews-1.4-megamod-testsite.zip
should be:
Quote
http://fray.host.sk/snews-1.4-megamod-testsite.zip
oops Ctrl-C Ctrl-V ERROR: (FIXED)
Title: [megaMOD] for snews1.4-txtdb
Post by: ahni on July 27, 2006, 05:38:08 am
Hey. Great package (it's saving me alot of time!!!). I'm having a little problem posting comments though. I get "Your comment was not sent." I think everything's been cmoded correctly, and the captacha is working fine. Any suggestions?
Title: [megaMOD] for snews1.4-txtdb
Post by: ketut on July 27, 2006, 06:23:36 am
can not download the file!
Title: [megaMOD] for snews1.4-txtdb
Post by: ahni on August 06, 2006, 04:24:57 pm
Quote from: ahni
Hey. Great package (it's saving me alot of time!!!). I'm having a little problem posting comments though. I get "Your comment was not sent." I think everything's been cmoded correctly, and the captacha is working fine. Any suggestions?
If someone could please take a second, I still need some help here. Thanks
Title: [megaMOD] for snews1.4-txtdb
Post by: fray_zack on August 28, 2006, 03:36:55 pm
Sorry my computer was out of order til today...


Quote from: ahni
Hey. Great package (it's saving me alot of time!!!). I'm having a little problem posting comments though. I get "Your comment was not sent." I think everything's been cmoded correctly, and the captacha is working fine. Any suggestions?
fixed...
download at the url at first post.
:)
Title: [megaMOD] for snews1.4-txtdb
Post by: ahni on August 28, 2006, 05:03:05 pm
Thanks so much Fray_zack - apoligies for being so impatient, but I'm in a rush to finish this site I'm building.
Title: [megaMOD] for snews1.4-txtdb
Post by: philmoz on August 31, 2006, 11:54:23 am
Getting 403 error when trying to download.

Quote
Forbidden

You don't have permission to access /snews-1.4-megamod-testsite.zip on this server.
Title: [megaMOD] for snews1.4-txtdb
Post by: Patric Ahlqvist on August 31, 2006, 11:59:56 am
Yupp, so do I.
Title: [megaMOD] for snews1.4-txtdb
Post by: Keyrocks on August 31, 2006, 02:31:45 pm
I'm getting the Error 403 page too, on all 3 links in your posts #1, #6 and #9.
Title: [megaMOD] for snews1.4-txtdb
Post by: ketut on September 02, 2006, 03:32:16 am
Quote from: fray_zack
Sorry my computer was out of order til today...

fixed...
download at the url at first post.
:)
still getting ERROR when try to download.!!!
do you have another URL?
Title: [megaMOD] for snews1.4-txtdb
Post by: ahni on September 03, 2006, 06:15:59 pm
Hey. The link in post #6 is the right one, but it's kinda messed up.

The correct one (unless fray has a more recent one) is

http://fray.host.sk/snews-1.4-megamod-testsite.zip (http://fray.host.sk/snews-1.4-megamod-testsite.zip)

oh.. It shows "forbidden" if you click the link but if you copy and paste the URL directly, it works.
Title: [megaMOD] for snews1.4-txtdb
Post by: fray_zack on September 05, 2006, 08:55:10 am
The problem with Forbidden message was corrected (I hope).
It seems the server not always accepts direct links to non-html pages from other sites (is it possible?)

I changed the link from where you can download the file (post #1)

Please try now.

Tnx to all for you patience.
Title: [megaMOD] for snews1.4-txtdb
Post by: philmoz on September 05, 2006, 10:03:42 am
Quote from: fray_zack
The problem with Forbidden message was corrected (I hope).
It seems the server not always accepts direct links to non-html pages from other sites (is it possible?)
I suspect it is very possible that either in your htaccess, or in the server config, there is protection against hot-linking, to prevent server from being used as a repository for countless places on the web, using up the allocated bandwidth...

My supposition anyway.

Ahni's method allowed me to download.
Title: [megaMOD] for snews1.4-txtdb
Post by: Keyrocks on September 08, 2006, 04:56:28 pm
Fray-Zak - I'm having a most frustrating experience trying to download your most recent megamod .zip. I've tried a dozen times this morning. Each time I click the d-load link, it shows the .zip as being 1.34MB in size yet each time I d-load it it shows as being 56KB to 60KB in size, and will not un-zip. Yet when I d-load other .zip files of larger size (up to 4.3MB) they d-load and un-zip properly.

I have an earlier version of your MegaMod already running on my offline (office development) server machine but I cannot get the TinyMCE editor working. I would rather use FCKEditor.... how do you integrate FCKEditor to run with your package?