PDA


View Full Version : News Digest Module


Morrus
07-07-2004, 10:58 PM
Hello. I haven't been able to get posting priviledges on my own account, so I'm using the account established by my list's owner - Russell Morrissey. My name is Michael Morris and the board we've been using VBAdvance CMPS on is ENWorld.

First I would like to congratulate and thank you for your work. It has made it possible to integrate our boards into one application face - well almost. We still have significant sections that need recoding, but this will be taken care of in time.

Still, we have had one notable problem with VBAdvance and CMPS, the news module. It's working - but it seems to have been designed for sites which have, at best, two or three news items a day. Unfortunately for us, on a busy day our site may see as many as 30 news items, though 10 is a more usual average.

Our older site module used Post Nuke and a display system which divided the articles into categories. Our main page then took the articles and sorted them by categories, displaying them by bulleted lists.

We've replicated this process by preparing the day's articles by hand and modifying the newsbit. This is time consuming though and it has damaged our ability to properly syndicate our news.

What we need is a news digest module that is able to do the following: Search designated forums (each forum will be a category) and pull the threads out one day at a time, displaying their first X words in bulleted list. Each category would be its own list and every day would be grouped together. The list would look like so.

Wednesday, July 7, 2004

Site News

News Item #1
News Item #2
News Item #3


Hosted Site News

News Item #1
News Item #2
News Item #3


Tuesday, July 6, 2004

Site News

News Item #1
News Item #2
News Item #3


Hosted Site News

News Item #1
News Item #2
News Item #3


.... And so on ...
I'll draw up a flowchart for this as an attempt to help, but unfortunately my programming skills outright can't be much help.

This digest mode is highly desirable to us and any help you could give in building it would be appreciated.

Morrus
07-10-2004, 11:30 PM
Well, I've pressed ahead with this - blindly. Here's my flowchart :(

1. Find out what forums are going to be searched and in what order. Call them categories

2. For each date in the last 7 days search the categories for news['message'] and nothing else. Store the messages date['category['item']']

3. Delete any categories or days that would be blank.

4. Spit it all out.

I'll also need to call a function that displays date in the long form - I'm sure that somewhere in vbulletin there is such a function.

Morrus
07-20-2004, 12:38 PM
Help!

AlexSFBay
08-21-2004, 01:47 AM
I'm with you on this one Morrus. I'm looking for a similar solution. Anybody have any advice or is someone working on like this?

dash
08-23-2004, 10:50 AM
I'm in the same boat.
I think they said that categories would be in the next update of CMPS,but no word on how long that would be. I have CMPS installed,but it's actually useless to me without categories. THis leaves me in a holding pattern unfortunately.
:(

Morrus
10-02-2004, 07:53 AM
Been working on this, but I'm getting stuck...




if ($vba_options['portal_news_forumid'])
{
$getnews = $DB_site->query("
SELECT thread.threadid, postusername, postuserid, thread.dateline AS postdateline,
forumid, post.postid, pagetext, allowsmilie
FROM " . TABLE_PREFIX . "thread AS thread
LEFT JOIN " . TABLE_PREFIX . "post AS post ON (post.postid = thread.firstpostid)
$deljoin
WHERE forumid IN($vba_options[portal_news_forumid]) AND thread.visible = 1 AND thread.open != 10 $notdeleted
GROUP BY post.postid
ORDER BY postdateline DESC, forumid DESC, post.postid");

$dategroup = '';
$listopen = false;
$prevdate = false;
$newsdigest = '';

while ($news = $DB_site->fetch_array($getnews))
{
// Construct the Date Headers for each Day's News as necessarry
if (!$dategroup == $news['postdateline'])
{
$datelongform = date('l, F jS, Y', $news['postdateline']);
$dategroup = $news['postdateline'];
eval('$home[$mods[\'modid\']][\'content\'] .= "' . fetch_template('adv_portal_newsdigest_date') . '";');
$prevdate = true;
}

// Construct the Categories
if (!$news['forumid'] == $categoryid)
{
if ($listopen)
{
$home[$mods['modid']]['content'] .= '</ul><br />';
}
$home[$mods['modid']]['content'] .= $news['forumid'] . '<br /><ul>';
$listopen = true;
$categoryid = $news['forumid'];
}

// News Message
$allowsmilie = '';
if ($vba_options['portal_news_enablesmilies'] AND $news['allowsmilie'])
{
$allowsmilie = 1;
}

$news['message'] = parse_bbcode2($news['pagetext'], $vba_options['portal_news_enablehtml'], $vba_options['portal_news_enablevbimage'], $allowsmilie, $vba_options['portal_news_enablevbcode']);

if ($vba_options['portal_news_maxchars'] AND strlen($news['message']) > $vba_options['portal_news_maxchars'])
{
$news['message'] = fetch_trimmed_title($news['message'], $vba_options['portal_news_maxchars']) . construct_phrase($vbphrase['read_more'], $vboptions['bburl'], $news['threadid'], $session['sessionurl']);
}

$home[$mods['modid']]['content'] .= '<li>' . $news['message'] . '</li>';

}

$home[$mods['modid']]['content'] .= '</ul>';

$DB_site->free_result($getnews);
unset($news, $foruminfo['allowratings'], $newsarchivebits, $attachment, $counter, $newsforumbits);

}



?>

I can't get the categories to appear in the order I want. Every time I try to left join or otherwise call the forum table so that I can get to the title field (for the category's name) I get a MySQL error. And the most fustrating thing is the system ignores the conditionals on the category sorting so that the title (or forumid in the above example since I can't get titles to work).

I'm about ready to give up on flexiablity and hard code the forum (category)titles into this. Oh well - this should be simple but it's not - I've been up 16 hrs so I'm going to sleep and hoping that will help.

Morrus
10-02-2004, 04:54 PM
Update: Started all over again and have a early working version!!! :D

I still need to test the category and date sorting completely, but I may have this ready for public beta later today or tomorrow.

shamil
06-05-2005, 08:29 PM
hi all how can i display the date of day in french?

EDIT : fixed