David
03-23-2006, 08:18 PM
This mod allows you to setup crons that import and delete news. This is not just a mod but also instructions for setting up the cron in cPanel. This mod will be added by default in future versions of NewsTopica.
How to implement the "Cron" mod:
1. Edit file "admin/init.php" and find following code (line 101):
"'importrss' => _L('Import RSS'),"
Insert this right after:
"'delete_old_news' => _L('Delete old News'),"
2. Edit file "include/tables.php" and find following code (line 182):
"array('ID' => 'ENABLE_BLANK', 'VALUE' => '0'),"
Insert this right after:
"array('ID' => 'OLD_YEAR', 'VALUE' => '0'),
array('ID' => 'OLD_MONTH', 'VALUE' => '0'),
array('ID' => 'OLD_DAY', 'VALUE' => '0'),"
Thats all!
Hint: this mod uses original NewsTopica 2.0
How to add Cron job for delete news older than X date (user can edit X date in admin page, menu item "Directory->Delete old News"):
1. Login in your cPanel
2. Click on link "Cron Jobs"
3. After this you will see a page with the message "Please choose experience level", click on button "Standard"
4. After this you will see a screen for adding new Cron Jobs 5. Near with "Command to run: " text you can see a textbox where you must enter a command in format like this:
/usr/local/bin/php /home/[newstopa]/public_html/[directory]/admin/delete_old_news.php
[newstopa] - this is a name of directory where placed your account, you can ask for this name your Hosting Support (Often this directory name its simple your login to access to cPanel) [directory] - this is a name of directory where installed NewsTopica software 6. Select needed time options 7. Click on "Save Crontab" button
-----------------------------------------------
How to add Cron job for Import RSS:
1. Login in your cPanel
2. Click on link "Cron Jobs"
3. After this you will see a page with message "Please choose experience level", click on button "Standart"
4. After this you will see a screen for adding new Cron Jobs 5. Near with "Command to run: " text you can see a textbox where you must enter a command in format like this:
/usr/local/bin/php
/home/[newstopa]/public_html/[directory]/admin/[link]
[newstopa] - this is a name of directory where placed your account, you can ask for this name your Hosting Support (Often this directory name its simple your login to access to cPanel) [directory] - this is a name of directory where installed NewsTopica software [link] - if you want to process ALL RSS Feeds from ALL categorys, use
dir_importrss.php?r=1 instead of [link], if you want to process RSS Feeds from some one category, you need:
1. Go to Newstopica admin page
2. Go to Categories page
3. Click on needed category
4. Have a look at url of "Import RSS" button (at the top of page).
5. Take from this url string "dir_importrss.php?c=10" (dont look at
"?c=10" - you can find some other numbers)
6. Use this string instead of [link]
7. Select needed time options
8. Click on "Save Crontab" button
How to implement the "Cron" mod:
1. Edit file "admin/init.php" and find following code (line 101):
"'importrss' => _L('Import RSS'),"
Insert this right after:
"'delete_old_news' => _L('Delete old News'),"
2. Edit file "include/tables.php" and find following code (line 182):
"array('ID' => 'ENABLE_BLANK', 'VALUE' => '0'),"
Insert this right after:
"array('ID' => 'OLD_YEAR', 'VALUE' => '0'),
array('ID' => 'OLD_MONTH', 'VALUE' => '0'),
array('ID' => 'OLD_DAY', 'VALUE' => '0'),"
Thats all!
Hint: this mod uses original NewsTopica 2.0
How to add Cron job for delete news older than X date (user can edit X date in admin page, menu item "Directory->Delete old News"):
1. Login in your cPanel
2. Click on link "Cron Jobs"
3. After this you will see a page with the message "Please choose experience level", click on button "Standard"
4. After this you will see a screen for adding new Cron Jobs 5. Near with "Command to run: " text you can see a textbox where you must enter a command in format like this:
/usr/local/bin/php /home/[newstopa]/public_html/[directory]/admin/delete_old_news.php
[newstopa] - this is a name of directory where placed your account, you can ask for this name your Hosting Support (Often this directory name its simple your login to access to cPanel) [directory] - this is a name of directory where installed NewsTopica software 6. Select needed time options 7. Click on "Save Crontab" button
-----------------------------------------------
How to add Cron job for Import RSS:
1. Login in your cPanel
2. Click on link "Cron Jobs"
3. After this you will see a page with message "Please choose experience level", click on button "Standart"
4. After this you will see a screen for adding new Cron Jobs 5. Near with "Command to run: " text you can see a textbox where you must enter a command in format like this:
/usr/local/bin/php
/home/[newstopa]/public_html/[directory]/admin/[link]
[newstopa] - this is a name of directory where placed your account, you can ask for this name your Hosting Support (Often this directory name its simple your login to access to cPanel) [directory] - this is a name of directory where installed NewsTopica software [link] - if you want to process ALL RSS Feeds from ALL categorys, use
dir_importrss.php?r=1 instead of [link], if you want to process RSS Feeds from some one category, you need:
1. Go to Newstopica admin page
2. Go to Categories page
3. Click on needed category
4. Have a look at url of "Import RSS" button (at the top of page).
5. Take from this url string "dir_importrss.php?c=10" (dont look at
"?c=10" - you can find some other numbers)
6. Use this string instead of [link]
7. Select needed time options
8. Click on "Save Crontab" button