View Single Post
  #99  
Old 12-14-2013, 09:33 PM
ye22 ye22 is offline
 
Join Date: Dec 2002
Location: cairo
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i am sorry for bumping this old thread but.., i still didn't mange to give admins the ability to edit other users status..
if anyone did mange to do that.., Please share it with us!

----------------Edit----------------
i manged to replace the :
Code:
<if condition="$userinfo['userid']==$vbulletin->userinfo['userid']">
with :
Code:
<if condition="($post['userid']==$vbulletin->userinfo['userid']) OR ($bbuserinfo[usergroupid]==6)">
to make admins able to see the "Edit" and "Save" buttons.., However, If they edited anyuser it would be changed to them.
Example (As an admin) .. :
if i changed my status to : "Is good." and saved it.. every thing is fine.
but when i want to change someone's else status.. Like from "has no status." to "Is fine." (or anything else..)
That user's(which i changed his status) Only appears(his status) as i changed it to. (The "Is fine." status) until i reload the page.. then his status changes to "has no status." and my status changes to "Is fine." (As if i edited my own status!)
So.., is there anyfix for this?
i think that it is aproblem in the "vbstatus_class.php" file.. :
Code:
<?php
require_once('JSON.php');

if(!function_exists  (  'iconv'  )){
	function iconv($string){
		return $string;
	}
}

class att_object{
	function att_object(){
	}
}
class vbstatus_class{
	function vbstatus_class()
	{
		global $att;
		global $data;
		$this->att = $att;
		$this->data = $data;
		$this->JSON = new JSON;
	}
	function process_status($status,$change_encoding=True)
	{
	global $vbulletin;
	if($change_encoding){
	$status = iconv('utf-8',$vbulletin->options['vbstatus_charset'],$status);
	}

	$charcount=strlen ($status);
	if($vbulletin->options['vbstatus_maxchars'])
	{
		if($charcount>$vbulletin->options['vbstatus_maxchars'])
		{
			return '[Too Long]';
		}
	}
		if($vbulletin->options['vbstatus_wordwrap'])
		{
			$status=wordwrap($status, $vbulletin->options['vbstatus_wordwrap'], "\n", true);
		}
		return $status;
	}
	function change_status($userid,$status)
	{
		$this->att->required($userid);
		$return = new att_object();
		$return->updated_status = $this->process_status($status,False);
		
		$status = $this->process_status($status);
		
		//$this->att->required($status);
		
		$this->data->set('user');
		$this->data->select('*');
		$this->data->where('userid',$userid);
		$userinfo = $this->data->execute('select1');
		$this->att->required($userinfo);
		
		$this->data->set('userfield');
		$this->data->update('vbstatus_status',$status);
		$this->data->where('userid',$userinfo['userid']);
		$this->data->execute('update');
		
		return $this->JSON->serialize($return);
	}
	

}

?>
However.., i am not sure.. :/
Thanks in advanced.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01293 seconds
  • Memory Usage 1,771KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete