Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 08-16-2008, 10:02 AM
Solar08 Solar08 is offline
 
Join Date: Aug 2008
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS'1);
define('THIS_SCRIPT''vbu'); // change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(

);

// get special data templates from the datastore
$specialtemplates = array(
    
);

// pre-cache templates used by all actions
$globaltemplates = array(
    
'orange',
);

// pre-cache templates used by specific actions
$actiontemplates = array(

);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
if (!
$vbulletin->userinfo['userid'])
{
        
print_no_permission();
}  

if (!
is_member_of($vbulletin->userinfo6) AND !is_member_of($vbulletin->userinfo7) AND !

is_member_of($vbulletin->userinfo11))
{
        
print_no_permission();
}  

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

$navbits = array();
$navbits[$parent] = 'إضافة عضو';

$navbits construct_navbits($navbits);


require_once(
'Connections/connection.php');
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue 

""
{
  
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? "'" doubleval($theValue) . "'" "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}

$editFormAction $_SERVER['PHP_SELF'];
if (isset(
$_SERVER['QUERY_STRING'])) {
  
$editFormAction .= "?" htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset(
$_POST["MM_update"])) && ($_POST["MM_update"] == "form2")) {
  
$updateSQL sprintf("UPDATE user SET usergroupid=%s, membergroupids=%s, displaygroupid=%s, 

username=%s, password=%s, passworddate=%s, email=%s, styleid=%s, parentemail=%s, homepage=%s, 

icq=%s, aim=%s, yahoo=%s, msn=%s, skype=%s, showvbcode=%s, showbirthday=%s, usertitle=%s, 

customtitle=%s, joindate=%s, daysprune=%s, lastvisit=%s, lastactivity=%s, lastpost=%s, 

lastpostid=%s, posts=%s, reputation=%s, reputationlevelid=%s, timezoneoffset=%s, pmpopup=%s, 

avatarid=%s, avatarrevision=%s, profilepicrevision=%s, sigpicrevision=%s, options=%s, 

birthday=%s, birthday_search=%s, maxposts=%s, startofweek=%s, ipaddress=%s, referrerid=%s, 

languageid=%s, emailstamp=%s, threadedmode=%s, autosubscribe=%s, pmtotal=%s, pmunread=%s, 

salt=%s, ipoints=%s, infractions=%s, warnings=%s, infractiongroupids=%s, infractiongroupid=%

s, adminoptions=%s, profilevisits=%s, friendcount=%s, friendreqcount=%s, vmunreadcount=%s, 

vmmoderatedcount=%s, socgroupinvitecount=%s, socgroupreqcount=%s, pcunreadcount=%s, 

pcmoderatedcount=%s, gmmoderatedcount=%s WHERE userid=%s"
,
                       
GetSQLValueString($_POST['usergroupid'], "int"),
                       
GetSQLValueString($_POST['membergroupids'], "text"),
                       
GetSQLValueString($_POST['displaygroupid'], "int"),
                       
GetSQLValueString($_POST['username'], "text"),
                       
GetSQLValueString($_POST['password'], "text"),
                       
GetSQLValueString($_POST['passworddate'], "date"),
                       
GetSQLValueString($_POST['email'], "text"),
                       
GetSQLValueString($_POST['styleid'], "int"),
                       
GetSQLValueString($_POST['parentemail'], "text"),
                       
GetSQLValueString($_POST['homepage'], "text"),
                       
GetSQLValueString($_POST['icq'], "text"),
                       
GetSQLValueString($_POST['aim'], "text"),
                       
GetSQLValueString($_POST['yahoo'], "text"),
                       
GetSQLValueString($_POST['msn'], "text"),
                       
GetSQLValueString($_POST['skype'], "text"),
                       
GetSQLValueString($_POST['showvbcode'], "int"),
                       
GetSQLValueString($_POST['showbirthday'], "int"),
                       
GetSQLValueString($_POST['usertitle'], "text"),
                       
GetSQLValueString($_POST['customtitle'], "int"),
                       
GetSQLValueString($_POST['joindate'], "int"),
                       
GetSQLValueString($_POST['daysprune'], "int"),
                       
GetSQLValueString($_POST['lastvisit'], "int"),
                       
GetSQLValueString($_POST['lastactivity'], "int"),
                       
GetSQLValueString($_POST['lastpost'], "int"),
                       
GetSQLValueString($_POST['lastpostid'], "int"),
                       
GetSQLValueString($_POST['posts'], "int"),
                       
GetSQLValueString($_POST['reputation'], "int"),
                       
GetSQLValueString($_POST['reputationlevelid'], "int"),
                       
GetSQLValueString($_POST['timezoneoffset'], "text"),
                       
GetSQLValueString($_POST['pmpopup'], "int"),
                       
GetSQLValueString($_POST['avatarid'], "int"),
                       
GetSQLValueString($_POST['avatarrevision'], "int"),
                       
GetSQLValueString($_POST['profilepicrevision'], "int"),
                       
GetSQLValueString($_POST['sigpicrevision'], "int"),
                       
GetSQLValueString($_POST['options'], "int"),
                       
GetSQLValueString($_POST['birthday'], "text"),
                       
GetSQLValueString($_POST['birthday_search'], "date"),
                       
GetSQLValueString($_POST['maxposts'], "int"),
                       
GetSQLValueString($_POST['startofweek'], "int"),
                       
GetSQLValueString($_POST['ipaddress'], "text"),
                       
GetSQLValueString($_POST['referrerid'], "int"),
                       
GetSQLValueString($_POST['languageid'], "int"),
                       
GetSQLValueString($_POST['emailstamp'], "int"),
                       
GetSQLValueString($_POST['threadedmode'], "int"),
                       
GetSQLValueString($_POST['autosubscribe'], "int"),
                       
GetSQLValueString($_POST['pmtotal'], "int"),
                       
GetSQLValueString($_POST['pmunread'], "int"),
                       
GetSQLValueString($_POST['salt'], "text"),
                       
GetSQLValueString($_POST['ipoints'], "int"),
                       
GetSQLValueString($_POST['infractions'], "int"),
                       
GetSQLValueString($_POST['warnings'], "int"),
                       
GetSQLValueString($_POST['infractiongroupids'], "text"),
                       
GetSQLValueString($_POST['infractiongroupid'], "int"),
                       
GetSQLValueString($_POST['adminoptions'], "int"),
                       
GetSQLValueString($_POST['profilevisits'], "int"),
                       
GetSQLValueString($_POST['friendcount'], "int"),
                       
GetSQLValueString($_POST['friendreqcount'], "int"),
                       
GetSQLValueString($_POST['vmunreadcount'], "int"),
                       
GetSQLValueString($_POST['vmmoderatedcount'], "int"),
                       
GetSQLValueString($_POST['socgroupinvitecount'], "int"),
                       
GetSQLValueString($_POST['socgroupreqcount'], "int"),
                       
GetSQLValueString($_POST['pcunreadcount'], "int"),
                       
GetSQLValueString($_POST['pcmoderatedcount'], "int"),
                       
GetSQLValueString($_POST['gmmoderatedcount'], "int"),
                       
GetSQLValueString($_POST['userid'], "int"));

  
mysql_select_db($database_connection$connection);
  
$Result1 mysql_query($updateSQL$connection) or die(mysql_error());

  
$updateGoTo "vbu2.php";
  if (isset(
$_SERVER['QUERY_STRING'])) {
    
$updateGoTo .= (strpos($updateGoTo'?')) ? "&" "?";
    
$updateGoTo .= $_SERVER['QUERY_STRING'];
  }
  
header(sprintf("Location: %s"$updateGoTo));
}

