PDA

View Full Version : cutenews.. Help?



tleftye
04-10-2005, 06:25 PM
well I'm abit stuck. I'm tired of uploading 5 or more cutenews folders. And now I'm making categories. But my problem is I don't know url to show a category. Like When you don't have a category it's "show_news.php"

Lysine
04-10-2005, 06:34 PM
That is to show the news.

tleftye
04-10-2005, 06:38 PM
that's to show all the news But I wanne know url to show a news in category.

Adzeh
04-10-2005, 06:58 PM
You have to create a separate file I think.

like atricles.php and newsusa.php that sort of thing.

dudez12
04-10-2005, 07:03 PM
Create a new file (with a .php extension!)

And include the following code:


<?PHP
$category = "CATEGORY ID GOES HERE";
include("path/to/show_news.php");
?>


And do that for each category.

here is a quote from the CuteNews Manual:


Including The News
After CuteNews is successfully installed you can start posting your news. To display the news you must include the file show_news.php (located in the main cutenews folder). To include show_news.php on your page you must use a code like this:
<?PHP
include("path/to/show_news.php");
?>
And you must replace path/to/show_news.php with the real path to show_news.php, NOT the URL !!!
Examples:
CORRECT: include("cutenews/show_news.php");
WRONG : include("http://site.com/cutenews/show_news.php");

Remember that to be able to use the php code, the extension of the file where you include it must be .php
If you want to include the code in .html page, you can rename he .html to .php and everything will work normal

All Variables You are Allowed to Use
Here is a list of all possible variables that you are allowed to use when including news or archives:
<?PHP

$number = "<X>"; // show only the X newest articles.
$template = "<NAME>"; // load another template, if you don't use it the default template will be loaded.
$static = TRUE; // included news will not load on this location, for more info see 'Using Multiple Includes'.
$category = "<ID>"; // show only news from the selected category where <ID> is the id of category.
$start_from = "<NUMBER>"; // show the news starting not from the first newest but from <NUMBER>, it is required to use $start_from = "<NUMBER>"; only when you use $number = "X";.

include("path/to/show_news.php");
?>
All of the above variables are optional and you may wish don't to use them.

Using Multiple Includes on One Page
Now will examine the situation when you want to use more than one include on a single page. For example if you want to show 5 headlines (using template headlines) and below them to be shown all other news. The problem in this situatuion situation is that when you click on a headline CuteNews won't understand where to show the result, on the headlines part or where all other news are included. The solution is to use the variable = TRUE; before including the headlines. When you use this variable CuteNews won't display any result on the place where you use .
Here is the correct code of the above example with the headlines and news:
<?PHP
Our Latest 5 Headlines:
$static = TRUE;
$number = "5";
$template = "Headlines";
include("path/to/show_news.php");

The News
include("path/to/show_news.php");
?>
Now When you click on a headline it will be displayed on the place of the other news and the list with the latest 5 headlines will still be showed.

Make some test with $static = TRUE; yourself to understand how it works exactly and how powerful it can be.

Understanding User Levels
For better security and control of your users there four types of user-levels implemented in CuteNews. Each user-level has limited permissions in doing specified actions and these permissions can not be changed.
The user-levels are as fallows:

1. Administrators - administrators are allowed to do anything they want: edit others posts, comments, ban users, edit system configurations and everything else ... so be careful with this level !!!

2. Editors - the users from this level are allowed to post news, they can edit own posts and the news posted from all other users.

3. Journalists - this level is for users who only need to post and edit news. They can edit only own posts !

4. Commenters - when users from this level login, they are allowed only to change their passwords. Can not post, edit news or perform any other action. This is useful when some user wants his username to be password protected when posting comments and no one else to be able to post with his username. You can also deny unregistered users to be able to post comments.

Only administrators are able to add users but by downloading an add-on from our your visitors will be able to register automatically.

What are Categories and How To Use Them
When adding new category, it will appear in the "Add News" section. Therefore when you post your news you'll be able to specify a category to which the article will belong (selecting category it optional), that way you can organize your news. Now, when adding new category you'll be able to specify name for this category and optionally URL to icon for this category. Automatically an ID number will be set for the new category, this ID is used when using include script to show all news only from this category. Example code:
<?PHP
$category = "2";
include("path/to/show_news.php");
?>
the above PHP code included on your page will display all news from category with ID 2
If you for example have 5 categories and want to display news on one page from only 3 of the categories, you can use the fallowing code:
<?PHP
$category = "2,3,5";
include("path/to/show_news.php");
?>
the above code will display all news from categories with ID 2, 3 and 5.
When you does not use $category = "<ID>"; CuteNews will display the news from all categories, but when using this code, only news from the specified category(s) will be shown.

The category icon can be shown together with your news, to do this you must put {category-icon} in your news templates.

Want to hide these adverts? Register an account for free!