QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

楼主: cnhnln

想要个php的下载系统,可有好的推荐?

[复制链接]
 楼主| 发表于 2006-4-4 23:11:38 | 显示全部楼层
兔子的drupal怎么样了阿?等着用呢
回复

使用道具 举报

发表于 2006-4-4 23:20:03 | 显示全部楼层
drupal为公社作的相关模块已经完成,现在兔兔的任务是phpbb2discuz,这周的工作任务比较多,工作之余没有偷懒哦
回复

使用道具 举报

发表于 2006-4-4 23:23:05 | 显示全部楼层
3N可以即时跟踪我的drupal开发进度
https://ako.3322.org/svn/repos/svn-LinuxFans/trunk/

https://ako.3322.org/tracroot/trac-LinuxFans/timeline
回复

使用道具 举报

 楼主| 发表于 2006-4-5 11:25:30 | 显示全部楼层
Subversion阿,不会用,只用过cvs
离完成还有多少啊?要不兔子弄个snapshot我先用
回复

使用道具 举报

发表于 2006-4-5 11:30:40 | 显示全部楼层
因为对drupal做了很多扩展应用,drupal相关的文档都没有整理,3N我得一件一件事儿做好,我不会偷懒的

今天先把公司的工作文档写好

你在linux下安装一个subversion,然后svn checkout https://ako.3322.org/svn/repos/svn-LinuxFans/trunk/

Trac上https://ako.3322.org/tracroot/trac-LinuxFans/timeline可以看到我工作之余的更新,看看没有偷懒吧
回复

使用道具 举报

 楼主| 发表于 2006-4-6 15:34:38 | 显示全部楼层
连不上
回复

使用道具 举报

发表于 2006-4-6 22:04:42 | 显示全部楼层
[quote:bb84c56ad3="cnhnln"]连不上[/quote]

内部服务器映射到公网是有些不稳定
回复

使用道具 举报

 楼主| 发表于 2006-4-6 23:07:28 | 显示全部楼层
