Donate / Donar / Doar / Donner / Spende | http://www.sfccp.net/wiki/Join
How to install sfa2irc : sf-active
IMC / INFORMATION WARFARE MUNITIONS
sf-active :: indymedia
english | castellano | italian | Nederlands
download : documentation : support
irc : cvs : bugs : faq : servers
latest articles : sf-active sites
about sf-active
sf-active is a collection of object-oriented classes for content management, open publishing and news syndication. All the pages needed to run an indymedia site are distributed with the code

other links
indymedia codebases
indymedia global tech

software, politica e indymedia





save and close it.

now we've to add the tables to the MySQL database. Connect to the DB, select the database and run the following command:

CREATE TABLE `sfa2irc` (
  `id` int(1) NOT NULL default '1',
  `enable` char(1) NOT NULL default '0',
  `egghost` varchar(255) NOT NULL default 'hmpf.info',
  `eggport` varchar(255) NOT NULL default '3333',
  `eggname` varchar(10) NOT NULL default 'hmpf',
  `egguser` varchar(255) NOT NULL default 'sf-active',
  `eggpassword` varchar(255) NOT NULL default 'blubb',
  `eggchannel` varchar(255) NOT NULL default '#hmpf',
  `egglang` varchar(255) NOT NULL default 'en_EN',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM;

CREATE TABLE `sfa2irc_chan` (
  `id` int(10) NOT NULL auto_increment,
  `eggchannel` varchar(255) NOT NULL default '',
  `eggchanlang` varchar(255) NOT NULL default '',
  `postarticle` varchar(255) NOT NULL default '0',
  `postcomment` varchar(255) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM AUTO_INCREMENT=26 ;

if the tables are created disconnect from the MySQL Server.

now open the file "/sf-active/shared/classes/article_class.inc", go to the line 900 and add the following code there:

// beginning of sfa2irc by tammo

$tammodate = date("Y");
$tammodate .= "/";
$tammodate .= date("m");
$sfa2irc_chantable = "sfa2irc_chan";
$eggquit = ".quit";
        $sfa2ircCheck=mysql_query("SELECT * FROM sfa2irc");
        $s2iRow=mysql_fetch_array($sfa2ircCheck);
        $eggenable="$s2iRow[enable]";
        $egghost="$s2iRow[egghost]";
        $eggport="$s2iRow[eggport]";
        $eggname="$s2iRow[eggname]";
        $egguser="$s2iRow[egguser]";
        $eggpass="$s2iRow[eggpassword]";
        $articleURL =    SF_NEWS_URL . "/" . $tammodate . "/" . $this->article["id"] . ".php";
        $commentURL =    SF_NEWS_URL . "/" . $tammodate . "/" . $this->article["parent_id"] . ".php";
if ($eggenable == "1") {
   
 $fp = fsockopen ($egghost, $eggport, &$errno, &$errstr, 180);
 sleep ( 2 );
   if (!$fp) {
     echo "$errstr ($errno)
\r\n"; } else { fputs ($fp, $egguser ."\r\n"); fputs ($fp, $eggpass ."\r\n"); $AbfragE = "SELECT id,eggchannel,eggchanlang,postarticle,postcomment from $sfa2irc_chantable ORDER BY 'id' ASC"; $ergEdit = mysql_db_query(DB_DATABASE,$AbfragE); while (list($chanid,$eggchannel,$eggchanlang,$postarticle,$postcomment) = mysql_fetch_row($ergEdit)) { if ($eggchanlang == "de_DE") { $teXT12 = "Ein Artikel mit dem Thema \" " . $this->article["heading"] . " \" wurde von " . $this->article["author"] . " eingetragen. URL: " . $articleURL . " "; $teXT1 = "Ein Kommentar von " . $this->article["author"] . " wurde zum folgendem Artikel hinzugefügt: " . $commentURL . ""; } elseif ($eggchanlang == "en_EN") { $teXT12 = "New Article with the title \" " . $this->article["heading"] . " \" was posted by " . $this->article["author"] . " . URL: " . $articleURL . " "; $teXT1 = "A new comment was added by " . $this->article["author"] . " in the article:" . $commentURL . ""; } if (($this->article["arttype"] == "webcast") && ($postarticle == "1")) { $eggcommand1 = ".say $eggchannel $teXT12"; fputs ($fp, $eggcommand1 ."\r\n"); } elseif (($this->article["arttype"] == "news-response") && ($postcomment == "1")) { $eggcommand2 = ".say $eggchannel $teXT1"; fputs ($fp, $eggcommand2 ."\r\n"); } } sleep ( 1 ); fputs ($fp, $eggquit ."\r\n"); fclose($fp); } } // end of sfa2irc by tammo
Save and exit the file.

boah!! now we're ready to logon to the administration center of your sf-active and edit the sfa2irc configs.


