function show_item($y) { $d = gmdate("g:i A \\U\\T\\C, F d Y", $y[7]); $file = $y[0]; if (strstr($file, 'http://')) { $url = $file; } else { $url = "http://boinc.berkeley.edu/addons/{$file}"; } page_head($y[1]); list_start(); list_item("Name<br><font size=-2>Click to download</font>", "<a href=\"{$url}\">" . $y[1] . '</a>'); if ($y[2]) { list_item("Version", $y[2]); } if ($y[3]) { list_item("Summary", $y[3]); } if ($y[4]) { list_item("Origin", '<a href=' . $y[4] . '>' . $y[4] . '</a>'); } if ($y[5]) { list_item("Platform", $y[5]); } if ($y[6]) { list_item("Description", $y[6]); } list_item("Date", $d); list_end(); page_tail(); }
function email_contact($vol) { echo "\n <p>\n <h2>Contact {$vol->name} by email</h2>\n <form action=help_vol.php>\n <input type=hidden name=volid value=\"{$vol->id}\">\n "; list_start(); list_item("Your email address", input("email_addr", "")); list_item("Subject<br><span class=note>Include 'BOINC' in the subject so {$vol->name} will know it's not spam</span>", input("subject", "")); list_item("Message<br><span class=note>\n \n Please include a detailed description of the problem\n you're experiencing.\n If possible, include the contents of BOINC's message log.\n </span>", textarea("message", "")); list_item("", "<input type=submit name=send_email value=OK>"); list_end(); echo "</form>\n "; }
function compare_tovar($catalog_id) { //Функция поиска новых товаров на сайте и скачки ID товара в таблицу "Товары на загрузку" global $host; global $user; global $password; global $database; // подключаемся к SQL серверу $link = mysqli_connect($host, $user, $password, $database) or die("Ошибка " . mysqli_error($link)); $i = 0; $commit = 0; $arr_tovar = list_item($catalog_id); // Получаем массив ID товаров по каталогу с сайта for ($j = 0; $j < count($arr_tovar); $j++) { $s1 = $arr_tovar[$j]["tovar_id"]; $s2 = $arr_tovar[$j]["catalog_id"]; $s3 = $arr_tovar[$j]["link"]; $s4 = $arr_tovar[$j]["parent_id"]; $query = 'select exist (select 1 from bitrixshop.tovar where tovar_id = ' . $s1 . ')'; // Ищем ID товара в таблице Tovar если не найден, то добавляем в таблицу Compare $result = mysqli_query($link, $query); $commit = $commit + 1; //Счетчик коммитов. Коммитим через 50 записей if ($result == 0) { //Здесь инсертим в базу новые ID товаров для последующей загрузки $query = "INSERT INTO Bitrixshop.compare (`tovar_id`,`parent_id`,`catalog`,`link`) VALUES ('" . $s1 . "','" . $s4 . "','" . $s2 . "','" . $s3 . "')"; $res = mysqli_query($link, $query); if (!$res) { echo "Ошибка загрузки данных: " . $query . "<br>"; } if ($commit == 51) { $query = "COMMIT"; $res = mysqli_query($link, $query); $commit = 0; flush(); //echo $i . "<br>"; } } $i = $i + 1; } echo "Catalog: " . $s2 . " всего товаров: " . $i . "<br>"; //Закрываем соединение с БД mysqli_close($link); }
function print_form($vol, $action_name) { list_start(); list_item("Name or nickname", input("volname", $vol->name)); list_item("Email address<br><font size=-2>This won't be publicized,\n but user email may be sent here.\n Use a separate mailbox if you want.</font>", input("email_addr", $vol->email_addr)); list_item("Password", password("password", $vol->password)); list_item("Skype ID<br><font size=-2>\n This will be publicized.\n Use a Skype account other than\n your primary one if you want.</font>", input("skypeid", $vol->skypeid)); list_item("Primary language", spoken_language_list("lang1", $vol->lang1)); list_item("Secondary language", spoken_language_list("lang2", $vol->lang2)); list_item("Country", "<select name=country>" . country_select($vol->country) . "</select>"); list_item("Specialties<br><font size=-2>\n What kinds of computers (Windows/Mac/Linux)\n and/or networking technologies (proxies, NATs)\n are you most familiar with?</font>", textarea("specialties", $vol->specialties)); list_item("Projects<br><font size=-2>\n Do you specialize in any particular BOINC-based projects?</font>", textarea("projects", $vol->projects)); list_item("What days and times are you typically available for help?\n <br><font size=-2>Include your time zone, or use UTC</font>", textarea("availability", $vol->availability)); list_item("Is Skype voice OK?", yesno("voice_ok", $vol->voice_ok)); list_item("Is Skype text OK?", yesno("text_ok", $vol->text_ok)); list_item("Hide your account?", yesno("hide", $vol->hide)); list_item("", "<input type=submit name={$action_name} value=OK>"); list_end(); }
function list_full($items) { $columns = 3; $i = 0; ?> <table><tr> <td><span></span></td><?php foreach ($items as $item) { if ($i == $columns) { $i = 0; ?> </tr><tr> <td><span></span></td> <?php } list_item($item, $i + 1 <= $columns); $i++; } ?> </tr></table><?php }
<?php require_once "docutil.php"; page_head("BOINC email lists"); echo "\n\nThe follow email lists are available.\nClick to subscribe or post to a list.\nBecause of spam problems,\nyou must subscribe to a list in order to post to it.\nMake sure you post from the same email address\nunder which you subscribed.\n\n<p>\n<b><font size=+1 color=#f00000>\nNote:\n\nThese email lists do not provide tech support\nfor SETI@home or other BOINC projects.\nHelp for SETI@home is available on the\n<a href=http://setiathome.berkeley.edu/forum_help_desk.php>SETI@home message boards</a>\nand help for BOINC is available <a href=help.php>here</a>.\n\n</font></b>\n"; list_start(); //list_item( // "<a href=http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_announce>boinc_announce</a>", // "Announcements of new versions of BOINC client software." //); list_item("<a href=http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_projects>boinc_projects</a>", "For people developing and operating BOINC projects.\n Questions and problems involving BOINC API and server software.\n Announcements of upgrades and changes.\n"); list_item("<a href=http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev>boinc_dev</a>", "For people developing, debugging or porting the BOINC software\n (client, server, and Web).\n Do NOT post questions about how to use the software.\n"); list_item("<a href=http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_loc>boinc_loc</a>", "For people doing non-English translations\n of the BOINC GUI or web interfaces.\n"); list_item("<a href=http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_stats>boinc_stats</a>", "For people developing web sites showing statistics for BOINC projects."); list_item("<a href=http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_cvs>boinc_cvs</a>", "Summaries of changes to the BOINC source code are posted to this list.\n No other posts, please."); list_item("<a href=http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_opt>boinc_opt</a>", "For people porting and optimizing BOINC applications."); list_item("<a href=http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_helpers>boinc_helpers</a>", "For BOINC <a href=help.php>Help Volunteers</a>,\n to discuss policies and user problems."); list_item("<a href=http://groups.google.com/group/boinc-team-founders>BOINC team founders</a> (Google group)", "Discussion of team-related issues."); list_end(); page_tail();
/** * HTML::Open('tag') -> Opens a HTML tag * * @static * @access private * @param string $tag Which tag we're gonna open? * @param mixed $attributes Custom attributes (must be a valid attribute for the specified tag) * @param array $li_items Some array with items for <ul> or <ol> tags * @return string Return the opened tag (<$tag>) */ function Open($tag, $attributes = null, $li_items = array()) { $tag = strtolower($tag); if (isset($attributes) && !empty($attributes)) { $attributes = parse_attr($attributes); } if ($tag == 'ul' || $tag == 'ol') { if (!empty($attributes['li_class'])) { $list = list_item($li_items, $attributes['li_class']); return '<' . $tag . $attributes . '>' . PHP_EOL . $li_items; } else { $list = list_item($li_items); return '<' . $tag . $attributes . '>' . PHP_EOL . $li_items; } } return '<' . $tag . $attributes . '>'; }
function compare_tovar($catalog_id) { global $host; global $user; global $password; global $database; // подключаемся к SQL серверу $link = mysqli_connect($host, $user, $password, $database) or die("Ошибка " . mysqli_error($link)); $i = 0; $commit = 0; $version = 0; // Получаем текущую версию загруженных данных $query = 'select value from bitrixshop.system where name = "version"'; $result = mysqli_query($link, $query); while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { $version = $row['value']; } $arr_tovar = list_item($catalog_id); // Получаем массив ID товаров по каталогу с сайта // Проверяем версию товара $query = 'select 1 from bitrixshop.tovar where version != "' . $version . '" union select 1 from bitrixshop.compare where version != "' . $version . '"'; $result = mysqli_query($link, $query); if (mysqli_num_rows($result) == 0) { $version = $version + 1; $query = 'UPDATE bitrixshop.system set value = "' . $version . '" where name = "version"'; $result = mysqli_query($link, $query); } for ($j = 0; $j < count($arr_tovar); $j++) { $s1 = $arr_tovar[$j]["tovar_id"]; $s2 = $arr_tovar[$j]["catalog_id"]; $s3 = $arr_tovar[$j]["link"]; $s4 = $arr_tovar[$j]["parent_id"]; $query = 'select 1 from bitrixshop.tovar where tovar_id = "' . $s1 . '" union select 1 from bitrixshop.compare where tovar_id = "' . $s1 . '"'; $result = mysqli_query($link, $query); if (mysqli_num_rows($result) == 0) { $new = 1; } else { $query = 'UPDATE bitrixshop.compare set version = "' . $version . '" where tovar_id = "' . $s1 . '"'; $result = mysqli_query($link, $query); $query = 'UPDATE bitrixshop.tovar set version = "' . $version . '" where tovar_id = "' . $s1 . '"'; $result = mysqli_query($link, $query); } $commit = $commit + 1; //Счетчик коммитов. Коммитим через 50 записей if ($new == 1) { //Здесь инсертим в базу новые ID товаров для последующей загрузки $query = "INSERT INTO Bitrixshop.compare (`tovar_id`,`version`,`parent_id`,`catalog`,`link`) VALUES ('" . $s1 . "','" . $version . "','" . $s4 . "','" . $s2 . "','" . $s3 . "')"; $res = mysqli_query($link, $query); if (!$res) { echo "Ошибка загрузки данных: " . $query . "<br>"; } if ($commit == 51) { $query = "COMMIT"; $res = mysqli_query($link, $query); $commit = 0; flush(); echo $i . "<br>"; } } $i = $i + 1; } echo "Catalog: " . $s2 . " всего товаров: " . $i . "<br>"; ob_flush(); flush(); //Закрываем соединение с БД mysqli_close($link); }
function list_item_func($x, $y) { list_item(html_text($x), $y); }
<?php require_once "docutil.php"; page_head("Project configuration web RPC"); echo "\nEach BOINC project and account manager exports\na few configuration items via a web RPC;\nnamely, it must provide an XML document at the address\n<pre>\nhttp://PROJECT_URL/get_project_config.php\n</pre>\nThis file is created by <a href=make_project.php>make_project</a>,\nand in most cases you don't have to change it.\n\n<p>\nThis document has the structure\n" . html_text("\n<project_config>\n <name>Project name</name>\n [ <min_passwd_length>N</min_passwd_length> ]\n [ <account_manager/> ]\n [ <uses_username/> ]\n [ <account_creation_disabled/> ]\n [ <client_account_creation_disabled/> ]\n [ <rpc_prefix>URL</rpc_prefix> ]\n [ <error_num>N</error_num> ]\n [\n <system_requirements>\n [ <p_fpops>N</p_fpops> ]\n [ <p_iops>N</p_iops> ]\n [ <p_membw>N</p_membw> ]\n [ <m_nbytes>N</m_nbytes> ]\n [ <m_swap>N</m_swap> ]\n [ <d_free>N</d_free> ]\n [ <bwup>N</bwup> ]\n [ <bwdown>N</bwdown> ]\n </system_requirements>\n ]\n [\n <platforms>\n <platform>windows_intelx86</platform>\n <platform>i686-pc-linux-gnu</platform>\n <platform>powerpc-apple-darwin</platform>\n ...\n </platforms>\n ]\n</project_config>\n") . "\nThe elements are:\n"; list_start(); list_item("name", "Project name"); list_item("account_manager", "If present, this is an account manager, not a BOINC project"); list_item("uses_username", "If present, this project uses names (rather than email addresses)\n as the primary account identifier"); list_item("account_creation_disabled", "If present, this project is not allowing creation of new accounts"); list_item("client_account_creation_disabled", "If present, new accounts can be created only via the web\n (not via the client software)."); list_item("min_passwd_length", "Minimum password length (for new account creation)"); list_item("rpc_prefix", "Prefix to use for web RPCs, instead of the master URL."); list_item("error_num", "The project is currently down. A BOINC error number is returned."); list_item("system_requirements", "Hardware requirements for participating in this project.\n If a computer doesn't meet these requirements it may not\n get sent any work by the project.\n All requirements are 'net'; e.g. the CPU requirements\n are after factors like <a href=sched.php>on-fraction, active-fraction</a>,\n and resource share have been taken into consideration.\n NOT IMPLEMENTED YET."); list_item("platforms", "A list of platforms for which the project has application versions.\n NOT IMPLEMENTED YET."); list_end(); echo "\nThe BOINC distribution includes a file\n<b>html/user/sample_get_project_config.php</b>\nthat supplies reasonable default values for BOINC projects.\nTo use this, rename it to <b>get_project_config.php</b>\n"; page_tail();