好不容易连上了,只有几K,而且下一会就停了 :-(
有没有好点的站点阿?或者打个包传给我
PS:这个系统现在可用否?
回复

使用道具 举报

发表于 2006-4-7 08:36:47 | 显示全部楼层
还有很多细节没有完成,多镜像下载的管理、软件截图、还有相关编辑
[code:1]
<?php

function download_help ($section)
{
        switch ($section) {
                case "admin/modules#description":
                        return t("将linuxfans.org(%linuxfans_url)使用的phpnuke(%phpnuke_url)下载模块嵌入Drupal,保持phpnuke的相关数据表结构。",
                                array(
                                        "%linuxfans_url"         => "http://www.linuxfans.org",
                                        "%phpnuke_url"                 => "http://phpnuke.org"
                                        )
                                );
                        break;
               
                case 'admin/settings/download':
                        // what should be setted for download module?
                        break;
        }
}

function download_perm ()
{
        return array("view", "download", "comment", "upload", "edit", "edit own upload", "delete", "delete own upload", "admin");
}

function download_menu ($may_cache)
{       
        $view_access                 = user_access("view");
        $download_access         = user_access("download");
        $comment_access         = user_access("comment");
        $upload_access                 = user_access("upload");
        $edit_access                 = user_access("edit");
        $delete_access                 = user_access("delete");
        $admin_access                 = user_access("admin");
       
        $items = array();
       
        if ($may_cache) {
                // for normal user
                $items[] = array(
                        "path"                                         => "download",
                        "title"                                 => t("下载"),
                        "callback"                                 => "download_main_page",
                        "access"                                 => $view_access
                );
               
                $items[] = array(
                        "path"                                         => "download/list",
                        "title"                                 => t("下载"),
                        "callback"                                 => "download_main_page",
                        "type"                                         => MENU_DEFAULT_LOCAL_TASK,
                        "access"                                 => $view_access,
                        "weight"                                 => -10
                );
               
                $items[] = array(
                        "path"                                         => "download/upload",
                        "title"                                 => t("上传"),
                        "callback"                                 => "download_upload",
                        "type"                                         => MENU_LOCAL_TASK,
                        "access"                                 => $upload_access
                );
               
                $items[] = array(
                        "path"                                         => "download/view",
                        "title"                                 => t("浏览"),
                        "callback"                                 => "download_view",
                        "type"                                         => MENU_CALLBACK,
                        "access"                                 => $view_access
                );
               
                $items[] = array(
                        "path"                                         => "download/mirror",
                        "title"                                 => t("镜像"),
                        "callback"                                 => "download_mirror",
                        "type"                                         => MENU_CALLBACK,
                        "access"                                 => $download_access
                );
               
                $items[] = array(
                        "path"                                         => "download/comment/add",
                        "title"                                 => t("添加评论"),
                        "callback"                                 => "download_comment_add",
                        "type"                                         => MENU_CALLBACK,
                        "access"                                 => $comment_access
                );
               
                // for administrator
                $items[] = array(
                        "path"                 => "admin/download",
                        "title"         => t("下载"),
                        "callback"         => "download_admin",
                        "access"         => $admin_access
                );
               
                $items[] = array(
                        "path"                 => "admin/download/category",
                        "title"         => t("下载分类"),
                        "callback"         => "download_category_admin",
                        "access"         => $admin_access
                );
               
                $items[] = array(
                        "path"                 => "admin/download/category/list",
                        "title"         => t("下载分类列表"),
                        "callback"         => "download_category_admin",
                        "type"                 => MENU_DEFAULT_LOCAL_TASK,
                        "weight"         => -10
                );
               
                $items[] = array(
                        "path"                 => "admin/download/category/configure",
                        "title"         => t("配置下载分类"),
                        "access"         => $admin_access,
                        "callback"         => "download_category_configure",
                        "type"                 => MENU_CALLBACK
                );
               
                $items[] = array(
                        "path"                 => "admin/download/category/delete",
                        "title"         => t("删除下载分类"),
                        "access"         => $admin_access,
                        "callback"         => "download_category_delete",
                        "type"                 => MENU_CALLBACK
                );
               
                $items[] = array(
                        "path"                 => "admin/download/category/add",
                        "title"         => t("添加下载分类"),
                        "access"         => $admin_access,
                        "callback"         => "download_category_add",
                        "type"                 => MENU_LOCAL_TASK
                );
               
                $items[] = array(
                        "path"                 => "admin/download/mirror",
                        "title"         => t("下载镜像"),
                        "callback"         => "download_mirror_admin",
                        "access"         => $admin_access
                );
               
                $items[] = array(
                        "path"                 => "admin/download/mirror/list",
                        "title"         => t("下载镜像列表"),
                        "callback"         => "download_mirror_admin",
                        "type"                 => MENU_DEFAULT_LOCAL_TASK,
                        "weight"         => -10
                );
               
                $items[] = array(
                        "path"                 => "admin/download/mirror/configure",
                        "title"         => t("配置下载镜像"),
                        "access"         => $admin_access,
                        "callback"         => "download_mirror_configure",
                        "type"                 => MENU_CALLBACK
                );
               
                $items[] = array(
                        "path"                 => "admin/download/mirror/delete",
                        "title"         => t("删除下载镜像"),
                        "access"         => $admin_access,
                        "callback"         => "download_mirror_delete",
                        "type"                 => MENU_CALLBACK
                );
               
                $items[] = array(
                        "path"                 => "admin/download/mirror/add",
                        "title"         => t("添加下载镜像"),
                        "access"         => $admin_access,
                        "callback"         => "download_mirror_add",
                        "type"                 => MENU_LOCAL_TASK
                );
        }
       
        return $items;
}

function download_admin ()
{
        $op         = $_POST['op'];
        $edit         = $_POST['edit'];
       
        unset($output);
        $admin_access = user_access("admin");
       
        if (user_access($admin_access)) {
                switch ($op) {
                        default:
                                // what should be shown as default of navigation admin?
                                $output = "这里是Linuxfans下载栏配置页面";
                                break;
                }
               
                print theme('page', $output);
        } else {
                print theme('page', message_access());
        }
}

function download_category_admin ()
{
        $op         = $_POST['op'];
        $edit         = $_POST['edit'];

        if (isset($op)) {
                drupal_set_message(download_category_admin_save($edit));
                cache_clear_all();
            drupal_goto($_GET['q']);
        }
       
        print theme('page', download_category_admin_display());
}

function download_category_admin_display ()
{
        $categories = _download_categories();
       
        if (count($categories) != 0) {
                $header = array(t('ID'), t('下载分类名称'));
                $header[] = array('data' => t('操作'), 'colspan' => 2);
       
                $rows = array();
       
                foreach ($categories as $category) {
                        $delete = l(t('删除'), 'admin/download/category/delete/'. $category["id"]);

                        $row = array(
                                array(
                                        "data"         => $category["id"],
                                        "class" => "block"
                                ),
                                array(
                                        "data"         => $category["title"],
                                        "class" => "block"
                                )
                        );

                        $row[] = l(t('配置'), 'admin/download/category/configure/' . $category["id"]);
                        $row[] = $delete;

                        $rows[] = $row;
                       
                        $output = theme('table', $header, $rows, array('id' => 'categories'));
                }
        } else {
                $output = "您还没有创建任何Linux项目,请点击<a href=\"admin/navigation/linuxfans_project/add\">添加Linux项目</a>先";       
        }

          return form($output, 'post', url('admin/download/category'));
}

function download_category_add ()
{
        $edit         = $_POST['edit'];
          $op         = $_POST['op'];
         
          switch ($op) {
            case t('Save Download Category'):
                      download_category_save($edit);
                      drupal_set_message(t('新建的下载分类添加完毕。'));
                      drupal_goto('admin/download/category');

            default:
                      $form = download_category_form();
                      $form .= form_submit(t('Save Download Category'));
                      $output .= form($form);
          }

          print theme('page', $output);
}

function download_category_configure ($cid = 0)
{
        $edit         = $_POST['edit'];
          $op         = $_POST['op'];
         
          switch ($op) {
                  case t('Save Download Category'):
                          drupal_set_message(download_category_save($edit, $cid));
                      cache_clear_all();
                      drupal_goto('admin/download/category');
                     
                      break;
             
              default:
                      if (!$edit) {
                              $sql = "SELECT title
                                      FROM {downloads_categories}
                                      WHERE cid = $cid";
                             
                              $edit = db_fetch_array(db_query($sql));
                      }
                     
                      drupal_set_title(t("配置下载分类'%name' ", array('%name' => $edit["title"])));
                     
                      $form = download_category_form($edit);
                      $form .= form_submit(t('Save Download Category'));
                      $output .= form($form);
                     
                      print theme('page', $output);
                     
                      break;
          }
}

function download_category_delete ($cid = 0)
{
        $op                 = $_POST['op'];
        $category         = download_category_get($cid);
        $info                 = $category["title"];
       
        if ($_POST['edit']['confirm']) {
                $sql = "DELETE
                        FROM {downloads_categories}
                        WHERE cid = $cid";
               
                db_query($sql);
               
                drupal_set_message(t('下载分类 %name 已经被删除。', array('%name' => theme('placeholder', $info))));
            cache_clear_all();
            drupal_goto('admin/download/category');
        } else {
                $output = theme('confirm',
                    t('您确认要删除下载分类 %name么?', array('%name' => theme('placeholder', $info))),
                    'admin/download/category',
                    NULL,
                    t('删除'));
        }
       
        print theme('page', $output);
}

function download_category_get ($cid)
{
        $sql = "SELECT title
                FROM {downloads_categories}
                WHERE cid = $cid";
       
        return db_fetch_array(db_query($sql));
}

function download_category_form ($edit = NULL)
{
        $output = form_textfield(t('下载分类名称'), 'title', $edit['title'], 30, 150, t('下载分类的名称。比如“驱动程序”。'));
       
        return $output;
}

function download_category_save ($edit, $cid = NULL)
{
        if (isset($cid)) {
                db_query("UPDATE {downloads_categories} SET title = '%s' WHERE id = %d", $edit['title'], $cid);
        } else {
                $sql = "INSERT INTO {downloads_categories} (title)
                        VALUES ('" . $edit["title"] . "') ";
                db_query($sql);
        }
       
        return t("下载分类已经更新。");
}

function download_main_page ()
{       
        $view_access                 = user_access("view");
       
        $op = $_POST['op'];
        $edit = $_POST['edit'];
       
        unset($output);
       
        if ($view_access) {
                switch ($op) {
                        case 'add':
                        $output = download_form();
                        break;
        
                        default:
                                $output = download_overview();
                                break;
                }
               
                print theme('page', $output);
        } else {
                print theme('page', message_access());
        }
}

function download_upload ()
{
        $edit = $_POST['edit'];
          $op = $_POST['op'];
         
          switch ($op) {
            case t('Upload'):
                      download_upload_save($edit);
                      drupal_set_message(t('上传完毕。'));
                      drupal_goto('download');

            default:
                      $output .= download_upload_form();
          }

          print theme('page', $output);
}

function download_upload_form ()
{       
        unset($group);
       
        $group = form_textfield(t('文件名称'), 'title', $edit['title'], 30, 150, t('显示在下载列表的文件名称。比如“MagicLinux”。'));
        $group .= form_file(t('上传文件'), 'file', 40, t(''));
        $group .= form_textfield(t('提供链接'), 'url', "http://" . $edit['url'], 30, 150,
        t('如果其他网站有稳定的下载源,请您提供链接。比如“http://sourceforge/”。'));
        /* without screenshot function at present ...
        $group .= form_file(t('截图1'), 'screenshot1', 40, t('可以选择是否上传截图1'));
        $group .= form_file(t('截图2'), 'screenshot2', 40, t('可以选择是否上传截图2'));
        $group .= form_file(t('截图3'), 'screenshot3', 40, t('可以选择是否上传截图3'));
        */
        $group .= form_textfield(t('版本'), 'version', $edit['version'], 30, 150, t('您提供的版本将会帮助下载者知道更多的信息。比如“2.0.1”。'));
        $group .= form_textfield(t('文件大小'), 'filesize', $edit['filesize'], 30, 150, t('显示下载的文件的物理大小。比如“13MB”。'));
        $group .= form_textfield(t('相关网址'), 'homepage', "http://" . $edit['homepage'], 30, 150,
        t('您提供的相关网址将会帮助下载者知道更多的信息。比如“http://sourceforge/”。'));
        $group .= form_select(t('所属分类'), 'cid', $edit['cid'], download_categories(),
        t('您提供的文件所属分类将会帮助下载者知道更多的信息。比如“驱动程序”'));
        $group .= form_textarea(t('相关描述'), 'description', $edit['description'], 70, 15, t('您可以在相关描述中讲解文件的简短描述、安装步骤和测试环境。'));
        $group .= form_submit(t('Upload'));
        $form = $group;
       
        return form($form, 'post', 0, array('enctype' => 'multipart/form-data'));
}

/**
* upload save
*
* @param array $edit
* @param int $lid
* @return char
*/
function download_upload_save ($edit, $lid = NULL)
{       
        global $user;
       
        if (isset($lid)) {
               
        } else {
                // do not use auto_intrement, but use drupal's next_id API
                $insert_id = db_next_id("downloads");
               
                /* upload file from remote machine to server's "./files/software" */
                if ($edit["url"] == "http://" && $edit["url"] == "") {
                        $file = file_save_upload('file', 'software');
                }
               
                /* insert upload file info into download table */
                $sql = "INSERT INTO {downloads} (lid, cid, title, url, description, date, name, submitter, filesize, version, homepage)
                        VALUES ('$insert_id', '" . $edit["cid"] . "', '" . $edit["title"] . "', '" . $edit["url"] . "', '" . $edit["description"] . "',
                        '" . time() . "',";
                if ($edit["title"] != "" && $edit["file"] == "") {
                        $sql .= "'" . $edit["title"] . "',";
                } else {
                        $sql .= "'$file->filename',";
                }
                $sql .= "'$user->name', ";
                if ($edit["filesize"] != "" && $edit["file"] == "") {
                        // if user provide other link point to the file ...
                        $sql .= "'" . $edit["filesize"] . "',";
                } else {
                        // if user upload the file from remote machine ...
                        $sql .= "'$file->filesize',";
                }
                $sql .= " '" . $edit["version"] . "', '" . $edit["homepage"] . "')";
                db_query($sql);
               
                /* without screenshot function at present ... */
        }
       
        return t("文件上传更新。");
}

function download_categories ()
{       
        $categories = array();
       
        $sql = "SELECT cid, title
                FROM {downloads_categories}";
       
        $result = db_query($sql);
       
        while ($row = db_fetch_object($result)) {
                $categories[] = array(
                        $row->cid => t($row->title)
                );
        }
       
        return $categories;
}

function _download_categories ()
{       
        $sql = "SELECT cid, title
                FROM {downloads_categories}";
       
        $result = db_query($sql);
       
        while ($row = db_fetch_object($result)) {
                $categories[] = array(
                        "id"         => $row->cid,
                        "title" => $row->title
                );
        }
       
        return $categories;
}

function download_overview ()
{
        global $user;
       
        if (empty($_SESSION['download_overview_filter'])) {
            $_SESSION['download_overview_filter'] = 'all';
          }

          $op = $_POST['op'];
          if ($op == t('Filter') && isset($_POST['edit']['filter'])) {
            $_SESSION['download_overview_filter'] = $_POST['edit']['filter'];
          }
       
        $form  = form_select(t('根据类别过滤'), 'filter', $_SESSION['download_overview_filter'], download_categories());
          $form .= form_submit(t('Filter'));
       
        $headers = array(
                t("截屏"),
                array(
                        "data"         => t("日期"),
                        "field" => "date",
                        "sort"         => "asc"
                ),
                array(
                        "data"         => t("名字"),
                        "field" => "name"
                ),
                array(
                        "data"         => t("类别"),
                        "field" => "ctitle"
                ),
                array(
                        "data"         => t("下载次数"),
                        "field" => "hits"
                ),
                array(
                        "data"         => t("得分"),
                        "field" => "totalvotes"
                )
        );
       
        if ($_SESSION['download_overview_filter'] != all) {
                $sql = "SELECT d.lid, d.title, d.date, d.name, d.hits, d.totalvotes, d.downloadratingsummary, d.totalcomments, c.title AS ctitle, s.pname
                        FROM {downloads} d LEFT JOIN {downloads_categories} c ON d.cid = c.cid = " . $_SESSION['download_overview_filter'] . "
                        LEFT JOIN {downloads_screenshots} s ON d.lid = s.lid
                        GROUP BY d.lid";
        } else {
                $sql = "SELECT d.lid, d.title, d.date, d.name, d.hits, d.totalvotes, d.downloadratingsummary, d.totalcomments, c.title AS ctitle, s.pname
                        FROM {downloads} d LEFT JOIN {downloads_categories} c ON d.cid = c.cid LEFT JOIN {downloads_screenshots} s ON d.lid = s.lid
                        GROUP BY d.lid";
        }
       
        $sql .= tablesort_sql($headers);
       
        $result = pager_query($sql, 18);
       
        while ($download = db_fetch_object($result)) {
                $row = array();
               
                $row[] = file_exists("files/software/smallshot/" . $download->pname) ? theme('image', "files/software/smallshot/" . $download->pname,
                t('Screenshot for %theme theme', array('%theme' => $download->pname)), '', 'class="screenshot"', false) : t('no screenshot');
                $row[] = date_format($download->date);
                $row[] = array("data" => l($download->title, "download/view/$download->lid"));
                $row[] = $download->ctitle;
                $row[] = $download->hits;
                $row[] = $download->totalvotes;
               
                $rows[] = $row;
        }
       
        if ($pager = theme('pager', NULL, 18, 0, tablesort_pager())) {
                $rows[] = array(array(
                        "data"                 => $pager,
                        "colspan"         => 8
                        )
                );
        }
       
        $out = '<div class="container-inline">'. form($form) .'</div>';
        $out .= theme('table', $headers, $rows);

          return $out;
}

function download_view ($lid = 0)
{
        $sql = "SELECT d.title, d.url, d.description, d.date, d.name, d.hits, d.submitter, d.downloadratingsummary, d.totalvotes, d.filesize,
        d.version, c.title AS ctitle, s.pname
                FROM {downloads} d LEFT JOIN {downloads_categories} c ON d.cid = c.cid LEFT JOIN {downloads_screenshots} s ON d.lid = s.lid
                WHERE d.lid = $lid";
       
        $download = db_fetch_object(db_query($sql));
       
        drupal_set_title(t("浏览'%name' ", array('%name' => $download->title)));
       
        $output .= '<table border="1" cellpadding="2" cellspacing="2">';
        $output .= ' <tr><th>'. t("名字") .'</th><td>' . l(t($download->title), "download/mirror/" . $download->name) . '</td></tr>';
        $output .= ' <tr><th>'. t("类别") .'</th><td>' . t($download->ctitle) . '</td></tr>';
        $output .= ' <tr><th>'. t("大小") .'</th><td>' . t($download->filesize) . '</td></tr>';
        $output .= ' <tr><th>'. t("提交者") .'</th><td>' . t($download->submitter) . '</td></tr>';
        $output .= ' <tr><th>'. t("下载次数") .'</th><td>' . t($download->hits) . '</td></tr>';
        $output .= ' <tr><th>'. t("上传时间") .'</th><td>' . t(date_format($download->date)) . '</td></tr>';
        $output .= ' <tr><th>'. t("版本") .'</th><td>' . t($download->version) . '</td></tr>';
        $output .= ' <tr><th>'. t("相关网址") .'</th><td>' . l(t($download->url), t($download->url)) . '</td></tr>';
        $output .= ' <tr><th>'. t("得分") .'</th><td>' . t($download->downloadratingsummary) . '</td></tr>';
        $output .= ' <tr><th>'. t("投票") .'</th><td>' . l(t("好"), "temp") . "|" . l(t("差"), "temp") . '</td></tr>';
        $output .= ' <tr><th>'. t("相关描述") .'</th><td>' . t($download->description) . '</td></tr>';
        $output .= '</table>';
       
        $output .= "<br >";
        $output .= download_comment_rendor($lid);
       
        $output .= l(t("我要评论"), "download/comment/add/" . $lid);
       
        print theme('page', $output);
}

function download_mirror ($name = NULL)
{       
        $headers = array(
                array(
                        "data"         => t("镜像名称")
                ),
                array(
                        "data"         => t("下载地址")
                )
        );
       
        $sql = "SELECT name, url
                FROM {downloads_mirrors}";
       
        $result = db_query($sql);
       
        drupal_set_title(t("镜像下载'%name' ", array('%name' => $name)));
       
        while ($mirror = db_fetch_object($result)) {
                $row = array();
               
                $row[] = $mirror->name;
                $row[] = l(t($mirror->url . $name), $mirror->url . $name);
               
                $rows[] = $row;
        }
       
        $output .= theme('table', $headers, $rows);

          print theme('page', $output);
}

function download_comment_rendor ($lid = 0, $comments_per_page = 8)
{
        $sql = "SELECT c.subject, c.comment, c.date, u.name
                FROM {downloads_comments} c LEFT JOIN {users} u ON c.userid = u.uid
                WHERE c.lid = $lid
                ORDER BY c.date";
       
        $result = db_query($sql);
       
        while ($comment = db_fetch_object($result)) {
                $comment = drupal_unpack($comment);
                $output .= theme('comment_view', $comment, theme('links', module_invoke_all('link', 'comment', $comment, 0)));
        }
       
        if ($pager = theme('pager', NULL, $comments_per_page, 0, array('comments_per_page' => $comments_per_page))) {
            $output .= $pager;
    }
       
        return $output;
}

function download_comment_add ($lid)
{
        $edit = $_POST['edit'];
          $op = $_POST['op'];
       
          switch ($op) {
                  case t("Add Comment"):
                          download_comment_save($edit, $lid);
                      drupal_set_message(t('新的评论添加完毕。'));
                      drupal_goto('download/view/' . $lid);
                      break;
                     
            default:
                    $form = download_comment_form();
                      $form .= form_submit(t('Add Comment'));
                      $output .= form($form);
                    break;                 
          }
       
          print theme('page', $output);
}

function download_comment_save ($edit, $lid, $cid = NULL)
{       
        global $user;
       
        if (isset($cid)) {
                // but download module in phpnuke is not able to edit...
        } else {
                $sql = "INSERT INTO {downloads_comments} (lid, subject, comment, date, userid)
                        VALUES ('$lid', '" . $edit["subject"] . "', '" . $edit["comment"] . "', '" . time() . "', '$user->uid') ";
               
                db_query($sql);
        }
       
        return t("评论已经添加。");
}

function download_comment_form ()
{
        $output = form_textfield(t('评论标题'), 'subject', $edit['subject'], 30, 150, t('评论的标题。比如“MagicLinux真不错”。'));
        $output .= form_textarea(t('评论内容'), 'comment', $edit['comment'], 70, 15, t('评论的内容。比如“MagicLinux的用户体验很好”。'));
        return $output;
}

function date_format ($date, $style = 'default')
{
        switch ($style) {
                default:
                        $output = date("Y-m-d", $date);
                        break;
        }
       
        return $output;
}

?>
[/code:1]

[code:1]
--
-- 表的结构 `default_downloads`
--

CREATE TABLE `default_downloads` (
  `lid` int(11) NOT NULL default '0',
  `cid` int(11) NOT NULL default '0',
  `sid` int(11) NOT NULL default '0',
  `title` varchar(100) NOT NULL default '',
  `url` varchar(100) NOT NULL default '',
  `description` text NOT NULL,
  `date` int(11) default NULL,
  `name` varchar(100) NOT NULL default '',
  `email` varchar(100) NOT NULL default '',
  `hits` int(11) NOT NULL default '0',
  `submitter` varchar(60) NOT NULL default '',
  `downloadratingsummary` double(6,4) NOT NULL default '0.0000',
  `totalvotes` int(11) NOT NULL default '0',
  `totalcomments` int(11) NOT NULL default '0',
  `filesize` varchar(11) NOT NULL default '0',
  `version` varchar(10) NOT NULL default '',
  `homepage` varchar(200) NOT NULL default '',
  PRIMARY KEY  (`lid`),
  KEY `lid` (`lid`),
  KEY `cid` (`cid`),
  KEY `sid` (`sid`),
  KEY `title` (`title`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
[/code:1]

[code:1]
CREATE TABLE `default_downloads_categories` (
  `cid` int(11) NOT NULL auto_increment,
  `title` varchar(50) NOT NULL default '',
  `cdescription` text,
  `parentid` int(11) NOT NULL default '0',
  PRIMARY KEY  (`cid`),
  KEY `cid` (`cid`),
  KEY `title` (`title`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
[/code:1]

[code:1]
--
-- 表的结构 `default_downloads_comments`
--

CREATE TABLE `default_downloads_comments` (
  `cid` int(11) NOT NULL auto_increment,
  `lid` int(11) NOT NULL default '0',
  `subject` varchar(150) NOT NULL default '',
  `comment` text NOT NULL,
  `date` int(11) NOT NULL default '0',
  `userid` int(11) NOT NULL default '0',
  PRIMARY KEY  (`cid`),
  KEY `lid` (`lid`,`userid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
[/code:1]

[code:1]
--
-- 表的结构 `default_downloads_mirrors`
--

CREATE TABLE `default_downloads_mirrors` (
  `mid` int(11) NOT NULL auto_increment,
  `name` varchar(150) NOT NULL default '',
  `url` varchar(150) NOT NULL default '',
  PRIMARY KEY  (`mid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
[/code:1]

[code:1]
--
-- 表的结构 `default_downloads_screenshots`
--

CREATE TABLE `default_downloads_screenshots` (
  `pid` int(11) NOT NULL auto_increment,
  `lid` int(11) NOT NULL default '0',
  `userid` int(11) NOT NULL default '0',
  `pname` varchar(150) NOT NULL default '',
  PRIMARY KEY  (`pid`),
  KEY `lid` (`lid`,`userid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
[/code:1]
回复

使用道具 举报

发表于 2006-4-7 09:45:54 | 显示全部楼层
真期待公社的新系统a!
回复

使用道具 举报

 楼主| 发表于 2006-4-7 11:12:13 | 显示全部楼层
下完了,马上试试看
需求是什么阿?mysql5支持否?
回复

使用道具 举报

发表于 2006-4-7 11:12:21 | 显示全部楼层
[quote:6c0d7f5864="hew"]真期待公社的新系统a![/quote]

不会让大家失望的,这个星期6应该有大块儿的时间作公社的事儿

咬一口hew,给兔兔鼓劲儿吧
回复

使用道具 举报

发表于 2006-4-7 11:13:13 | 显示全部楼层
[quote:00aa2678bf="cnhnln"]下完了,马上试试看
需求是什么阿?mysql5支持否?[/quote]

就是在php5 + mysql5上开发的
回复

使用道具 举报

发表于 2006-4-7 11:14:51 | 显示全部楼层
[quote:e3d7b39c4f="cnhnln"]下完了,马上试试看
需求是什么阿?mysql5支持否?[/quote]

这样的,今天晚上,我把drupal多站点的搭建方法写成文档

还有另外开发的一些module需要如何使用的
回复

使用道具 举报

 楼主| 发表于 2006-4-9 14:14:14 | 显示全部楼层
update了,没看到文档阿 :-(
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-3-28 18:49 , Processed in 0.074508 second(s), 12 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表