• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP preprocessProfilePicture函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: sendSetPicture

 /**
  * Set your profile picture
  *
  * @param string $jid
  * @param string $filepath
  *  URL or localpath to image file
  */
 protected function sendSetPicture($jid, $filepath)
 {
     if (stripos($filepath, 'http') !== false && !preg_match('/\\s/', $filepath)) {
         $extension = end(explode(".", $filepath));
         $newImageName = rand(0, 100000);
         $imagePath = static::PICTURES_FOLDER . "/" . $newImageName . ".jpg";
         if ($extension == 'jpg') {
             copy($filepath, $imagePath);
             $filepath = $imagePath;
         }
     }
     preprocessProfilePicture($filepath);
     $fp = @fopen($filepath, "r");
     if ($fp) {
         $data = fread($fp, filesize($filepath));
         if ($data) {
             //this is where the fun starts
             $picture = new ProtocolNode("picture", null, null, $data);
             $icon = createIconGD($filepath, 96, true);
             $thumb = new ProtocolNode("picture", array("type" => "preview"), null, $icon);
             $hash = array();
             $nodeID = $this->createMsgId("setphoto");
             $hash["id"] = $nodeID;
             $hash["to"] = $this->getJID($jid);
             $hash["type"] = "set";
             $hash["xmlns"] = "w:profile:picture";
             $node = new ProtocolNode("iq", $hash, array($picture, $thumb), null);
             $this->sendNode($node);
             $this->waitForServer($nodeID);
         }
     }
 }
开发者ID:micschk,项目名称:WhatsAPI,代码行数:39,代码来源:whatsprot.class.php


示例2: sendSetPicture

 /**
  * Set your profile picture
  *
  * @param string $jid
  * @param string $filepath
  *  URL or localpath to image file
  */
 protected function sendSetPicture($jid, $filepath)
 {
     preprocessProfilePicture($filepath);
     $fp = @fopen($filepath, "r");
     if ($fp) {
         $data = fread($fp, filesize($filepath));
         if ($data) {
             //this is where the fun starts
             $picture = new ProtocolNode("picture", null, null, $data);
             $icon = createIconGD($filepath, 96, true);
             $thumb = new ProtocolNode("picture", array("type" => "preview"), null, $icon);
             $hash = array();
             $nodeID = $this->createMsgId("setphoto");
             $hash["id"] = $nodeID;
             $hash["to"] = $this->getJID($jid);
             $hash["type"] = "set";
             $hash["xmlns"] = "w:profile:picture";
             $node = new ProtocolNode("iq", $hash, array($picture, $thumb), null);
             $this->sendNode($node);
             $this->waitForServer($nodeID);
         }
     }
 }
开发者ID:nekulin,项目名称:WhatsAPI,代码行数:30,代码来源:whatsprot.class.php


示例3: sendSetPicture

 /**
  * Set your profile picture.
  *
  * @param string $jid
  * @param string $filepath URL or localpath to image file
  */
 protected function sendSetPicture($jid, $filepath)
 {
     $nodeID = $this->createIqId();
     $data = preprocessProfilePicture($filepath);
     $preview = createIconGD($filepath, 96, true);
     $picture = new ProtocolNode('picture', ['type' => 'image'], null, $data);
     $preview = new ProtocolNode('picture', ['type' => 'preview'], null, $preview);
     $node = new ProtocolNode('iq', ['id' => $nodeID, 'to' => $this->getJID($jid), 'type' => 'set', 'xmlns' => 'w:profile:picture'], [$picture, $preview], null);
     $this->sendNode($node);
 }
开发者ID:Veivan,项目名称:WABuh,代码行数:16,代码来源:whatsprot.class.php


示例4: sendSetPicture

 /**
  * Set your profile picture
  *
  * @param string $jid
  * @param string $filepath URL or localpath to image file
  */
 protected function sendSetPicture($jid, $filepath)
 {
     $nodeID = $this->createIqId();
     $data = preprocessProfilePicture($filepath);
     $preview = createIconGD($filepath, 96, true);
     $picture = new ProtocolNode("picture", array("type" => "image"), null, $data);
     $preview = new ProtocolNode("picture", array("type" => "preview"), null, $preview);
     $node = new ProtocolNode("iq", array('id' => $nodeID, 'to' => $this->getJID($jid), 'type' => 'set', 'xmlns' => 'w:profile:picture'), array($picture, $preview), null);
     $this->sendNode($node);
     $this->waitForServer($nodeID);
 }
开发者ID:rezanadimi72,项目名称:Chat-API,代码行数:17,代码来源:whatsprot.class.php


示例5: sendSetPicture

 /**
  * Set your profile picture
  *
  * @param string $jid
  * @param string $filepath
  *  URL or localpath to image file
  */
 protected function sendSetPicture($jid, $filepath)
 {
     $data = preprocessProfilePicture($filepath);
     $preview = createIconGD($filepath, 96, true);
     $picture = new ProtocolNode("picture", array("type" => "image"), null, $data);
     $preview = new ProtocolNode("picture", array("type" => "preview"), null, $preview);
     $hash = array();
     $nodeID = $this->createMsgId("setphoto");
     $hash["id"] = $nodeID;
     $hash["to"] = $this->getJID($jid);
     $hash["type"] = "set";
     $hash["xmlns"] = "w:profile:picture";
     $node = new ProtocolNode("iq", $hash, array($picture, $preview), null);
     $this->sendNode($node);
     $this->waitForServer($nodeID);
 }
开发者ID:ankurdebnath,项目名称:WebProjects,代码行数:23,代码来源:whatsprot.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP presence函数代码示例发布时间:2022-05-15
下一篇:
PHP prepend_attachment函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap