vbulletin发布了CURL和PHP的帖子

我需要通过CURL和 PHP在vbulletin上发布论坛帖子,似乎不是一项艰苦的工作,但它必须有图像,我可以上传一张图片,但是只要我添加第二张图片,就可以了似乎只是重定向到我试图发布到论坛的顶级主题?

继承我的代码,好像发布第二张图片只是改变图像的路径..但​​它不起作用?

$post = array(
                'st' => '0',
                'act' => 'Post',
                's' => '',
                'f' => '157',
                'auth_key' => $this->scrape->fetchBetween("<input type='hidden' name='auth_key' value='", "'",$this->scrape->result),
                'removeattachid' => '0',
                'MAX_FILE_SIZE' => '0',
                'CODE' => '01',
                'post_key' => $this->scrape->fetchBetween("<input type='hidden' name='post_key' value='", "'",$this->scrape->result),
                'TopicTitle' => $data['title'],
                'TopicDesc' => '',
                'tag' => $tag,
                'bbmode' => 'normal',
                'ffont' => '0',
                'fsize' => '0',
                'fcolor' => '0',
                'LIST' => 'LIST ',
                'helpbox' => 'Image (alt + g) [img]http://www.dom.com/img.gif[/img]',
                'tagcount' => '',
                'Post' => $description,
                'enableemo' => 'yes',
                'enablesig' => 'yes',
                'iconid' => '0',
                'FILE_UPLOAD' => "@".$data['img1'],
                'attachgo' => 'Add This Attachment'
        );
        $this->scrape->fetch('http://forum.lowyat.net/index.php?', $username, $post);
        if(!empty($data['img2'])) {
            $post = array(
                'st' => '0',
                'act' => 'Post',
                's' => '',
                'f' => '157',
                'auth_key' => $this->scrape->fetchBetween("<input type='hidden' name='auth_key' value='", "'",$this->scrape->result),
                'removeattachid' => '0',
                'MAX_FILE_SIZE' => '0',
                'CODE' => '01',
                'post_key' => $this->scrape->fetchBetween("<input type='hidden' name='post_key' value='", "'",$this->scrape->result),
                'TopicTitle' => $data['title'],
                'TopicDesc' => '',
                'tag' => $tag,
                'bbmode' => 'normal',
                'ffont' => '0',
                'fsize' => '0',
                'fcolor' => '0',
                'LIST' => 'LIST ',
                'helpbox' => 'Image (alt + g) [img]http://www.dom.com/img.gif[/img]',
                'tagcount' => '',
                'Post' => $description,
                'enableemo' => 'yes',
                'enablesig' => 'yes',
                'iconid' => '0',
                'FILE_UPLOAD' => "@".$data['img2'],
                'attachgo' => 'Add This Attachment');

            $this->scrape->fetch('http://forum.lowyat.net/index.php?', $username, $post);
            echo "<pre>";
            print_r($post);
            exit($this->scrape->result);

        }

我很感激任何建议……一定有什么东西隐藏在某个地方,但我只是看不到它..

谢谢,
小号

你没有在一个帖子中添加第二个图像:你正在做两个有两个图像的帖子.当您通过欺骗POST参数执行此操作时,第一个帖子将被执行,然后第二个帖子将不会因为vBull对两个快速提交的帖子提供保护.帖子(几乎)相同,所以第二个被拒绝.您需要做的是检查POST结构是否包含第二张图像并在一次通话中欺骗,而不是两次通话.

但是:作为一般指南,如果代码中的内容发生变化,这种方法将被视为“危险”.

您可能应该考虑使用vBulletin提供的非常实用的API. https://members.vbulletin.com/api/vBulletin/vB_DataManager_ThreadPost.html https://members.vbulletin.com/api/vBulletin/vB_DataManager_Post.html

与vBull有什么关系,它有点复杂,但有一个很好的论坛(如果你有许可证)可以帮助你.您将看到“POST”允许API中的数组.

相关文章
相关标签/搜索