CuteNewsRu

所属分类:建站系统
开发工具:PHP
文件大小:0KB
下载次数:0
上传日期:2024-03-24 08:35:26
上 传 者sh-1993
说明:  可爱的新闻。RU是用PHP设计的强大内容管理系统,使用文本文件(txtSQL)或MySQL来存储其数据。它基于CutePHP的Cutenews。
(CuteNews.RU is powerful content management system designed in PHP, uses either textfiles (txtSQL) or MySQL to store its data. It is based on CutePHP s Cutenews.)

文件列表:
backup/
convert/
data/
example/
inc/
install/
plugins/
skins/
upgrade/
.htaccess
head.php
index.php
license.txt
print.php
remote_headlines.php
rss.php
search.php
show_news.php
show_users.php
trackback.php
xmlrpc.php

CuteNews.RU readme
CuteNews.RU readme

Informations about the script

CuteNews.RU - is a powerfull and simple news script that allows you to publish your news and any content that you wish. The script is built on the core of CuteNews by the CutePHP Team, and it borrows ideas from AJ-Fork, another system that is based on CuteNews. Cutenews.RU uses either textfiles (txtSQL) or MySQL to store its data. The system requirements are minimal but the possibilities to use the script are vast. You can use CuteNews.Ru to publish your private home page, start blogging, use it as a content management system or anything that is on your mind.

More information about how to use this script can be found on the official website of CuteNews.RU ( only available in Russian )!
Before you start using the script you should read the license agreement which is included in the zip file. By installing the script you accept this license .
If you need help or support you can go to the Russian speaking forum or the English speaking forum.

You can support this project by linking to the official site ( CuteNews.ru ), or by donating on the WebMoney account: $ - Z584423619010, - E489862997841, R - R435030808543

System requirements

  • Minimal installation:
    • You will need PHP version 4.1.0 or higher.
  • Advanced installation:
    • For the thumbnail creation you need GD2.
    • For search engine friendly urls (rufus = "yes") you need mod_rewrite and .htaccess files.
    • To store the data in a MySQL database instead of a flatfile database (txtSQL), you need a MySQL database.

As you can see all you need to run CuteNews.RU is PHP.

Take it, use it, love it :).

Installation of CuteNews.RU

Attention! path/to is the path to your CuteNews.RU installation

Installing CuteNews.RU is very simple. Just proceed with the following instructions:

  1. Download the latest version of CuteNews.RU
  2. Unzip the zip-file
  3. Upload all the files and folders to your server
  4. Set the permissions of the files with the help of a FTP client
    • CHMOD 777 the folders cache/ and example/ and data/ and all files and folders in the data/ folder
    • CHMOD 644 the index.php
  5. Open your browser and go to http://yoursite.com/path/to/index.php and follow the instructions
  6. Don't forget to delete the install folder after completion of the installation

Upgrade from 02x, CuteNews and AJ-Fork

Upgrade for 024, 025, 026, 027, 028, 029, original CuteNews and AJ-Fork. If you're using AJ-Fork v.168, you need to go to tools/anticonvert.php (inside your AJ-Fork installation) and then use our upgrade.

  1. Install the script
  2. Put your old folder /data to path/to/convert/02x
  3. CHMOD all tmp-files to 777
  4. Open your browser and go to http://yoursite.com/path/to/convert/
  5. Choose "02x series to 03x series"
  6. Choose what you want to transfer to the new script

Upgrade

  1. Unzip the zip-file to a temporary directory
  2. Delete the data folder and the install folder from this temporary directory
  3. Upload this temporary directory to your server
  4. Go to the admin panel and login as admin - the script will automatically be updated

Update from txtSQL (text version) to MySQL

  1. Open your browser and go to http://yoursite.com/path/to/convert/
  2. Choose "txtSQL to MySQL"
  3. Follow the instructions

BackUp

You can make a backup of your MySQL database and/or your data folder. Open your browser and go to http://yoursite.com/path/to/backup and choose what to backup.

We recommend to do a backup at least once a month.

Variables

There are several important variables that you should know of.

$static['variable'] = VALUE; // tells the script that you dont want to show entire news. This is very, very useful for several cases ( eg. Guestbook ).