if ((isset(
$_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
  
$updateSQL sprintf("UPDATE user SET usergroupid=%s WHERE userid=%s",
                       
GetSQLValueString($_POST['usergroupid'], "int"),
                       
GetSQLValueString($_POST['userid'], "int"));

  
mysql_select_db($database_connection$connection);
  
$Result1 mysql_query($updateSQL$connection) or die(mysql_error());
}

$maxRows_Recordset1 10;
$pageNum_Recordset1 0;
if (isset(
$_GET['pageNum_Recordset1'])) {
  
$pageNum_Recordset1 $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 $pageNum_Recordset1 $maxRows_Recordset1;

mysql_select_db($database_connection$connection);
$query_Recordset1 "SELECT * FROM `user` where usergroupid = 4";
$query_limit_Recordset1 sprintf("%s LIMIT %d, %d"$query_Recordset1$startRow_Recordset1

$maxRows_Recordset1);
$Recordset1 mysql_query($query_limit_Recordset1$connection) or die(mysql_error());
$row_Recordset1 mysql_fetch_assoc($Recordset1);

if (isset(
$_GET['totalRows_Recordset1'])) {
  
$totalRows_Recordset1 $_GET['totalRows_Recordset1'];
} else {
  
$all_Recordset1 mysql_query($query_Recordset1);
  
$totalRows_Recordset1 mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
?>
<body>
<?php if ($totalRows_Recordset1 == 0) { // Show if recordset empty ?>
  <p align="center"><strong>لايوجد 

أعضاء في قائمة 

الإنتظار </strong></p>
  <?php // Show if recordset empty ?>
  <?php if ($totalRows_Recordset1 0) { // Show if recordset not empty ?>
  
  <p></p>
  <form method="post" name="form2" action="<?php echo $editFormAction?>">
    <input type="hidden" name="MM_update" value="form2">
    <input type="hidden" name="userid" value="<?php echo $row_Recordset1['userid']; ?>">
    <table border="1">
      <tr>
        <td>userid</td>
        <td>usergroupid</td>
        <td>username</td>
        <td>email</td>
        <td>parentemail</td>
        <td>homepage</td>
        <td>skype</td>
        <td>usertitle</td>
      </tr>
      <?php do { ?>
        <tr>
          <td><?php echo $row_Recordset1['userid']; ?></td>
          <td><label>
            <select name="usergroupid">
              <option value="4" <?php if (!(strcmp(4$row_Recordset1['usergroupid']))) {echo 

"SELECTED";} ?>>في الإنتظار</option>
              <option value="2" <?php if (!(strcmp(2$row_Recordset1['usergroupid']))) {echo 

"SELECTED";} ?>>تسجيل العضو</option>
            </select>
          </label></td>
          <td><?php echo $row_Recordset1['username']; ?></td>
          <td><?php echo $row_Recordset1['email']; ?></td>
          <td><?php echo $row_Recordset1['parentemail']; ?></td>
          <td><?php echo $row_Recordset1['homepage']; ?></td>
          <td><?php echo $row_Recordset1['skype']; ?></td>
          <td><?php echo $row_Recordset1['usertitle']; ?></td>
        </tr>
        <?php } while ($row_Recordset1 mysql_fetch_assoc($Recordset1)); ?>
        </table>
    <input name="submit" type="submit" value="OK do it" />
  </form>
  
  <form method="post" name="form1" action="<?php echo $editFormAction?>">
    <p class="style1">programming by Sndan</p>
  </form>
  <?php // Show if recordset not empty ?></body>
</html>
<?php
mysql_free_result
($Recordset1);

?>
this is my phpcode... the file
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:57 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05642 seconds
  • Memory Usage 2,867KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (11)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete