Lavalair Mods...

Started on the old forum in June 2008 · view the original in the archive · old links redirect here

147 replies · 72,508 views · started 18 years ago · 1 min read

TL;DR · summary of 147 replies
  • -metulj provided a fixed code and usage instructions for the total unread PMs count feature.
  • -Rider added code to display user avatars next to their names in online lists, forums, etc.
  • -The profile moods functionality was discussed by opticalpigion, with a link provided for downloading images.
  • -No specific unresolved issues were mentioned regarding the forum mods.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

48 participants
stefan998 Junior · 25 posts #141
<?php

include("core.php");
include("config.php");

header("Content-type: text/html; charset=ISO-8859-1");
echo "<?xml version="1.0" encoding="ISO-8859-1" ?>";
echo "<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN""http://www.wapforum.org/DTD/xhtml-mobile10.dtd">";
echo "<html xmlns="http://www.w3.org/1999/xhtml">";

//<html xmlns="http://www.w3.org/1999/xhtml">

$uid = $_POST["uid"];
$pwd = $_POST["pwd"];
$cpw = $_POST["cpw"];
$email = $_POST["email"];
$ubr = $_POST["browserm"];
$usx = $_POST["usx"];
$bdy = $_POST["bdy"];
$ulc = $_POST["ulc"];
$info = $_POST["info"];
$brws = $_POST["brws"];
$usex = $_POST["usex"];

connectdb();

$sitename = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='sitename'"));

$sitename = $sitename[0];

$brws = explode("/",$_SERVER['HTTP_USER_AGENT']);

$ubr = $brws[0];

echo "<head>";

echo "<title>$sitename</title>";

echo "<link rel="stylesheet" type="text/css" href="../themes/black_medium.css">";

echo "</head>";

echo "<body>";

$ipr = getip();

$uip = explode(".",$ipr);

//if((!canreg())||(isipbanned($ipr,$ubr)))
if(!canreg())

{

    echo "<p>";

    echo "<img src="../images/notok.gif" border="0" alt="X"/>Registration is closed at the moment";

    echo "</p>";

}else{

echo "<p>";

?>

<img src="../images/point.gif" alt="!"/>

Allowed characters in userid and password are a-z, 0-9, and -_ only<br/>

<img src="../images/point.gif" alt="!"/>

No vulgar words are accepted in Username<br/>

<img src="../images/point.gif" alt="!"/>

Username and Password must contain at least 4 characters<br/>

<img src="../images/point.gif" alt="!"/>

Username must begin with a letter and cannot contain capitals<br/>

<img src="../images/point.gif" alt="!"/>

Password will be case sensitive<br/>

<?php

$tolog = false;

if(trim($uid)=="")

{

    echo registerform(1);

}else if(trim($pwd)=="")

{

    echo registerform(2);

}else if(trim($cpw)=="")

{

    echo registerform(3);

}else if(spacesin($uid)||scharin($uid))

{

    echo registerform(4);

}else if(spacesin($pwd)||scharin($pwd))

{

    echo registerform(5);

}else if($pwd!=$cpw)

{

    echo registerform(6);

}else if(strlen($uid)<4)

{

    echo registerform(7);

}else if(strlen($pwd)<4)

{

    echo registerform(8);

}else if(isdigitf($uid))

{

    echo registerform(11);

}else if(checknick($uid)==1)

{

    echo registerform(12);

}else if(checknick($uid)==2)

{

    echo registerform(13);

}else if(trim($email)=="")

{

    echo registerform(14);

}else if(register($uid,$pwd,$usx,$bday,$ulc,$email,$info,$ubr)==1)

{

    echo registerform(9);

}else if(register($uid,$pwd,$usx,$bday,$ulc,$email,$info,$ubr)==2)

{

    echo registerform(10);

}else{

$brws = explode("/",$_SERVER['HTTP_USER_AGENT']);

    $ubr = $brws[0];

    //$fp = fopen("gallery/info.txt","a+");

    //fwrite ($fp, "\n".$uid."-".$pwd."-".$ipr."-".$ubr."\n");

    //fclose($fp);

  echo "Registration completed successfully!<br/>";

 // echo "<br/><b>Username: </b>$uid<br/>";

 // echo "<b>Password: </b>$pwd<br/><br/>";

  if(validation())

  {

  echo "Please give us up to 12hrs to validate you (normally it be done within an hour)";

  }

  $tolog = true;

}

echo "</p>";

}

echo "<p>";

if($tolog)

{

echo "<a href="login.php?loguid=$uid&logpwd=$pwd"><img src="../images/home.gif" alt=""/>Login</a>";

}else{

echo "<b>0 </b><a accesskey="0" href="index.php"><img src="../images/home.gif" alt=""/>Home</a>";

}

echo "</p>";

echo "</body>";

?>

</html>

Here is the code of register.php

stefan998 Junior · 25 posts #142
////////////////////////////////////////////////////Register

function register($name,$pass,$usex,$bday,$uloc,$email,$info, $ubr)

{

  $execms = mysql_query("SELECT * FROM ibwf_users WHERE name='".$name."'");

  if (mysql_num_rows($execms)>0){

    return 1;

  }else{

    $pass = md5($pass);

    $validation = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='vldtn'"));

    if($validation[0]==1)

    {

    $validated=0;

    }else{

    $validated=1;

    }

    $reg = mysql_query("INSERT INTO ibwf_users SET name='".$name."', pass='".$pass."', birthday='".$bday."', sex='".$usex."', location='".$uloc."', cluster='".$email."', signature='".$info."', regdate='".time()."', validated='".$validated."', ipadd='".getip()."', browserm='".$ubr."'");
  //  $reg = mysql_query("INSERT INTO iwbf_users SET name='".$name."', pass='".$pass."', birthday='".$bday."', sex='".$usex."', location='".$uloc."', regdate='".time()."', ipadd='".getip()."', browserm='".$ubr."'");

    if ($reg)

    {
      $uid = mysql_fetch_array(mysql_query("SELECT id FROM ibwf_users WHERE name='".$name."'"));
  //  $uid = getuid_nick($name);

      addonline($uid,"Just Registered","");

      $delonline = mysql_query("DELETE FROM ibwf_online WHERE userid='".$uid."'");

      $uid = mysql_fetch_array(mysql_query("SELECT id FROM ibwf_users WHERE name='".$name."'"));

      $sitename = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='sitename'"));

      $msg = "Hello /reader =). Greetings from all $sitename[0] staff, we are happy to have you here, welcome to our big happy family!, If You Have any questions or comments about the site feel free to message me or any of the other staff members online. ENJOY!(excited)[br/][small][i]p.s: this is an automated pm[/i][/small]";

      $msg = mysql_escape_string($msg);

      autopm($msg, $uid[0]);

      return 0;

    }else{

      return 2;

    }

  }

}
function registerform($ef)

{

  $ue = $errl = $pe = $ce = "";

  switch($ef)

  {

    case 1:

        $errl = "<img src="../images/point.gif" alt="!"/> Pls type your username";

        $ue = "<img src="../images/point.gif" alt="!"/>";

        break;

    case 2:

        $errl = "<img src="../images/point.gif" alt="!"/> Pls type your password";

        $pe = "<img src="../images/point.gif" alt="!"/>";

        break;

    case 3:

        $errl = "<img src="../images/point.gif" alt="!"/> Pls type your password again";

        $ce = "<img src="../images/point.gif" alt="!"/>";

        break;

    case 4:

        $errl = "<img src="../images/point.gif" alt="!"/> Username is invalid";

        $ue = "<img src="../images/point.gif" alt="!"/>";

        break;

    case 5:

        $errl = "<img src="../images/point.gif" alt="!"/> Password is invalid";

        $pe = "<img src="../images/point.gif" alt="!"/>";

        break;

    case 6:

        $errl = "<img src="../images/point.gif" alt="!"/> Passwords dnt match";

        $ce = "<img src="../images/point.gif" alt="!"/>";

        break;

    case 7:

        $errl = "<img src="../images/point.gif" alt="!"/> Username must be 4 characters or more";

        $ue = "<img src="../images/point.gif" alt="!"/>";

        break;

    case 8:

        $errl = "<img src="../images/point.gif" alt="!"/> Password must be 4 characters or more";

        $pe = "<img src="../images/point.gif" alt="!"/>";

        break;

    case 9:

        $errl = "<img src="../images/point.gif" alt="!"/> Username is taken";

        $ue = "<img src="../images/point.gif" alt="!"/>";

        break;

    case 10:

        $errl = "<img src="../images/point.gif" alt="!"/> Unknown error pls try again l8r";

break;

    case 11:

        $errl = "<img src="../images/point.gif" alt="!"/> Username must start with a letter from a-z";

        $ue = "<img src="../images/point.gif" alt="!"/>";

        break;

    case 12:

        $errl = "<img src="../images/point.gif" alt="!"/> Username is reserved for admins of the site";

        $ue = "<img src="../images/point.gif" alt="!"/>";

        break;

    case 13:

        $errl = "<img src="../images/point.gif" alt="!"/> Please choose an appropriate username";

        $ue = "<img src="../images/point.gif" alt="!"/>";

        break;

    case 14:

        $errl = "<img src="../images/point.gif" alt="!"/> U must enter an email address";

        $ue = "<img src="../images/point.gif" alt="!"/>";

        break;

  }

 $rform = "<small>$errl</small><br/><br/>";
  $rform .= "<form action="register.php" method="post">";

  $rform .= "$ue Username: <input name="uid" style="-wap-input-format: '*x'" maxlength="12"/><br/>";

  $rform .= "$pe Password: <input type="password" name="pwd" maxlength="10"/><br/>";

  $rform .= "$ce Password: <input type="password" name="cpw" maxlength="10"/><br/>";

$rform .= "Date of birth (YYYY-MM-DD): <input name="bdy" maxlength="30"/><br/>";
  $rform .= "Sex:<br/>";

  $rform .= "<select name="usx" value="M">";

  $rform .= "<option value="M">Male</option>";

  $rform .= "<option value="F">Female</option>";

  $rform .= "</select><br/>";

  $rform .= "Country: <input name="ulc" maxlength="100"/><br/>";

  $rform .= "Email: <input name="email" maxlength="50"/><br/>";

  $rform .= "Info: <input name="info" maxlength="100"/><br/>";

//  $rform .= "<input type="Submit" name="Register" Value="Register"></form>";

  //$rform .= "<br/>$errl";

  $rform .= "<input type="submit" value="Register"/>";
  $rform .= "</form>";
  return $rform;

Those are from core.php

something else Fellow · 2,296 posts #143

There is multiple php errors on your registration page...

I think I have fixed them with this:

<?php
    include("core.php");
    include("config.php");
    header("Content-type: text/html; charset=ISO-8859-1");
    echo '<?xml version="1.0" encoding="ISO-8859-1" ?>';
    echo '<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN""http://www.wapforum.org/DTD/xhtml-mobile10.dtd">';
    echo '<html xmlns="http://www.w3.org/1999/xhtml">';

    $uid = $_POST["uid"];
    $pwd = $_POST["pwd"];
    $cpw = $_POST["cpw"];
    $email = $_POST["email"];
    $ubr = $_POST["browserm"];
    $usx = $_POST["usx"];
    $bdy = $_POST["bdy"];
    $ulc = $_POST["ulc"];
    $info = $_POST["info"];
    $brws = $_POST["brws"];
    $usex = $_POST["usex"];

    connectdb();
    $sitename = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='sitename'"));
    $sitename = $sitename[0];
    $brws = explode("/",$_SERVER['HTTP_USER_AGENT']);
    $ubr = $brws[0];
    echo '<head><title>'.$sitename.'</title><link rel="stylesheet" type="text/css" href="../themes/black_medium.css"></head><body>';
    $ipr = getip();
    $uip = explode(".",$ipr);

    //if((!canreg())||(isipbanned($ipr,$ubr)))
    if(!canreg())
    {
        echo '<p><img src="../images/notok.gif" border="0" alt="X"/>Registration is closed at the moment</p>';
    }
    else
    {
?>
        <p>
        <img src="../images/point.gif" alt="!"/>
        Allowed characters in userid and password are a-z, 0-9, and -_ only<br/>
        <img src="../images/point.gif" alt="!"/>
        No vulgar words are accepted in Username<br/>
        <img src="../images/point.gif" alt="!"/>
        Username and Password must contain at least 4 characters<br/>
        <img src="../images/point.gif" alt="!"/>
        Username must begin with a letter and cannot contain capitals<br/>
        <img src="../images/point.gif" alt="!"/>
        Password will be case sensitive<br/>
<?php
        $tolog = false;
        if(trim($uid)=="")
        {
            echo registerform(1);
        }
        else if(trim($pwd)=="")
        {
            echo registerform(2);
        }
        else if(trim($cpw)=="")
        {
            echo registerform(3);
        }
        else if(spacesin($uid)||scharin($uid))
        {
            echo registerform(4);
        }
        else if(spacesin($pwd)||scharin($pwd))
        {
            echo registerform(5);
        }
        else if($pwd!=$cpw)
        {
            echo registerform(6);
        }
        else if(strlen($uid)<4)
        {
            echo registerform(7);
        }
        else if(strlen($pwd)<4)
        {
            echo registerform(8);
        }else if(isdigitf($uid))
        {
            echo registerform(11);
        }
        else if(checknick($uid)==1)
        {
            echo registerform(12);

        }
        else if(checknick($uid)==2)
        {
            echo registerform(13);

        }
        else if(trim($email)=="")
        {
            echo registerform(14);

        }
        else if(register($uid,$pwd,$usx,$bday,$ulc,$email,$info,$ubr)==1)
        {
            echo registerform(9);
        }
        else if(register($uid,$pwd,$usx,$bday,$ulc,$email,$info,$ubr)==2)
        {
            echo registerform(10);
        }
        else
        {
            $brws = explode("/",$_SERVER['HTTP_USER_AGENT']);
            $ubr = $brws[0];
            //$fp = fopen("gallery/info.txt","a+");
            //fwrite ($fp, "\n".$uid."-".$pwd."-".$ipr."-".$ubr."\n");
            //fclose($fp);

            echo "Registration completed successfully!<br/>";
            // echo "<br/><b>Username: </b>$uid<br/>";
            // echo "<b>Password: </b>$pwd<br/><br/>";
            if(validation())
            {
                echo "Please give us up to 12hrs to validate you (normally it be done within an hour)";
            }
            $tolog = true;
        }
        echo "</p>";
    }
    echo "<p>";
    if($tolog)
    {
        /*
        $msg = "\n Username: ".$uid." \n Password: ".$pwd." \n\n ".$sitename." is a nice friendly chat community we are glad to hav u with us :o) pls feel free to bring ya m8s along \n\n Thank You\n".$sitename;
        $subj = "Registration details for ".$sitename;
        $headers = 'From: owner@vodkawap.us.to' . "\r\n" .
        'Reply-To: fiona@scotland.uk.to' . "\r\n" .
        'X-Mailer: PHP/' . phpversion();
        mail($email, $subj, $msg, $headers);
        */
        echo '<a href="login.php?loguid='.$uid.'&logpwd='.$pwd.'"><img src="../images/home.gif" alt=""/>Login</a>';
    }
    else
    {
        echo '<b>0 </b><a accesskey="0" href="index.php"><img src="../images/home.gif" alt=""/>Home</a>';
    }
    echo "</p></body></html>";
?>

Note: I have edited this post as there was still 1 error on it

stefan998 Junior · 25 posts #144

This is what I after clicking register

Attachments: still-the-same-problem-this-is-what-i-get-after-clicking-re.png
something else Fellow · 2,296 posts #145

Try putting these 2 lines at the top of your register page after "<?php" to see if php gives you any error messages:

error_reporting  (E_ALL);
ini_set ('display_errors', true);
stefan998 Junior · 25 posts #146

This is what i get Notice: Undefined index: uid in /home/vol15_6/byethost3.com/b3_20561234/htdocs/web/register.php on line 16

Notice: Undefined index: pwd in /home/vol15_6/byethost3.com/b3_20561234/htdocs/web/register.php on line 17

Notice: Undefined index: cpw in /home/vol15_6/byethost3.com/b3_20561234/htdocs/web/register.php on line 18

Notice: Undefined index: email in /home/vol15_6/byethost3.com/b3_20561234/htdocs/web/register.php on line 19

Notice: Undefined index: browserm in /home/vol15_6/byethost3.com/b3_20561234/htdocs/web/register.php on line 20

Notice: Undefined index: usx in /home/vol15_6/byethost3.com/b3_20561234/htdocs/web/register.php on line 21

Notice: Undefined index: bdy in /home/vol15_6/byethost3.com/b3_20561234/htdocs/web/register.php on line 22

Notice: Undefined index: ulc in /home/vol15_6/byethost3.com/b3_20561234/htdocs/web/register.php on line 23

Notice: Undefined index: info in /home/vol15_6/byethost3.com/b3_20561234/htdocs/web/register.php on line 24

Notice: Undefined index: brws in /home/vol15_6/byethost3.com/b3_20561234/htdocs/web/register.php on line 25

Notice: Undefined index: usex in /home/vol15_6/byethost3.com/b3_20561234/htdocs/web/register.php on line 26 Those are lines 16-26

**```php $uid = $_POST["uid"]; $pwd = $_POST["pwd"]; $cpw = $_POST["cpw"]; $email = $_POST["email"]; $ubr = $_POST["browserm"]; $usx = $_POST["usx"]; $bdy = $_POST["bdy"]; $ulc = $_POST["ulc"]; $info = $_POST["info"]; $brws = $_POST["brws"]; $usex = $_POST["usex"];

something else Fellow · 2,296 posts #147

They are all undeclared string notices and won't stop it from working.

I have noticed there is multiple errors in your registration function also, I think coding-talk is screwing up your code when you post it. (You can check this by looking at your script and looking at your post on here to see they will be different)

Getting these problems with a script at such an early stage and also there is security holes I can see where registration can be hacked easily with sql injection makes me think you are better off trying a more secure version of Lava rather than messing about with a unsecure version with problems in it.

stefan998 Junior · 25 posts #148

I have my version that I edited completely but its not in english,do you have some recommendations of some working versions on english because i dont have time to translate mine ?

something else Fellow · 2,296 posts #149

Maybe: </t/11293-wapirate-net-wapirate-top-list-many-more-unreleased-mods-lava> but it does show errors until you get some data in the forums because of null mysql fetch arrays

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close