7

(I don't know the best way to word this but here goes!) I have a site that is in PHP and it grabs certain data from tables depending on an identifier input like .php?id=500 and looks up from each table grabbing each respective fields and putting them into tables or lists.

What is the best easy CMS that I would use? How would I approach this? Is there a simple plugin for something like Joomla or Wordpress or the such I can point to specific tables, tell it the identifier column, and tell it to list every row that matches? Including other tables?

IE. It pulls something from address table and lists all their address, pulls something from information and lists their gender age, and etc.

So this way, it creates dynamic pages that I can manage a lot easier and have searches and indexes. Trying to code all that and it's getting way ahead of me. I figured there's a CMS that does all this for me.

I hope you guys understand my question, I tried searching many wordings of this.

4

11 回答 11

1

你正在做出正确的决定。移至 CMS。我已成功将数据(类别、文章和图像)迁移到 Joomla 安装中,步骤如下:

  1. 从您的 CMS 相关数据中选择
  2. 如果图片与 CMS 中的文章分开存储,请在前面至少添加一个

    到文本并附加其余部分;

  3. J2.5+ 支持文章图片和缩略图,但模板仍然没有实现
  4. 除非您需要在文章级别进行细粒度访问,否则将所有文章指向单个资产 ID
  5. 创建示例文章并使用额外字段填写空白
  6. 如果可能,使用适当的 IntroText 和 FullText 分离;确保进入每个的 html 是独立的并验证
  7. 验证您的数据是 UTF-8(否则转换它)然后运行 ​​SQL 导入
  8. 从文章管理器中选择重建图标来重建资产和 ltr-rtl 字段

要执行 SQL 导入,您还需要清除 content_frontpage 表。

这是一个从另一个 cms 接收一行并将其放入 Joomla 的函数;一些评论是用意大利语写的,但你应该知道如何去做。mdc2j 是我编写的专用函数,用于根据需要正确转义数据并更改格式/类别 ID 等。

function importaArticolo($row) {
    global $link;
    echo "<h3>Importa Articolo ".$row->Id . " (". $row->titolo . ")</h3>";

    /*
        " ('$row->id', '0', 'test', 'test_alias', '', 'tutto il testo riga per riga', ".
        "  '', '0', '0', '0', '111', '2001-01-25 16:30:15', '4', 'la firma', '2001-01-25 16:30:15',  ".
        " '0', '0', '0000-00-00 00:00:00', '2001-01-25 16:30:30', '0000-00-00 00:00:00', 'list of images?', 'list of urls?',  ".
        " '".'{"show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_vote":"","show_hits":"","show_noauth":"","alternative_readmore":"","article_layout":""}'."', ".
        "  '1', '0', '0', 'kewords', 'key-description',  ".
        " '0', '0',  ".
        " '".'{"robots":"","author":"","rights":"","xreference":""}'."', '0', '*', '');";
        */
    try {
        $idcategory = mdc2jCategory($row->idCanale);
        if ($row->isDossier * 1 == 1) {
            if (1*$idcategory==10) {
                $idcategory= 28;
            }
        }
        $default_user=42;
        $SQL=sprintf(
            "INSERT INTO `".$GLOBALS['db_database_new']."`.`eco_content` (`id`, `asset_id`, `title`, `alias`, `title_alias`, `introtext`, ".
            " `fulltext`, `state`, `sectionid`, `mask`, `catid`, `created`, `created_by`, `created_by_alias`, `modified`,  ".
            " `modified_by`, `checked_out`, `checked_out_time`, `publish_up`, `publish_down`, `images`, `urls`, `attribs`,  ".
            " `version`, `parentid`, `ordering`, `metakey`, `metadesc`, `access`, `hits`, `metadata`, `featured`, `language`,  ".
            " `xreference`)  ".
            " VALUES  ".
            " ('%d', '0', '%s', '%s', '', '%s', ".
            "  '%s', '%d', '0', '0', '%d', '%s', '%d', '%s', '%s',  ".
            " '0', '0', '0000-00-00 00:00:00', '%s', '0000-00-00 00:00:00', '', '',  ".
            " '".'{"show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_vote":"","show_hits":"","show_noauth":"","alternative_readmore":"","article_layout":""}'."', ".
            "  '1', '0', '0', '%s', '%s',  ".
            " '%d', '%d',  ".
            " '".'{"robots":"","author":"","rights":"","xreference":""}'."', '%d', '*', '');",
        $row->Id,
        mysql_real_escape_string($row->titolo),
        makeAlias($row->titolo), // alias
        mdc2jSommario($row), // this creates the introtext

        mdc2jText($row), // this returns the text
        $row->idStato=="2"?0:1, // idStato="suspended"
        $idcategory, // correct category id
        mdc2jDate($row->dataCreazione),
        $default_user,
        mdc2jFirma($row->firma),
        mdc2jDate($row->dataCreazione), //2001-01-25 16:30:15
        mdc2jDate($row->dataPubblica), //2001-01-25 16:30:30

        mdc2jMetaKeywords($row), // adds "dossier" if appropriate
        mdc2jMetaDesc($row), // if not assigned, create it automatically
        $row->idStato=="2"?3:1,
        $row->viewCounter,
        0 //featured: (($row->Id % 13) == 0 ? 1 : 0 )
        );


        $res = mysql_query($SQL);

        if ($res) {
            $lastid = mysql_insert_id();
            //echo "Article $lastid ($row->Id) Inserted into DB<br>";
                    // this will import images in a separate tool, an ignite gallery, so it's not really meaningful for you:
            importaImmagini($row->Id, $row->canale, $row->cid);


            return 1;

        }
        else {
            echo "<span class='err'>WARNING: article not inserted in db</span>"."<br>".mysql_errno($link) . ": " . mysql_error($link);
            echo "<textarea cols='80' rows='3'>".$SQL."</textarea><br>";
        }

        return 0;

    }
    catch (Exception $e)
    {
        echo "<span class='err'>Exception! ".$e->getMessage()."</span><br>";
        return 0;
    }
}
于 2013-01-24T07:55:29.017 回答
0

You have a few options:

  1. Convert your PHP template to a WordPress Compatible Theme.
  2. Use and existing theme and install TablePress Plugin to manage your tables.

Also see http://thethemefoundry.com/blog/html-wordpress/ Also see http://wordpress.org/plugins/tablepress/

于 2013-12-24T03:26:11.237 回答
0

写自己真的不会那么复杂。事实上,它类似于我的一个内容管理系统的工作方式:我为每个“模块”和属性指定了一个类,这些属性指定要从中选择记录的数据库表、要在概览页面上显示的列(表标题),以及要在表单视图(输入)中显示的列。

试图将已经构建的网站硬塞进 WordPress 或 Joomla 等 CMS 中!想要开箱即用地为您做所有事情(包括前端站点)将是一件痛苦的事情。即使你在你的网站上安装了一个 CMS 并让它运行起来,它也会变得臃肿不堪。

于 2013-01-23T16:05:46.257 回答
0

以下是您尝试完成的一些可能的快捷方式:

如果您当前的站点正在生成 RSS 聚合链接,那么WP-RSS-Multi-Importer 看起来很有希望。

如果您当前的站点没有 RSS,但您可以访问数据库(通过主机控制面板/phpmyadmin,或通过服务器命令行实用程序,如 mysqldump),那么您可以将数据库导出为 CSV 或 XML 并尝试使用WP-All-Import 之类的插件将其导入 Wordpress 。

这将花费更多时间,因为您需要将数据映射到适当的 wordpress 字段。

如果您既没有 RSS 也没有访问数据库的权限,那么您将需要“抓取”您的网站。通常这意味着编码,但有几个 wordpress 插件可能适合您。这里可能会出现很多问题,因此如果最终产品不是您想要的,请不要感到惊讶。

于 2014-11-19T23:08:04.517 回答
0

好问题。由于回答了 Joomla,我将为 WordPress 回答。我建议创建一个 php 文件,将所有表数据导出到 xml(RSSWordPress)。然后,您可以使用WordPress 导入功能简单地将您的信息导入 WordPress。

这样,您可以保留两个表格,并且可以将信息完全导入 WordPress。

如果您有兴趣,如果您给我表格的格式,我可能会一起编写一些代码。

最后,您应该在WordPress Stack Exchange (wordpress.stackexchange.com)上搜索并重新发布您的答案。

于 2013-06-13T15:50:47.340 回答
0

有很多 CMS 解决方案可以为您做到这一点。老实说,如果您已经建立并运行了一个网站,而您只想要一个 CMS,那么 Joomla 或 WordPress 有点矫枉过正。看看PyroCMS,它完全符合您的描述。它很容易设置和运行,并且有很好的文档。

如果您对 Python 感兴趣并且对混合解决方案感兴趣,那么我已经成功地将 PHP 框架用于主要站点,并将Django(在 Python 中)用于 CMS。

于 2013-01-23T15:59:05.170 回答
0

另一个想法可能是使用 Cakephp http://cakephp.org/。Cake 可以读取您的数据库方案并生成启动和运行所需的文件。(如果您有命令行访问权限)。它使用 MVC 模式并且设置起来非常快。我个人在您描述的许多项目中都使用过蛋糕。

如果不手动执行,Wordpress 可能有点难以将所有帖子都输入。但是,如果您不想编写太多代码并且愿意手动移动所有内容,则 wordpress 或其他一些开箱即用的 CMS 系统可能适合您。

于 2013-05-31T17:29:42.533 回答
0

比使用 cakephp 低一点的方法是使用ActiveRecord,它对处理数据库有很大帮助。

例如使用PHP ActiveRecord

于 2015-01-12T13:56:35.320 回答
0

有四个问号:

问:我会使用的最简单的 CMS 是什么?

答:WordPress。

我将如何处理这个?

A. 学习 PHP。

问:是否有一个简单的插件,比如 Joomla 或 Wordpress 或者我可以指向特定表,告诉它标识符列,并告诉它列出匹配的每一行?

答:可能。这是 PHP 中的一个简单任务。

Q. 包括其他表?

答:同上。

于 2014-11-19T01:43:32.643 回答
-1
  1. 使用 WordPress 或 Joomla 或 drupal 设置新的 CMS。
  2. 制作一个 PHP 以将所有数据库项导入该 CMS。
于 2014-12-28T00:12:53.970 回答
-1

你可以使用像 yii 或 codeigniter 这样的框架。他们可以让你的生活变得非常轻松。您可以使用这些框架非常轻松快速地制作 CMS。

您可以传递参数,如 id

于 2014-12-22T13:25:56.357 回答