Page 1 of 2

Beta2: News mod - RC4 valid

Posted: Sun 11. Apr 2004, 00:42
by frold
Hey

I have made a news mod and it is based on the company mod by jerome. It is very simple but with the right skills it is easy to make more advance but my skills are low.

Here you can help :lol:
The first thing I need is someone who want to test it and to make better replacement tag for it.

Right now the only replacement tags that work is :

Replacement tags
{NM:AUTHOR_NAME:news_title}
{NM:CATEGORY:news_title}
{NM:STORY:news_title}

The replacement tags is controlled in this file:
news.func.inc

Installation:
only 5 minutes to install
only 2 files to edit
good instruction included

Functions:
Let you add:
Title
Categori
Author
Story via wysiwug editor based on the settings in you conf.inc.php
Deleting news
Edit old news


Images:
Image
Image

Download:
http://www.frold.dk/news_mod/mod_news_beta2.zip

First thing to do
Better replacement tag
Auto adding of day added

Code: Select all

############################################################################################
## MOD Title: phpwcms News Mod
## MOD Author: Based on Company MOD by Jerome < spam@jerome-gamez.de > (Jerome Gamez) http://jerome-gamez.de/
## MOD Co-Author: Company MOD modified be Frold
## MOD Description: Adds a news function to phpwcms
## MOD Version: BETA TESTING
##
## Installation Level: Easy
## Installation Time: 5 Minutes
##
## Requirements:  - phpwcms V1.1-RC2 2003-04-04 (only tested on that version)
##		  - or RC3
##                - or RC4
##
## Files To Edit:  phpwcms.php
##                 include/inc_front/content.func.inc.php
##
###########################################################################################
## For Security Purposes, Please Check http://www.phpwcms.de/forum/viewtopic.php?p=8790
## for the latest version of this MOD. Downloading this MOD from other sites could cause 
## malicious code to enter into your phpwcms-installation. As such, phpwcms will not 
## offer support for MOD's not offered at: http://www.phpwcms.de/forum/
###########################################################################################
## Author Notes:
##
##     WARNING:     The deletion of entries is hard. That means, unlike the usual
##                  phpwcms behavior, the entries are completely deleted from the
##                  database and not just marked as "deleted".
###########################################################################################
## MOD History:
##
##   2004-04-10 BETA TESTING
##      * For phpwcms V1.1-RC2 2003-04-04
##   2004-04-25 Testet if it work with RC3 and it does + better installing instructions
##   2004-04-26 Minor bud fix in news.functions.inc missing DB_PREPEND
##   2004-05-06 Change in news.list.tmpl so the newest news is listed first
##              Add a news_mod.php - now you can browse news in the frontend...
##
###########################################################################################
## Before Adding This MOD To Your phpwcms, You Should Back Up All Files Related To This MOD
###########################################################################################

Posted: Sun 11. Apr 2004, 01:04
by Fulvio Romanin
ready for testing, can't help for other tags, sadly
anyway, if you need me, i'm there...

Posted: Sun 11. Apr 2004, 01:12
by frold
I was updating the post while you posted!

Posted: Sun 11. Apr 2004, 01:43
by snobba
Great thinking! The company mode is a perfect way to start buildning a news mod...

When I installed it I ran into trouble when I wanted to login - error in phpwcms.php

The problem was here:

Code: Select all

#
#-----[ FIND ]------------------------------------------
#

		case "modules":	//Modules
	   					switch ($p) {


#
#-----[ REPLACE WITH ]------------------------------------------
#

							case 3: // News MOD
									include_once "./include/inc_module/mod_news/main.inc.php";
									break;
I solved it by not replace the case "modules" but just parse it into the { tag...But I could be different for someone else because I just changed this due to the grahpical text mod from J.

I am now going to try it out! So far so good!

Greetings from Martin

Posted: Sun 11. Apr 2004, 03:47
by Fulvio Romanin
just one thing....what about news archiving?
phpwcms seems to be very strict about having articles without menu levels... i mean, if i'd have to make a veeeeeery huge archive (like a newspaper, eg.) i'd have TONS of news each day but i wouldn't need'em to appear everyone at once, but just some, and some other to recall via search engine...

...another thing: keywords? :)

Posted: Sun 11. Apr 2004, 08:34
by ionrock
This looks very similar to a blog... in which case it might be a better idea to look into making a frontend within phpwcms for using something like movable type, wordpress or some other blogging system. The reason I say this is because most of the archive, searching and category work is already done for you along with the rss/atom feeds and comments section. Just my two cents. I also would like to see a frontend to wordpress or movable type created so I might be speaking from my selfish ambition :) Either way good luck with it and whatever works for you might be what works for someone else so go for it!

Posted: Sun 11. Apr 2004, 12:09
by frold
snobba wrote: The problem was here:

Code: Select all

#
#-----[ FIND ]------------------------------------------
#

		case "modules":	//Modules
	   					switch ($p) {


#
#-----[ REPLACE WITH ]------------------------------------------
#

							case 3: // News MOD
									include_once "./include/inc_module/mod_news/main.inc.php";
									break;
Oooops shoud be ADD AFTER I change that

Posted: Mon 12. Apr 2004, 12:03
by snobba
Ionrock > Does your great blog work for the newest phpWCMS relese?

Posted: Mon 12. Apr 2004, 17:26
by ionrock
Not yet. I might try and get it working with it but I kind of feel as though I am reinventing the wheel so we'll see. At this point I am thinking more about taking some wordpress code and doing things that way to make it all more standards compliant with regard to other blogging systems. The other side of things is that I haven't had a chance to mess with the new release much so hopefully this week I can do some work with it.

Installed OK, but then??

Posted: Mon 12. Apr 2004, 23:19
by rsantifort
I installed the newsmod:
- see it in the backend
- can edit some news

But now further? How to show the news on a page?
Please give me som documentation how to test it further

Posted: Mon 12. Apr 2004, 23:21
by frold
if you have news called: welcome

then make a new article and insert

{NM:AUTHOR_NAME:welcome}
{NM:CATEGORY:welcome}
{NM:STORY:welcome}


I need to make better replacement tags but I still looks for the right solution thats why it is beta ;-)

Posted: Tue 13. Apr 2004, 01:50
by GreenNuggs
Is your goal to have all of the news items stricly internal?

I was thinking about using this mod for my external news page. That is, I am going to peruse major online newspapers, magazines and television outlet websites and post a summary of what I've found each day to be interesting reading. I'd like to list them by CATEGORY (i.e. NYTimes, CNN) and then have the STORY actually only be a summary of the article but also be a link to that article. Kinda like this: http://www.dogwoodpapers.com/index.php?goodreads

Maybe I'm just wishful thinking! :D


Oh, by the way, I found a small bug. If you put a colon ':' in the title of the news, it won't recall the content.

Re: BetaRelease: News mod

Posted: Sun 25. Apr 2004, 10:18
by frold
Tested for RC3 (and it works) and better installing instruction added...

BUg Inside !!!

Posted: Mon 26. Apr 2004, 13:19
by Keules
Hi frold!

I believe you have an error in your SQL Script. With registering into the data base sets you the prepend (e.g. cms_phpwcms_news), not however with the selection. I got an SQL error and saw that the file

news.function.inc.php has follw sql-statement:

$query = "SELECT * FROM phpwcms_news ORDER BY news_id";

I edit this for me into :

$query = "SELECT * FROM cms_phpwcms_news ORDER BY news_id";

Now it works right. Can you update your Mod :) ?

I put on and got the table without prepend with to insert from new News an error. The table does not exist. I chenged my tablename into cms_phpwcms_news and the insert into the table works.

But the selection of the news on the finaly site crashed and i got a failure.

Ciao
Keules

#Translating by me and Babelsish :) #

Posted: Mon 26. Apr 2004, 16:57
by Jérôme
In the PHP code, the Line has to look like the following:

Code: Select all

$query = "SELECT * FROM ".DB_PREPEND."phpwcms_news ORDER BY news_id";
And according to this anywhere else.