当前位置: 首页>>代码示例>>PHP>>正文


PHP dbresult函数代码示例

本文整理汇总了PHP中dbresult函数的典型用法代码示例。如果您正苦于以下问题:PHP dbresult函数的具体用法?PHP dbresult怎么用?PHP dbresult使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了dbresult函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dbarray

}
if (isset($_GET['action']) && $_GET['action'] == "mu" && (isset($_GET['field_id']) && isnum($_GET['field_id']))) {
    $data2 = dbarray(dbquery("SELECT * FROM " . DB_USER_FIELDS . " WHERE field_id='" . $_GET['field_id'] . " LIMIT 1'"));
    $data = dbarray(dbquery("SELECT * FROM " . DB_USER_FIELDS . " WHERE field_group='" . $data2['field_group'] . "' AND field_order='" . intval($_GET['order']) . "'"));
    $result = dbquery("UPDATE " . DB_USER_FIELDS . " SET field_order=field_order+1 WHERE field_id='" . $data['field_id'] . "'");
    $result = dbquery("UPDATE " . DB_USER_FIELDS . " SET field_order=field_order-1 WHERE field_id='" . $_GET['field_id'] . "'");
    redirect(FUSION_SELF . $aidlink);
} elseif (isset($_GET['action']) && $_GET['action'] == "md" && (isset($_GET['field_id']) && isnum($_GET['field_id']))) {
    $data2 = dbarray(dbquery("SELECT * FROM " . DB_USER_FIELDS . " WHERE field_id='" . $_GET['field_id'] . " LIMIT 1'"));
    $data = dbarray(dbquery("SELECT * FROM " . DB_USER_FIELDS . " WHERE field_group='" . $data2['field_group'] . "' AND field_order='" . intval($_GET['order']) . "'"));
    $result = dbquery("UPDATE " . DB_USER_FIELDS . " SET field_order=field_order-1 WHERE field_id='" . $data['field_id'] . "'");
    $result = dbquery("UPDATE " . DB_USER_FIELDS . " SET field_order=field_order+1 WHERE field_id='" . $_GET['field_id'] . "'");
    redirect(FUSION_SELF . $aidlink);
} elseif (isset($_GET['enable']) && file_exists(INCLUDES . "user_fields/" . $_GET['enable'] . "_include_var.php") && file_exists(INCLUDES . "user_fields/" . $_GET['enable'] . "_include.php")) {
    include INCLUDES . "user_fields/" . $_GET['enable'] . "_include_var.php";
    $field_order = dbresult(dbquery("SELECT MAX(field_order) FROM " . DB_USER_FIELDS . " WHERE field_group='{$user_field_group}'"), 0) + 1;
    if (!$user_field_dbinfo || ($result = dbquery("ALTER TABLE " . DB_USERS . " ADD " . $user_field_dbname . " " . $user_field_dbinfo))) {
        $result = dbquery("INSERT INTO " . DB_USER_FIELDS . " (field_name, field_group, field_order) VALUES ('{$user_field_dbname}', '{$user_field_group}', '{$field_order}')");
    }
    redirect(FUSION_SELF . $aidlink);
} elseif (isset($_GET['disable']) && isnum($_GET['disable'])) {
    $data = dbarray(dbquery("SELECT * FROM " . DB_USER_FIELDS . " WHERE field_id='" . $_GET['disable'] . "'"));
    include INCLUDES . "user_fields/" . $data['field_name'] . "_include_var.php";
    if (!$user_field_dbinfo || ($result = dbquery("ALTER TABLE " . DB_USERS . " DROP " . $user_field_dbname))) {
        $result = dbquery("UPDATE " . DB_USER_FIELDS . " SET field_order=field_order-1 WHERE field_group='" . $data['field_group'] . "' AND field_order>'" . $data['field_order'] . "'");
        $result = dbquery("DELETE FROM " . DB_USER_FIELDS . " WHERE field_id='" . $_GET['disable'] . "'");
    }
    redirect(FUSION_SELF . $aidlink);
}
$available_fields = array();
$enabled_fields = array();
开发者ID:simplyianm,项目名称:clububer,代码行数:31,代码来源:user_fields.php

