, Guest!
Already a Member? Login or Register.





Menu



Clients



Showcase



Rate FlexCMS

ScriptSearch.com Rating:

Hotscripts Rating
Excellent!
Very Good
Good
Fair
Poor



FlexCMS eNews

To subscribe to our enewsletter, please enter your email address in the box below and click the "Subscribe" button.


Note:  You may easily remove yourself from the newsletter list at any time by following the instructions included with every mailing.

LATEST DEVELOPMENT NEWS:  FlexCMS 2.5 has been released!!! Click here to read the official announcement!

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: 157
 
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>';

}
 

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


Posts: 5
 
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: 348
 
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
 
Grady


Posts: 5
 
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: 348
 
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
 
Grady


Posts: 5
 
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 







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

Processing Time: 0.09318 seconds.
 

Powered By FlexCMS
Powered By FlexCMS


Valid CSS!