ここの情報は古いです。ご理解頂いた上でお取り扱いください。

source: OpenPNE/branches/kijiji/2_4/webapp/modules/pc/do/dmd_diary_kijiji.php @ 622

Last change on this file since 622 was 622, checked in by kanbe, 16 years ago

enter code for debug and remove code on 2-4th image posting

File size: 2.9 KB
Line 
1<?php
2/**
3 * @copyright 2005-2006 OpenPNE Project
4 * @license   http://www.php.net/license/3_01.txt PHP License 3.01
5 */
6
7require_once 'HTTP/Request.php';
8
9class pc_do_dmd_diary_kijiji extends OpenPNE_Action
10{
11    function execute($requests)
12    {
13        $u = $GLOBALS['AUTH']->uid();
14
15        $c_member = db_common_c_member4c_member_id($u, true);
16        $c_diary = db_diary_get_c_diary4id($requests['target_c_diary_id']);
17
18        if ($c_diary['c_member_id'] != $u) {
19            handle_kengen_error();
20        }
21
22        $num_img = intval($requests['image']);
23        $image_url = '';
24        if ($num_img >= 1 && $num_img <= 3) {
25            $p = array('filename' => $c_diary['image_filename_' . $num_img]);
26            $image_url = openpne_gen_img_url($p);
27        }
28
29        $post_url = 'http://ad.kijiji.co.jp/pnegate/getpostdata.php';
30        $req =& new HTTP_Request($post_url);
31        $req->setMethod(HTTP_REQUEST_METHOD_POST);
32        $req->addHeader('Content-Type', 'multipart/form-data');
33        $req->addPostData("email", $c_member['secure']['pc_address']);
34        $req->addPostData("area_id", $requests['area_id']);
35        $req->addPostData("cat_id", $requests['cat_id']);
36        $req->addPostData("format", $requests['format']);
37        $req->addPostData("ask_price", $requests['ask_price']);
38        $req->addPostData("price_type", $requests['price_type']);
39        $req->addPostData("address", $requests['address']);
40        $req->addPostData("title", $requests['title']);
41        $req->addPostData("desc", $requests['desc']);
42        $req->addPostData("event_start_year", $requests['event_start_year']);
43        $req->addPostData("event_start_month", $requests['event_start_month']);
44        $req->addPostData("event_start_date", $requests['event_start_date']);
45        $req->addPostData("event_end_year", $requests['event_end_year']);
46        $req->addPostData("event_end_month", $requests['event_end_month']);
47        $req->addPostData("event_end_date", $requests['event_end_date']);
48        $req->addPostData("event_start_hourc", $requests['event_start_hour']);
49        $req->addPostData("event_start_minute", $requests['event_start_minute']);
50        $req->addPostData("event_end_hour", $requests['event_end_hour']);
51        $req->addPostData("event_end_minute", $requests['event_end_minute']);
52        $req->addPostData("image1", $image_url);
53        $req->addPostData("image2", $image_url);
54        $req->addPostData("image3", $image_url);
55        $req->addPostData("image4", $image_url);
56        $req->addPostData('from', OPENPNE_URL);
57       
58        var_dump($req);
59
60        if (!PEAR::isError($req->sendRequest())) {
61            $res = $req->getResponseBody();
62            //echo $res;
63        } else {
64            $res = -1;
65        }
66       
67        //echo "<p>echo output example\n</p>";
68
69        openpne_redirect('pc', 'page_dmd_diary_kijiji_end', array('result' => $res));
70    }
71}
72
73?>
Note: See TracBrowser for help on using the repository browser.