, 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 > User Help > Code Snippets > News/Articles Block/Pages: Clickable Links

FlexCMS Support Forum


News/Articles Block/Pages: Clickable Links
Started April 23, 2007 @ 8:33pm by otter
Post Message 
otter
Administrator



Posts: 177
 
News/Articles Block/Pages: Clickable LinksApril 23, 2007 @ 8:33pm
Displays Articles As Clickable Links Only

Simply paste the following code into a block and enable PHP on it.


Code

$query_na = "SELECT * FROM `".$Settings['DBPrefix']."na-Categories` WHERE
Parent='0' ORDER BY CategoryName asc";

$result_na = mysql_query($query_na) or die (mysql_error());
while ($row_na = mysql_fetch_array($result_na)) {

print '<a
href="'.$MainURL.'/articles/'.$row_na['RecordNumber'].'.html">'.$row_na['CategoryName'].'</a><br>';

}



ONLINE TRAINING CLASSES FOR FLEXCMS IN MAY: FlexCMS Basics (101), Sat., May, 15, 2010 & FlexCMS Blocks (Mon., May 10, 2010).
 

Last Edit: June 23, 2007 @ 3:38pm by DCSun
Grady


Posts: 25
 
This does not work for meJune 23, 2007 @ 12:44pm

Quote (otter)

Displays Articles As Clickable Links Only

Simply paste the following code into a block and enable PHP on it.


Code

$query_na = "SELECT * FROM `".$Settings['DBPrefix']."na-Categories` WHERE
Parent='0' ORDER BY CategoryName asc";

$result_na = mysql_query($query_na) or die (mysql_error());
while ($row_na = mysql_fetch_array($result_na)) {

print '<a
href="'.$MainURL.'/articles/'.$row_na['RecordNumber'].'.html">'.$row_na['CategoryName'].'</a><br>';

}


I added the above mentioned code in a block and it returns nothing. I cannot tell that it was added. Is something missing from the code? Thank you
 

Last Edit: June 23, 2007 @ 3:38pm by DCSun
DCSun
Administrator



Posts: 625
 
June 23, 2007 @ 3:38pm
Grady,

It looks like there's a line break/return that shouldn't be in there, and that's causing nothing to display. I've fixed the code above, so you can paste that in again, or simply remove the line break to bring "egoryName'].'</a><br>';". up to the end of the line above it.


David


FlexCMS v3.2 Has Been Released!
 
Grady


Posts: 25
 
The code still will not display articlesJune 24, 2007 @ 3:35am
I appreciate the speediness of your reply, but the code will stillnot return article links. I copied the code exactly as you have it and pasted it into the code box of a new block and enabled php processing.
 
DCSun
Administrator



Posts: 625
 
June 24, 2007 @ 3:53am
Grady,

Sorry to hear you're still having problems. It worked fine on a site I tested it on just now.

It's perhaps worth noting that this script generates a list of the article categories, not the actual articles. Is that what you were expecting, or do you not have any categories in the system right now for it to display?


David


FlexCMS v3.2 Has Been Released!
 
Grady


Posts: 25
 
Works GreatJune 24, 2007 @ 4:38pm
David, Thank you. The script did something different than what i thought and it also required I create an article category. The script would not work without my creating an article category. Thank you and I am impressed with the level of customer service and speed of service. Grady
 

Last Edit: June 24, 2007 @ 4:39pm by Grady

Post Message 




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.13267 seconds.
 
Management Login

Powered By FlexCMS
Powered By FlexCMS