Location: PHPKode > projects > news-tnk > news-tnk/php3/include/config_news.php3
<?
// new-tnk v1.2.3 php3 config file
// Thierry Nkaoua hide@address.com
//   MySQL Configuration and some general settings

// Edit this part

//usr login, password, etc
$username ="user";             // user name for mysql
$password ="password";        // mysql password
$dbhost = "localhost";        //mysql host
$database = "news";          // database
$admin_password="adminpassword";      //admin password CHANGE IT!!
$time_cookie=1800;                            //Time for admin cookie password
// KONQUEROR users: change 1800 to 5400
// There is a bug in KONQUEROR for cookies expiration date (1 hour less...)

//default number of news per page
$max_news="15";

// email admin when a news is proposed
$prevenir="0";             // 0 for no mail, 1 for mail
$mailadmin="hide@address.com";   //admin email adress

// Background colors
$bg_head="#92bdd5";    // color of message list head
$bg_row="#9FCFE8";      // color of messages in a thread
$bg_row1=" #a4d6e3";  //first color of threads
$bg_row2="#9FCFE8";   //decond color of threads
$bg_body="#cbe5ff";   // general background color

// Language
$lang="english";  //available french, english, german, spanish, dutch

// Don't change anything below !!!!!!!!!!!!!!!!!!!!!!!!!
//############################################################

//Crypt password
$admin_password=crypt($admin_password,"tn");

// language file
$lang_file=$lang."_news.inc";

// Language
include("include/$lang_file");
$loctime=setlocale("LC_TIME","$lang");

// Simplified HTML
$talk_init="29";
$nb_html="11";

$tag=array(
"[url]",
"[/url]",
"[email]",
"[/email]",
"[b]",
"[/b]",
"[i]",
"[/i]",
"[u]",
"[/u]",
"[li]"
);

// number of icons-row and icons per row and total number of icons
$nb_icons_rows="3";
$nb_icons_inline="10";
$nb_icons=$nb_icons_rows*$nb_icons_inline;

// filtering of the messages
function htmlfilt($filt,$nb_icons) {

//change < to &lt; and > to &gt.
$filt=eregi_replace("<","&lt;",$filt);
$filt=eregi_replace(">","&gt;",$filt);

//  changing the icons  text to images
for($i=1;$i<=$nb_icons;$i++){
        $filt=eregi_replace("/ICONBOARD".$i."/","<img src=\"icons_board/icon$i.gif\" border=\"0\" alt=\"icon\"></img>",$filt);
        }

// Replace some asci icons by gifs
$filt=eregi_replace(quotemeta(";-)"),"<img src=\"icons_board/icon12.gif\" border=\"0\" alt=\"icon\"></img>",$filt);
$filt=eregi_replace(quotemeta(";)"),"<img src=\"icons_board/icon12.gif\" border=\"0\" alt=\"icon\"></img>",$filt);
$filt=eregi_replace(quotemeta(":-)"),"<img src=\"icons_board/icon9.gif\" border=\"0\" alt=\"icon\"></img>",$filt);
$filt=eregi_replace(quotemeta(":)"),"<img src=\"icons_board/icon18.gif\" border=\"0\" alt=\"icon\"></img>",$filt);
$filt=eregi_replace(quotemeta(":-("),"<img src=\"icons_board/icon14.gif\" border=\"0\" alt=\"icon\"></img>",$filt);
$filt=eregi_replace(quotemeta(":("),"<img src=\"icons_board/icon14.gif\" border=\"0\" alt=\"icon\"></img>",$filt);



// Simplified HTML
$filt=eregi_replace(quotemeta("[b]"),quotemeta("<b>"),$filt);
$filt=eregi_replace(quotemeta("[/b]"),quotemeta("</b>"),$filt);
$filt=eregi_replace(quotemeta("[li]"),quotemeta("<li>"),$filt);
$filt=eregi_replace(quotemeta("[i]"),quotemeta("<i>"),$filt);
$filt=eregi_replace(quotemeta("[/i]"),quotemeta("</i>"),$filt);
$filt=eregi_replace(quotemeta("[u]"),quotemeta("<u>"),$filt);
$filt=eregi_replace(quotemeta("[/u]"),quotemeta("</u>"),$filt);


// URL
$filt=eregi_replace("\\[url\\]([^\\[]*)\\[/url\\]","<a href=\"http://\\1\" target=_blank>\\1</a>",$filt);


// Email
$filt=eregi_replace("\\[email\\]([^\\[]*)\\[/email\\]","<a href=\"mailto:\\1\">\\1</a>",$filt);

// Replace newline by <br>
$filt=nl2br($filt);

$filt=eregi_replace("<br />","<br>",$filt);
return $filt;
}


//Reverse  filtering of the messages
function backhtmlfilt($filt,$nb_icons) {

//<br> to newline
$filt=eregi_replace("<br>","",$filt);

//email
$filt=eregi_replace("<a href=\"mailto:([^\\[<]*)\">([^\\[<]*)</a>","[email]\\1[/email]",$filt);

//url
$filt=eregi_replace("<a href=\"http://([^\\[<]*)\" target=_blank>([^\\[<]*)</a>","[url]\\1[/url]",$filt);

// Simplified HTML
$filt=eregi_replace(quotemeta("<b>"),"[b]",$filt);
$filt=eregi_replace(quotemeta("</b>"),"[/b]",$filt);
$filt=eregi_replace(quotemeta("<li>"),"[li]",$filt);
$filt=eregi_replace(quotemeta("<i>"),"[i]",$filt);
$filt=eregi_replace(quotemeta("</i>"),"[/i]",$filt);
$filt=eregi_replace(quotemeta("<u>"),"[u]",$filt);
$filt=eregi_replace(quotemeta("</u>"),"[/u]",$filt);

//  changing the icons  text to images
for($i=1;$i<=$nb_icons;$i++){
        $filt=eregi_replace("<img src=\"icons_board/icon$i.gif\" border=\"0\" alt=\"icon\"></img>","/ICONBOARD".$i."/",$filt);
        // for previous versions that did not have the </img> tag
         $filt=eregi_replace("<img src=\"icons_board/icon$i.gif\" border=\"0\" alt=\"icon\">","/ICONBOARD".$i."/",$filt);
        }

$filt=eregi_replace("&lt;","<",$filt);
$filt=eregi_replace("&gt;",">",$filt);

return $filt;
}
Return current item: news-tnk