rider的技术博客

欢迎光临

自己做的网页嵌入到xoops中,用pagewrap

rider | 09 元月, 2008 12:08

把自己做的网页嵌入到xoops中,最直接的办法就是在网页中直接 include mainfile.php, header.php ,footer.php. 

这里介绍一个模块,可以用来管理你的网页。它就是Pagewrap.

Pagewrap 大概是最简单的模块了,你也可以用它来作为入门,学习自己设计xoops模块。

用的时候,你需要修改xoops_version.php和index.php两个文件。

 

1。在xoops_version.php中,你可以修改这个模块的名字:

如果你就想用pagewrap作为你这个模块的名字那就把下行

$modversion['name'] = "CHANGE THIS"; //name of module

改为

$modversion['name'] = "pagewrap"; //name of module

同样,你需要该你这个模块的路径名(文件夹)名:

$modversion['dirname'] = "pagewrap"; //name of directory. You can give the directory any name you want.

2。你的网页将会放到它的index.php中,

它的内容很简单,就是include 那几个文件:

<?php

if (file_exists("mainfile.php")) {

include("mainfile.php");

} elseif (file_exists("../mainfile.php")) {

include("../mainfile.php");

} else {

include("../../mainfile.php");

}

include(XOOPS_ROOT_PATH."/header.php");

$xoopsTpl->assign( 'xoops_showrblock', 1); // 1 = With right block - 0 = Without right block

$xoopsTpl->assign( 'xoops_showlblock', 0); // 1 = With left block - 0 = Without left block

?>

Your HTML content goes here! Everything that appears between the <body></body> tags of your page. If you want to "wrap" a script so that it displays within Xoops, you can do so by using an <iframe> tag in this space.

<?php

if(isset($xoTheme) && is_object($xoTheme)) {

$xoopsTpl->assign('xoops_sitename','This is the page title, visible at the top of the browser');

$xoTheme->addMeta( 'meta', 'keywords', "keyword, keyword, keyword, etc.");

$xoTheme->addMeta( 'meta', 'description', "This is the page description line that often appears in search results.");

}

include(XOOPS_ROOT_PATH."/footer.php");

?>

根据需要,如果你想保留xoops本身设置的sitename和'meta',那最后几行你可以去掉。

下载: http://xoopsexperts.com/modules/downloads/singlefile.php?cid=2&lid=1

评论

新年快乐

新年快乐 | 24/01/2008, 01:45

buy wow gold
EURO starting at $29.99, and make sure to check for rare and epic items on your server. Enjoy! :)

Re: 自己做的网页嵌入到xoops中,用pagewrap

rider | 10/01/2008, 10:34

注意index.php的最后几行代码,你用你的titile 去代替代码里面这句话就行了:'This is the page title, visible at the top of the browser'

你好,你在xoops上的留言我看到了

link | 09/01/2008, 21:15

还有问题,想请教你,但看不到你的联系方式,暂写在这里,不知道你何时能够看到,如果看到,请帮忙一下。
我本来有个静态网站,里面很多网页。都是html的,现在我打算挪到我的新的xoops站里面,但数量众多,觉得用上面的办法批量替换,也是个办法,但我发现网页的title替换完毕后千篇一律,不知道如何解决?批量解决的方法,有没有?谢谢。有空的话可以给我回个邮件吗?

发表评论
  验证码不分大小写  如果看不清验证码,请点击图片刷新 | 最多可尝试10次