could not connect to the database!
Started on the old forum in July 2010 · view the original in the archive · old links redirect here
Create a mysql database first form your hosting cpanel. Then edit your config.Php file and imput there your database details. Its all.
config not
Why these scripts havnt a config.Php help
if yes please give me!
abhiz wrote: Why these scripts havnt a config.Php help
if yes please give me!
Open 2wapforum.zip
Goto scripts then
edit waawaamp.inc
<?php
// This trick is to see just how long this **** takes to load, we have to stick this at the top of the site for it to be most accurate
// (think of this file as the top, all other files as little bottoms) and there's another part to this in index.php in the root.
//
//
$mtime = microtime();
$mtime = explode(' ', $mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////
// database connection point 3
///////////////////////////
$databasehost = "localhost";
$databaseuser = "user";
$databasepass = "pass";
$databasename = "your_db";
// default username please..
$PHNAME = "ADMIN";
//
//
//
//
mysql_connect($databasehost, $databaseuser, $databasepass) or
die("Could not connect to the database, check settings");
mysql_select_db($databasename);
//
//
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
//
// PhoenixBytes.co.uk v2.0 - Public EDITION.
//
// by: Chris [PhoenixBytes@o2.co.uk | admin@phoenixbytes.co.uk]
//
//
// date started: (day -96) 16/10/04 (it began one cold october night....)
// date opened: (day 001) 19/01/05 (...it took just three months from field to fork)
// date closed: (day 145) 03/06/05 (closed the site as i had no time for it.)
// date re-opened: (day 146) 30/07/05 (o2 started charging for gprs the next day.)
// last update as WaaWaamp: (day 165) 18/08/05 (time for a change)
// first update as Phoenix: (day 001) 31/08/05 (PhoenixBytes.co.uk)
// last update (day 068) 06/11/05 (making a copy for the public!)
//
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
header("Content-type: text/html");
header("Last-Modified: " . gmdate("D, dMYH:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
// the DocType Definition, or DTD, tells the browser that this page is XHTML version 1.0
// here we'll alternate between two DTDs to find the best, notice that one DTD should always be commented out.
//
// HTML transitional. (for debugging)
//
// echo "<!DOCTYPE html
// PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
// \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"><html><head>";
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
//
// XHTML mobile profile. (for mainstream use after all debugging)
//
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\"><head>";
//
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
// the login variable! - $login - if this is empty, then there is no session and this user must be a guest!
// ok so what's the '$u' for then? i mean, if $login is the username, where does $u come in?
// WELL, $u carries the username when logging in,
// since the look and feel of the site is based upon the user's settings
// i found myself at a loss to controlling the outside colours.
// the guest account was born and the $u is here to make sure that if $u is empty, we don't get a gay looking page.
//
//
//
if ($u != "") $login = "$u";
elseif ($login != "") $login = "$login";
else $login = "$PHNAME";
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
//// we select some from the ses and some from a static row.
////
$query = "select * from forum_users where username='$login'";
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
$row = mysql_fetch_array($result);
//////////////////////
//
//
//// switches
//
$css = $row["css"]; // Cascading Style Sheets on or off, good for debugging and saving some coin!
$in = $row_ses["inbox"]; // inbox message pop up notification switch
$simages = $row_ses["simages"]; // site images switch i.e. logos or buttons.
$alactive = $row_ses["alerts"]; // alert switch
$alertstatus = $row_ses["alerts"]; // same as $alactive but a different variable name to cater for older pages
$filter = $row_ses["filter"]; // profanity filter switch
$uicn = $row_ses["uicn"]; // user icon switch, i.e. uploads and remote images
$sicn = $row_ses["sicn"]; // site icon switch
$shortc = $row_ses["shortcuts"]; // site icon switch
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
////
//// colour settings - to keep the site running smoothly, we must query these rather than taking them from the session.
//// but we only want them for css users.
if ($css == "on")
{
$bgcolo = $row["bg_col"]; // background colour
$bgc = $row["bg_col"]; // same as $bgcolo but a different variable name to cater for older pages
$textcolour = $row["text_col"]; // text colour
$txt = $row["text_col"]; // same as $textcolour but a different variable name to cater for older pages
$namecolour = $row["my_color"]; // name colour
$cocol = $row["my_color"]; // same as $namecolour but a different variable name to cater for older pages
$tr_col = $row["tr_col"]; // table row colour [tables removed but still used!]
$tablecol = $row["tr_col"]; // same as $tr_col but a different variable name to cater for older pages
$trdc = $row["tr_col"]; // same as $tr_col but a different variable name to cater for older pages
}
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
////
//// forum settings
$pmax = $row_ses["pmax"]; // maximum replies per page in forums
$tmax = $row_ses["tmax"]; // maximum posts per page in forums
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
////
//// visits and posts etc
$visits = $row_ses["visits"]; // amount of times a user has visited
$posts = $row_ses["visits"]; // amount of times a user has posted
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
////
//// admin stuff
$group = $row_ses["userlevel"]; // user group. 1-admin 2-moderator 3-user
$trust = $row_ses["circle_of_trust"]; // circle of trust status
$owner = $row_ses["circle_of_trust"]; // site ownership status // Global means, set this to YES, all users are owners!
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
//
// and what about the velcome message?
$query = "select * from welcome";
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
$row = mysql_fetch_array($result);
$wwmsg = $row["msg"];
$logo_url = $row["url"];
$sitename = $row["sitetitle"];
$breakstick = $row["breaker"];
$upl = $row["uploaderlinks"];
$upls = $row["uploadsearchaddress"];
$lback = $row["linkbackaddress"];
$serverlocat = $row["serverlocation"];
$vyear = gmdate("Y");
$lIlIlIlI = "© PhoenixBytes $vyear";
//
// let's make the welcome message scroll across the screen and assign a variable
//
$ver = "<marquee loop=\"800\" bgcolor=\"red\" direction=\"left\">$wwmsg</marquee>";
//
// raw welcome message
$welcome = "$wwmsg";
//
// let's use the same query for the site logo.
//
$logo = "<img src=\"$lback/scripts/phoenix.php?string=$sitename\" alt=\"$sitename\"/>";
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
// CSS - Cascading Style Sheets.
//
// grab your phone, go on wap, bring up a page with text, input boxes and buttons then have a play about with these puppies.
// their names are a good indication as to what they do!
// remember to restore the old settings afterwards, otherwise you could really shag things up bad style.
// but before all that, let's pass a few colours in eh?
//
//
//
$topleft = "$namecolour";
$bottomright = "$tr_col";
$bg2 = "$txt";
$fontfamily = "Comic Sans MS, Tahoma, Verdana";
//
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
if ($css == "on")
{
echo "
<style type=\"text/css\">
<!--
a {text-decoration:none; color:$namecolour;}
-->
</style>
<style type=\"text/css\">
<!--
a:hover {color:$namecolour;}
-->
</style>
<style type=\"text/css\">
<!--
body {
color: $txt;
background-color: $bgc;
font-family: $fontfamily;
}
font-size: large;
}
a:link { color: $namecolour; }
a:visited { color: $tr_col; }
-->
</style>
<style type=\"text/css\">
<!--
.buttstyle {
background-color: $txt;
border-style: ridge;
padding: 2;
border-width: 1;
border-top-color: $topleft;
border-left-color: $topleft;
border-right-color: $bottomright;
border-bottom-color: $bottomright;
text-align: center;
color: $bgcolo;
font-family: $fontfamily;
font-weight: bold; }
-->
</style>
<style type=\"text/css\">
<!--
.break {
background-color: $txt;
border-style: ridge;
padding: 2;
border-width: 1;
border-top-color: $topleft;
border-left-color: $topleft;
border-right-color: $bottomright;
border-bottom-color: $bottomright;
color: $bgcolo;
text-align: center;
font-family: $fontfamily;
font-weight: bold; }
-->
</style>
<style type=\"text/css\">
<!--
.forum {
background-color: $txt;
text-align: left;
color: $bgcolo;
font-family: $fontfamily; }
-->
</style>
<style type=\"text/css\">
<!--
.breakforum {
background-color: $bg2;
text-align: left;
color: $bgcolo;
font-family: $fontfamily; }
-->
</style>
<style type=\"text/css\">
.textbox {
background-color: $txt;
border-style: ridge;
padding: 2;
border-width: 1;
border-top-color: $topleft;
border-left-color: $topleft;
border-right-color: $bottomright;
border-bottom-color: $bottomright;
color: $bgcolo;
font-family: $fontfamily;
font-weight: bold;
}
</style>";
}
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
// this is the calendar, formerly known as 'clock' until we ended up on a german server.
// php's date() function is beezer, but i wanted the days and the months in full, and in lower case.
// i could have strtolower()'d it but i'd have ended up with nov, dec, mon, tue etc, not nice.
//
$vday = gmdate("D");
if ($vday == "Mon") $day = "monday";
elseif ($vday == "Tue") $day = "tuesday";
elseif ($vday == "Wed") $day = "wednesday";
elseif ($vday == "Thu") $day = "thursday";
elseif ($vday == "Fri") $day = "friday";
elseif ($vday == "Sat") $day = "saturday";
elseif ($vday == "Sun") $day = "sunday";
$vmonth = gmdate("M");
if ($vmonth == "Jan") $month = "january";
elseif ($vmonth == "Feb") $month = "february";
elseif ($vmonth == "Mar") $month = "march";
elseif ($vmonth == "Apr") $month = "april";
elseif ($vmonth == "May") $month = "may";
elseif ($vmonth == "Jun") $month = "june";
elseif ($vmonth == "Jul") $month = "july";
elseif ($vmonth == "Aug") $month = "august";
elseif ($vmonth == "Sep") $month = "september";
elseif ($vmonth == "Oct") $month = "october";
elseif ($vmonth == "Nov") $month = "november";
elseif ($vmonth == "Dec") $month = "december";
$number = gmdate("jS");
$rawdate = "$day, $month $number";
$date = "<small>$rawdate</small>";
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
//
// this is where we rip out all the colour for our non-css'ians
$col = "#000000";
$mcol = "#000000";
$uol = "#000000";
$txt = "#000000";
$tr_col = "#000000";
// copyright info, to show who did all the work
//
$cp = "<small>$cpyright</small>";
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
// now we're getting the link addresses, again, nothing needs to be edited here!
//
$serverlocation = "$serverlocat";
$linkaddress = "$upl";
$linksubmitout = "$lback";
$uploadsearchlink = "$upl";
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
// this seperates pages but only if css is off!
if ($css == "off") $breaker = "<br/>$breakstick<br/>";
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
// hyfor, hyback and hyl are made to go on hyperlinks in the following format:
//
// forward/next link = $hyfor <a href=\"\"></a>
//
// back/previous/to the top link = $hyback <a href=\"\"></a>
//
// all other links = $hyl<a href=\"\"></a>$hyl
//
$hyl = "-";
$hyback = "<-";
$hyfor = "->";
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
//
// ok, so our header isn't working on skaggy samsungs, let's give this meta-shag (meta tag) a shot
// ok, prove yourself worthy of being in my file.
echo "<meta Http-Equiv=\"Pragma\" Content=\"no-cache\" />";
//
// ok, since we're doing the meta thing, i should tell you what else it can do
// there is no need to change these, see Meta Information in Administration.
//
// now, we want search engines to pick us up, yes? exaggerate like a bastard!
//
echo "<meta name=\"keywords\" content=\"$meta_keywords\"/>";
//
// the description of our site.
//
echo "<meta name=\"description\" content=\"$meta_description\"/>";
//
// what type of file is it? an image? a song? no, it's a document of xhtml.
//
echo "<meta name=\"resource-type\" content=\"document\"/>";
//
// and the copyright info
//
echo "<meta name=\"copyright\" content=\"$meta_copyright\"/>";
//
// and finally, who wrote the damn thing?
//
echo "<meta name=\"Author\" content=\"$meta_author\"/>";
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
//
// now we'll give back the shortcuts we cruelly nicked onReopen. let's take advantage of our AccessKeys, this way,
// as a user 'gets to know' the site, they can hold down the number of their desired shortcut and get there with no scrolling, thanks to the numbers.
//
// still not as good as WML shortcuts though, but we need the <go> and <do> tags for that and xhtml doesn't do those.
//
//
if ($group == 1) $adscut = "<dd>8 <a accesskey=\"8\" href=\"$lback/options/index2.php?ses=$ses&act=getgone\">administration</a></dd>";
else $adscut = "";
//
//
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
//
// shortcuts, an utter ****!
//
if ($shortc == "on")
{
$shortcuts = "</p><p align=\"left\">
<dl><dt><b>$Shortcuts</b></dt>
<dd>{</dd>
<dd><form action=\"$lback/forum/topics.php?ses=$ses&forum=$forum\" method=\"post\">
<select name=\"forum\" title=\"forums\" class=\"textbox\" value=\"$forum\">
<option value=\"everyday\">everyday forum</option>
<option value=\"newbies\">sign in forum</option>
<option value=\"mobiles\">mobiles forum</option>
<option value=\"fight\">fight forum</option>
<option value=\"test\">test forum</option>
</select>
<input type=\"hidden\" value=\"$ses\"/>
<postfield name=\"forum\" value=\"$(forum)\"/>
<postfield name=\"ses\" value=\"$(ses)\"/>
<input type=\"submit\" class=\"buttstyle\" value=\"go\"/>
</form></dd>
<dd>1 <a accesskey=\"1\" href=\"$lback/mail/index.php?ses=$ses&act=index\">mailbox</a></dd>
<dd>2 <a accesskey=\"2\" href=\"$lback/options/index.php?ses=$ses\">options</a></dd>
<dd>3 <a accesskey=\"3\" href=\"$lback/friends/index.php?ses=$ses\">friends</a></dd>
<dd>4 <a accesskey=\"4\" href=\"$lback/uploader/index.php?ses=$ses\">uploader</a></dd>
<dd>5 <a accesskey=\"5\" href=\"$lback/blogs.php?ses=$ses\">blogs</a></dd>
<dd>6 <a accesskey=\"6\" href=\"$lback/online.php?ses=$ses\">online list</a></dd>
<dd>7 <a accesskey=\"7\" href=\"$lback/faq/faqmain.php?ses=$ses\">help & info</a></dd>
$adscut
<dd>}</dd></dl></p><p align=\"center\">";
}
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
// decide what the page title should be...
//
echo "<title>$sitename</title>";
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
// the inbox link will appear on the page if a user has notification tyrned on and one or more new messages
//
if ($group <= 3)
{
if ($in == 1)
{
$query ="select count(*) from phoenix_mail where userto='$login' and read_state!=1 and bound!='out' and archive='no'";
$result = mysql_query($query);
$ims = number_format(mysql_result($result,0,"count(*)"));
if ($ims == 1) $inboxes = "<br/><b>$ims <a href=\"$lback/mail/inbox.php?ses=$ses\">new msg</a></b>";
elseif ($ims >> 1) $inboxes = "<br/><b>$ims <a href=\"$lback/mail/inbox.php?ses=$ses\">new msgs</a></b>";
else $inboxes = "";
}
}
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
// now let's close the <head> and open the body, because our adventure has only just begun, and we'll even need to argue on this!
if ($css == "on") echo "</head><body bgcolor=\"$bgc\" text=\"$txt\">";
else echo "</head><body bgcolor=\"#FFFFFF\" text=\"#000000\">";
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
// let's get the hits
//
$query = "select * from hit_counter";
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
$rowhit = mysql_fetch_array($result);
$hits = $rowhit["hits"];
//
// and give them a variable
//
$hitcounter = "<img src=\"$lback/scripts/hits.php?string=$hits\" alt=\"$hits\"/>";
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
// Now, we set our FUNCTIONS,
// because they don't occur naturally in php, we have to make them exist, let's go...
//
//
function make_wml_compat($string)
{
$string = ltrim($string);
$string = ereg_replace("©","~copy",$string);
$string = ereg_replace("®","~reg",$string);
$string = ereg_replace("---","'",$string);
$string = ereg_replace("-ampersand-","&",$string);
$string = ereg_replace("-dquote-","\"",$string);
$string = ereg_replace("-squote-","'",$string);
$string = ereg_replace("-tilde-","~",$string);
$string = ereg_replace("-pound-","£",$string);
$string = ereg_replace("-dollar-","?",$string);
$string = ereg_replace("£","£",$string);
$string = ereg_replace("<","<",$string);
$string = ereg_replace(">",">",$string);
$string = ereg_replace("icon:","=",$string);
$string = ereg_replace("-drop-","<br/>",$string);
$string = ereg_replace("¹","-1",$string);
$string = ereg_replace("²","-2",$string);
$string = ereg_replace("³","-3",$string);
$string = ereg_replace("€","-euro",$string);
$string = ereg_replace("~copy","©",$string);
$string = ereg_replace("~reg","®",$string);
$string = ereg_replace("~club","♣",$string);
$string = ereg_replace("~spade","♠",$string);
$string = ereg_replace("~heart","♥",$string);
$string = ereg_replace("~diamond","♦",$string);
$string = ereg_replace("~1","¹",$string);
$string = ereg_replace("~2","²",$string);
$string = ereg_replace("~3","³",$string);
$string = ereg_replace("~half","½",$string);
$string = ereg_replace("~quart","¼",$string);
$string = ereg_replace("~euro","€",$string);
$string = ereg_replace("~dot","•",$string);
$curcharlength = strlen($string);
$outstring = $string;
for ($i = 0; $i <= ($curcharlength-1); $i++) {
$curchar = substr ($string,$i,1);
$ochar = ord($curchar);
if ($ochar > 122) {
$new = "&#x" . strtoupper(dechex($ochar)) . ";";
$outstring = ereg_replace($curchar,$new,$outstring);
}
if ($ochar < 32)
$outstring = ereg_replace($curchar,"", $outstring);
}
return $outstring;
}
function funk_it_up($string)
{
//
//
$string = ereg_replace("¶","<br/>",$string);
$string = ereg_replace("µ"," ",$string);
$string = " " . $string . " ";
$string = ereg_replace("===","<br/>",$string);
$string = ereg_replace(chr(10),"<br/>",$string);
$string = ereg_replace(chr(13),"<br/>",$string);
//
$query = "select * from welcome";
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
$row = mysql_fetch_array($result);
$sitename = $row["sitetitle"];
//
$string = eregi_replace("call:([^<>[:space:]]+[[:alnum:]/])","<a href=\"wtai://wp/mc;\\1\">Call \\1</a>", $string);
$string = eregi_replace("pbook:([^<>[:space:]]+[[:alnum:]/])","<a href=\"wtai://wp/ap;\\1;$sitename\">Save \\1</a>", $string);
$string = eregi_replace("click:([^<>[:space:]]+[[:alnum:]/])","<a href=\"http://\\1\"><img src=\"http://\\1\" alt=\"\" /></a>", $string);
$string = eregi_replace("mailto:([^<>[:space:]]+[[:alnum:]/])","<a href=\"mailto:\\1?subject=$sitename\">\\1</a>", $string);
$string = eregi_replace("img:([^<>[:space:]]+[[:alnum:]/])","<img src=\"http://\\1\" alt=\"\" />", $string);
$string = eregi_replace("icons:([^<>[:space:]]+[[:alnum:]/])","<b><a href=\"$lback/options/\\1.php?ses=$ses\">\\1 icons</a></b>", $string);
$string = eregi_replace("file:([^<>[:space:]]+[[:alnum:]/])","<b><a style=\"background-color: green;\" href=\"$upl/\\1\">\\1</a></b>", $string);
$string = eregi_replace("link:([^<>[:space:]]+[[:alnum:]/])","<b><a href=\"http://\\1\">\\1</a></b>", $string);
$string = preg_replace( "#\(br\)#is", "$breakstick", $string );
$string = preg_replace( "#\(b\)(.+?)\(/b\)#is", "<b>\\1</b>", $string );
$string = preg_replace( "#\(i\)(.+?)\(/i\)#is", "<i>\\1</i>", $string );
$string = preg_replace( "#\(u\)(.+?)\(/u\)#is", "<u>\\1</u>", $string );
$string = preg_replace( "#\(l\)(.+?)\(/l\)#is", "<big><b>\\1</b></big>", $string );
$string = preg_replace( "#\(big\)(.+?)\(/big\)#is", "<big>\\1</big>", $string );
$string = preg_replace( "#\(s\)(.+?)\(/s\)#is", "<small>\\1</small>", $string );
$string = preg_replace( "#\(q\)(.+?)\(/q\)#is", "<i>"...\\1..."</i>", $string );
$string = preg_replace( "#\(c\)(.+?)\(/c\)#is", "</p><p align=\"center\">\\1</p><p></center>", $string );
$string = preg_replace( "#\(r\)(.+?)\(/r\)#is", "</p><p align=\"right\">\\1</p><p>", $string );
$string = preg_replace( "#\(d\)(.+?)\(/d\)#is", "</p><p align=\"left\">\\1</p><p>", $string );
$string = preg_replace( "#\(red\)(.+?)\(/red\)#is", "<span style=\"color: #FF0000;\">\\1</span>", $string );
$string = preg_replace( "#\(green\)(.+?)\(/green\)#is", "<span style=\"color: #00CC00;\">\\1</span>", $string );
$string = preg_replace( "#\(yellow\)(.+?)\(/yellow\)#is", "<span style=\"color: #FFFF00;\">\\1</span>", $string );
$string = preg_replace( "#\(orange\)(.+?)\(/orange\)#is", "<span style=\"color: #FF9900;\">\\1</span>", $string );
$string = preg_replace( "#\(pink\)(.+?)\(/pink\)#is", "<span style=\"color: #FF1493;\">\\1</span>", $string );
$string = preg_replace( "#\(blue\)(.+?)\(/blue\)#is", "<span style=\"color: #0000FF;\">\\1</span>", $string );
$string = preg_replace( "#\(black\)(.+?)\(/black\)#is", "<span style=\"color: #000000;\">\\1</span>", $string );
$string = preg_replace( "#\(white\)(.+?)\(/white\)#is", "<span style=\"color: #FFFFFF;\">\\1</span>", $string );
$string = preg_replace( "#\(gray\)(.+?)\(/gray\)#is", "<span style=\"color: #CCCCCC;\">\\1</span>", $string );
$string = preg_replace( "#\(cyan\)(.+?)\(/cyan\)#is", "<span style=\"color: #00FFFF;\">\\1</span>", $string );
$string = preg_replace( "#\(scr\)(.+?)\(/scr\)#is", "<marquee loop=\"800\" direction=\"right\">\\1</marquee>", $string );
$string = preg_replace( "#\(scl\)(.+?)\(/scl\)#is", "<marquee loop=\"800\" direction=\"left\">\\1</marquee>", $string );
$string = preg_replace( "#\(scr:red\)(.+?)\(/scr\)#is", "<marquee loop=\"800\" bgcolor=\"#FF0000\" direction=\"right\">\\1</marquee>", $string );
$string = preg_replace( "#\(scr:green\)(.+?)\(/scr\)#is", "<marquee loop=\"800\" bgcolor=\"#00CC00\" direction=\"right\">\\1</marquee>", $string );
$string = preg_replace( "#\(scr:yellow\)(.+?)\(/scr\)#is", "<marquee loop=\"800\" bgcolor=\"#FFFF00\" direction=\"right\">\\1</marquee>", $string );
$string = preg_replace( "#\(scr:blue\)(.+?)\(/scr\)#is", "<marquee loop=\"800\" bgcolor=\"#0000FF\" direction=\"right\">\\1</marquee>", $string );
$string = preg_replace( "#\(scr:orange\)(.+?)\(/scr\)#is", "<marquee loop=\"800\" bgcolor=\"#FF9900\" direction=\"right\">\\1</marquee>", $string );
$string = preg_replace( "#\(scr:pink\)(.+?)\(/scr\)#is", "<marquee loop=\"800\" bgcolor=\"#FF1493\" direction=\"right\">\\1</marquee>", $string );
$string = preg_replace( "#\(scr:white\)(.+?)\(/scr\)#is", "<marquee loop=\"800\" bgcolor=\"#FFFFFF\" direction=\"right\">\\1</marquee>", $string );
$string = preg_replace( "#\(scr:gray\)(.+?)\(/scr\)#is", "<marquee loop=\"800\" bgcolor=\"#CCCCCC\" direction=\"right\">\\1</marquee>", $string );
$string = preg_replace( "#\(scr:black\)(.+?)\(/scr\)#is", "<marquee loop=\"800\" bgcolor=\"#000000\" direction=\"right\">\\1</marquee>", $string );
$string = preg_replace( "#\(scr:cyan\)(.+?)\(/scr\)#is", "<marquee loop=\"800\" bgcolor=\"#00FFFF\" direction=\"right\">\\1</marquee>", $string );
$string = preg_replace( "#\(scl:red\)(.+?)\(/scl\)#is", "<marquee loop=\"800\" bgcolor=\"#FF0000\" direction=\"left\">\\1</marquee>", $string );
$string = preg_replace( "#\(scl:green\)(.+?)\(/scl\)#is", "<marquee loop=\"800\" bgcolor=\"#00CC00\" direction=\"left\">\\1</marquee>", $string );
$string = preg_replace( "#\(scl:yellow\)(.+?)\(/scl\)#is", "<marquee loop=\"800\" bgcolor=\"#FFFF00\" direction=\"left\">\\1</marquee>", $string );
$string = preg_replace( "#\(scl:blue\)(.+?)\(/scl\)#is", "<marquee loop=\"800\" bgcolor=\"#0000FF\" direction=\"left\">\\1</marquee>", $string );
$string = preg_replace( "#\(scl:orange\)(.+?)\(/scl\)#is", "<marquee loop=\"800\" bgcolor=\"#FF9900\" direction=\"left\">\\1</marquee>", $string );
$string = preg_replace( "#\(scl:pink\)(.+?)\(/scl\)#is", "<marquee loop=\"800\" bgcolor=\"#FF1493\" direction=\"left\">\\1</marquee>", $string );
$string = preg_replace( "#\(scl:white\)(.+?)\(/scl\)#is", "<marquee loop=\"800\" bgcolor=\"#FFFFFF\" direction=\"left\">\\1</marquee>", $string );
$string = preg_replace( "#\(scl:gray\)(.+?)\(/scl\)#is", "<marquee loop=\"800\" bgcolor=\"#CCCCCC\" direction=\"left\">\\1</marquee>", $string );
$string = preg_replace( "#\(scl:black\)(.+?)\(/scl\)#is", "<marquee loop=\"800\" bgcolor=\"#000000\" direction=\"left\">\\1</marquee>", $string );
$string = preg_replace( "#\(scl:cyan\)(.+?)\(/scl\)#is", "<marquee loop=\"800\" bgcolor=\"#00FFFF\" direction=\"left\">\\1</marquee>", $string );
$string = preg_replace( "#\(blink\)(.+?)\(/blink\)#is", "<blink>\\1</blink>", $string );
$string = preg_replace( "#\(flash\)(.+?)\(/flash\)#is", "<blink>\\1</blink>", $string );
$string = ereg_replace("<br/><br/><img","<br/><img",$string);
$string = trim($string);
return $string;
}
//////////////////////////////////////////////////////
/////////////////////////////////////////////////////
//
// stats
//
//
function show_it_up($string)
{
//
$string = ereg_replace("<br/><br/><img","<br/><img",$string);
//
$string = trim($string);
return $string;
}
///////////////////////////////////////////
// site icons
//
//
function add_sicn($string)
{
$query = "SELECT typed, image FROM phoenix_icons";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
while ($row)
{
$text = $row["typed"];
$icon = $row["image"];
$string = str_replace($text, " <img src=\"$lback/sicn/$icon.gif\" alt=\"$icon\" /> ", $string);
$row = mysql_fetch_array($result);
}
return $string;
}
//////////////////////////////////////////////////////
$vyear = gmdate("Y");
$lIlIlIlI = "© PhoenixBytes $vyear";
//////////////////////////////////////////////////////
/////////////////////////////////////////////////////
//
// strip urls for bad stuff
//
function make_url_compat($string)
{
$string = ltrim($string);
$string = ereg_replace("&","%26",$string);
$string = ereg_replace(" ","%20",$string);
$string = ereg_replace("\(","%28",$string);
$string = ereg_replace("\)","%29",$string);
$string = ereg_replace("<","%3C",$string);
$string = ereg_replace(">","%3E",$string);
$curcharlength = strlen($string);
$outstring = $string;
for ($i = 0; $i <= ($curcharlength-1); $i++) {
$curchar = substr ($string,$i,1);
$ochar = ord($curchar);
if ($ochar > 122) {
$new = "&#x" . strtoupper(dechex($ochar)) . ";";
$outstring = ereg_replace($curchar,$new,$outstring);
}
if ($ochar < 32)
$outstring = ereg_replace($curchar,"", $outstring);
}
return $outstring;
}
//////////////////////////////////////////////////////////////
//
// user icons
//
function add_uicn($string)
{
$query = "SELECT code, name, loc FROM phoenix_uicons";
$result = mysql_query($query);
$rowu = mysql_fetch_array($result);
while ($rowu)
{
$text = $rowu["code"];
$uicon = $rowu["name"];
$loc = $rowu["loc"];
$loc = make_url_compat("$loc");
$uicon = make_url_compat("$uicon");
$string = eregi_replace($text.$uicon," <img src=\"$loc\" alt=\"$uicon\" /> ", $string);
$rowu = mysql_fetch_array($result);
}
return $string;
}
/////////////////////////////////////////////////////////////////////////////
//
// profanity filter
//
function add_filter($string)
{
$query = "SELECT * FROM phoenix_filter";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
while ($row)
{
$word = $row["word"];
$replace = $row["replace"];
$string = eregi_replace($word, "$replace", $string);
$row = mysql_fetch_array($result);
}
return $string;
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//
// this one's old now but some pages might still want it, if you delete it and it wants it a fatal error occurs "undefined function"
//
function make_db_compat($string)
{
$string = ltrim($string);
$string = ereg_replace("\|",".",$string);
$curcharlength = strlen($string);
$outstring = $string;
for ($i = 0; $i <= ($curcharlength-1); $i++) {
$curchar = substr ($string,$i,1);
$ochar = ord($curchar);
if ($ochar > 122) {
$new = "&#x" . strtoupper(dechex($ochar)) . ";";
$outstring = ereg_replace($curchar,$new,$outstring);
}
if ($ochar < 32)
$outstring = ereg_replace($curchar,"", $outstring);
}
$outstring = ereg_replace("waawaank","waawaamp", $outstring);
$outstring = ereg_replace("waawank","waawaamp", $outstring);
return $outstring;
}
$vyear = gmdate("Y");
$lIlIlIlI = "© PhoenixBytes $vyear";
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
?>
Taken me to find is 1.8 sec's Taken me to write here 2.9 sec's
Watch your eye's go WOW im silly is priceless !!!!
Added after 9 minutes:
Wapdesire_v2.zip
core/main.inc
<?php
function incfile($file,$d="")
{
while(!is_file($d.$file)){$d.="../";}
require($d.$file);
}
incfile('./core/register.inc');
incfile('./core/functions.inc');
incfile('./core/xhtml.inc');
incfile('./core/admin.inc');
incfile('./core/userinfo.inc');
incfile('./core/header.inc');
$databasehost="localhost";
$databaseuser="root";
$databasepass="rootwdp";
$databasename="teaze_chat";
mysql_connect($databasehost, $databaseuser, $databasepass) or
die("Could not connect to the database");
mysql_select_db($databasename);
putenv("TZ=".timezone());
//if($username=="")$username="guest";
$key0="accesskey=\"0\"";
$zerokey="<b>0 </b>";
$key1="accesskey=\"1\"";
$onekey="<b>1 </b>";
$key2="accesskey=\"2\"";
$twokey="<b>2 </b>";
$key3="accesskey=\"3\"";
$threekey="<b>3 </b>";
$key4="accesskey=\"4\"";
$fourkey="<b>4 </b>";
$key5="accesskey=\"5\"";
$fivekey="<b>5 </b>";
$key6="accesskey=\"6\"";
$sixkey="<b>6 </b>";
$key7="accesskey=\"7\"";
$sevenkey="<b>7 </b>";
$key8="accesskey=\"8\"";
$eightkey="<b>8 </b>";
$key9="accesskey=\"9\"";
$ninekey="<b>9 </b>";
$keyS="accesskey=\"*\"";
$Skey="<b>* </b>";
$keN="accesskey=\"#\"";
$Nkey="<b># </b>";
$row_users=mysql_fetch_array(mysql_query("select * from users where username='".getnick_sid($sid)."'"));
$row_profiles=mysql_fetch_array(mysql_query("select * from profiles where uid='".getuid_sid($sid)."'"));
$row_quiz=mysql_fetch_array(mysql_query("select * from quiz"));
$count_popup=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM popups WHERE unread='1' AND toid='".getuid_sid($sid)."'"));
$query="select * from settings";
$result=mysql_query($query);
$num_rows=mysql_num_rows($result);
$row=mysql_fetch_array($result);
$sitename=sitename();
$align=align();
$vars=$_GET;
function isreq($str)
{
$req="a.p.b.g";
$pos=strpos($req, $str);
if($pos===false){return false;}
return true;
}
foreach($vars as $var=>$val){
if(!isreq($var)){
$uname=$var;
break;
}
}
if(end(explode("/",$_SERVER['SCRIPT_FILENAME']))=="index.php"&&isuser(getuid_nick($uname))){
header("location: ./wapsites/wapsite.php?$uname");
exit;
}
$total="3";
$file_type=".png";
$start="1";
$random=mt_rand($start, $total);
$image_name=$random . $file_type;
$logo="logo_".$image_name;
if(mobile())$logo="logo_".$image_name."&f=png&w=150";
$banner="banner_".$image_name;
if(mobile())$banner="banner_".$image_name."&f=png&w=128";
$ver="<marquee loop=\"800\" bgcolor=\"red\" direction=\"left\">$sitename</marquee>";
$copyright="© ".sitename()." ".gmdate("Y");
$emailaddress=email(site);
$max_buds=100;
?>
Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!
SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…
ummmmmm, sign up then change perm to 3 ????
Nothing easy for you is there ?
If you still can't work out this problem !!
Read this topic
Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!
SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…