You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.

 For more information please view the readme.txt file.
******************************************************************************/
require 'config.php';
require_once 'mod_errorlogs.php';
require_once 'mod_categories.php';
require_once 'mod_joined.php';
require_once 'mod_owned.php';
require_once 'mod_affiliates.php';
require_once 'mod_settings.php';
$all_owned = get_owned('current', 'none', 'bydate');
$all_joined = get_joined('approved', 'none', 'id');
// total number categories (regardless of if there are stuff inside)
$total_cats = count(enth_get_categories());
// number of joined listings (pending)
$joined_pending = count(get_joined('pending'));
// number of joined listings (approved)
$joined_approved = count(get_joined('approved'));
// number of joined listings (pending+approved)
$joined = $joined_pending + $joined_approved;
// number of owned listings (pending)
$owned_pending = count(get_owned('pending'));
// number of owned listings (upcoming)
$owned_upcoming = count(get_owned('upcoming'));
// number of owned listings (current)
$owned_current = count(get_owned('current'));
// number of owned listings (pending+upcoming+current)
$owned = $owned_pending + $owned_upcoming + $owned_current;
// number of collective affiliates
Esempio n. 2
0
   <form action="categories.php" method="get">
   <input type="hidden" name="dosearch" value="now" />

   <p class="center">
   <input type="text" name="search" />
   <input type="submit" value="Search" />
   </p>

   </form>

<?php 
    $start = isset($_REQUEST['start']) ? $_REQUEST['start'] : '0';
    $search = isset($_GET['search']) ? $_GET['search'] : '';
    $total = 0;
    $cats = enth_get_categories($search, $start);
    $total = count(enth_get_categories($search));
    // fix cats array
    foreach ($cats as $i => $c) {
        $cats[$i]['text'] = '';
        if ($ancestors = array_reverse(get_ancestors($c['catid']))) {
            // get ancestors
            $text = '';
            foreach ($ancestors as $a) {
                $text .= strlen($text) > 0 ? ' &raquo; ' . get_category_name($a) : get_category_name($a);
            }
            $cats[$i]['text'] .= $text;
        } else {
            $cats[$i]['text'] = get_category_name($c['catid']);
        }
    }
    usort($cats, 'category_array_compare');