$template = 'TEMPLATE'; tells the script which template you want to use. For example if you write: $template = "Headlines" all news in that php include will be displayed as headlines. If you want to use template Default, then you dont have to declare this variable because it is used by default.

$category = 'ID CATEGORIES;' // tells the script that you want to show news from different categories. You can show several categories, just write: $category = '1,4,7'. This will show only news from category 1, 4 and 7. You can go to Control panel to create, delete and edit your categories.

$number = NUMBER; // tells the script the number of news to be displayed on one page. For example: $number = 7; will show 7 news per page.

$year, $month, $day, $user (or $author) are similar to $category. Those variables serve for sorting news. For example if you write: $month="12"; $user="odin", you will see news only from december and only posted by user "odin" . Of course, everything can be used "together".

$skip = SKIP; // use this variable only when using $number. $skip tells the script how many news you want to leave out. For example: $skip = 4; shows your news starting with the fourth news.

$user_query = URL; // adds a query to the URL. You find an example of using it in search.php .

$ucat // It's analog to $category but only works with full news. See the example below to understand its use

$sort = array('field', 'order'); // tells the script to sort the news by "field" in "order".

$PHP_SELF = file; // if rUFUs is turned off you can tell the script where to open the news

Variables you can use when using $sort:
date - date of news
author - author of news
title - title
short - the number of signs in the short story
full - the number of signs in the full story
category - category (use id1, id2 and so on )
url - the transliterated title or the value of the field "URL" in addnews/editnews
id - the identification number of news
views - number of views
comments number of comments

Two possibilities to sort:
ASC - Ascending
DESC - Descending

For example, if you declare $sort = array('comments', 'DESC') - you will see news sorted from least to largest amount of comments.

Show news

It's very easy to show the news on your page. Simply put this code to the file which will show the news:

include 'path/to/head.php';

Attention. path/to/ is the path to your CuteNews.RU directory.

And where you want to show the news you must add this code:

include $cutepath.'/show_news.php';

You have to include all the variable mentioned above before you include the show_news.php:

$number = 7;
include $cutepath.'/show_news.php';

You may include show_news.php several times, simply don't forget to use $static.

Examples

Please go to path/to/example/index.php and take a look at the example file. You will soon understand how everything is working.

Normal including. It will show all news from all categories, with default sorting (newest on top):

include $cutepath.'/show_news.php';

