当前位置: 首页>>代码示例>>PHP>>正文


PHP zipfile::addfiles方法代码示例

本文整理汇总了PHP中zipfile::addfiles方法的典型用法代码示例。如果您正苦于以下问题:PHP zipfile::addfiles方法的具体用法?PHP zipfile::addfiles怎么用?PHP zipfile::addfiles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在zipfile的用法示例。


在下文中一共展示了zipfile::addfiles方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: foreach

                $files[] = create_fullsize_read($rowset[$key]['filepath'], $rowset[$key]['filename']);
                //$files[] = $rowset[$key]['filepath'].$rowset[$key]['filename'];
            }
        }
    } else {
        foreach ($superCage->get->_source as $key => $val) {
            if (strpos($key, "pic") !== false) {
                $favs .= "{$val},";
            }
        }
        $favs .= "-1";
        $select_columns = 'filepath,filename';
        $result = cpg_db_query("SELECT {$select_columns} FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES'AND pid IN ({$favs})");
        $rowset = cpg_db_fetch_rowset($result);
        foreach ($rowset as $key => $row) {
            //$filelist[] = $rowset[$key]['filepath'].$rowset[$key]['filename'];
            $files[] = create_fullsize_read($rowset[$key]['filepath'], $rowset[$key]['filename']);
            //add_to_history($USER_DATA['user_id'],$rowset[$key]['filename']);
        }
    }
    $flags['storepath'] = 0;
    // $cwd = './albums';
    //$cwd = "./{$CONFIG['fullpath']}";
    $cwd = substr($cwd, 0, -1);
    $zip = new zipfile($cwd, $flags);
    $zip->addfiles($files);
    $zip->filedownload('pictures.zip');
    foreach ($files as $fn) {
        secure_fullsize($fn);
    }
}
开发者ID:phill104,项目名称:branches,代码行数:31,代码来源:zipdownload_extended.php

示例2: pageheader

    //someone has entered the url manually, while the admin has disabled zipdownload
    pageheader($lang_error);
    starttable('-2', $lang_error);
    print <<<EOT
<tr>
        <td align="center" class="tableb">
      {$lang_errors['perm_denied']}
      </td>
</tr>
EOT;
    endtable();
    pagefooter();
    ob_end_flush();
} else {
    // zipdownload allowed, go ahead...
    $filelist = array();
    if (count($FAVPICS) > 0) {
        $favs = implode(",", $FAVPICS);
        $select_columns = 'filepath,filename';
        $result = db_query("SELECT {$select_columns} FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES'AND pid IN ({$favs})");
        $rowset = db_fetch_rowset($result);
        foreach ($rowset as $key => $row) {
            $filelist[] = $rowset[$key]['filepath'] . $rowset[$key]['filename'];
        }
    }
    $flags['storepath'] = 0;
    $cwd = './albums';
    $zip = new zipfile($cwd, $flags);
    $zip->addfiles($filelist);
    $zip->filedownload('pictures.zip');
}
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:31,代码来源:zipdownload.php


注:本文中的zipfile::addfiles方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。