k, installed and where i can get the eggdrop now ?

You can download it from ftp://ftp.eggheads.org/pub/eggdrop/source/1.6/eggdrop1.6.17.tar.gz you can use the same eggdrop and the same eggdrop-login for different sf-actives

add your comments


stuff to do
by pseudopunk Wednesday, Feb. 02, 2005 at 6:47 AM

can this work with shared/locql setup ?

add your comments


bug report
by tammo Wednesday, Mar. 23, 2005 at 9:19 PM

k, i've located a few bugs:

1. There must be a first entry to the mysql db into the config table...
2. If you add a comment to an article which issn't written in the actually month, the eggdrop will post a wrong URL
3. The installation description have to be better...
4. Not all Sf-a Servers are able to connect to an eggdrop. Why they don't want to connect? No idea!

k, now to PseudoPunks Question:
If the Serveradmin have added the lines which have to be written into the "/sf-active/shared/classes/article_class.inc" file it should work, because all local sf-active-sites uses their own MySQL Databases in which are the configsets are.. so every local sites are able to use their own sfa2irc configs (e.g. their own eggdropdatas and own channels)

tammo

add your comments


Christmas
by Paolo M. Wednesday, Nov. 22, 2006 at 6:24 PM

no comments...

Truck-part-service
Truck-driving-school - Driving In Kentucky School Truck, Driving In Kentucky School Truck, Truck Driving Schools In Tennessee
Truck-tool-box - Truck Mounted Tool Box, Kobalt Truck Tool Box, Truck Tool Box Manufacturer
Dodge-truck - Custom Dodge Truck, Custom Dodge Truck, Dodge-truck
Ford-truck - Atlanta Ford Truck, Atlanta Ford Truck, Ford Lightning Truck
Chevy-truck - Carolina Charlotte Chevrolet North Truck, Carolina Charlotte Chevrolet North Truck, Buffalo Chevrolet Truck
Baby Names - Unique Baby Boy Name, Baby Name List, Unique Baby Boy Name
Baby Blankets
Baby Boys Names - Telugu Baby Boy Name, Scottish Baby Boy Name, Telugu Baby Boy Name
Top 100 Baby Names
List Of Baby Names - Unique Baby Boy Name, Hindu Baby Girl Name, Black Baby Name
Christmas - Christmas Dress, Christmas Light, Christmas Card
Christmas Cards - Religious Christmas Card, Beach Christmas Card, Handmade Christmas Card Idea
Christmas Gift Ideas - Christmas College Gift Idea Student, Christmas Friend Gift Idea, Child Christmas Gift Idea
Christmas Ornament
Custom Christmas Cards
Nightmare Before Christmas - Before Christmas Layout Myspace Nightmare, Before Christmas Nightmare Screensaver, Before Burton Christmas Nightmare Tim

add your comments


printable version - email this article
View article without comments

How to install sfa2irc
by tammo Sunday, Jan. 23, 2005 at 4:49 AM

how to install a sf-active to irc realtime newsposter

sf-active to irc

first, sorry for my english!

What the fuck is sfa2irc ?

sfa2irc is a script which allows you to enable or disable a realtime newsposter for incomming articles and comments to your sf-active cms. The script needs a running Sf-Active page (written for Version 0.9.4), 2 new mysql tables and an eggdrop irc bot.


Give me an example! Now

Okay, if you've installed to your sf-active system and got a running eggdrop, then you can add different channels to the sfa2irc script. You can select if the eggdrop have to post only new articles, or also comments. You can also select in which lanuage the bot have to post the news to the channel.

if you wanna see a already running sfa2irc, you can take a look to http://sfa.hmpf.info, join the channel #de-tech and #ircd on the irc.indymedia.org network and poste a new article or comment to the website. the bot will say something like this:

The lang for #ircd is english, so the bot say:
<@HmpF> New Article with the title "Test" was posted by Tammo-Tester. URL: http://sfa.hmpf.info/news/2005/01/43.php


The lang for #de-tech is german, so the bot say:
<@HmpF> Ein Artikel mit dem Thema "Test" wurde von Tammo-Tester eingetragen. URL: http://sfa.hmpf.info/news/2005/01/43.php



Yeah, man! cool stuff... and how i can install it to my sfa ?

k, you have to add some things to already existing files on the server, add a new file into a ne dir and you've to create 2 new MySQL-Tables

lets begin: go to the directory "/sf-active/sitename/website/admin/" and make a new folder called "sfa2irc", go into it and upload the index.php from the index.zip file. open the file and go to line 50 and edit the serverdatas.

k, now open the file /sf-active/sitename/local/include/admin-header.inc go to the line 105 and add the following line there:

sfa2irc
pick a theme:

Latest Newswire
Publish your news
View Latest Comments