Esempio n. 3
0
function show_step1()
{
    require 'config.php';
    ?>
   <p>
   Welcome to the Setup section of Enthusiast 3. On this section, you will
   be able to add listings to your collective. It will automatically
   create the database tables for you if needed, and you need only to add
   the required <code>config.php</code> file in your listing's directory 
   and insert appropriate PHP snippets in your listing's pages.
   </p>

   <h2>Important notes:</h2>

   <ul>

   <li> Only uncheck the <code>Create database tables</code> checkbox if you
   are just adding the listing to your collective <i>AND the tables
   have already been previously created!</i> This is useful if you wish to
   run a specific listing already installed in another Enth3 admin panel
   and you just need this installation to connect to the other database. </li>

   <li> <b>Make sure you have proper MySQL privileges
   set!</b> Enthusiast 3 requires the privilege to <code>CREATE</code>,
   <code>ALTER</code>, and <code>DROP</code> database tables. When a listing
   is deleted, the database table is deleted as well. </li>

   </ul>

   <form action="setup.php" method="post">
   <input type="hidden" name="step" value="2" />

   <table>
<?php 
    $dbserver = $db_server;
    $dbdatabase = $db_database;
    $dbuser = $db_user;
    $dbpassword = '';
    $dbtable = '';
    $catids = array();
    $subject = '';
    $email = '';
    $status = 'current';
    if (isset($_POST['dbserver'])) {
        $dbserver = $_POST['dbserver'];
    }
    if (isset($_POST['dbdatabase'])) {
        $dbdatabase = $_POST['dbdatabase'];
    }
    if (isset($_POST['dbuser'])) {
        $dbuser = $_POST['dbuser'];
    }
    if (isset($_POST['dbpassword'])) {
        $dbpassword = $_POST['dbpassword'];
    }
    if (isset($_POST['dbtable'])) {
        $dbtable = $_POST['dbtable'];
    }
    if (isset($_POST['catid'])) {
        $catids = $_POST['catid'];
    }
    if (isset($_POST['subject'])) {
        $subject = $_POST['subject'];
    }
    if (isset($_POST['email'])) {
        $email = $_POST['email'];
    }
    if (isset($_POST['status'])) {
        $status = $_POST['status'];
    }
    ?>
   <tr><th colspan="2">Database settings</th></tr>

   <tr><td><b>
   Create database tables?
   </b></td><td>
   Only uncheck the <code>Create database tables</code> checkbox if you
   are just adding the listing to your collective <i>AND the tables
   have already been previously created!</i> This is useful if you wish to
   run a specific listing already installed in another Enth3 admin panel
   and you just need this installation to connect to the other database.
   <br /><br />
   <input type="checkbox" name="createtable" value="yes" checked="checked" />
   Yes, create the tables
   </td></tr>

   <tr class="rowshade"><td><b>
   Database server
   </b></td><td>
   This is the server your MySQL database is running on. The value you have
   set for this collective is, by default, set in the field for you.<br />
   <br />
   <input type="text" name="dbserver" value="<?php 
    echo $dbserver;
    ?>
" />
   </td></tr>

   <tr><td><b>
   Database name
   </b></td><td>
   This is the actual name of the database you will be using for this
   listing. The database that you have set for this collective is, by
   default, set in the field for you..<br /><br />
   <input type="text" name="dbdatabase" value="<?php 
    echo $dbdatabase;
    ?>
" />
   </td></tr>

   <tr class="rowshade"><td><b>
   Database user
   </b></td><td>
   This is the database username that has access privileges for the database
   set above. The user that you have set for this collective is, by default,
   set in the field for you.<br /><br />
   <input type="text" name="dbuser" value="<?php 
    echo $dbuser;
    ?>
" />
   </td></tr>

   <tr><td><b>
   Database password
   </b></td><td>
   This is the password that allows the user above access to the database
   specified. Please type the password twice for verification.<br /><br />
   <input type="password" name="dbpassword" />
   <input type="password" name="dbpasswordv" />
   </td></tr>

   <tr class="rowshade"><td><b>
   Database table
   </b></td><td>
   This is the database table that the fanlisting will use.<br /><br />
   <input type="text" name="dbtable" value="<?php 
    echo $dbtable;
    ?>
" />
   </td></tr>

   <tr><th colspan="2">
   Listing information
   </th></tr>

   <tr><td><b>
   Categories
   </b></td><td>
   This are the categories under your collective that you wish this listing
   be listed under.<br /><br />
   <select name="catid[]" multiple="multiple" size="5">
<?php 
    $cats = enth_get_categories();
    $options = array();
    foreach ($cats as $cat) {
        $optiontext = $cat['catname'];
        if (count($ancestors = array_reverse(get_ancestors($cat['catid']))) > 1) {
            // get ancestors
            $text = '';
            foreach ($ancestors as $a) {
                $text .= get_category_name($a) . ' > ';
            }
            $optiontext = rtrim($text, ' > ');
            $optiontext = str_replace('>', '&raquo;', $optiontext);
        }
        $options[] = array('text' => $optiontext, 'id' => $cat['catid']);
    }
    usort($options, 'category_array_compare');
    $selected = explode('|', $info['catid']);
    foreach ($options as $o) {
        echo '<option value="' . $o['id'];
        if (in_array($o['id'], $catids)) {
            echo '" selected="selected';
        }
        echo '">' . $o['text'] . '</option>';
    }
    ?>
   </select>
   </td></tr>

   <tr class="rowshade"><td><b>
   Subject
   </b></td><td>
   This is the subject of the listing.<br /><br />
   <input type="text" name="subject" value="<?php 
    echo $subject;
    ?>
" />
   </td></tr>

   <tr><td><b>
   Email
   </b></td><td>
   This is the email address that all listing emails will come from.
   <br /><br />
   <input type="text" name="email" value="<?php 
    echo $email;
    ?>
" />
   </td></tr>

   <tr class="rowshade"><td><b>
   Status
   </b></td><td>
   This is the status of your listing, and is especially useful for
   making 'upcoming' lists. It is set to "current" by default.<br /><br />
   <select name="status">
   <option value="<?php 
    echo $status;
    ?>
"><?php 
    echo ucfirst($status);
    ?>
</option>
   <option value="">--</option>
   <option value="current">Current</option>
   <option value="upcoming">Upcoming</option>
   <option value="pending">Pending Application</option>
   </select>
   </td></tr>

   <tr><td colspan="2" class="right">
   <input type="submit" value="Add and setup this fanlisting!" />
   <input type="reset" value="Reset form values" />
   </td></tr>

   </table>
<?php 
}
Esempio n. 4
0
function show_edit_forms()
{
    require 'config.php';
    $info = get_listing_info($_REQUEST['id']);
    ?>
   <div class="submenu">
   <a href="owned.php?action=edit&id=<?php 
    echo $info['listingid'];
    ?>
&type=database">Database</a>
   <a href="owned.php?action=edit&id=<?php 
    echo $info['listingid'];
    ?>
&type=info">Info</a>
   <a href="owned.php?action=edit&id=<?php 
    echo $info['listingid'];
    ?>
&type=settings">Settings</a>
   <a href="owned.php?action=edit&id=<?php 
    echo $info['listingid'];
    ?>
&type=emails">Emails</a>
   <a href="owned.php?action=edit&id=<?php 
    echo $info['listingid'];
    ?>
&type=templates">Templates</a>
   </div>

   <p>This page allows you to edit information and settings for the
   <i><?php 
    echo $info['title'];
    ?>
: <?php 
    echo $info['subject'];
    ?>
   <?php 
    echo $info['listingtype'];
    ?>
</i>. Click on one of the submenu items
   to modify the <?php 
    echo $info['listingtype'];
    ?>
.
   </p>

   <h2>Quick <?php 
    echo $info['listingtype'];
    ?>
 stats</h2>
<?php 
    $stats = get_listing_stats($info['listingid']);
    // prepare date format
    $lastupdated = @date(get_setting('date_format'), strtotime($stats['lastupdated']));
    $countries = $stats['countries'];
    $average = $stats['average'];
    ?>
   <p><b>Last updated:</b> <?php 
    echo $lastupdated;
    ?>
<br />
   <b>Members:</b> <?php 
    echo $stats['total'];
    echo $info['country'] == 1 ? ' from ' . $countries . ' countries' : '';
    ?>
, <?php 
    echo $stats['pending'];
    ?>
 pending<br />
   <b>Growth rate:</b> <?php 
    echo $average;
    ?>
 per day since opening
   </p>
<?php 
    if (isset($_REQUEST['type']) && $_REQUEST['type'] == 'database') {
        ?>
      <form action="owned.php" method="post">
      <input type="hidden" name="action" value="edit" />
      <input type="hidden" name="done" value="yes" />
      <input type="hidden" name="type" value="database" />
      <input type="hidden" name="id" value="<?php 
        echo $_REQUEST['id'];
        ?>
" />

      <table>
      <tr><th colspan="2">Database/fields Settings</th></tr>

      <tr><td>
      Server
      </td><td style="text-align: left;">
      <input type="text" name="dbserver" value="<?php 
        echo $info['dbserver'];
        ?>
" />
      </td></tr>

      <tr class="rowshade"><td>
      Name
      </td><td style="text-align: left;">
      <input type="text" name="dbdatabase" value="<?php 
        echo $info['dbdatabase'];
        ?>
" />
      </td></tr>

      <tr><td>
      User
      </td><td style="text-align: left;">
      <input type="text" name="dbuser" value="<?php 
        echo $info['dbuser'];
        ?>
" />
      </td></tr>

      <tr class="rowshade"><td>
      Table
      </td><td style="text-align: left;">
      <input type="text" name="dbtable" value="<?php 
        echo $info['dbtable'];
        ?>
" />
      </td></tr>

      <tr><td>
      Password
      </td><td style="text-align: left;">
      <small>Fill out only if changing the password.</small><br />
      <input type="password" name="dbpassword" />
      <input type="password" name="dbpasswordv" />
      </td></tr>

      <tr class="rowshade"><td>
      Country field
      </td><td style="text-align: left;">
<?php 
        if ($info['country'] == 1) {
            ?>
         <input type="radio" name="country" value="leave" checked="checked" />
         Leave as is (Enabled)<br />
         <input type="radio" name="country" value="disable" /> Disable (will
         delete current values from database!)<br />
<?php 
        } else {
            ?>
         <input type="radio" name="country" value="leave" checked="checked" />
         Leave as is (Disabled)<br />
         <input type="radio" name="country" value="enable" /> Enable<br />
<?php 
        }
        ?>
      </td></tr>

      <tr><td>
      Affiliates
      </td><td style="text-align: left;">
      <input type="radio" name="affiliates" value="leave" checked="checked" />
      Leave as is
<?php 
        if ($info['affiliates'] == 0) {
            echo ' (Disabled)<br />';
            echo '<input type="radio" name="affiliates" value="enable" /> Yes, ';
            echo 'images directory at <input type="text" name="affiliatesdir" ' . '/><br /><small>' . 'Please don\'t forget the trailing slash; this folder (absolute ' . 'path, i.e., /home/user/public_html/images/) must have ' . 'proper permissions set (i.e., must be CHMODed to ' . '755).</small><br />';
        } else {
            echo ' (Enabled)<br />';
            echo '<input type="radio" name="affiliates" value="rename" /> Move ';
            echo 'images directory to <input type="text" name="affiliatesdir" ' . 'value="' . $info['affiliatesdir'] . '" /><br /><small>' . 'Please don\'t forget the trailing slash; this folder (absolute ' . 'path, i.e., /home/user/public_html/images/) must have ' . 'proper permissions set (i.e., must be CHMODed to ' . '755).</small><br />';
            echo '<input type="radio" name="affiliates" value="disable" /> ';
            echo 'Disable';
        }
        ?>
      </td></tr>

      <tr class="rowshade"><td>
      Additional Fields
      </td><td style="text-align: left;">
      <small>Click the "+" sign if you need more additional field fields
      below. You may edit the name of the existing fields by modifying the
      field directly, or deleting existing fields by removing the name
      entirely from the field.<br />
      Additional fields must be ALL LOWERCASE, with NO SPACES and NO
      PUNCTUATION and NO SPECIAL CHARACTERS; if you wish for the field to
      have a space in its "name", use an underscore. For example: 
      <i>favorite_book, do_you_like_apples</i><br />
      Deleting an existing field will cause its contents to be discarded
      and this cannot be undone.</small><br />
<?php 
        $fields = explode(',', $info['additional']);
        $printed = 0;
        foreach ($fields as $f) {
            if ($f != '') {
                $printed++;
                echo '<div style="padding: 2px;"> ' . $printed . ' <input type="text" name="additional[]" value="' . $f . '" /> </div>';
            }
        }
        ?>
      <div id="multifields" style="padding: 2px; display: block;">
      <input type="text" name="additional[]" />
      <input type="button" value="+" onclick="moreFields()" />
      <input type="button" value="x"
         onclick="this.parentNode.parentNode.removeChild(this.parentNode);" />
      </div>
      <span id="multifieldshere"></span>
		</td></tr>

      <tr><td colspan="2" class="right">
      <input type="submit" value="Update database settings" />
      <input type="reset" value="Reset form values" />
      <input type="button" value="Cancel"
         onclick="javascript:window.location='owned.php';" />
      </td></tr>

      </table></form>
<?php 
    } else {
        if (isset($_REQUEST['type']) && $_REQUEST['type'] == 'info') {
            ?>
      <form action="owned.php" method="post" enctype="multipart/form-data">
      <input type="hidden" name="action" value="edit" />
      <input type="hidden" name="done" value="yes" />
      <input type="hidden" name="type" value="info" />
      <input type="hidden" name="id" value="<?php 
            echo $_REQUEST['id'];
            ?>
" />

      <table>
      <tr><th colspan="2">Listing information</th></tr>

      <tr><td>
      Category
      Listing Category
      </td><td>
      <select name="catid[]" multiple="multiple" size="5">
<?php 
            $cats = enth_get_categories();
            $options = array();
            foreach ($cats as $cat) {
                $optiontext = $cat['catname'];
                if (count($ancestors = array_reverse(get_ancestors($cat['catid']))) > 1) {
                    // get ancestors
                    $text = '';
                    foreach ($ancestors as $a) {
                        $text .= get_category_name($a) . ' > ';
                    }
                    $optiontext = rtrim($text, ' > ');
                    $optiontext = str_replace('>', '&raquo;', $optiontext);
                }
                $options[] = array('text' => $optiontext, 'id' => $cat['catid']);
            }
            usort($options, 'category_array_compare');
            $selected = explode('|', $info['catid']);
            foreach ($options as $o) {
                echo '<option value="' . $o['id'];
                if (in_array($o['id'], $selected)) {
                    echo '" selected="selected';
                }
                echo '">' . $o['text'] . '</option>';
            }
            ?>
      </select>
      </td></tr>

      <tr class="rowshade"><td>
      Subject
      </td><td>
      <input type="text" name="subject" value="<?php 
            echo $info['subject'];
            ?>
" />
      </td></tr>

      <tr><td>
      Email
      </td><td>
      <input type="text" name="email" value="<?php 
            echo $info['email'];
            ?>
" />
      </td></tr>

      <tr class="rowshade"><td>
      URL
      </td><td>
      <input type="text" name="url" value="<?php 
            echo $info['url'];
            ?>
" />
      </td></tr>

      <tr><td>
      Title
      </td><td>
      <input type="text" name="title" value="<?php 
            echo $info['title'];
            ?>
" />
      </td></tr>

      <tr class="rowshade"><td>
      Listing type
      </td><td>
      <input type="text" name="listingtype" value="<?php 
            echo $info['listingtype'];
            ?>
" />
      </td></tr>

      <tr><td>
      Description
      </td><td>
      <textarea name="desc" rows="3" cols="30"><?php 
            echo $info['desc'];
            ?>
</textarea>
      </td></tr>

      <tr class="rowshade"><td rowspan="3">
      Image
      </td><td>
<?php 
            $dir = get_setting('owned_images_dir');
            if ($info['imagefile'] == '' || !is_file($dir . $info['imagefile'])) {
                echo 'No image specified.';
            } else {
                $root_web = get_setting('root_path_web');
                $root_abs = get_setting('root_path_absolute');
                @($image = getimagesize($dir . $info['imagefile']));
                $dir = str_replace($root_abs, $root_web, $dir);
                $dir = str_replace('\\', '/', $dir);
                echo '<img src="' . $dir . $info['imagefile'] . '" ' . $image[3] . ' border="0" alt="" />';
            }
            ?>
      </td></tr><tr class="rowshade"><td>
      <input type="radio" name="image_change" value="no" checked="checked"
         /> Leave as it is<br />
      <input type="radio" name="image_change" value="delete" /> Delete
         image<br />
      <input type="radio" name="image_change" value="yes" /> Change with:
      </td></tr><tr class="rowshade"><td>
      <input type="file" name="image" />
      </td></tr>

      <tr><td>
      Status
      </td><td>
      <select name="status">
<?php 
            if ($info['status'] == 0) {
                echo '<option value="pending">Leave as is (Pending)</option>';
                echo '<option value="pending">--</option>';
            } else {
                if ($info['status'] == 1) {
                    echo '<option value="upcoming">Leave as is (Upcoming)</option>';
                    echo '<option value="upcoming">--</option>';
                } else {
                    if ($info['status'] == 2) {
                        echo '<option value="current">Leave as is (Current)</option>';
                        echo '<option value="current">--</option>';
                    }
                }
            }
            ?>
      <option value="pending">Pending</option>
      <option value="upcoming">Upcoming</option>
      <option value="current">Current</option>
      </select>
      </td></tr>

      <tr class="rowshade"><td>
      Date opened
      </td><td>
      <select name="date_day">
      <option value="<?php 
            echo @date('j', strtotime($info['opened']));
            ?>
">Current (<?php 
            echo @date('j', strtotime($info['opened']));
            ?>
)</option>
<?php 
            for ($i = 1; $i <= 31; $i++) {
                echo '<option>' . $i . '</option>';
            }
            ?>
      </select>

      <select name="date_month">
      <option value="<?php 
            echo @date('n', strtotime($info['opened']));
            ?>
">Current (<?php 
            echo @date('F', strtotime($info['opened']));
            ?>
)</option>
      <option value="01">January</option>
      <option value="02">February</option>
      <option value="03">March</option>
      <option value="04">April</option>
      <option value="05">May</option>
      <option value="06">June</option>
      <option value="07">July</option>
      <option value="08">August</option>
      <option value="09">September</option>
      <option value="10">October</option>
      <option value="11">November</option>
      <option value="12">December</option>
      </select>

      <select name="date_year">
      <option value="<?php 
            echo @date('Y', strtotime($info['opened']));
            ?>
">Current (<?php 
            echo @date('Y', strtotime($info['opened']));
            ?>
)</option>
<?php 
            for ($year = date('Y'); $year >= 2000; $year--) {
                echo '<option>' . $year . '</option>';
            }
            ?>
      </select>

      </td></tr>

      <tr><td colspan="2" class="right">
      <input type="submit" value="Update information" />
      <input type="reset" value="Reset form values" />
      <input type="button" value="Cancel"
         onclick="javascript:window.location='owned.php';" />
      </td></tr>

      </table></form>