If you want to show 5 news from category "News" (for example this category's ID is 1) and from category "Articles" (ID 4) as headlines, use this code:

$number = 5;
$category = '1,4';
$template = 'Headlines';
include $cutepath.'/show_news.php';

A more advanced example: if somebody has opened the full-story, you can show a few (7) headlines from that category below the full story:

$number = 5;
include $cutepath.'/show_news.php';

if ($id and $ucat){
   $static['template'] = 'Headlines';
   $static['number'] = 7;
   $static['category'] = $ucat;
   include $cutepath.'/show_news.php';
}

Script optimization

To accelerate the speed of the script and to decrease the server usage it is necessary to activate caching. It is activated by default. To turn it off go to head.php and set cache to false at the beginning of the file. It is not recommanded to turn it off as some plugins and functions (especially functions involving categories) query the database and cause unnecessary server traffic.

You can set global_cache to true if your server is really busy.

rUFUs / URL management

This part of the script will allow you to change the URLs in whatever way you want.

The "heart" of rUFUs is the file urls.ini in the data folder. You can edit this file directly or by going to "Options -> User Friendly Urls" in admin panel.

It is very difficult to understand the way it is working so have a look at an example:

[home]
post = "{year}/{month}/{day}/{title}.html"

dosearch = "search{add:do=search}"

docategory = "category{add:do=category}"
category = "category/{categories}"

dousers = "users{add:do=users}"
user = "users/{user:do=users}.html"

day = "{year}/{month}/{day}"
month = "{year}/{month}"
year = "{year}"

[rss]
post = "{year}/{month}/{day}/{title}.xml"
category = "category/{categories}/rss.xml"
user = "users/{user}.xml"
feed = "rss.xml"

[print]
post = "{year}/{month}/{day}/{title}.phtml"

[trackback]
post = "{year}/{month}/{day}/{title}.tb"


[home] is the file which shows your news. You can change it in Options -> System settings -> "Path to page". [Something] is the file's name, for example [rss] controls rss.php, [print] controls print.php and so on.

If you set rUFUs to yes in Options -> System settings -> you are able to generate a .htaccess file and use search engine friendly urls.

Pay attention! Only set rUFUs to "yes" if your server allows .htaccess files and supports mod_rewrite. Otherwise you will get an error 404. When using rUFUs avoid having "foreign" characters in your categories as this will cause errors.

You can add new {tags} which create new rules in the .htaccess file. For example we create the tag {user}:

user = "users/{user:do=users}.html"

After that you can use links like: http://yoursite.com/users/USER.html (if rufus = no, then links like http://yoursite.com/page.php/users/USER.html), instead of http://yoursite.com/page.php?do=users&user=USER

The tag {add} is really usefull too. You can create any condition you like. For example, if we use ?do=users in a link to show a list of users (as in example.php) and the link should be like /users/user.html, and in /users/ is the list. Then we can write something like this:

dousers = "users{add:do=users}"

This would result in a link like http://yoursite.com/users/ (if rufus = no, then like http://yoursite.com/page.php/users/), instead of http://yoursite.com/page.php?do=users

After that you can show the users in your short or full story template like this:

{link=home/dousers}

So, you may use {link=file/type} in the templates.

List of global types:

post - news link
category - category link
user - user link
day - day link
month - month link
year - year link
feed - RSS link

List of tags:

{id} - news ID
{year} - year of news
{month} - month's number (from 01 till 12) of news
{Month} - month's name (from jan till dec) of news
{day} - day (from 01 till 31) of news
{time} - time (hour:minute:second) of news
{title} - title of news
{user} - author of news
{user-id} - ID of user (only for table users!)
{category-id} - ID of category
{category} - name of category (in translit or called in field "Alternative Url")
{categories} - category with all parents: /category/sub/our-category

rUFUs: search engine friendly links

Advice: follow this hierarchy:

[home]
post = "{year}/{month}/{day}/{title}.html"
user = "users/{user}.html"
day = "{year}/{month}/{day}"
month = "{year}/{month}"
year = "{year}"
category = "{categories}"
[rss]
post = "{year}/{month}/{day}/{title}.xml"
category = "rss.php/category/{categories}/rss.xml"
user = "rss.php/users/{user}.xml"
feed = "rss.php/rss.xml"
[print]
post = "{year}/{month}/{day}/{title}.phtml"
[trackback]
post = "{year}/{month}/{day}/{title}.tb"

If you want to have links the old style use something like this:

[home]
post = "?id={id}"

category = "?category={category-id}"

user = "?user={user}&do=users"

day = "?year={year}&month={month}&day={day}"
month = "?year={year}&month={month}"
year = "?year={year}"

[rss]
post = "?id={id}"
category = "?category={category-id}"
user = "?user={user}"
feed = "?"

[print]
post = "?id={id}"

[trackback]
post = "?id={id}"

Plugins

Some words about the plugin "Calendar/Archives/Categories/Title". There are four features available: cn_calendar(), cn_archives(), cn_category() and cn_title. The first one displays a calendar with your news, the second one lists your archives, the third one lists your categories and the fourth one the "path" of the news in the browser's title.

Pay attention! These are PHP functions. You have to call them like this:

<?=cn_category(); ?>

Or with the proper variables like this:

<?=cn_category('variable1', 'variable2'); ?>

cn_archives():

cn_archives([template [, sort [, id]]])
- template is the look of the archives (Default: <a href="{link}">{date} ({count})</a><br />),
  {count} (number of news for this month), {date} (for example April 2005),
  {link} (for example /2005/04/, can be changed in urls.ini category - [home], type - month).
- sort for example array('author', 'DESC') (Default: array('date', 'DESC'))
- ID the ID for the cache

cn_category():

cn_category([prefix [, template [, no_prefix [, level [, id]]]]])
- prefix it's that, what will be before template, but, will be constantly repeated. Default prefix - &nbsp; (empty symbol).
- no-prefix it is important thing. It directs script to make prefix for categories-parents from which begins all ... ...


近期下载者

相关文件


收藏者