Plugin Directory

Changeset 161493


Ignore:
Timestamp:
10/08/2009 04:46:40 AM (16 years ago)
Author:
webternals
Message:

AdMangler: Development Code Update!

Location:
admangler/trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • admangler/trunk/adMangler.class.php

    r161460 r161493  
    88            $this->adsTable = $wpdb->prefix."AdMangler_ads";
    99            $this->settingsTable = $wpdb->prefix."AdMangler_settings";
     10            $this->usersTable = $wpdb->prefix."AdMangler_users";
    1011        } // End function AdMangler
    1112
     
    4849                        username VARCHAR(256) COLLATE utf8_bin NOT NULL,
    4950                        password VARCHAR(256) COLLATE utf8_bin NOT NULL,
    50                         credit FLOAT(10,2) NOT NULL
     51                        credits FLOAT(10,2)
    5152                        UNIQUE KEY id (id),
    5253                        PRIMARY KEY username (username)
     
    6263                foreach($sql as $temp)
    6364                    dbDelta($temp);
    64                 add_option('AdMangler_db_version', $db_version);
     65                if (get_option('AdMangler_db_version'))
     66                    update_option('AdMangler_db_version', $db_version);
     67                else
     68                    add_option('AdMangler_db_version', $db_version);
    6569            }
    6670
  • admangler/trunk/panel/login.php

    r161460 r161493  
    1 <form action="?action=login" method="post">
     1<?php
     2    global $wpdb,$adMangler;
     3    $wpdb->hide_errors();
     4    if (isset($_POST['username']) && isset($_POST['password']))
     5    {
     6        $sql = "SELECT id FROM $adMangler->usersTable WHERE username='".$_POST['username']."' AND password='".sha1($_POST['password'])."'";
     7        $result = $wpdb->query($wpdb->prepare($sql));
     8        if ($result)
     9        {
     10            $login = $wpdb->get_row($result);
     11            if (1 == $wpdb->num_rows)
     12            {
     13                echo "Found You!";
     14            }
     15        }
     16    }
     17?>
     18<form action="?action=login" method="POST">
    219    <div><label>Username:</label></div>
    3     <div><input type="username" /></div>
     20    <div><input type="text" name="username" /></div>
    421    <div>&nbsp;</div>
    522    <div><label>Password:</label></div>
    6     <div><input type="password" /></div>
     23    <div><input type="password" name="password" /></div>
    724    <div><button type="submit">GO!</button></div>
    825    <div>&nbsp;</div>
  • admangler/trunk/panel/register.php

    r161460 r161493  
    7373    }
    7474?>
    75 
     75<style type="text/css">
     76    dl { clear:both; padding:3px; }
     77    dt { float:left; width:125px; text-align:right; padding:0px 5px; margin:0px; }
     78    dd { float:left; text-align:left; padding:0px; margin:0px; }
     79</style>
     80<h3>Register</h3>
    7681<form action="" method="post">
    77     <label>Username:</label>
    78     <input type="username" />
    79     <label>Password:</label>
    80     <input type="password" />
    81     <label>Password Again:</label>
    82     <input type="password" />
    83     <label>Email Address:</label>
    84     <input type="text" />
     82    <dl>
     83        <dt><label>Username:</label></dt>
     84        <dd><input type="username" /></dd>
     85    </dl>
     86    <dl>
     87        <dt><label>Password:</label></dt>
     88        <dd><input type="password" /></dd>
     89    </dl>
     90    <dl>
     91        <dt><label>Password Again:</label></dt>
     92        <dd><input type="password" /></dd>
     93    </dl>
     94    <dl>
     95        <dt><label>Email Address:</label></dt>
     96        <dd><input type="text" /></dd>
     97    </dl>
     98    <dl>
     99        <dt><label>&nbsp;</label></dt>
     100        <dd><button type="submit">Register</button></dd>
     101    </dl>
    85102</form>
Note: See TracChangeset for help on using the changeset viewer.