<?php 
        } else {
            if (isset($_REQUEST['type']) && $_REQUEST['type'] == 'settings') {
                ?>
      <form action="owned.php" method="post">
      <input type="hidden" name="action" value="edit" />
      <input type="hidden" name="done" value="yes" />
      <input type="hidden" name="type" value="settings" />
      <input type="hidden" name="id" value="<?php 
                echo $_REQUEST['id'];
                ?>
" />

      <table>
      <tr><th colspan="2">Management/look settings</th></tr>

      <tr><td>
      Hold member updates
      </td><td style="text-align: left;">
<?php 
                if ($info['holdupdate'] == 1) {
                    ?>
         <input type="radio" name="holdupdate" value="leave"
            checked="checked" /> Leave as is (Enabled)<br />
         <input type="radio" name="holdupdate" value="disable" /> Disable<br />
<?php 
                } else {
                    ?>
         <input type="radio" name="holdupdate" value="leave" checked="checked"
            /> Leave as is (Disabled)<br />
         <input type="radio" name="holdupdate" value="enable" /> Enable<br />
<?php 
                }
                ?>
      <small>This setting will determine whether a member who updates his/her
      information will be placed back on pending or not.</small>
      </td></tr>

      <tr class="rowshade"><td>
      Pending notify
      </td><td style="text-align: left;">
<?php 
                if ($info['notifynew'] == 1) {
                    ?>
         <input type="radio" name="notifynew" value="leave" checked="checked"
            /> Leave as is (Enabled)<br />
         <input type="radio" name="notifynew" value="disable" /> Disable<br />
<?php 
                } else {
                    ?>
         <input type="radio" name="notifynew" value="leave" checked="checked"
            /> Leave as is (Disabled)<br />
         <input type="radio" name="notifynew" value="enable" /> Enable<br />
<?php 
                }
                ?>
      <small>This setting will determine if you will be notified via
      email when a member has been added/placed on the pending queue.</small>
      </td></tr>

      <tr><td>
      Dropdown sorting
      </td><td style="text-align: left;">
<?php 
                if ($info['dropdown'] == 1) {
                    ?>
         <input type="radio" name="dropdown" value="leave" checked="checked" />
            Leave as is (Enabled)<br />
         <input type="radio" name="dropdown" value="disable" /> Disable<br />
<?php 
                } else {
                    ?>
         <input type="radio" name="dropdown" value="leave" checked="checked" />
            Leave as is (Disabled)<br />
         <input type="radio" name="dropdown" value="enable" /> Enable<br />
<?php 
                }
                ?>
      </td></tr>

      <tr class="rowshade"><td>
      Sort members by
      </td><td style="text-align: left;">
      <input type="text" name="sort" value="<?php 
                echo $info['sort'];
                ?>
" /><br />
      <small>This is the database field that will determine how your
      members are sorted. This can be either any of your additional fields
      or by 'country'. Sorting by multiple fields are allowed -- separate
      fields using a comma (,).</small>
      </td></tr>

      <tr><td>
      Members per page
      </td><td style="text-align: left;">
      <input type="text" name="perpage" value="<?php 
                echo $info['perpage'];
                ?>
" /><br />
      </td></tr>

      <tr class="rowshade"><td>
      Link target
      </td><td style="text-align: left;">
      <input type="text" name="linktarget" value="<?php 
                echo $info['linktarget'];
                ?>
" /><br />
      </td></tr>

      <tr><td>
      Join page
      </td><td style="text-align: left;">
      <input type="text" name="joinpage" value="<?php 
                echo $info['joinpage'];
                ?>
" /><br />
      </td></tr>

      <tr class="rowshade"><td>
      List page
      </td><td style="text-align: left;">
      <input type="text" name="listpage" value="<?php 
                echo $info['listpage'];
                ?>
" /><br />
      </td></tr>

      <tr><td>
      Update page
      </td><td style="text-align: left;">
      <input type="text" name="updatepage" value="<?php 
                echo $info['updatepage'];
                ?>
" /><br />
      </td></tr>

      <tr class="rowshade"><td>
      Lostpass page
      </td><td style="text-align: left;">
      <input type="text" name="lostpasspage" value="<?php 
                echo $info['lostpasspage'];
                ?>
" /><br />
      </td></tr>

      <tr><td colspan="2" class="right">
      <input type="submit" value="Update settings" />
      <input type="reset" value="Reset form values" />
      <input type="button" value="Cancel"
         onclick="javascript:window.location='owned.php';" />
      </td></tr>

      </table></form>
<?php 
            } else {
                if (isset($_REQUEST['type']) && $_REQUEST['type'] == 'emails') {
                    ?>
      <form action="owned.php" method="post">
      <input type="hidden" name="action" value="edit" />
      <input type="hidden" name="done" value="yes" />
      <input type="hidden" name="type" value="emails" />
      <input type="hidden" name="id" value="<?php 
                    echo $_REQUEST['id'];
                    ?>
" />

      <table>
      <tr><th colspan="2">Email Templates</th></tr>

      <tr><td>
      Signup email
      </td><td>
      <textarea name="emailsignup" rows="10" cols="60"><?php 
                    echo $info['emailsignup'];
                    ?>
</textarea>
      </td></tr>

      <tr class="rowshade"><td>
      Approval email
      </td><td>
      <textarea name="emailapproved" rows="10" cols="60"><?php 
                    echo $info['emailapproved'];
                    ?>
</textarea>
      </td></tr>

      <tr><td>
      Update info email
      </td><td>
      <textarea name="emailupdate" rows="10" cols="60"><?php 
                    echo $info['emailupdate'];
                    ?>
</textarea>
      </td></tr>

      <tr class="rowshade"><td>
      Lost password email
      </td><td>
      <textarea name="emaillostpass" rows="10" cols="60"><?php 
                    echo $info['emaillostpass'];
                    ?>
</textarea>
      </td></tr>

      <tr><td colspan="2" class="right">
      <input type="submit" value="Update emails" />
      <input type="reset" value="Reset form values" />
      <input type="button" value="Cancel"
         onclick="javascript:window.location='owned.php';" />
      </td></tr>

      </table></form>
<?php 
                } else {
                    if (isset($_REQUEST['type']) && $_REQUEST['type'] == 'templates') {
                        ?>
      <form action="owned.php" method="post">
      <input type="hidden" name="action" value="edit" />
      <input type="hidden" name="done" value="yes" />
      <input type="hidden" name="type" value="templates" />
      <input type="hidden" name="id" value="<?php 
                        echo $_REQUEST['id'];
                        ?>
" />

      <table>
      <tr><th colspan="2">Website Templates</th></tr>

      <tr><td>
      Members List
      </td><td>
      <textarea name="listtemplate" rows="10" cols="60"><?php 
                        echo $info['listtemplate'];
                        ?>
</textarea>
      </td></tr>

      <tr class="rowshade"><td>
      Affiliates
      </td><td>
      <textarea name="affiliatestemplate" rows="10" cols="60"><?php 
                        echo $info['affiliatestemplate'];
                        ?>
</textarea>
      </td></tr>

      <tr><td>
      Statistics
      </td><td>
      <textarea name="statstemplate" rows="10" cols="60"><?php 
                        echo $info['statstemplate'];
                        ?>
</textarea>
      </td></tr>

      <tr class="rowshade"><td colspan="2" class="right">
      <input type="submit" value="Update templates" />
      <input type="reset" value="Reset form values" />
      <input type="button" value="Cancel"
         onclick="javascript:window.location='owned.php';" />
      </td></tr>

      </table></form>
<?php 
                    }
                }
            }
        }
    }
}
Esempio n. 5
0
      <form action="joined.php" method="post" enctype="multipart/form-data">
      <input type="hidden" name="action" value="edit" />
      <input type="hidden" name="done" value="yes" />
      <input type="hidden" name="id" value="<?php 
                    echo $_REQUEST['id'];
                    ?>
" />

      <table>

      <tr><td class="important" valign="top">
      Listing Category
      </td><td>
      <select name="catid[]" multiple="multiple" size="5">
<?php 
                    $cats = enth_get_categories();
                    $options = array();
                    foreach ($cats as $cat) {
                        $optiontext = $cat['catname'];
                        if (count($ancestors = array_reverse(get_ancestors($cat['catid']))) > 1) {
                            // get ancestors
                            $text = '';
                            foreach ($ancestors as $a) {
                                $text .= get_category_name($a) . ' > ';
                            }
                            $optiontext = rtrim($text, ' > ');
                            $optiontext = str_replace('>', '&raquo;', $optiontext);
                        }
                        $options[] = array('text' => $optiontext, 'id' => $cat['catid']);
                    }
                    usort($options, 'category_array_compare');