示例2: stripinput

     include LOCALE . LOCALESET . "user_fields/" . stripinput($_GET['enable']) . ".php";
 }
 include INCLUDES . "user_fields/" . stripinput($_GET['enable']) . "_include_var.php";
 if (isset($_POST['enable'])) {
     $field_cat = isnum($_POST['field_cat']) ? $_POST['field_cat'] : 0;
     $field_required = isset($_POST['field_required']) && $_POST['field_required'] == 1 ? 1 : 0;
     $field_log = isset($_POST['field_log']) && $_POST['field_log'] == 1 ? 1 : 0;
     $field_registration = isset($_POST['field_registration']) && $_POST['field_registration'] == 1 ? 1 : 0;
     $rows = dbcount("(field_id)", DB_USER_FIELDS, "field_name='" . stripinput($_GET['enable']) . "'");
     // existed in db. how come when enable there is existing record???
     // check : not removed during disable??
     if ($rows > 0) {
         $result = dbquery("UPDATE " . DB_USER_FIELDS . " SET\r\n\t\t\t\t\tfield_cat='" . $field_cat . "', field_required='" . $field_required . "', field_log='" . $field_log . "',\r\n\t\t\t\t\tfield_registration='" . $field_registration . "'\r\n\t\t\t\tWHERE field_name='" . stripinput($_GET['enable']) . "'");
     } else {
         // new record
         $field_order = dbresult(dbquery("SELECT MAX(field_order) FROM " . DB_USER_FIELDS . " WHERE field_cat='" . $field_cat . "'"), 0) + 1;
         // new in api 1.02
         $c_query = dbquery("SELECT * FROM " . DB_USER_FIELD_CATS . " WHERE field_cat_id='" . $field_cat . "' LIMIT 1");
         if (dbrows($c_query) > 0) {
             // existed
             $c_data = dbarray($c_query);
             $field_cat_db = $c_data['field_cat_db'] ? DB_PREFIX . $c_data['field_cat_db'] : DB_USERS;
         }
         // change here.
         if (!$user_field_dbinfo || ($result = dbquery("ALTER TABLE " . $field_cat_db . " ADD " . $user_field_dbname . " " . $user_field_dbinfo))) {
             $result = dbquery("INSERT INTO " . DB_USER_FIELDS . " (\r\n\t\t\t\t\t\tfield_name, field_cat, field_required, field_log, field_registration, field_order\r\n\t\t\t\t\t) VALUES (\r\n\t\t\t\t\t\t'" . $user_field_dbname . "', '" . $field_cat . "', '" . $field_required . "',\r\n\t\t\t\t\t\t'" . $field_log . "', '" . $field_registration . "', '" . $field_order . "'\r\n\t\t\t\t\t)");
         }
     }
     //redirect(FUSION_SELF.$aidlink);
 } else {
     $result = dbquery("SELECT field_cat, field_required, field_log, field_registration FROM " . DB_USER_FIELDS . "\r\n\t\t\tWHERE field_name='" . stripinput($_GET['enable']) . "'");
开发者ID:WuChEn,项目名称:PHP-Fusion,代码行数:31,代码来源:user_fields.php

示例3: isnum

         $album_id = isnum($_POST['album_id']) ? $_POST['album_id'] : "0";
         $photo_name = strtolower(substr($submit_criteria['photo_file'], 0, strrpos($submit_criteria['photo_file'], ".")));
         $photo_ext = strtolower(strrchr($submit_criteria['photo_file'], "."));
         $photo_dest = PHOTOS . (!SAFEMODE ? "album_" . $album_id . "/" : "");
         $photo_file = image_exists($photo_dest, $photo_name . $photo_ext);
         copy(PHOTOS . "submissions/" . $submit_criteria['photo_file'], $photo_dest . $photo_file);
         chmod($photo_dest . $photo_file, 0644);
         unlink(PHOTOS . "submissions/" . $submit_criteria['photo_file']);
         $imagefile = @getimagesize($photo_dest . $photo_file);
         $photo_thumb1 = image_exists($photo_dest, $photo_name . "_t1" . $photo_ext);
         createthumbnail($imagefile[2], $photo_dest . $photo_file, $photo_dest . $photo_thumb1, $settings['thumb_w'], $settings['thumb_h']);
         if ($imagefile[0] > $settings['photo_w'] || $imagefile[1] > $settings['photo_h']) {
             $photo_thumb2 = image_exists($photo_dest, $photo_name . "_t2" . $photo_ext);
             createthumbnail($imagefile[2], $photo_dest . $photo_file, $photo_dest . $photo_thumb2, $settings['photo_w'], $settings['photo_h']);
         }
         $photo_order = dbresult(dbquery("SELECT MAX(photo_order) FROM " . DB_PHOTOS . " WHERE album_id='{$album_id}'"), 0) + 1;
         $result = dbquery("INSERT INTO " . DB_PHOTOS . " (album_id, photo_title, photo_description, photo_filename, photo_thumb1, photo_thumb2, photo_datestamp, photo_user, photo_views, photo_order, photo_allow_comments, photo_allow_ratings) VALUES ('{$album_id}', '{$photo_title}', '{$photo_description}', '{$photo_file}', '{$photo_thumb1}', '{$photo_thumb2}', '" . time() . "', '" . $data['submit_user'] . "', '0', '{$photo_order}', '1', '1' ,'" . LANGUAGE . "')");
         $result = dbquery("DELETE FROM " . DB_SUBMISSIONS . " WHERE submit_id='" . $_GET['submit_id'] . "'");
         opentable($locale['580']);
         echo "<br /><div style='text-align:center'>" . $locale['581'] . "<br /><br />\n";
         echo "<a href='" . FUSION_SELF . $aidlink . "'>" . $locale['402'] . "</a><br /><br />\n";
         echo "<a href='index.php" . $aidlink . "'>" . $locale['403'] . "</a></div><br />\n";
         closetable();
     } else {
         redirect(FUSION_SELF . $aidlink);
     }
 } else {
     if (isset($_POST['delete']) && (isset($_GET['submit_id']) && isnum($_GET['submit_id']))) {
         opentable($locale['582']);
         $data = dbarray(dbquery("SELECT submit_criteria FROM " . DB_SUBMISSIONS . " WHERE submit_id='" . $_GET['submit_id'] . "'"));
         $submit_criteria = unserialize($data['submit_criteria']);
开发者ID:WuChEn,项目名称:PHP-Fusion,代码行数:31,代码来源:submissions.php

示例4: dbresult

         if (!$error) {
             if (isset($_GET['action']) && $_GET['action'] == "edit" && (isset($_GET['album_id']) && isnum($_GET['album_id']))) {
                 $old_album_order = dbresult(dbquery("SELECT album_order FROM " . DB_PHOTO_ALBUMS . " WHERE album_id='" . $_GET['album_id'] . "'"), 0);
                 if ($album_order > $old_album_order) {
                     $result = dbquery("UPDATE " . DB_PHOTO_ALBUMS . " SET album_order=(album_order-1)\r\n\t\t\t\t\t\tWHERE album_order>'{$old_album_order}' AND album_order<='{$album_order}'");
                 } elseif ($album_order < $old_album_order) {
                     $result = dbquery("UPDATE " . DB_PHOTO_ALBUMS . " SET album_order=(album_order+1)\r\n\t\t\t\t\t\tWHERE album_order<'{$old_album_order}' AND album_order>='{$album_order}'");
                 }
                 $result = dbquery("UPDATE " . DB_PHOTO_ALBUMS . " SET album_title='{$album_title}', album_description='{$album_description}',\r\n\t\t\t\t\t" . (isset($album_thumb) ? " album_thumb='{$album_thumb}'," : "") . " album_user='" . $userdata['user_id'] . "',\r\n\t\t\t\t\talbum_parent='{$album_parent}', album_access='{$album_access}', album_order='{$album_order}' WHERE album_id='" . $_GET['album_id'] . "'");
                 // Pimped: Subcategories
                 $rowstart = $album_order > $settings['thumbs_per_page'] ? (ceil($album_order / $settings['thumbs_per_page']) - 1) * $settings['thumbs_per_page'] : "0";
                 redirect(FUSION_SELF . $aidlink . "&status=su&page={$rowstart}");
                 // Pimped
             } else {
                 if (!$album_order) {
                     $album_order = dbresult(dbquery("SELECT MAX(album_order) FROM " . DB_PHOTO_ALBUMS . ""), 0) + 1;
                 }
                 $result = dbquery("UPDATE " . DB_PHOTO_ALBUMS . " SET album_order=(album_order+1) WHERE album_order>='{$album_order}'");
                 $result = dbquery("\r\n\t\t\t\t\tINSERT INTO " . DB_PHOTO_ALBUMS . " \r\n\t\t\t\t\t(album_title, album_description, album_thumb, album_user, album_parent, album_access, album_order, album_datestamp)\r\n\t\t\t\t\tVALUES\r\n\t\t\t\t\t('{$album_title}', '{$album_description}', '" . (isset($album_thumb) ? $album_thumb : "") . "', '" . $userdata['user_id'] . "', \r\n\t\t\t\t\t'{$album_parent}', '{$album_access}', '{$album_order}', '" . time() . "')\r\n\t\t\t\t\t");
                 // Pimped: Subcategories
                 $rowstart = $album_order > $settings['thumbs_per_page'] ? (ceil($album_order / $settings['thumbs_per_page']) - 1) * $settings['thumbs_per_page'] : "0";
                 redirect(FUSION_SELF . $aidlink . "&status=sn&page={$rowstart}");
                 // Pimped
             }
         } else {
             redirect(FUSION_SELF . $aidlink . "&status=se&error={$error}");
         }
     } else {
         redirect(FUSION_SELF . $aidlink . "&status=se&error=5");
     }
 } else {
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:31,代码来源:photoalbums.php

示例5: orderbyOptions

echo "<td class='tbl1' align='left'>" . $locale['107'] . "</td>\n";
echo "<td class='tbl1' align='right'>\n";
echo "<select name='orderby' size='1' class='textbox' style='width:150px;'>" . orderbyOptions($orderby) . "</select>\n";
echo " <select name='expr' size='1' class='textbox' style='width:100px;'>" . exprOptions($expr) . "</select>\n";
echo "</td>\n</tr>\n<tr>\n";
echo "<td class='tbl1' align='left'>" . $locale['108'] . "</td>\n";
echo "<td class='tbl1' align='right'><input type='text' name='user' value='" . $user . "' class='textbox' style='width:252px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl1'>" . $locale['115'] . "</td>";
echo "<td class='tbl1' align='right'><select name='userField' size='1' class='textbox' style='width:254px;'>" . userFieldOptions($userField) . "</select></td>";
echo "</tr>\n<tr>\n";
echo "<td class='tbl' align='left'></td>\n<td class='tbl' align='right'><input type='submit' value=' " . $locale['109'] . "' class='button' /></td>\n";
echo "</tr>\n</table>\n</form>\n";
echo "<br />";
$result = dbquery("SELECT SQL_CALC_FOUND_ROWS userlog_id, userlog_user_id, userlog_field, userlog_value_old, userlog_value_new, userlog_timestamp, user_name, user_status\n\t\t\t\t   FROM " . DB_USER_LOG . "\n\t\t\t\t   LEFT JOIN " . DB_USERS . " ON userlog_user_id=user_id\n\t\t\t\t   " . $dbWhere . "\n\t\t\t\t   " . $dbOrder . "\n\t\t\t\t   LIMIT " . $_GET['rowstart'] . ",20");
$rows = dbresult(dbquery("SELECT FOUND_ROWS()"), 0);
if (dbrows($result)) {
    echo "<table cellpadding='0' cellspacing='1' class='tbl-border center' style='width: 700px;'>\n";
    echo "<tr>\n";
    echo "<td class='tbl2' style='white-space:nowrap; width:100px;'>" . $locale['102'] . "</td>\n";
    echo "<td class='tbl2' style='white-space:nowrap; width:150px;'>" . $locale['103'] . "</td>\n";
    echo "<td class='tbl2' style='white-space:nowrap; width:140px;'>" . $locale['104'] . "</td>\n";
    echo "<td class='tbl2' style='white-space:nowrap; width:160px;'>" . $locale['105'] . "</td>\n";
    echo "<td class='tbl2' style='white-space:nowrap; width:160px;'>" . $locale['106'] . "</td>\n";
    echo "<td class='tbl2' style='white-space:nowrap; width:160px;'>" . $locale['117'] . "</td>\n";
    echo "</tr>\n";
    $i = 1;
    while ($data = dbarray($result)) {
        $class = $i % 2 ? "tbl1" : "tbl2";
        echo "<tr>\n";
        echo "<td class='" . $class . "'>" . showdate("shortdate", $data['userlog_timestamp']) . "</td>\n";
开发者ID:necrophcodr,项目名称:Muks,代码行数:31,代码来源:user_log.php

示例6: author

| Author: PHP-Fusion Development Team
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
pageAccess("PH");
$data = array("album_id" => 0, "album_title" => "", "album_keywords" => "", "album_description" => "", "album_access" => "", "album_language" => LANGUAGE, "album_image" => "", "album_thumb1" => "", "album_thumb2" => "", "album_order" => dbcount("(album_id)", DB_PHOTO_ALBUMS, multilang_table("PG") ? "album_language='" . LANGUAGE . "'" : "") + 1);
if (isset($_POST['save_album'])) {
    $data = array("album_id" => form_sanitizer($_POST['album_id'], 0, "album_id"), "album_title" => form_sanitizer($_POST['album_title'], "", "album_title"), "album_keywords" => form_sanitizer($_POST['album_keywords'], "", "album_keywords"), "album_description" => form_sanitizer($_POST['album_description'], "", "album_description"), "album_access" => form_sanitizer($_POST['album_access'], "", "album_access"), "album_language" => form_sanitizer($_POST['album_language'], "", "album_language"), "album_order" => form_sanitizer($_POST['album_order'], "", "album_order"), "album_image" => "", "album_thumb1" => "", "album_thumb2" => "", "album_user" => $userdata['user_id'], "album_datestamp" => time());
    if (empty($data['album_order'])) {
        $data['album_order'] = dbresult(dbquery("SELECT MAX(album_order) FROM " . DB_PHOTO_ALBUMS . "\n\t\t\t\t" . (multilang_table("PG") ? "where album_language='" . LANGUAGE . "'" : "") . ""), 0) + 1;
    }
    // do delete image
    if (defender::safe()) {
        if (!empty($_FILES['album_image']) && is_uploaded_file($_FILES['album_image']['tmp_name'])) {
            $upload = form_sanitizer($_FILES['album_image'], "", "album_image");
            if (empty($upload['error'])) {
                $data['album_image'] = $upload['image_name'];
                $data['album_thumb1'] = $upload['thumb1_name'];
                $data['album_thumb2'] = $upload['thumb2_name'];
            }
        } else {
            if (isset($_POST['del_image'])) {
                // album_id
                $result = dbquery("select album_image, album_thumb1, album_thumb2 FROM " . DB_PHOTO_ALBUMS . " WHERE album_id='" . $data['album_id'] . "'");
                if (dbrows($result) > 0) {
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:31,代码来源:gallery_cat.php

示例7: get_albumOpts

 if (dbcount("('photo_id')", DB_PHOTOS, "album_id = '" . intval($_GET['cat_id']) . "'")) {
     $list = get_albumOpts();
     $albumArray[0] = $locale['album_0028'];
     foreach ($list as $album_id => $album_title) {
         $albumArray[$album_id] = sprintf($locale['album_0029'], $album_title);
     }
     // unset own album
     unset($albumArray[$_GET['cat_id']]);
     if (isset($_POST['confirm_delete'])) {
         $targetAlbum = form_sanitizer($_POST['target_album'], '0', 'target_album');
         // Purge or move photos
         $photosResult = dbquery("SELECT * FROM " . DB_PHOTOS . " WHERE album_id = '" . intval($_GET['cat_id']) . "'");
         if (dbrows($photosResult) > 0) {
             if ($targetAlbum > 0) {
                 // move picture to $move_album
                 $target_max_order = dbresult(dbquery("SELECT MAX(photo_order) FROM " . DB_PHOTOS . " WHERE album_id='" . intval($targetAlbum) . "'"), 0) + 1;
                 while ($photo_data = dbarray($result)) {
                     $photo_data['photo_order'] = $target_max_order;
                     dbquery("UPDATE " . DB_PHOTO_ALBUMS . " SET album_id='" . intval($targetAlbum) . "' WHERE photo_id='" . $photo_data['photo_id'] . "'");
                     $target_max_order++;
                 }
                 addNotice("success", sprintf($locale['album_0031'], $albumArray[$targetAlbum]));
             } else {
                 // delete all
                 $photoRows = 0;
                 while ($photo_data = dbarray($photosResult)) {
                     purgePhotoImage($photo_data);
                     dbquery("delete from " . DB_COMMENTS . " where comment_item_id='" . intval($photo_data['photo_id']) . "' and comment_type='P'");
                     dbquery("delete from " . DB_RATINGS . " where rating_item_id='" . intval($photo_data['photo_id']) . "' and rating_type='P'");
                     dbquery_insert(DB_PHOTOS, $photo_data, 'delete');
                     $photoRows++;
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:31,代码来源:gallery_actions.php

示例8: redirect

        }
    } else {
        redirect(FUSION_SELF . $aidlink . "&amp;error=4");
    }
    // Save Insert
} elseif (isset($_POST['btn_save'])) {
    $version_h = substr(stripinput($_POST['version_h']), 0, 5);
    $version_l = substr(stripinput($_POST['version_l']), 0, 5);
    $version_s = substr(stripinput($_POST['version_s']), 0, 12);
    $version_description = stripinput($_POST['version_description']);
    if (empty($version_h) || empty($version_l)) {
        redirect(FUSION_SELF . $aidlink . "&amp;error=1");
    } elseif (dbcount("(*)", DB_ADDON_VERSIONS, "version_h='{$version_h}' AND version_l='{$version_l}' AND version_s='{$version_s}'") != 0) {
        redirect(FUSION_SELF . $aidlink . "&amp;error=2");
    } else {
        $version_order = dbresult(dbquery("SELECT MAX(version_order) FROM " . DB_ADDON_VERSIONS), 0) + 1;
        $result = dbquery("INSERT INTO " . DB_ADDON_VERSIONS . " VALUES(\r\n\t\t\t\t'',\r\n\t\t\t\t'" . $version_h . "',\r\n\t\t\t\t'" . $version_l . "',\r\n\t\t\t\t'" . $version_s . "',\r\n\t\t\t\t'" . $version_description . "',\r\n\t\t\t\t'" . $version_order . "'\r\n\t\t\t)");
        redirect(FUSION_SELF . $aidlink . "&amp;insert=ok");
    }
} else {
    $version_h = "";
    $version_l = "";
    $version_s = "";
    $version_description = "";
    $version_formaction = FUSION_SELF . $aidlink;
    opentable($locale['addondb408']);
}
echo "<form name='frm_version' method='post' action='{$version_formaction}'>\r\n<table align='center' cellpadding='0' cellspacing='0' class='tbl-border'>" . (isset($err) ? "<tr><td colspan='3' class='tbl1 error' align='center' colspan='2'>" . $err . "</td></tr>" : "") . "\r\n<tr>\r\n<td class='tbl1' nowrap>" . $locale['addondb401'] . "<strong><span style='color:red;'>*</span></strong>:</td>\r\n<td class='tbl1' nowrap>v&nbsp;<input type='text' class='textbox' name='version_h' value='" . $version_h . "' style='width:30px;text-align:right;'>&nbsp;.&nbsp;<input type='text' class='textbox' name='version_l' value='" . $version_l . "' style='width:50px;'>&nbsp;&nbsp;<input type='text' class='textbox' name='version_s' value='" . $version_s . "' style='width:100px;'></td>\r\n</tr>\r\n<tr>\r\n<td class='tbl1' nowrap valign='top'>" . $locale['addondb402'] . ":</td>\r\n<td class='tbl1' nowrap><textarea class='textbox' name='version_description' style='width:211px; height:40px;'>" . $version_description . "</textarea></td>\r\n</tr>\r\n<tr>\r\n<td class='tbl1' nowrap colspan='2' align='center'>" . $locale['addondb413'] . "</td>\r\n</tr>\r\n<tr>\r\n<td class='tbl1' nowrap colspan='2' align='center'><input type='submit' class='button' name='btn_save' value='" . $locale['addondb409'] . "'>" . (isset($_GET['action']) && $_GET['action'] == "edit" ? "&nbsp;<input type='submit' class='button' name='btn_cancel' value='" . $locale['addondb410'] . "'>" : "") . "</td>\r\n</tr>\r\n</table>\r\n</form>";
closetable();
opentable($locale['addondb400']);
$result = dbquery("SELECT * FROM " . DB_ADDON_VERSIONS . " ORDER BY version_order");
开发者ID:xXxthebeastxXx,项目名称:addondb,代码行数:31,代码来源:versions.php

示例9: isnum

            $forum_attach = isnum($_POST['forum_attach']) ? $_POST['forum_attach'] : 0;
            $forum_attach_download = isnum($_POST['forum_attach_download']) ? $_POST['forum_attach_download'] : 0;
            $forum_poll = isnum($_POST['forum_poll']) ? $_POST['forum_poll'] : 0;
            $forum_vote = isnum($_POST['forum_vote']) ? $_POST['forum_vote'] : 0;
            $forum_merge = isset($_POST['forum_merge']) && isnum($_POST['forum_merge']) ? $_POST['forum_merge'] : 0;
            $result = dbquery("UPDATE " . DB_FORUMS . " SET forum_name='" . $forum_name . "', forum_cat='" . $forum_cat . "', forum_description='" . $forum_description . "', forum_moderators='" . $forum_mods . "', forum_access='" . $forum_access . "', forum_post='" . $forum_post . "', forum_reply='" . $forum_reply . "', forum_attach='" . $forum_attach . "', forum_attach_download='" . $forum_attach_download . "', forum_poll='" . $forum_poll . "', forum_vote='" . $forum_vote . "', forum_merge='" . $forum_merge . "', forum_language='" . $forum_language . "' WHERE forum_id='" . $_GET['forum_id'] . "'");
            redirect(FUSION_SELF . $aidlink . "&status=savefu");
        } else {
            $uniqueCheck = dbcount("(forum_id)", DB_FORUMS, "" . (multilang_table("FO") ? "forum_language='" . LANGUAGE . "' AND" : "") . " forum_cat='" . $forum_cat . "' AND forum_name='" . $forum_name . "'");
            if ($uniqueCheck != 0) {
                $defender->stop();
                $defender->addNotice($locale['517']);
            }
            $forum_order = isnum($_POST['forum_order']) ? $_POST['forum_order'] : "";
            if (!$forum_order) {
                $forum_order = dbresult(dbquery("SELECT MAX(forum_order) FROM " . DB_FORUMS . " " . (multilang_table("FO") ? "WHERE forum_language='" . LANGUAGE . "' AND" : "WHERE") . " forum_cat='{$forum_cat}'"), 0) + 1;
            }
            $result = dbquery("UPDATE " . DB_FORUMS . " SET forum_order=forum_order+1 " . (multilang_table("FO") ? "WHERE forum_language='" . LANGUAGE . "' AND" : "WHERE") . " forum_cat='{$forum_cat}' AND forum_order>='{$forum_order}'");
            $result = dbquery("INSERT INTO " . DB_FORUMS . " (forum_cat, forum_name, forum_order, forum_description, forum_moderators, forum_access, forum_post, forum_reply, forum_attach, forum_attach_download, forum_poll, forum_vote, forum_lastpost, forum_lastuser, forum_merge, forum_language) VALUES ('" . $forum_cat . "', '" . $forum_name . "', '" . $forum_order . "', '" . $forum_description . "', '103', '101', '101', '101', '0', '0', '0', '0', '0', '0', '0', '" . $forum_language . "')");
            redirect(FUSION_SELF . $aidlink . "&status=savefn");
        }
    }
} elseif (isset($_GET['action']) && $_GET['action'] == "mu" && (isset($_GET['forum_id']) && isnum($_GET['forum_id'])) && (isset($_GET['order']) && isnum($_GET['order']))) {
    if (isset($_GET['t']) && $_GET['t'] == "cat") {
        $data = dbarray(dbquery("SELECT forum_id FROM " . DB_FORUMS . " " . (multilang_table("FO") ? "WHERE forum_language='" . LANGUAGE . "' AND" : "WHERE") . " forum_cat='0' AND forum_order='" . $_GET['order'] . "'"));
        $result = dbquery("UPDATE " . DB_FORUMS . " SET forum_order=forum_order+1 " . (multilang_table("FO") ? "WHERE forum_language='" . LANGUAGE . "' AND" : "WHERE") . " forum_id='" . $data['forum_id'] . "'");
        $result = dbquery("UPDATE " . DB_FORUMS . " SET forum_order=forum_order-1 " . (multilang_table("FO") ? "WHERE forum_language='" . LANGUAGE . "' AND" : "WHERE") . " forum_id='" . $_GET['forum_id'] . "'");
    } elseif (isset($_GET['t']) && $_GET['t'] == "forum" && (isset($_GET['cat']) && isnum($_GET['cat']))) {
        $data = dbarray(dbquery("SELECT forum_id FROM " . DB_FORUMS . " " . (multilang_table("FO") ? "WHERE forum_language='" . LANGUAGE . "' AND" : "WHERE") . " forum_cat='" . $_GET['cat'] . "' AND forum_order='" . $_GET['order'] . "'"));
        $result = dbquery("UPDATE " . DB_FORUMS . " SET forum_order=forum_order+1 " . (multilang_table("FO") ? "WHERE forum_language='" . LANGUAGE . "' AND" : "WHERE") . " forum_id='" . $data['forum_id'] . "'");
        $result = dbquery("UPDATE " . DB_FORUMS . " SET forum_order=forum_order-1 " . (multilang_table("FO") ? "WHERE forum_language='" . LANGUAGE . "' AND" : "WHERE") . " forum_id='" . $_GET['forum_id'] . "'");
开发者ID:WuChEn,项目名称:PHP-Fusion,代码行数:31,代码来源:forums.php

示例10: elseif

        }
    }
} elseif (isset($_POST['save_ac'])) {
    $ac_name = trim(stripinput($_POST['ac_name']));
    $ac_url = $_POST['ac_url'];
    $ac_target = isnum($_POST['ac_target']) ? $_POST['ac_target'] : 0;
    $ac_cat = isnum($_POST['ac_cat']) ? $_POST['ac_cat'] : 0;
    if (isset($_GET['action']) && $_GET['action'] == "edit" && (isset($_GET['ac_id']) && isnum($_GET['ac_id'])) && (isset($_GET['t']) && $_GET['t'] == "ac")) {
        $ac_access = isnum($_POST['ac_access']) ? $_POST['ac_access'] : 0;
        $result = dbquery("UPDATE " . DB_AC_NAVIGATION . " SET ac_name='{$ac_name}', ac_cat='{$ac_cat}', ac_url='{$ac_url}', ac_target='{$ac_target}', ac_access='{$ac_access}' WHERE ac_id='" . $_GET['ac_id'] . "'");
        redirect(FUSION_SELF . $aidlink . "&status=savefu");
    } else {
        if ($ac_name) {
            $ac_order = isnum($_POST['ac_order']) ? $_POST['ac_order'] : "";
            if (!$ac_order) {
                $ac_order = dbresult(dbquery("SELECT MAX(ac_order) FROM " . DB_AC_NAVIGATION . " WHERE ac_cat='{$ac_cat}'"), 0) + 1;
            }
            $result = dbquery("UPDATE " . DB_AC_NAVIGATION . " SET ac_order=ac_order+1 WHERE ac_cat='{$ac_cat}' AND ac_order>='{$ac_order}'");
            $result = dbquery("INSERT INTO " . DB_AC_NAVIGATION . " (ac_cat, ac_name, ac_url, ac_target, ac_access, ac_order) VALUES ('{$ac_cat}', '{$ac_name}', '{$ac_url}', '{$ac_target}', '{$ac_access}', '{$ac_order}')");
            redirect(FUSION_SELF . $aidlink . "&status=savefn");
        } else {
            redirect(FUSION_SELF . $aidlink);
        }
    }
} elseif (isset($_GET['action']) && $_GET['action'] == "mu" && (isset($_GET['ac_id']) && isnum($_GET['ac_id'])) && (isset($_GET['order']) && isnum($_GET['order']))) {
    if (isset($_GET['t']) && $_GET['t'] == "cat") {
        $data = dbarray(dbquery("SELECT * FROM " . DB_AC_NAVIGATION . " WHERE ac_cat='0' AND ac_order='" . $_GET['order'] . "'"));
        $result = dbquery("UPDATE " . DB_AC_NAVIGATION . " SET ac_order=ac_order+1 WHERE ac_id='" . $data['ac_id'] . "'");
        $result = dbquery("UPDATE " . DB_AC_NAVIGATION . " SET ac_order=ac_order-1 WHERE ac_id='" . $_GET['ac_id'] . "'");
    } elseif (isset($_GET['t']) && $_GET['t'] == "ac" && (isset($_GET['cat']) && isnum($_GET['cat']))) {
        $data = dbarray(dbquery("SELECT * FROM " . DB_AC_NAVIGATION . " WHERE ac_cat='{$cat}' AND ac_order='" . $_GET['order'] . "'"));
开发者ID:edwintcloud,项目名称:mycms,代码行数:31,代码来源:ac_navigation_admin.php

示例11: set_customPageLinks

 /**
  * Set CustomPage Links into Navigation Bar
  * @param $data
  */
 protected function set_customPageLinks($data)
 {
     $page_language = explode(".", $data['page_language']);
     foreach ($page_language as $language) {
         $link_order = dbresult(dbquery("SELECT MAX(link_order) FROM " . DB_SITE_LINKS . " " . (multilang_table("SL") ? "WHERE link_language='" . LANGUAGE . "' AND" : "WHERE") . " link_cat='" . $data['page_link_cat'] . "'"), 0) + 1;
         $link_data = array('link_id' => !empty($data['link_id']) ? $data['link_id'] : 0, 'link_cat' => $data['page_link_cat'], 'link_name' => $data['page_title'], 'link_url' => 'viewpage.php?page_id=' . $data['page_id'], 'link_icon' => '', 'link_language' => $language, 'link_visibility' => 0, 'link_position' => 2, 'link_window' => 0, 'link_order' => $link_order);
         print_p($link_data);
         if (\PHPFusion\SiteLinks::verify_edit($link_data['link_id'])) {
             dbquery_insert(DB_SITE_LINKS, $link_data, 'update');
         } else {
             dbquery_insert(DB_SITE_LINKS, $link_data, 'save');
         }
     }
 }
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:18,代码来源:CustomPage.php

示例12: fusion_get_username

/**
 * Fetches username
 * @param $user_id
 * @return string
 */
function fusion_get_username($user_id)
{
    $result = NULL;
    $result = dbresult(dbquery("SELECT user_name FROM " . DB_USERS . " WHERE user_id='" . intval($user_id) . "'"), 0);
    return $result !== NULL ? $result : fusion_get_locale("na");
}
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:11,代码来源:core_functions_include.php

示例13: array

            $today_online[] = array("user_id" => $data['user_id'], "user_name" => $data['user_name'], "user_level" => $data['user_level']);
        }
    }
    $rowspan++;
}
// Today's birthday
if ($settings['forum_statistics_birthday']) {
    $today_birthday = "";
    $birthday = false;
    if (iMEMBER) {
        if (isset($userdata['user_birthdate'])) {
            $birthday = true;
        }
    } else {
        $result = dbquery("SELECT field_name FROM " . DB_USER_FIELDS . " WHERE field_name='user_birthdate'");
        $birthday = dbresult($result, 0);
    }
    if ($birthday) {
        $result = dbquery("SELECT user_id, user_name, user_level, user_status, user_birthdate\r\n\t\t\t\tFROM " . DB_USERS . " WHERE user_birthdate LIKE '____-" . date("m") . "-" . date("d") . "'");
        $birthday_rows = dbrows($result);
        if ($birthday_rows) {
            while ($data = dbarray($result)) {
                $birthdate = explode("-", $data['user_birthdate']);
                $year = date("Y") - $birthdate[0];
                if ($today_birthday == "") {
                    if ($birthday_rows == 1) {
                        $today_birthday .= $locale['forum_stats_114'];
                    } else {
                        $today_birthday .= sprintf($locale['forum_stats_115'], $birthday_rows);
                    }
                } else {
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:31,代码来源:forum_statistics.php

示例14: foreach

$add = $locale['addondb429'];
foreach ($addon_types as $k => $addon_typ) {
    $addon_type_list .= "<li class='" . $k . "'>" . $addon_typ . "</li>\n";
    $type == $k ? $add = $addon_typ : "";
}
$aob = $locale['func016'];
foreach ($addon_orderby as $k => $addon_orderby) {
    $addon_orderby_list .= "<li class='" . $k . "'>" . $addon_orderby . "</li>\n";
    $orderby == $k ? $aob = $addon_orderby : "";
}
$aobl = $locale['func023'];
foreach ($addon_orderby_dir as $k => $addon_orderby_dir) {
    $addon_orderby_dir_list .= "<li class='" . $k . "'>" . $addon_orderby_dir . "</li>\n";
    $sort == $k ? $aobl = $addon_orderby_dir : "";
}
$rows = dbresult(dbquery("SELECT COUNT(*) FROM " . DB_ADDON_CATS . " tc LEFT JOIN " . DB_ADDONS . " tm USING(addon_cat_id) LEFT JOIN " . DB_ADDON_VERSIONS . " tv USING(version_id) WHERE " . groupaccess('tc.addon_cat_access') . " AND " . $db_opts . " AND addon_status='0'"), 0);
$result = dbquery("\r\n\tSELECT tc.*,tm.*,tv.*\r\n\tFROM " . DB_ADDON_CATS . " tc\r\n\tLEFT JOIN " . DB_ADDONS . " tm USING(addon_cat_id)\r\n\tLEFT JOIN " . DB_ADDON_VERSIONS . " tv USING(version_id)\r\n\tWHERE " . $db_opts . " AND " . groupaccess('tc.addon_cat_access') . "\r\n\tGROUP BY addon_id, tc.addon_cat_id\r\n\tORDER BY addon_cat_name, " . $orderby . " " . $sort . "\r\n\tLIMIT " . $_GET['rowstart'] . "," . $settings_global['addons_per_page']);
add_to_title($locale['addondb435'] . $locale['addondb400']);
include ADDON_INC . "view_nav.php";
opentable($locale['addondb400']);
?>
<form name="filterform" method="get" action="<?php 
echo FUSION_SELF;
?>
">
	<div class="dropselect threecol">
		<?php 
echo $locale['addondb432'];
?>
		<p class="field"><?php 
echo $add;
开发者ID:xXxthebeastxXx,项目名称:addondb,代码行数:31,代码来源:index.php

示例15: isnum

            $forum_attach = isnum($_POST['forum_attach']) ? $_POST['forum_attach'] : 0;
            $forum_attach_download = isnum($_POST['forum_attach_download']) ? $_POST['forum_attach_download'] : 0;
            $forum_poll = isnum($_POST['forum_poll']) ? $_POST['forum_poll'] : 0;
            $forum_vote = isnum($_POST['forum_vote']) ? $_POST['forum_vote'] : 0;
            $forum_merge = isset($_POST['forum_merge']) && isnum($_POST['forum_merge']) ? $_POST['forum_merge'] : 0;
            $result = dbquery("UPDATE " . DB_FORUMS . " SET forum_name='" . $forum_name . "', forum_cat='" . $forum_cat . "', forum_parent='" . $forum_parent . "', forum_description='" . $forum_description . "', forum_moderators='" . $forum_mods . "', forum_access='" . $forum_access . "', forum_post='" . $forum_post . "', forum_reply='" . $forum_reply . "', forum_attach='" . $forum_attach . "', forum_attach_download='" . $forum_attach_download . "', forum_poll='" . $forum_poll . "', forum_vote='" . $forum_vote . "', forum_merge='" . $forum_merge . "' WHERE forum_id='" . $_GET['forum_id'] . "'");
            //subforums
            redirect(FUSION_SELF . $aidlink . "&status=savefu");
        } else {
            $uniqueCheck = dbcount("(forum_id)", DB_FORUMS, "forum_cat='" . $forum_cat . "' AND forum_name='" . $forum_name . "'");
            if ($uniqueCheck != 0) {
                redirect(FUSION_SELF . $aidlink . "&status=saveft");
            }
            $forum_order = isnum($_POST['forum_order']) ? $_POST['forum_order'] : "";
            if (!$forum_order) {
                $forum_order = dbresult(dbquery("SELECT MAX(forum_order) FROM " . DB_FORUMS . " WHERE forum_parent='{$forum_parent}' AND forum_cat='{$forum_cat}'"), 0) + 1;
            }
            //subforums
            $result = dbquery("UPDATE " . DB_FORUMS . " SET forum_order=forum_order+1 WHERE forum_cat='{$forum_cat}' AND forum_parent='{$forum_parent}' AND forum_order>='{$forum_order}'");
            //subforums
            $result = dbquery("INSERT INTO " . DB_FORUMS . " (forum_cat, forum_parent, forum_name, forum_order, forum_description, forum_moderators, forum_access, forum_post, forum_reply, forum_attach, forum_attach_download, forum_poll, forum_vote, forum_lastpost, forum_lastuser, forum_merge) VALUES ('" . $forum_cat . "', '" . $forum_parent . "', '" . $forum_name . "', '" . $forum_order . "', '" . $forum_description . "', '103', '101', '101', '101', '0', '0', '0', '0', '0', '0', '0')");
            //subforums
            redirect(FUSION_SELF . $aidlink . "&status=savefn");
        }
    } else {
        redirect(FUSION_SELF . $aidlink . "&status=saveft");
    }
} elseif (isset($_GET['action']) && $_GET['action'] == "mu" && (isset($_GET['forum_id']) && isnum($_GET['forum_id'])) && (isset($_GET['order']) && isnum($_GET['order']))) {
    if (isset($_GET['t']) && $_GET['t'] == "cat") {
        $parent = isset($_GET['parent']) && isNum($_GET['parent']) ? " AND forum_parent='" . $_GET['parent'] . "'" : "";
        //subforums
开发者ID:keddyboys,项目名称:kmods,代码行数:31,代码来源:forums.php


注:本文中的dbresult函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。