コード例 #1
0
ファイル: Asset.lib.php プロジェクト: NateBrune/bithub
 public function store_asset($repo)
 {
     $G = new Github();
     $G->load_repo($repo);
     $public_id = HOTWALLET_ASSET;
     // Store a temp asset id, then update it later I guess
     $qi = "INSERT INTO asset (public_id, name_short, name, contract_url, issuer, description, description_mime, type, divisibility, link_to_website, icon_url, image_url, version, date_created) VALUES \n\t\t\t\t(\n\t\t\t\t\t'" . $public_id . "',\n\t\t\t\t\t'" . escape(substr($G->json_response->name, 0, 10)) . "',\n\t\t\t\t\t'" . escape($G->json_response->full_name) . "',\n\t\t\t\t\t'" . escape(SITE_URL . '/asset/' . $G->json_response->full_name) . "',\n\t\t\t\t\t'" . escape($G->json_response->owner->login) . "',\n\t\t\t\t\t'" . escape($G->json_response->description . "\n" . $G->json_response->html_url) . "',\n\t\t\t\t\t'text/x-markdown; charset=UTF-8',\n\t\t\t\t\t'Bithub', \n\t\t\t\t\t'" . DEFAULT_DIVISIBILITY . "', \n\t\t\t\t\t'false',\n\t\t\t\t\t'" . escape($G->json_response->owner->avatar_url) . "', \n\t\t\t\t\t'" . escape($G->json_response->owner->avatar_url) . "', \n\t\t\t\t\t'1.0', \n\t\t\t\t\tNOW()\n\t\t\t\t\t)";
     query($qi);
     return mysqli_insert_id(Gbl::get('db'));
 }