コード例 #1
0
ファイル: view.php プロジェクト: e-rasvet/textanalysis
 } else {
     if ($type == "gallery") {
         $alluserslink = "";
         if ($_POST['addselect']) {
             foreach ($_POST['addselect'] as $user) {
                 $alluserslink .= $user . ":";
             }
         }
         echo "<h2>Gallery:</h2><br />";
         echo '<a href="get_csv.php?id=' . $id . '&type=gallery&addselect=' . $alluserslink . '">Download CSV</a><br /><br />';
         require_once $CFG->dirroot . "/gallery2/bootstrap.inc";
         require_once $CFG->dirroot . "/gallery2/embed.php";
         $embed = new GalleryEmbed();
         $embed->init();
         $g_api = new GalleryCoreApi();
         list($ret, $usersdata) = $g_api->fetchUsernames();
         if ($_POST['addselect']) {
             foreach ($_POST['addselect'] as $user) {
                 list($ret, $items) = $g_api->fetchAllItemIdsByOwnerId($user);
                 //---------------------????????? ? ????????????---------------------//
                 list($ret, $usr) = $g_api->fetchUserByUserName($usersdata[$user]);
                 $summary = "";
                 $summary_s = "";
                 foreach ($items as $item) {
                     $r_tb = mysql_query("SELECT * FROM " . $storeConfig['tablePrefix'] . "Item WHERE " . $storeConfig['columnPrefix'] . "id = '" . $item . "'");
                     $row_tb = mysql_fetch_array($r_tb);
                     if ($row_tb[$storeConfig['columnPrefix'] . 'summary'] != $usr->userName) {
                         $summarysize = strlen(trim($row_tb[$storeConfig['columnPrefix'] . 'summary']));
                         $descriptionsize = strlen(trim($row_tb[$storeConfig['columnPrefix'] . 'description']));
                         if ($summarysize > $descriptionsize) {
                             $summary .= strip_tags(trim($row_tb[$storeConfig['columnPrefix'] . 'summary'])) . " [s]<br />";