We are using Windows 2000 Server prof Edition though I hosted my site on Linux Server..I also like to know how to create and edit .htaccess file in my Windows machine ?
Thanks,
// META TAGS FOR INDIVIDUAL MODULES //
If I want to set individual keywords, description (as meta tags for searching) and page title for each module then what I have to do?
If you notice carefully then you will find that each module contain one file called "xoops_version.php", which contain some important information regarding that module.
Let say, you want to set some keywords, description (as meta tags) and page title for module "contact us". Don't worry, you have to do only two things.
Step: 1. Open the "xoops_version.php" file located in "\modules\contact" and write
three lines :-
// if you want to set "keywords" for "contact us" module, it's not mandatory
a:) $modversion['keywords']="contact us, admin@coswap.com, contact us form";
// if you want to set "description" for "contact us" module, it's not mandatory
b:) $modversion['desc']="contact us, admin@coswap.com, contact us form";
// if you want to set "page title" for "contact us" module, it's not mandatory
c:) $modversion['slogan']="We are waiting for your query";
now save "xoops_version.php" and close it.
step: 2. Now open "header.php" file located in "" and paste the following lines before code for showing 'banners' ( // show banner? Line no. 79 approx.).
// META TAGS FOR INDIVIDUAL MODULES //
if (!empty($xoopsModule))
{
$mid=$xoopsModule->mid();
if (is_numeric($mid))
{
$module_handler =& xoops_gethandler('module');
$versioninfo =& $module_handler->get($mid);
}
elseif (file_exists(XOOPS_ROOT_PATH.'/modules/'.$mid.'/xoops_version.php'))
{
$module_handler =& xoops_gethandler('module');
$versioninfo =& $module_handler->create();
$versioninfo->loadInfo(trim($mid));
}
$module_keywords =$versioninfo->getInfo('keywords');
$module_desc =$versioninfo->getInfo('desc');
$slogan=$versioninfo->getinfo('slogan');
}
if ($module_keywords)
{ $xoopsTpl->assign('xoops_meta_keywords', $module_keywords); }
if ($module_desc)
{ $xoopsTpl->assign('xoops_meta_description', $module_desc); }
//---------------------------------
and overwrite the following code
-------------------------------------
if (!empty($xoopsModule))
{
// set page title
$xoopsTpl->assign('xoops_pagetitle', $xoopsModule->getVar('name'));
if (preg_match("/index\.php$/i", xoops_getenv('PHP_SELF')) && $xoopsConfig['startpage'] == $xoopsModule->getVar('dirname'))
{
$block_arr =& $xoopsblock->getAllByGroupModule($xoopsUser->getGroups(), $xoopsModule->getVar('mid'), true, XOOPS_BLOCK_VISIBLE);
}
else
{
$block_arr =& $xoopsblock->getAllByGroupModule($xoopsUser->getGroups(), $xoopsModule->getVar('mid'), false, XOOPS_BLOCK_VISIBLE);
}
}
----------------------
with
----------------------
if (!empty($xoopsModule))
{
// set page title
if($slogan)
{
$xoopsTpl->assign('xoops_pagetitle', $slogan);
}
else
{
$xoopsTpl->assign('xoops_pagetitle', $xoopsModule->getVar('name'));
}
if (preg_match("/index\.php$/i", xoops_getenv('PHP_SELF')) && $xoopsConfig['startpage'] == $xoopsModule->getVar('dirname'))
{
$block_arr =& $xoopsblock->getAllByGroupModule($xoopsUser->getGroups(), $xoopsModule->getVar('mid'), true, XOOPS_BLOCK_VISIBLE);
}
else
{
$block_arr =& $xoopsblock->getAllByGroupModule($xoopsUser->getGroups(), $xoopsModule->getVar('mid'), false, XOOPS_BLOCK_VISIBLE);
}
}
-------------------
and
-------------------
if (isset($xoopsModule))
{
// set page title
$xoopsTpl->assign('xoops_pagetitle', $xoopsModule->getVar('name'));
if (preg_match("/index\.php$/i", xoops_getenv('PHP_SELF')) && $xoopsConfig['startpage'] == $xoopsModule->getVar('dirname'))
{
$block_arr =& $xoopsblock->getAllByGroupModule(XOOPS_GROUP_ANONYMOUS, $xoopsModule->getVar('mid'), true, XOOPS_BLOCK_VISIBLE);
}
else
{
$block_arr =& $xoopsblock->getAllByGroupModule(XOOPS_GROUP_ANONYMOUS, $xoopsModule->getVar('mid'), false, XOOPS_BLOCK_VISIBLE);
}
}
-----------------------
with
-----------------------
if (isset($xoopsModule))
{
// set page title
if($slogan)
{
$xoopsTpl->assign('xoops_pagetitle', $slogan);
}
else
{
$xoopsTpl->assign('xoops_pagetitle', $xoopsModule->getVar('name'));
}
if (preg_match("/index\.php$/i", xoops_getenv('PHP_SELF')) && $xoopsConfig['startpage'] == $xoopsModule->getVar('dirname'))
{
$block_arr =& $xoopsblock->getAllByGroupModule(XOOPS_GROUP_ANONYMOUS, $xoopsModule->getVar('mid'), true, XOOPS_BLOCK_VISIBLE);
}
else
{
$block_arr =& $xoopsblock->getAllByGroupModule(XOOPS_GROUP_ANONYMOUS, $xoopsModule->getVar('mid'), false, XOOPS_BLOCK_VISIBLE);
}
}
------------------------
and save "header.php".
Now open your site in your browser and go to the "contact us" module. Click on view->source link in your browser and you will see that this page contains those meta tags (keywords, description) which you have define in "xoops_version.php".Page title of your "contact us" module has been changed to "We are waiting for your query".
** If you haven't set any keywords or description or page title in "xoops_version.php" then default keywords,description and page title selected by admin from admin section will be set by default.
But then again, you know what the meta generator of e-xoops was also a core hack + module until they put it into the core... Sorry just thinking out loud here.