• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

this.setUserMeta not updating meta data

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
7 posts • Page 1 of 1

Postby Bubba » Mon Dec 13, 2010 4:03 am

Support Template
PFC Version: 1.3
PHP Version: 5.3.3

Shared or Dedicated Hosting: VPS server
Link to your website:

Are you able to reproduce the issue on the official demo (http://www.phpfreechat.net/demo)? No (custom code)

Have you set any parameters?
If so, please include your entire code, using the [code ] and[/code ] tags (without the space).

What is the issue you are experiencing in detail?
Using this.setUserMeta(nickid, 'age', 100); in pfcclient.js does not change the age meta data that was set via $params["nickmeta"] = array("age" => '0'); in index.php

Are you seeing any error messages, such as javascript errors?
There are no error messages, doing /whois nickname returns an age of 0.

I have also tried making a custom command to force the age to change, this fails as well.. (copy of /op command)

Code: Select all
<?php

require_once(dirname(__FILE__)."/../pfccommand.class.php");

class pfcCommand_age extends pfcCommand
{
  var $usage = "/age {nickname} {age}";
 
  function run(&$xml_reponse, $p)
  {
    $clientid    = $p["clientid"];
    $param       = $p["param"];
    $sender      = $p["sender"];
    $recipient   = $p["recipient"];
    $recipientid = $p["recipientid"];

    $c  =& pfcGlobalConfig::Instance();
    $u  =& pfcUserConfig::Instance();
    $ct =& pfcContainer::Instance();

    if (trim($param) == "")
    {
      // error
      $cmdp = $p;
      $cmdp["param"] = _pfc("Missing parameter");
      $cmdp["param"] .= " (".$this->usage.")";
      $cmd =& pfcCommand::Factory("error");
      $cmd->run($xml_reponse, $cmdp);
      return;
    }

    // just change the "age" meta flag
    $nicktoop   = trim($param);
    $nicktoopid = $ct->getNickId($nicktoop);
    $ct->setUserMeta($nicktoopid, 'age', '100'); //<-- this does not work

    $this->forceWhoisReload($nicktoopid); //<-- This also does not work
  }
}

?>

The funny thing is, the /op command works fine and does a forced whois reload where mine does not, but I guess that is because isadmin is a dynamic var?

I read that the /away custom command no longer works with PFC 1.3, is anyone looking into why the setUserMeta function is failing?

Thanks.
Last edited by Bubba on Mon Dec 13, 2010 4:04 am, edited 1 time in total.
Bubba
New member
 
Posts: 5
Joined: Mon Dec 13, 2010 3:46 am
Top

Postby re*s.t.a.r.s.*2 » Mon Dec 13, 2010 4:18 am

Is working I have got it working, but yeah emoticon in nick, and avatar doesnt update when set, you need to reload page to force it update and show it to the other users..
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top

Postby Bubba » Mon Dec 13, 2010 4:22 am

re*s.t.a.r.s.*2 wrote:Is working I have got it working, but yeah emoticon in nick, and avatar doesnt update when set, you need to reload page to force it update and show it to the other users..

How do you mean reload the page? Isn't $this->forceWhoisReload($nicktoopid); meant to do this?

Do you have some example code I could have a look at?

Thanks.
Bubba
New member
 
Posts: 5
Joined: Mon Dec 13, 2010 3:46 am
Top

Postby re*s.t.a.r.s.*2 » Mon Dec 13, 2010 4:26 am

I dont use that function just, set it on session and then tell them to reload the chat..
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top

Postby Bubba » Mon Dec 13, 2010 4:33 am

re*s.t.a.r.s.*2 wrote:I dont use that function just, set it on session and then tell them to reload the chat..

Ok thanks, but not a workable solution having all the users reload the chat and setting dynamic chat vars in a session. Before you ask, no the age param is not going to be dynamic, it is just an easy example to use.

Obviously something is wrong with this.setUserMeta and nickmeta params, or I am doing something wrong.

Has anyone else had any luck dynamically changing nickmeta values?
Bubba
New member
 
Posts: 5
Joined: Mon Dec 13, 2010 3:46 am
Top

Postby re*s.t.a.r.s.*2 » Mon Dec 13, 2010 4:58 am

Not sure what could be, really away meta refresh automatically but avatar and emoticon in nicks dont..


perhaps you are trying to use reload it on php, but dont thinks its had to be done there but javascript..
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top

Postby Bubba » Mon Dec 13, 2010 6:07 am

Simple fix in the command class..

$ct->setUserMeta($u->nickid, 'age', 100);
$this->forceWhoisReload($u->nickid);


I hope this helps anyone else having problems..

But I cannot get the javascript setUserMeta() function working but can work around it for now.
Bubba
New member
 
Posts: 5
Joined: Mon Dec 13, 2010 3:46 am
Top


Post a reply
7 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 19 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
cron
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub