Beta2: News mod - RC4 valid

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Beta2: News mod - RC4 valid

Post 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
###########################################################################################
Last edited by frold on Thu 6. May 2004, 23:54, edited 13 times in total.
http://www.studmed.dk Portal for doctors and medical students in Denmark
User avatar
Fulvio Romanin
Posts: 394
Joined: Thu 4. Dec 2003, 11:12
Location: Udine, Italy
Contact:

Post by Fulvio Romanin »

ready for testing, can't help for other tags, sadly
anyway, if you need me, i'm there...
Completeness is reached through subtraction, not through addition
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

I was updating the post while you posted!
http://www.studmed.dk Portal for doctors and medical students in Denmark
snobba
Posts: 166
Joined: Sat 6. Mar 2004, 12:41
Location: Sweden
Contact:

Post 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
User avatar
Fulvio Romanin
Posts: 394
Joined: Thu 4. Dec 2003, 11:12
Location: Udine, Italy
Contact:

Post 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? :)
Completeness is reached through subtraction, not through addition
ionrock
Posts: 279
Joined: Fri 20. Feb 2004, 17:04

Post 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!
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post 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
http://www.studmed.dk Portal for doctors and medical students in Denmark
snobba
Posts: 166
Joined: Sat 6. Mar 2004, 12:41
Location: Sweden
Contact:

Post by snobba »

Ionrock > Does your great blog work for the newest phpWCMS relese?
ionrock
Posts: 279
Joined: Fri 20. Feb 2004, 17:04

Post 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.
rsantifort
Posts: 68
Joined: Mon 9. Feb 2004, 00:44

Installed OK, but then??

Post 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
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post 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 ;-)
http://www.studmed.dk Portal for doctors and medical students in Denmark
GreenNuggs
Posts: 34
Joined: Fri 9. Apr 2004, 01:14
Location: Boston, MA. USA

Post 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.
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Re: BetaRelease: News mod

Post by frold »

Tested for RC3 (and it works) and better installing instruction added...
http://www.studmed.dk Portal for doctors and medical students in Denmark
Keules
Posts: 80
Joined: Tue 2. Mar 2004, 17:06
Location: Hamburg

BUg Inside !!!

Post 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 :) #
Jérôme
Posts: 481
Joined: Tue 16. Mar 2004, 10:33
Location: Cologne, Germany
Contact:

Post 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.
Post Reply