, Guest!
Already a Member? Login or Register.

Menu



Showcase


Due to the volume of spam happening on our forums, posting is now restricted to verified members only.  If you're not verified, drop us a note with your username.

Home > FlexCMS Support Forum > Recent Messages

FlexCMS Support Forum


Recent Messages

Previous Page Next Page

User Help > General Support Requests > RSS/ATOM feeds from Flexcms (Go To Message)
DCSun
 
April 29, 2008 @ 2:49pm
Chris,

What area of FlexCMS were you looking to pull data from to create the feed? If the news/articles system, you're in luck, the code at the link below should do the trick for you. Otherwise you might be able to modify it to work for your needs.

Creating an RSS Feed from your FlexCMS News/Articles


David
User Help > Code Snippets > Creating an RSS Feed from your FlexCMS News/Articles (Go To Message)
DCSun
 
Creating an RSS Feed from your FlexCMS News/ArticlesApril 29, 2008 @ 2:46pm
Hey sports fans, we've had some interest from users to create an RSS feed from their FlexCMS site's news/articles module, so here it is Smile

To make it work, simply create a new page, paste the code below into it, and enable PHP. The address of that page becomes the URL of your feed (ie: http://www.flexcms.com/index.php/pages/rss.html, if you called the page "rss").
Code

if ($IM['na'] == 'y') {

$query_na = "select * from `".$Settings['DBPrefix']."na-Settings`";
$result_na = mysql_query($query_na) or die (mysql_error());
while ($row_na = mysql_fetch_array($result_na)) {
$naSettings[$row_na['Name']] = $row_na['Value'];
}


$CategoriesList = "";
// optional -- comma separated list of category IDs to use articles from


$ArticlesCount = 5;
// optional -- number of articles to include in feed


$DescriptionLength = "";
// optional -- number of characters to use for description, otherwise
// defaults to FlexCMS news/articles teaser length setting



header('Content-type: text/xml');

print '<?xml version="1.0" encoding="UTF-8"?>
<rss version="0.91">
<channel>
<title>'.$Settings['SiteName'].'</title>
<link>'.$BaseURL.'</link>
<description></description>
<language>en-us</language>';



if ($DescriptionLength > 0) {
$naSettings['TeaserLength'] = $DescriptionLength;
}


if ($ArticlesCount != '') {
if (strpos($ArticlesCount,',') !== false) {
list($ACOffset,$ACCount) = explode(',',$ArticlesCount);
$LimitString = intval($ACOffset).','.intval($ACCount);
}
else {
$LimitString = intval($ArticlesCount);
}
}
else {
$LimitString = 5;
}

if ($CategoriesList != '') {

$CategoriesArray = explode(',',$CategoriesList);
for ($i = 0; $i < count($CategoriesArray); $i++) {
$CategoriesArray[$i] = intval($CategoriesArray[$i]);
}
$CategoriesList2 = '"'.implode('","',$CategoriesArray).'"';

$query_na = "SELECT * FROM `".$Settings['DBPrefix']."na-Articles` WHERE ApprovedBy!='' AND (Category IN (".$CategoriesList2.") OR Category2 IN (".$CategoriesList2.") OR Category3 IN (".$CategoriesList2.") OR Category4 IN (".$CategoriesList2.") OR Category5 IN (".$CategoriesList2.") OR Category6 IN (".$CategoriesList2.") OR Category7 IN (".$CategoriesList2.") OR Category8 IN (".$CategoriesList2.") OR Category9 IN (".$CategoriesList2.") OR Category10 IN (".$CategoriesList2.")) ORDER BY DateCode DESC LIMIT ".$LimitString;
}
else {
$query_na = "SELECT * FROM `".$Settings['DBPrefix']."na-Articles` WHERE ApprovedBy!='' ORDER BY DateCode DESC LIMIT ".$LimitString;
}

$result_na = mysql_query($query_na) or die (mysql_error());




$BadWordChars = array(
"\xe2\x80\x98", // left single quote
"\xe2\x80\x99", // right single quote
"\xe2\x80\x9c", // left double quote
"\xe2\x80\x9d", // right double quote
"\xe2\x80\x94", // em dash
"\xe2\x80\xa6", // elipses
"\xe2\x80\x93", // long dash
"\xe2\x80\x94", // long dash
"\xe2\x80\x98", // single quote opening
"\xe2\x80\x99", // single quote closing
"\xe2\x80\x9c", // double quote opening
"\xe2\x80\x9d", // double quote closing
"\xe2\x80\xa2", // dot used for bullet points
chr(146),
);

$FixedWordChars = array(
"‘",
"’",
'“',
'”',
'—',
'…',
'-',
'-',
'\'',
'\'',
'"',
'"',
'*',
'\''
);


while ($row_na = mysql_fetch_array($result_na)) {

if ($row_na['Teaser'] == '') {
$row_na['Article'] = strip_tags($row_na['Article']);

if (strlen($row_na['Article']) > $naSettings['TeaserLength']) {
$TeaserSection = substr($row_na['Article'],0,$naSettings['TeaserLength']);
while (substr($TeaserSection,strlen($TeaserSection)-1,1) != ' ') {
$TeaserSection = substr($TeaserSection,0,strlen($TeaserSection)-1);
}
while (substr($TeaserSection,strlen($TeaserSection)-1,1) == ' ') {
$TeaserSection = substr($TeaserSection,0,strlen($TeaserSection)-1);
}
$TeaserSection .= '...';
}
else {
$TeaserSection = $row_na['Article'];
}
}
else {
$row_na['Teaser'] = strip_tags($row_na['Teaser']);

$TeaserSection = substr($row_na['Teaser'],0,$naSettings['TeaserLength']);

if (strlen($row_na['Teaser']) > strlen($TeaserSection)) {
while (substr($TeaserSection,strlen($TeaserSection)-1,1) != ' ') {
$TeaserSection = substr($TeaserSection,0,strlen($TeaserSection)-1);
}
while (substr($TeaserSection,strlen($TeaserSection)-1,1) == ' ') {
$TeaserSection = substr($TeaserSection,0,strlen($TeaserSection)-1);
}
$TeaserSection .= '...';
}

}



$TeaserSection = str_replace($BadWordChars, $FixedWordChars, $TeaserSection);

$TeaserPrint = '';
for ($x = 0; $x < $naSettings['TeaserLength']; $x++) {
$CharCode = ord(substr($TeaserSection,$x,1));
if (($CharCode > 31 && $CharCode < 127) || $CharCode == 10 || $CharCode == 13 || $CharCode == 9) {
$TeaserPrint .= chr($CharCode);
}
else {
//$TeaserPrint .= '&#'.$CharCode.';';
}
}


$TeaserSection = str_replace($BadWordChars, $FixedWordChars, $TeaserSection);

$TeaserPrint = '';
for ($x = 0; $x < $naSettings['TeaserLength']; $x++) {
$CharCode = ord(substr($TeaserSection,$x,1));
if (($CharCode > 31 && $CharCode < 127) || $CharCode == 10 || $CharCode == 13 || $CharCode == 9) {
$TeaserPrint .= chr($CharCode);
}
else {
//$TeaserPrint .= '&#'.$CharCode.';';
}
}


$TeaserPrint = str_replace('&nbsp;',' ',$TeaserPrint);
$TeaserPrint = str_replace('&amp;','&',$TeaserPrint);
$TeaserPrint = str_replace('&','&amp;',$TeaserPrint);



$TitleSection = str_replace($BadWordChars, $FixedWordChars, $row_na['Title']);

$TitlePrint = '';
for ($x = 0; $x < strlen($TitleSection); $x++) {
$CharCode = ord(substr($TitleSection,$x,1));
if (($CharCode > 31 && $CharCode < 127) || $CharCode == 10 || $CharCode == 13 || $CharCode == 9) {
$TitlePrint .= chr($CharCode);
}
else {
//$TitlePrint .= '&#'.$CharCode.';';
}
}


$TitlePrint = str_replace('&nbsp;',' ',$TitlePrint);
$TitlePrint = str_replace('&amp;','&',$TitlePrint);
$TitlePrint = str_replace('&','&amp;',$TitlePrint);


print '<item>
<title>'.$TitlePrint.'</title>
<link>'.$MainURL.'/articles/view/'.$row_na['RecordNumber'].'.html</link>
<description>'.$TeaserPrint.'</description>
</item>';

}

print '</channel>
</rss>';


}


exit();


You can also make it appear as a feed for your site in newer browsers by adding this tag to your template or a block on your site:
Code

<link rel="alternate" type="application/rss+xml" title="YourSiteName News Feed [RSS]" href="http://www.yoursitedomain.com/index.php/pages/rss.html">
User Help > General Support Requests > HOW TO restrict article edit list screen to a particular category (Go To Message)
DCSun
 
April 29, 2008 @ 2:29pm
Chris,

Maybe I'm missing something, but they're already arranged by category and you can expand/contract them to view the ones you wish.

But whatever the case may be, that output is controlled on line 163 of the inc-na-admin-articles.php file, so you can alter that MySQL query to suit your needs. The list of categories is generated on line 138 of the same file if you wanted to build your dropdown from that.


David
User Help > General Support Requests > RSS/ATOM feeds from Flexcms (Go To Message)
cberks
 
RSS/ATOM feeds from FlexcmsApril 29, 2008 @ 12:03pm
Is there a capability in Flexcms top produce an RSS or ATOM feed from Flexcms databases?

If not which program would be best to look at to use as a basis for producing such feed(s)

Regards, Chris
User Help > General Support Requests > HOW TO restrict article edit list screen to a particular category (Go To Message)
cberks
 
HOW TO restrict article edit list screen to a particular categoryApril 29, 2008 @ 12:01pm
On the "manage articles screen I would like to add a pulldown category list to pick a category and restrict the list of articles to that category. Could you please point me to the appropriate coe to look at to make this change.

Regards, Chris
User Help > General Support Requests > Different photo galley (Go To Message)
DCSun
 
April 9, 2008 @ 12:13pm


David
User Help > General Support Requests > Different photo galley (Go To Message)
homer_jay
 
April 9, 2008 @ 3:44am
Please can you tell me where I send the artwork to get a cost estimate for a template and a lightbox gallery addition?

H.
User Help > General Support Requests > Where do I start (Go To Message)
DCSun
 
April 8, 2008 @ 2:06pm
We do have a user's manual, it's available here: http://www.flexcms.com/doc (select a topic from the left block when you go there).

Like any software package, probably the best way to get familiar with FlexCMS is just to play with it for a while.

If you're planning to build a functional site, my suggestion would be to start with creating a few pages, and then see which template you might like to use (note that there are many more templates available here: http://www.flexcms.com/index.php/pages/templates.html, there are only so many we can include with the installation package before it becomes a huge file to download and upload).

And of course if you have any questions feel free to post them here in the forum and I'm sure someone will be able to help you out.


David
User Help > General Support Requests > Where do I start (Go To Message)
homer_jay
 
Where do I startApril 8, 2008 @ 1:48pm
I'm sure that there's a link or something somewhere to a manual / user guide. This software seems so comprehensive that I'm a little confused about just where I should start! Are there any idiots guides etc?

H.
User Help > General Support Requests > Different photo galley (Go To Message)
DCSun
 
April 8, 2008 @ 1:43pm
Hello,

Thanks for your feedback about the FlexCMS photo gallery.

There are presently no other photo gallery packages which will work with FlexCMS right out of the box. Most packages probably could be modified to display within FlexCMS, however that would need to be done by you or by us for an additional fee as a custom programming project.

We're also happy to accept any suggestions for how the FlexCMS photo gallery could be improved in future versions.


David

Previous Page Next Page





Try & Buy FeedForAll - Easy to use RSS Feed Creator - great for iTunes users!

MEMBERS




All Contents, Code, Scripts and Technologies Copyright 2003-2009 FlexCMS.
All Rights Reserved. Software License Agreement

Processing Time: 0.13343 seconds.
 
Management Login

Powered By FlexCMS
Powered By FlexCMS